aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorOmar Tarabai <tarabai@devegypt.com>2014-05-16 12:54:18 +0000
committerOmar Tarabai <tarabai@devegypt.com>2014-05-16 12:54:18 +0000
commitaeaf5c97d7d115d99f30e86be66c622b7a6ebf4f (patch)
tree13e3f037af1fc84188b91e6054153714ad3f631a /src/include
parent369811cfb47a51f240c7c4872e29c6eccd21fb0c (diff)
downloadgnunet-aeaf5c97d7d115d99f30e86be66c622b7a6ebf4f.tar.gz
gnunet-aeaf5c97d7d115d99f30e86be66c622b7a6ebf4f.zip
towards peerstore iterate
Diffstat (limited to 'src/include')
-rw-r--r--src/include/gnunet_peerstore_plugin.h18
-rw-r--r--src/include/gnunet_peerstore_service.h20
2 files changed, 20 insertions, 18 deletions
diff --git a/src/include/gnunet_peerstore_plugin.h b/src/include/gnunet_peerstore_plugin.h
index ce473b508..e9563b508 100644
--- a/src/include/gnunet_peerstore_plugin.h
+++ b/src/include/gnunet_peerstore_plugin.h
@@ -39,22 +39,6 @@ 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 char *sub_system,
52 const struct GNUNET_PeerIdentity *peer,
53 const char *key,
54 const void *value,
55 size_t size);
56
57/**
58 * @brief struct returned by the initialization function of the plugin 42 * @brief struct returned by the initialization function of the plugin
59 */ 43 */
60struct GNUNET_PEERSTORE_PluginFunctions 44struct GNUNET_PEERSTORE_PluginFunctions
@@ -103,7 +87,7 @@ struct GNUNET_PEERSTORE_PluginFunctions
103 const char *sub_system, 87 const char *sub_system,
104 const struct GNUNET_PeerIdentity *peer, 88 const struct GNUNET_PeerIdentity *peer,
105 const char *key, 89 const char *key,
106 GNUNET_PEERSTORE_RecordIterator iter, void *iter_cls); 90 GNUNET_PEERSTORE_Processor iter, void *iter_cls);
107 91
108}; 92};
109 93
diff --git a/src/include/gnunet_peerstore_service.h b/src/include/gnunet_peerstore_service.h
index d8b8935cc..6fd059961 100644
--- a/src/include/gnunet_peerstore_service.h
+++ b/src/include/gnunet_peerstore_service.h
@@ -56,6 +56,24 @@ struct GNUNET_PEERSTORE_StoreContext;
56typedef void (*GNUNET_PEERSTORE_Continuation)(void *cls, int success); 56typedef void (*GNUNET_PEERSTORE_Continuation)(void *cls, int success);
57 57
58/** 58/**
59 * Function called by for each matching record.
60 *
61 * @param cls closure
62 * @param peer peer identity
63 * @param sub_system name of the GNUnet sub system responsible
64 * @param value stored value
65 * @param size size of stored value
66 * @return #GNUNET_YES to continue iterating, #GNUNET_NO to stop
67 */
68typedef int (*GNUNET_PEERSTORE_Processor) (void *cls,
69 const char *sub_system,
70 const struct GNUNET_PeerIdentity *peer,
71 const char *key,
72 const void *value,
73 size_t size,
74 struct GNUNET_TIME_Absolute expiry);
75
76/**
59 * Connect to the PEERSTORE service. 77 * Connect to the PEERSTORE service.
60 * 78 *
61 * @return NULL on error 79 * @return NULL on error
@@ -91,7 +109,7 @@ GNUNET_PEERSTORE_store (struct GNUNET_PEERSTORE_Handle *h,
91 const char *key, 109 const char *key,
92 const void *value, 110 const void *value,
93 size_t size, 111 size_t size,
94 struct GNUNET_TIME_Relative lifetime, 112 struct GNUNET_TIME_Absolute expiry,
95 GNUNET_PEERSTORE_Continuation cont, 113 GNUNET_PEERSTORE_Continuation cont,
96 void *cont_cls); 114 void *cont_cls);
97 115