summaryrefslogtreecommitdiff
path: root/lib/cookie.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>1999-12-29 14:20:26 +0000
committerDaniel Stenberg <daniel@haxx.se>1999-12-29 14:20:26 +0000
commitae1912cb0d494b48d514d937826c9fe83ec96c4d (patch)
tree3b027d577182fc74bade646227f729eac461d0d2 /lib/cookie.h
downloadcurl-ae1912cb0d494b48d514d937826c9fe83ec96c4d.tar.gz
Initial revision
Diffstat (limited to 'lib/cookie.h')
-rw-r--r--lib/cookie.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/cookie.h b/lib/cookie.h
new file mode 100644
index 000000000..466844a5d
--- /dev/null
+++ b/lib/cookie.h
@@ -0,0 +1,45 @@
+#ifndef __COOKIE_H
+#define __COOKIE_H
+
+#include <stdio.h>
+#ifdef WIN32
+#include <time.h>
+#else
+#include <sys/time.h>
+#endif
+
+#include <curl/curl.h>
+
+struct Cookie {
+ struct Cookie *next; /* next in the chain */
+ char *name; /* <this> = value */
+ char *value; /* name = <this> */
+ char *path; /* path = <this> */
+ char *domain; /* domain = <this> */
+ time_t expires; /* expires = <this> */
+ char *expirestr; /* the plain text version */
+ bool secure; /* whether the 'secure' keyword was used */
+};
+
+struct CookieInfo {
+ /* linked list of cookies we know of */
+ struct Cookie *cookies;
+
+ char *filename; /* file we read from/write to */
+};
+
+/* This is the maximum line length we accept for a cookie line */
+#define MAX_COOKIE_LINE 2048
+#define MAX_COOKIE_LINE_TXT "2047"
+
+/* This is the maximum length of a cookie name we deal with: */
+#define MAX_NAME 256
+#define MAX_NAME_TXT "255"
+
+struct Cookie *cookie_add(struct CookieInfo *, bool, char *);
+struct CookieInfo *cookie_init(char *);
+struct Cookie *cookie_getlist(struct CookieInfo *, char *, char *, bool);
+void cookie_freelist(struct Cookie *);
+void cookie_cleanup(struct CookieInfo *);
+
+#endif