doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cookie.h
Go to the documentation of this file.
1 #ifndef __COOKIE_H
2 #define __COOKIE_H
3 /***************************************************************************
4  * _ _ ____ _
5  * Project ___| | | | _ \| |
6  * / __| | | | |_) | |
7  * | (__| |_| | _ <| |___
8  * \___|\___/|_| \_\_____|
9  *
10  * Copyright (C) 1998 - 2004, Daniel Stenberg, <daniel@haxx.se>, et al.
11  *
12  * This software is licensed as described in the file COPYING, which
13  * you should have received as part of this distribution. The terms
14  * are also available at http://curl.haxx.se/docs/copyright.html.
15  *
16  * You may opt to use, copy, modify, merge, publish, distribute and/or sell
17  * copies of the Software, and permit persons to whom the Software is
18  * furnished to do so, under the terms of the COPYING file.
19  *
20  * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
21  * KIND, either express or implied.
22  *
23  * $Id: cookie.h,v 1.15 2004/01/07 09:19:35 bagder Exp $
24  ***************************************************************************/
25 
26 #include <stdio.h>
27 #ifdef WIN32
28 #include <time.h>
29 #else
30 #include <sys/time.h>
31 #endif
32 
33 #include <curl/curl.h>
34 
35 struct Cookie {
36  struct Cookie *next; /* next in the chain */
37  char *name; /* <this> = value */
38  char *value; /* name = <this> */
39  char *path; /* path = <this> */
40  char *domain; /* domain = <this> */
41  long expires; /* expires = <this> */
42  char *expirestr; /* the plain text version */
43  bool tailmatch; /* weather we do tail-matchning of the domain name */
44 
45  /* RFC 2109 keywords. Version=1 means 2109-compliant cookie sending */
46  char *version; /* Version = <value> */
47  char *maxage; /* Max-Age = <value> */
48 
49  bool secure; /* whether the 'secure' keyword was used */
50  bool livecookie; /* updated from a server, not a stored file */
51 };
52 
53 struct CookieInfo {
54  /* linked list of cookies we know of */
55  struct Cookie *cookies;
56 
57  char *filename; /* file we read from/write to */
58  bool running; /* state info, for cookie adding information */
59  long numcookies; /* number of cookies in the "jar" */
60  bool newsession; /* new session, discard session cookies on load */
61 };
62 
63 /* This is the maximum line length we accept for a cookie line */
64 #define MAX_COOKIE_LINE 2048
65 #define MAX_COOKIE_LINE_TXT "2047"
66 
67 /* This is the maximum length of a cookie name we deal with: */
68 #define MAX_NAME 256
69 #define MAX_NAME_TXT "255"
70 
71 struct SessionHandle;
72 /*
73  * Add a cookie to the internal list of cookies. The domain and path arguments
74  * are only used if the header boolean is TRUE.
75  */
76 
78  struct CookieInfo *, bool header, char *line,
79  char *domain, char *path);
80 
82  char *, struct CookieInfo *, bool);
83 struct Cookie *Curl_cookie_getlist(struct CookieInfo *, char *, char *, bool);
84 void Curl_cookie_freelist(struct Cookie *);
85 void Curl_cookie_cleanup(struct CookieInfo *);
86 int Curl_cookie_output(struct CookieInfo *, char *);
87 
88 #endif
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:2853
const char * path
Definition: sws.c:117