summaryrefslogtreecommitdiff
path: root/lib/cookie.h
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2011-04-04 15:46:42 +0200
committerDaniel Stenberg <daniel@haxx.se>2011-04-04 19:27:26 +0200
commit9d1e914a56e8a4030d8917875eaedaddf5cff97c (patch)
tree103f73104c796dd3000b7063623d20a256601d6a /lib/cookie.h
parentd3408d05935e61a303b5761cc5aa029eb54408f8 (diff)
downloadcurl-9d1e914a56e8a4030d8917875eaedaddf5cff97c.tar.gz
disable cookies: remove ifdefs, move code
1 - make sure to #define macros for cookie functions in the cookie header when cookies are disabled to avoid having to use #ifdefs in code using those functions. 2 - move cookie-specific code to cookie.c and use the functio conditionally as mentioned in (1). net result: 6 #if lines removed, and 9 lines of code less
Diffstat (limited to 'lib/cookie.h')
-rw-r--r--lib/cookie.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/cookie.h b/lib/cookie.h
index e8c005f20..6b159b238 100644
--- a/lib/cookie.h
+++ b/lib/cookie.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -87,20 +87,24 @@ struct Cookie *Curl_cookie_add(struct SessionHandle *data,
struct CookieInfo *, bool header, char *lineptr,
const char *domain, const char *path);
-struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
- const char *, struct CookieInfo *, bool);
struct Cookie *Curl_cookie_getlist(struct CookieInfo *, const char *,
const char *, bool);
void Curl_cookie_freelist(struct Cookie *cookies, bool cookiestoo);
void Curl_cookie_clearall(struct CookieInfo *cookies);
void Curl_cookie_clearsess(struct CookieInfo *cookies);
-void Curl_cookie_cleanup(struct CookieInfo *);
int Curl_cookie_output(struct CookieInfo *, const char *);
#if defined(CURL_DISABLE_HTTP) || defined(CURL_DISABLE_COOKIES)
#define Curl_cookie_list(x) NULL
#define Curl_cookie_loadfiles(x) do { } while (0)
+#define Curl_cookie_init(x,y,z,w) NULL
+#define Curl_cookie_cleanup(x)
+#define Curl_flush_cookies(x,y)
#else
+void Curl_flush_cookies(struct SessionHandle *data, int cleanup);
+void Curl_cookie_cleanup(struct CookieInfo *);
+struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
+ const char *, struct CookieInfo *, bool);
struct curl_slist *Curl_cookie_list(struct SessionHandle *data);
void Curl_cookie_loadfiles(struct SessionHandle *data);
#endif