HKDF (does not work yet)
[oweals/gnunet.git] / src / include / gnunet_statistics_service.h
index 0fc84cfc350c0f4c655148beb23688077c295924..5c166d43d39e15b1ad70c46576c1dc2bc662ea8a 100644 (file)
@@ -102,6 +102,11 @@ void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h,
  */
 typedef void (*GNUNET_STATISTICS_Callback) (void *cls, int success);
 
+/**
+ * Handle that can be used to cancel a statistics 'get' operation.
+ */
+struct GNUNET_STATISTICS_GetHandle;
+
 /**
  * Get statistic from the peer.
  *
@@ -113,8 +118,9 @@ typedef void (*GNUNET_STATISTICS_Callback) (void *cls, int success);
  * @param cont continuation to call when done (can be NULL)
  * @param proc function to call on each value
  * @param cls closure for proc and cont
+ * @return NULL on error
  */
-void
+struct GNUNET_STATISTICS_GetHandle *
 GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle,
                        const char *subsystem,
                        const char *name,
@@ -122,6 +128,17 @@ GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle,
                        GNUNET_STATISTICS_Callback cont,
                        GNUNET_STATISTICS_Iterator proc, void *cls);
 
+
+/**
+ * Cancel a 'get' request.  Must be called before the 'cont' 
+ * function is called.
+ *
+ * @param gh handle of the request to cancel
+ */
+void
+GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh);
+
+
 /**
  * Set statistic value for the peer.  Will always use our
  * subsystem (the argument used when "handle" was created).