diff options
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_namestore_plugin.h | 38 | ||||
-rw-r--r-- | src/include/gnunet_namestore_service.h | 46 |
2 files changed, 1 insertions, 83 deletions
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 037c6927a..5c3298d98 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h | |||
@@ -39,16 +39,6 @@ extern "C" | |||
39 | 39 | ||
40 | 40 | ||
41 | /** | 41 | /** |
42 | * Function called for matching blocks. | ||
43 | * | ||
44 | * @param cls closure | ||
45 | * @param block lookup result | ||
46 | */ | ||
47 | typedef void (*GNUNET_GNSRECORD_BlockCallback) (void *cls, | ||
48 | const struct GNUNET_GNSRECORD_Block *block); | ||
49 | |||
50 | |||
51 | /** | ||
52 | * Function called by for each matching record. | 42 | * Function called by for each matching record. |
53 | * | 43 | * |
54 | * @param cls closure | 44 | * @param cls closure |
@@ -76,34 +66,6 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
76 | void *cls; | 66 | void *cls; |
77 | 67 | ||
78 | /** | 68 | /** |
79 | * Cache a block in the datastore. Overwrites existing blocks | ||
80 | * for the same zone and label. | ||
81 | * | ||
82 | * @param cls closure (internal context for the plugin) | ||
83 | * @param block block to cache | ||
84 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | ||
85 | */ | ||
86 | int (*cache_block) (void *cls, | ||
87 | const struct GNUNET_GNSRECORD_Block *block); | ||
88 | |||
89 | |||
90 | /** | ||
91 | * Get the block for a particular zone and label in the | ||
92 | * datastore. Will return at most one result to the iterator. | ||
93 | * | ||
94 | * @param cls closure (internal context for the plugin) | ||
95 | * @param query hash of public key derived from the zone and the label | ||
96 | * @param iter function to call with the result | ||
97 | * @param iter_cls closure for @a iter | ||
98 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | ||
99 | */ | ||
100 | int (*lookup_block) (void *cls, | ||
101 | const struct GNUNET_HashCode *query, | ||
102 | GNUNET_GNSRECORD_BlockCallback iter, void *iter_cls); | ||
103 | |||
104 | |||
105 | |||
106 | /** | ||
107 | * Store a record in the datastore for which we are the authority. | 69 | * Store a record in the datastore for which we are the authority. |
108 | * Removes any existing record in the same zone with the same name. | 70 | * Removes any existing record in the same zone with the same name. |
109 | * | 71 | * |
diff --git a/src/include/gnunet_namestore_service.h b/src/include/gnunet_namestore_service.h index b37cecf50..36e912f51 100644 --- a/src/include/gnunet_namestore_service.h +++ b/src/include/gnunet_namestore_service.h | |||
@@ -96,23 +96,6 @@ typedef void (*GNUNET_NAMESTORE_ContinuationWithStatus) (void *cls, | |||
96 | 96 | ||
97 | /** | 97 | /** |
98 | * Store an item in the namestore. If the item is already present, | 98 | * Store an item in the namestore. If the item is already present, |
99 | * it is replaced with the new record. | ||
100 | * | ||
101 | * @param h handle to the namestore | ||
102 | * @param block block to store | ||
103 | * @param cont continuation to call when done | ||
104 | * @param cont_cls closure for @a cont | ||
105 | * @return handle to abort the request | ||
106 | */ | ||
107 | struct GNUNET_NAMESTORE_QueueEntry * | ||
108 | GNUNET_NAMESTORE_block_cache (struct GNUNET_NAMESTORE_Handle *h, | ||
109 | const struct GNUNET_GNSRECORD_Block *block, | ||
110 | GNUNET_NAMESTORE_ContinuationWithStatus cont, | ||
111 | void *cont_cls); | ||
112 | |||
113 | |||
114 | /** | ||
115 | * Store an item in the namestore. If the item is already present, | ||
116 | * it is replaced with the new record. Use an empty array to | 99 | * it is replaced with the new record. Use an empty array to |
117 | * remove all records under the given name. | 100 | * remove all records under the given name. |
118 | * | 101 | * |
@@ -135,33 +118,6 @@ GNUNET_NAMESTORE_records_store (struct GNUNET_NAMESTORE_Handle *h, | |||
135 | void *cont_cls); | 118 | void *cont_cls); |
136 | 119 | ||
137 | 120 | ||
138 | /** | ||
139 | * Process a record that was stored in the namestore. | ||
140 | * | ||
141 | * @param cls closure | ||
142 | * @param block block that was stored in the namestore | ||
143 | */ | ||
144 | typedef void (*GNUNET_GNSRECORD_BlockProcessor) (void *cls, | ||
145 | const struct GNUNET_GNSRECORD_Block *block); | ||
146 | |||
147 | |||
148 | /** | ||
149 | * Get a result for a particular key from the namestore. The processor | ||
150 | * will only be called once. | ||
151 | * | ||
152 | * @param h handle to the namestore | ||
153 | * @param derived_hash hash of zone key combined with name to lookup | ||
154 | * then at the end once with NULL | ||
155 | * @param proc function to call on the matching block, or with | ||
156 | * NULL if there is no matching block | ||
157 | * @param proc_cls closure for @a proc | ||
158 | * @return a handle that can be used to cancel | ||
159 | */ | ||
160 | struct GNUNET_NAMESTORE_QueueEntry * | ||
161 | GNUNET_NAMESTORE_lookup_block (struct GNUNET_NAMESTORE_Handle *h, | ||
162 | const struct GNUNET_HashCode *derived_hash, | ||
163 | GNUNET_GNSRECORD_BlockProcessor proc, void *proc_cls); | ||
164 | |||
165 | 121 | ||
166 | /** | 122 | /** |
167 | * Process a record that was stored in the namestore. | 123 | * Process a record that was stored in the namestore. |
@@ -223,7 +179,7 @@ GNUNET_NAMESTORE_cancel (struct GNUNET_NAMESTORE_QueueEntry *qe); | |||
223 | * @param zone zone to access, NULL for all zones | 179 | * @param zone zone to access, NULL for all zones |
224 | * @param proc function to call on each name from the zone; it | 180 | * @param proc function to call on each name from the zone; it |
225 | * will be called repeatedly with a value (if available) | 181 | * will be called repeatedly with a value (if available) |
226 | * and always once at the end with a name of NULL. | 182 | * and always once at the end with a label of NULL. |
227 | * @param proc_cls closure for @a proc | 183 | * @param proc_cls closure for @a proc |
228 | * @return an iterator handle to use for iteration | 184 | * @return an iterator handle to use for iteration |
229 | */ | 185 | */ |