Initial revision
[libcurl.git] / lib / cookie.h
blob466844a5d3b13b04335f34ed2ed75f2381086ad6
1 #ifndef __COOKIE_H
2 #define __COOKIE_H
4 #include <stdio.h>
5 #ifdef WIN32
6 #include <time.h>
7 #else
8 #include <sys/time.h>
9 #endif
11 #include <curl/curl.h>
13 struct Cookie {
14 struct Cookie *next; /* next in the chain */
15 char *name; /* <this> = value */
16 char *value; /* name = <this> */
17 char *path; /* path = <this> */
18 char *domain; /* domain = <this> */
19 time_t expires; /* expires = <this> */
20 char *expirestr; /* the plain text version */
21 bool secure; /* whether the 'secure' keyword was used */
24 struct CookieInfo {
25 /* linked list of cookies we know of */
26 struct Cookie *cookies;
28 char *filename; /* file we read from/write to */
31 /* This is the maximum line length we accept for a cookie line */
32 #define MAX_COOKIE_LINE 2048
33 #define MAX_COOKIE_LINE_TXT "2047"
35 /* This is the maximum length of a cookie name we deal with: */
36 #define MAX_NAME 256
37 #define MAX_NAME_TXT "255"
39 struct Cookie *cookie_add(struct CookieInfo *, bool, char *);
40 struct CookieInfo *cookie_init(char *);
41 struct Cookie *cookie_getlist(struct CookieInfo *, char *, char *, bool);
42 void cookie_freelist(struct Cookie *);
43 void cookie_cleanup(struct CookieInfo *);
45 #endif