From 5510abf69022d8393e6c5fc3d1456cc47f96fa4a Mon Sep 17 00:00:00 2001 From: Brendan Taylor Date: Mon, 27 Sep 2010 10:41:13 -0600 Subject: move cookie handling into a subclass of SoupCookieJar this cleans up the code and slightly improves efficiency. --- src/cookie-jar.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/cookie-jar.h (limited to 'src/cookie-jar.h') diff --git a/src/cookie-jar.h b/src/cookie-jar.h new file mode 100644 index 0000000..80af00e --- /dev/null +++ b/src/cookie-jar.h @@ -0,0 +1,33 @@ +#ifndef UZBL_COOKIE_JAR_H +#define UZBL_COOKIE_JAR_H + +#include + +#define UZBL_TYPE_COOKIE_JAR (soup_cookie_jar_socket_get_type ()) +#define UZBL_COOKIE_JAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UZBL_TYPE_COOKIE_JAR, UzblCookieJar)) +#define UZBL_COOKIE_JAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UZBL_TYPE_COOKIE_JAR, UzblCookieJarClass)) + +typedef struct { + SoupCookieJar parent; + + const gchar *handler; + + const gchar *socket_path; + int connection_fd; + + gboolean in_get_callback; +} UzblCookieJar; + +typedef struct { + SoupCookieJarClass parent_class; +} UzblCookieJarClass; + +UzblCookieJar *uzbl_cookie_jar_new(); + +void +uzbl_cookie_jar_set_handler(UzblCookieJar *jar, const gchar *handler); + +char +*get_cookies(UzblCookieJar *jar, SoupURI *uri); + +#endif -- cgit v1.2.3