check
[oweals/gnunet.git] / src / include / gnunet_statistics_service.h
index 5c166d43d39e15b1ad70c46576c1dc2bc662ea8a..e22fe16d4c90df82cb9efb6ff6fc8a1ad5153de6 100644 (file)
@@ -1,6 +1,6 @@
 /*
       This file is part of GNUnet
-      (C) 2009 Christian Grothoff (and other contributing authors)
+      (C) 2009, 2010 Christian Grothoff (and other contributing authors)
 
       GNUnet is free software; you can redistribute it and/or modify
       it under the terms of the GNU General Public License as published
@@ -70,14 +70,12 @@ typedef int (*GNUNET_STATISTICS_Iterator) (void *cls,
 /**
  * Get handle for the statistics service.
  *
- * @param sched scheduler to use
  * @param subsystem name of subsystem using the service
  * @param cfg services configuration in use
  * @return handle to use
  */
 struct GNUNET_STATISTICS_Handle
-  *GNUNET_STATISTICS_create (struct GNUNET_SCHEDULER_Handle *sched,
-                             const char *subsystem,
+  *GNUNET_STATISTICS_create (const char *subsystem,
                              const struct GNUNET_CONFIGURATION_Handle *cfg);
 
 
@@ -93,6 +91,26 @@ void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h,
                                int sync_first);
 
 
+/**
+ * Watch statistics from the peer (be notified whenever they change).
+ * Note that the only way to cancel a "watch" request is to destroy
+ * the statistics handle given as the first argument to this call.
+ *
+ * @param handle identification of the statistics service
+ * @param subsystem limit to the specified subsystem, never NULL
+ * @param name name of the statistic value, never NULL
+ * @param proc function to call on each value
+ * @param proc_cls closure for proc
+ * @return GNUNET_OK on success, GNUNET_SYSERR on error
+ */
+int
+GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle,
+                        const char *subsystem,
+                        const char *name,
+                        GNUNET_STATISTICS_Iterator proc, 
+                        void *proc_cls);
+
+
 /**
  * Continuation called by the "get_all" and "get" functions.
  *