aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_peerstore_plugin.h
diff options
context:
space:
mode:
authorOmar Tarabai <tarabai@devegypt.com>2014-05-12 17:01:59 +0000
committerOmar Tarabai <tarabai@devegypt.com>2014-05-12 17:01:59 +0000
commitd743a7e758a4fd96f5997a2b6d0f2ce4d62e13cf (patch)
tree1c5c537eecbe2b71b661a442da4729e8bc605ccd /src/include/gnunet_peerstore_plugin.h
parentac2be7dde06b71347d87ed491eb38d64a9163ad8 (diff)
downloadgnunet-d743a7e758a4fd96f5997a2b6d0f2ce4d62e13cf.tar.gz
gnunet-d743a7e758a4fd96f5997a2b6d0f2ce4d62e13cf.zip
towards PEERSTORE iterate
Diffstat (limited to 'src/include/gnunet_peerstore_plugin.h')
-rw-r--r--src/include/gnunet_peerstore_plugin.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/include/gnunet_peerstore_plugin.h b/src/include/gnunet_peerstore_plugin.h
index f693072c0..2d397088c 100644
--- a/src/include/gnunet_peerstore_plugin.h
+++ b/src/include/gnunet_peerstore_plugin.h
@@ -39,6 +39,21 @@ extern "C"
39 39
40 40
41/** 41/**
42 * Function called by for each matching record.
43 *
44 * @param cls closure
45 * @param peer peer identity
46 * @param sub_system name of the GNUnet sub system responsible
47 * @param value stored value
48 * @param size size of stored value
49 */
50typedef void (*GNUNET_PEERSTORE_RecordIterator) (void *cls,
51 const struct GNUNET_PeerIdentity *peer,
52 const char *sub_system,
53 const void *value,
54 size_t size);
55
56/**
42 * @brief struct returned by the initialization function of the plugin 57 * @brief struct returned by the initialization function of the plugin
43 */ 58 */
44struct GNUNET_PEERSTORE_PluginFunctions 59struct GNUNET_PEERSTORE_PluginFunctions
@@ -68,6 +83,23 @@ struct GNUNET_PEERSTORE_PluginFunctions
68 const void *value, 83 const void *value,
69 size_t size); 84 size_t size);
70 85
86 /**
87 * Iterate over the records given an optional peer id
88 * and/or sub system.
89 *
90 * @param cls closure (internal context for the plugin)
91 * @param peer Peer identity (can be NULL)
92 * @param sub_system name of sub system (can be NULL)
93 * @param iter function to call with the result
94 * @param iter_cls closure for @a iter
95 * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error
96 */
97 int
98 (*iterate_records) (void *cls,
99 const struct GNUNET_PeerIdentity *peer,
100 const char *sub_system,
101 GNUNET_PEERSTORE_RecordIterator iter, void *iter_cls);
102
71}; 103};
72 104
73 105