diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-01-11 22:13:37 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-01-11 22:13:37 +0000 |
commit | bb4e48f94a3daba7b0294ce8760a231b0601fa11 (patch) | |
tree | c32408c3060ba0a51bf8ca031d944d478a65f866 /src/include/gnunet_peerinfo_service.h | |
parent | c85579b554836cd5a67e87abb3e11a2d53d6a3e8 (diff) |
adding notification API to peerinfo
Diffstat (limited to 'src/include/gnunet_peerinfo_service.h')
-rw-r--r-- | src/include/gnunet_peerinfo_service.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h index 54fc680336..463131e6a8 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h @@ -99,6 +99,41 @@ GNUNET_PEERINFO_for_all (const struct GNUNET_CONFIGURATION_Handle *cfg, void *callback_cls); +/** + * Handle for notifications about changes to the set of known peers. + */ +struct GNUNET_PEERINFO_NotifyContext; + + +/** + * Call a method whenever our known information about peers + * changes. Initially calls the given function for all known + * peers and then only signals changes. Note that it is + * possible (i.e. on disconnects) that the callback is called + * twice with the same peer information. + * + * @param cfg configuration to use + * @param sched scheduler to use + * @param callback the method to call for each peer + * @param callback_cls closure for callback + * @return NULL on error + */ +struct GNUNET_PEERINFO_NotifyContext * +GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, + struct GNUNET_SCHEDULER_Handle *sched, + GNUNET_PEERINFO_Processor callback, + void *callback_cls); + + +/** + * Stop notifying about changes. + * + * @param nc context to stop notifying + */ +void +GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc); + + #if 0 /* keep Emacsens' auto-indent happy */ { #endif |