src/util/crypto_rsa.c
src/util/crypto_symmetric.c
src/util/disk.c
-src/util/disk_iterator.c
src/util/getopt.c
src/util/getopt_helpers.c
src/util/gnunet-config.c
*/
struct curl_slist *json_header;
+ /**
+ * Function we need to call whenever the event loop's
+ * socket set changed.
+ */
+ GNUNET_CURL_RescheduleCallback cb;
+
+ /**
+ * Closure for @e cb.
+ */
+ void *cb_cls;
};
* Initialise this library. This function should be called before using any of
* the following functions.
*
+ * @param cb function to call when rescheduling is required
+ * @param cb_cls closure for @a cb
* @return library context
*/
struct GNUNET_CURL_Context *
-GNUNET_CURL_init ()
+GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb,
+ void *cb_cls)
{
struct GNUNET_CURL_Context *ctx;
CURLM *multi;
return NULL;
}
ctx = GNUNET_new (struct GNUNET_CURL_Context);
+ ctx->cb = cb;
+ ctx->cb_cls = cb_cls;
ctx->multi = multi;
ctx->share = share;
GNUNET_assert (NULL != (ctx->json_header =
GNUNET_CONTAINER_DLL_insert (ctx->jobs_head,
ctx->jobs_tail,
job);
+ ctx->cb (ctx->cb_cls);
return job;
}
#include "gnunet_util_lib.h"
+/**
+ * Function called by the context to ask for the event loop to be
+ * rescheduled, that is the application should call
+ * #GNUNET_CURL_get_select_info() as the set of sockets we care about
+ * just changed.
+ *
+ * @param cls closure
+ */
+typedef void
+(*GNUNET_CURL_RescheduleCallback)(void *cls);
+
+
/**
* Initialise this library. This function should be called before using any of
* the following functions.
*
+ * @param cb function to call when rescheduling is required
+ * @param cb_cls closure for @a cb
* @return library context
*/
struct GNUNET_CURL_Context *
-GNUNET_CURL_init (void);
+GNUNET_CURL_init (GNUNET_CURL_RescheduleCallback cb,
+ void *cb_cls);
/**