Enable use of HTTP cache headers in curl plugin
[monky] / src / ccurl_thread.h
index 18d7b27..6f7e830 100644 (file)
@@ -1,9 +1,10 @@
-/*
+/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*-
+ *
  * Conky, a system monitor, based on torsmo
  *
  * Please see COPYING for details
  *
- * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al.
+ * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al.
  *     (see AUTHORS)
  * All rights reserved.
  *
 #ifndef _CURL_THREAD_H_
 #define _CURL_THREAD_H_
 
+#include "timed_thread.h"
+
+
+/* curl thread lib exports begin */
+
 typedef struct _ccurl_location_t {
-       char *uri; /* uri of location */
-       void *result; /* a pointer to some arbitrary data, will be freed by ccurl_free_info() if non-null */
-       timed_thread *p_timed_thread; /* internal thread pointer */
-       void (*process_function)(void *, const char *); /* function to call when data is ready to be processed, the first argument will be the result pointer, and the second argument is an internal buffer that shouldn't be mangled */
-       struct _ccurl_location_t *next; /* internal list pointer */
+       /* uri of location */
+       char *uri;
+       char *last_modified;
+       char *etag;
+       /* a pointer to some arbitrary data, will be freed by ccurl_free_info() if
+        * non-null */
+       void *result;
+       /* internal thread pointer, destroyed by timed_thread.c */
+       timed_thread *p_timed_thread;
+       /* function to call when data is ready to be processed, the first argument
+        * will be the result pointer, and the second argument is an internal
+        * buffer that shouldn't be mangled */
+       void (*process_function)(void *, const char *);
+       /* internal list pointer, don't mess with this unless you don't know any
+        * better */
+       struct _ccurl_location_t *next;
 } ccurl_location_t;
 
 /* find an existing location for the uri specified */
@@ -37,13 +54,25 @@ ccurl_location_t *ccurl_find_location(ccurl_location_t **locations_head, char *u
 /* free all locations (as well as location->uri and location->result if
  * non-null) */
 void ccurl_free_locations(ccurl_location_t **locations_head);
-/* initiates a thread at the location specified using the interval in seconds */
+/* initiates a curl thread at the location specified using the interval in
+ * seconds */
 void ccurl_init_thread(ccurl_location_t *curloc, int interval);
 
+/* curl thread lib exports end */
+
+
+/* $curl exports begin */
+
 /* for $curl, free internal list pointer */
 void ccurl_free_info(void);
 /* runs instance of $curl */
 void ccurl_process_info(char *p, int p_max_size, char *uri, int interval);
 
+void curl_parse_arg(struct text_object *, const char *);
+void curl_print(struct text_object *, char *, int);
+void curl_obj_free(struct text_object *);
+
+/* $curl exports end */
+
 #endif /* _CURL_THREAD_H_ */