diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:51:21 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-15 21:51:21 +0000 |
commit | 6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (patch) | |
tree | edbc42f37889069033e57da201fef242939a6e0f /src/include | |
parent | 502af2167f7c218366666ca4944bd7cc54b5b19a (diff) | |
download | gnunet-6fd3e715cae09fa6e657c96f1c6f9711ee51f42f.tar.gz gnunet-6fd3e715cae09fa6e657c96f1c6f9711ee51f42f.zip |
indentation
Diffstat (limited to 'src/include')
46 files changed, 1084 insertions, 1266 deletions
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h index e0a0b83ad..76529ede4 100644 --- a/src/include/gnunet_arm_service.h +++ b/src/include/gnunet_arm_service.h | |||
@@ -104,11 +104,10 @@ void GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); | |||
104 | * @param cb callback to invoke when service is ready | 104 | * @param cb callback to invoke when service is ready |
105 | * @param cb_cls closure for callback | 105 | * @param cb_cls closure for callback |
106 | */ | 106 | */ |
107 | void | 107 | void GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, |
108 | GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, | 108 | const char *service_name, |
109 | const char *service_name, | 109 | struct GNUNET_TIME_Relative timeout, |
110 | struct GNUNET_TIME_Relative timeout, | 110 | GNUNET_ARM_Callback cb, void *cb_cls); |
111 | GNUNET_ARM_Callback cb, void *cb_cls); | ||
112 | 111 | ||
113 | 112 | ||
114 | /** | 113 | /** |
@@ -122,11 +121,10 @@ GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, | |||
122 | * @param cb callback to invoke when service is ready | 121 | * @param cb callback to invoke when service is ready |
123 | * @param cb_cls closure for callback | 122 | * @param cb_cls closure for callback |
124 | */ | 123 | */ |
125 | void | 124 | void GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, |
126 | GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, | 125 | const char *service_name, |
127 | const char *service_name, | 126 | struct GNUNET_TIME_Relative timeout, |
128 | struct GNUNET_TIME_Relative timeout, | 127 | GNUNET_ARM_Callback cb, void *cb_cls); |
129 | GNUNET_ARM_Callback cb, void *cb_cls); | ||
130 | 128 | ||
131 | 129 | ||
132 | 130 | ||
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index a6149ee5a..dd648dd75 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -156,8 +156,8 @@ struct GNUNET_ATS_SuggestionContext *GNUNET_ATS_suggest_address (struct | |||
156 | * | 156 | * |
157 | * @param asc handle of the request to cancel | 157 | * @param asc handle of the request to cancel |
158 | */ | 158 | */ |
159 | void | 159 | void GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext |
160 | GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc); | 160 | *asc); |
161 | 161 | ||
162 | 162 | ||
163 | /** | 163 | /** |
@@ -174,15 +174,12 @@ GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc); | |||
174 | * @param ats performance data for the connection | 174 | * @param ats performance data for the connection |
175 | * @param ats_count number of performance records in 'ats' | 175 | * @param ats_count number of performance records in 'ats' |
176 | */ | 176 | */ |
177 | void | 177 | void GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, |
178 | GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, | 178 | const struct GNUNET_PeerIdentity *peer, |
179 | const struct GNUNET_PeerIdentity *peer, | 179 | const char *plugin_name, struct Session *session, |
180 | const char *plugin_name, | 180 | const void *plugin_addr, size_t plugin_addr_len, |
181 | struct Session *session, | 181 | const struct GNUNET_TRANSPORT_ATS_Information |
182 | const void *plugin_addr, | 182 | *ats, uint32_t ats_count); |
183 | size_t plugin_addr_len, | ||
184 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | ||
185 | uint32_t ats_count); | ||
186 | 183 | ||
187 | 184 | ||
188 | /** | 185 | /** |
@@ -193,9 +190,8 @@ GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, | |||
193 | * @param atc handle | 190 | * @param atc handle |
194 | * @param peer identity of the peer | 191 | * @param peer identity of the peer |
195 | */ | 192 | */ |
196 | void | 193 | void GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, |
197 | GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, | 194 | const struct GNUNET_PeerIdentity *peer); |
198 | const struct GNUNET_PeerIdentity *peer); | ||
199 | 195 | ||
200 | 196 | ||
201 | /** | 197 | /** |
@@ -205,10 +201,9 @@ GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, | |||
205 | * @param peer identity of the peer | 201 | * @param peer identity of the peer |
206 | * @param session session handle that is no longer valid | 202 | * @param session session handle that is no longer valid |
207 | */ | 203 | */ |
208 | void | 204 | void GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, |
209 | GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, | 205 | const struct GNUNET_PeerIdentity *peer, |
210 | const struct GNUNET_PeerIdentity *peer, | 206 | const struct Session *session); |
211 | const struct Session *session); | ||
212 | 207 | ||
213 | 208 | ||
214 | /** | 209 | /** |
@@ -229,16 +224,14 @@ GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, | |||
229 | * @param ats performance data for the address | 224 | * @param ats performance data for the address |
230 | * @param ats_count number of performance records in 'ats' | 225 | * @param ats_count number of performance records in 'ats' |
231 | */ | 226 | */ |
232 | void | 227 | void GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, |
233 | GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, | 228 | const struct GNUNET_PeerIdentity *peer, |
234 | const struct GNUNET_PeerIdentity *peer, | 229 | struct GNUNET_TIME_Absolute valid_until, |
235 | struct GNUNET_TIME_Absolute valid_until, | 230 | const char *plugin_name, |
236 | const char *plugin_name, | 231 | struct Session *session, |
237 | struct Session *session, | 232 | const void *plugin_addr, size_t plugin_addr_len, |
238 | const void *plugin_addr, | 233 | const struct GNUNET_TRANSPORT_ATS_Information |
239 | size_t plugin_addr_len, | 234 | *ats, uint32_t ats_count); |
240 | const struct GNUNET_TRANSPORT_ATS_Information *ats, | ||
241 | uint32_t ats_count); | ||
242 | 235 | ||
243 | 236 | ||
244 | #endif | 237 | #endif |
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h index 059a6696c..e78d16552 100644 --- a/src/include/gnunet_bandwidth_lib.h +++ b/src/include/gnunet_bandwidth_lib.h | |||
@@ -89,8 +89,8 @@ struct GNUNET_BANDWIDTH_Tracker | |||
89 | * @param bytes_per_second value to create | 89 | * @param bytes_per_second value to create |
90 | * @return the new bandwidth value | 90 | * @return the new bandwidth value |
91 | */ | 91 | */ |
92 | struct GNUNET_BANDWIDTH_Value32NBO | 92 | struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t |
93 | GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); | 93 | bytes_per_second); |
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -107,20 +107,12 @@ GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); | |||
107 | * @param deadline when is the deadline | 107 | * @param deadline when is the deadline |
108 | * @return number of bytes available at bps until deadline | 108 | * @return number of bytes available at bps until deadline |
109 | */ | 109 | */ |
110 | uint64_t | 110 | uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct |
111 | 111 | GNUNET_BANDWIDTH_Value32NBO | |
112 | 112 | bps, | |
113 | 113 | struct | |
114 | 114 | GNUNET_TIME_Relative | |
115 | 115 | deadline); | |
116 | |||
117 | |||
118 | |||
119 | |||
120 | GNUNET_BANDWIDTH_value_get_available_until (struct GNUNET_BANDWIDTH_Value32NBO | ||
121 | bps, | ||
122 | struct GNUNET_TIME_Relative | ||
123 | deadline); | ||
124 | 116 | ||
125 | 117 | ||
126 | /** | 118 | /** |
@@ -131,9 +123,11 @@ uint64_t | |||
131 | * @param size number of bytes we want to have available | 123 | * @param size number of bytes we want to have available |
132 | * @return how long it would take | 124 | * @return how long it would take |
133 | */ | 125 | */ |
134 | struct GNUNET_TIME_Relative | 126 | struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct |
135 | GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, | 127 | GNUNET_BANDWIDTH_Value32NBO |
136 | uint64_t size); | 128 | bps, |
129 | uint64_t | ||
130 | size); | ||
137 | 131 | ||
138 | 132 | ||
139 | 133 | ||
@@ -144,9 +138,12 @@ GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, | |||
144 | * @param b2 second value | 138 | * @param b2 second value |
145 | * @return the min of b1 and b2 | 139 | * @return the min of b1 and b2 |
146 | */ | 140 | */ |
147 | struct GNUNET_BANDWIDTH_Value32NBO | 141 | struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct |
148 | GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, | 142 | GNUNET_BANDWIDTH_Value32NBO |
149 | struct GNUNET_BANDWIDTH_Value32NBO b2); | 143 | b1, |
144 | struct | ||
145 | GNUNET_BANDWIDTH_Value32NBO | ||
146 | b2); | ||
150 | 147 | ||
151 | 148 | ||
152 | /** | 149 | /** |
@@ -163,10 +160,10 @@ GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, | |||
163 | * @param max_carry_s maximum number of seconds unused bandwidth | 160 | * @param max_carry_s maximum number of seconds unused bandwidth |
164 | * may accumulate before it expires | 161 | * may accumulate before it expires |
165 | */ | 162 | */ |
166 | void | 163 | void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, |
167 | GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, | 164 | struct GNUNET_BANDWIDTH_Value32NBO |
168 | struct GNUNET_BANDWIDTH_Value32NBO | 165 | bytes_per_second_limit, |
169 | bytes_per_second_limit, uint32_t max_carry_s); | 166 | uint32_t max_carry_s); |
170 | 167 | ||
171 | 168 | ||
172 | /** | 169 | /** |
@@ -180,9 +177,8 @@ GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, | |||
180 | * @param size number of bytes consumed | 177 | * @param size number of bytes consumed |
181 | * @return GNUNET_YES if this consumption is above the limit | 178 | * @return GNUNET_YES if this consumption is above the limit |
182 | */ | 179 | */ |
183 | int | 180 | int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, |
184 | GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | 181 | ssize_t size); |
185 | ssize_t size); | ||
186 | 182 | ||
187 | 183 | ||
188 | /** | 184 | /** |
@@ -194,9 +190,10 @@ GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | |||
194 | * @param size number of bytes we would like to consume | 190 | * @param size number of bytes we would like to consume |
195 | * @return time to wait for consumption to be OK | 191 | * @return time to wait for consumption to be OK |
196 | */ | 192 | */ |
197 | struct GNUNET_TIME_Relative | 193 | struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct |
198 | GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, | 194 | GNUNET_BANDWIDTH_Tracker |
199 | size_t size); | 195 | *av, |
196 | size_t size); | ||
200 | 197 | ||
201 | 198 | ||
202 | /** | 199 | /** |
@@ -206,15 +203,9 @@ GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, | |||
206 | * @param av tracker to query | 203 | * @param av tracker to query |
207 | * @return number of bytes available for consumption right now | 204 | * @return number of bytes available for consumption right now |
208 | */ | 205 | */ |
209 | int64_t | 206 | int64_t GNUNET_BANDWIDTH_tracker_get_available (struct |
210 | 207 | GNUNET_BANDWIDTH_Tracker | |
211 | 208 | *av); | |
212 | |||
213 | |||
214 | |||
215 | |||
216 | |||
217 | GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av); | ||
218 | 209 | ||
219 | 210 | ||
220 | /** | 211 | /** |
@@ -223,10 +214,9 @@ int64_t | |||
223 | * @param av tracker to initialize | 214 | * @param av tracker to initialize |
224 | * @param bytes_per_second_limit new limit to assume | 215 | * @param bytes_per_second_limit new limit to assume |
225 | */ | 216 | */ |
226 | void | 217 | void GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, |
227 | GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, | 218 | struct GNUNET_BANDWIDTH_Value32NBO |
228 | struct GNUNET_BANDWIDTH_Value32NBO | 219 | bytes_per_second_limit); |
229 | bytes_per_second_limit); | ||
230 | 220 | ||
231 | 221 | ||
232 | #if 0 /* keep Emacsens' auto-indent happy */ | 222 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index f0b486fd2..74512ec40 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h | |||
@@ -72,8 +72,8 @@ int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | |||
72 | * @param len the number of bytes to read | 72 | * @param len the number of bytes to read |
73 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 73 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
74 | */ | 74 | */ |
75 | int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, | 75 | int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, |
76 | const char *what, void *result, size_t len); | 76 | void *result, size_t len); |
77 | 77 | ||
78 | 78 | ||
79 | /** | 79 | /** |
@@ -86,8 +86,8 @@ int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, | |||
86 | * @param len the number of bytes to read | 86 | * @param len the number of bytes to read |
87 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 87 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
88 | */ | 88 | */ |
89 | int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, | 89 | int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, |
90 | const char *file, int line, void *result, size_t len); | 90 | int line, void *result, size_t len); |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * Read 0-terminated string from a file. | 93 | * Read 0-terminated string from a file. |
@@ -99,8 +99,8 @@ int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, | |||
99 | * @param maxLen maximum allowed length for the string | 99 | * @param maxLen maximum allowed length for the string |
100 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 100 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
101 | */ | 101 | */ |
102 | int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, | 102 | int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, |
103 | const char *what, char **result, size_t maxLen); | 103 | char **result, size_t maxLen); |
104 | 104 | ||
105 | 105 | ||
106 | /** | 106 | /** |
@@ -144,8 +144,8 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, | |||
144 | * @param i address of 32-bit integer to read | 144 | * @param i address of 32-bit integer to read |
145 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 145 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
146 | */ | 146 | */ |
147 | int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, | 147 | int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
148 | const char *file, int line, int32_t * i); | 148 | int line, int32_t * i); |
149 | 149 | ||
150 | 150 | ||
151 | /** | 151 | /** |
@@ -166,8 +166,8 @@ int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, | |||
166 | * @param i address of 64-bit integer to read | 166 | * @param i address of 64-bit integer to read |
167 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 167 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
168 | */ | 168 | */ |
169 | int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, | 169 | int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
170 | const char *file, int line, int64_t * i); | 170 | int line, int64_t * i); |
171 | 171 | ||
172 | 172 | ||
173 | /** | 173 | /** |
@@ -210,8 +210,8 @@ int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | |||
210 | * @param n number of bytes to write | 210 | * @param n number of bytes to write |
211 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 211 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
212 | */ | 212 | */ |
213 | int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, | 213 | int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, |
214 | const void *buffer, size_t n); | 214 | size_t n); |
215 | 215 | ||
216 | 216 | ||
217 | /** | 217 | /** |
diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h index ae6884869..51b8254d0 100644 --- a/src/include/gnunet_block_lib.h +++ b/src/include/gnunet_block_lib.h | |||
@@ -161,9 +161,8 @@ struct GNUNET_BLOCK_Context; | |||
161 | * @param mingle_number number for hash permutation | 161 | * @param mingle_number number for hash permutation |
162 | * @param hc where to store the result. | 162 | * @param hc where to store the result. |
163 | */ | 163 | */ |
164 | void | 164 | void GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, |
165 | GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, | 165 | uint32_t mingle_number, GNUNET_HashCode * hc); |
166 | uint32_t mingle_number, GNUNET_HashCode * hc); | ||
167 | 166 | ||
168 | 167 | ||
169 | /** | 168 | /** |
@@ -203,15 +202,23 @@ void GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); | |||
203 | * @param reply_block_size number of bytes in reply block | 202 | * @param reply_block_size number of bytes in reply block |
204 | * @return characterization of result | 203 | * @return characterization of result |
205 | */ | 204 | */ |
206 | enum GNUNET_BLOCK_EvaluationResult | 205 | enum GNUNET_BLOCK_EvaluationResult GNUNET_BLOCK_evaluate (struct |
207 | GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx, | 206 | GNUNET_BLOCK_Context |
208 | enum GNUNET_BLOCK_Type type, | 207 | *ctx, |
209 | const GNUNET_HashCode * query, | 208 | enum GNUNET_BLOCK_Type |
210 | struct GNUNET_CONTAINER_BloomFilter **bf, | 209 | type, |
211 | int32_t bf_mutator, | 210 | const GNUNET_HashCode |
212 | const void *xquery, | 211 | * query, |
213 | size_t xquery_size, | 212 | struct |
214 | const void *reply_block, size_t reply_block_size); | 213 | GNUNET_CONTAINER_BloomFilter |
214 | **bf, | ||
215 | int32_t bf_mutator, | ||
216 | const void *xquery, | ||
217 | size_t xquery_size, | ||
218 | const void | ||
219 | *reply_block, | ||
220 | size_t | ||
221 | reply_block_size); | ||
215 | 222 | ||
216 | 223 | ||
217 | /** | 224 | /** |
@@ -227,11 +234,9 @@ GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx, | |||
227 | * GNUNET_SYSERR if type not supported | 234 | * GNUNET_SYSERR if type not supported |
228 | * (or if extracting a key from a block of this type does not work) | 235 | * (or if extracting a key from a block of this type does not work) |
229 | */ | 236 | */ |
230 | int | 237 | int GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, |
231 | GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, | 238 | enum GNUNET_BLOCK_Type type, const void *block, |
232 | enum GNUNET_BLOCK_Type type, | 239 | size_t block_size, GNUNET_HashCode * key); |
233 | const void *block, | ||
234 | size_t block_size, GNUNET_HashCode * key); | ||
235 | 240 | ||
236 | 241 | ||
237 | #if 0 /* keep Emacsens' auto-indent happy */ | 242 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_block_plugin.h b/src/include/gnunet_block_plugin.h index 885842157..6d1f2f103 100644 --- a/src/include/gnunet_block_plugin.h +++ b/src/include/gnunet_block_plugin.h | |||
@@ -50,15 +50,27 @@ | |||
50 | * @param reply_block_size number of bytes in reply block | 50 | * @param reply_block_size number of bytes in reply block |
51 | * @return characterization of result | 51 | * @return characterization of result |
52 | */ | 52 | */ |
53 | typedef enum GNUNET_BLOCK_EvaluationResult | 53 | typedef enum |
54 | (*GNUNET_BLOCK_EvaluationFunction) (void *cls, | 54 | GNUNET_BLOCK_EvaluationResult (*GNUNET_BLOCK_EvaluationFunction) (void *cls, |
55 | enum GNUNET_BLOCK_Type type, | 55 | enum |
56 | const GNUNET_HashCode * query, | 56 | GNUNET_BLOCK_Type |
57 | struct GNUNET_CONTAINER_BloomFilter ** | 57 | type, |
58 | bf, int32_t bf_mutator, | 58 | const |
59 | const void *xquery, size_t xquery_size, | 59 | GNUNET_HashCode |
60 | const void *reply_block, | 60 | * query, |
61 | size_t reply_block_size); | 61 | struct |
62 | GNUNET_CONTAINER_BloomFilter | ||
63 | ** bf, | ||
64 | int32_t | ||
65 | bf_mutator, | ||
66 | const void | ||
67 | *xquery, | ||
68 | size_t | ||
69 | xquery_size, | ||
70 | const void | ||
71 | *reply_block, | ||
72 | size_t | ||
73 | reply_block_size); | ||
62 | 74 | ||
63 | 75 | ||
64 | /** | 76 | /** |
@@ -74,11 +86,11 @@ typedef enum GNUNET_BLOCK_EvaluationResult | |||
74 | * GNUNET_SYSERR if type not supported | 86 | * GNUNET_SYSERR if type not supported |
75 | * (or if extracting a key from a block of this type does not work) | 87 | * (or if extracting a key from a block of this type does not work) |
76 | */ | 88 | */ |
77 | typedef int | 89 | typedef int (*GNUNET_BLOCK_GetKeyFunction) (void *cls, |
78 | (*GNUNET_BLOCK_GetKeyFunction) (void *cls, | 90 | enum GNUNET_BLOCK_Type type, |
79 | enum GNUNET_BLOCK_Type type, | 91 | const void *block, |
80 | const void *block, | 92 | size_t block_size, |
81 | size_t block_size, GNUNET_HashCode * key); | 93 | GNUNET_HashCode * key); |
82 | 94 | ||
83 | 95 | ||
84 | 96 | ||
diff --git a/src/include/gnunet_chat_service.h b/src/include/gnunet_chat_service.h index 723c280e6..d9c3ec76f 100644 --- a/src/include/gnunet_chat_service.h +++ b/src/include/gnunet_chat_service.h | |||
@@ -213,12 +213,12 @@ struct GNUNET_CHAT_Room *GNUNET_CHAT_join_room (const struct | |||
213 | * @param receiver use NULL to send to everyone in the room | 213 | * @param receiver use NULL to send to everyone in the room |
214 | * @param sequence_number where to write the sequence id of the message | 214 | * @param sequence_number where to write the sequence id of the message |
215 | */ | 215 | */ |
216 | void | 216 | void GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, |
217 | GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, | 217 | const char *message, |
218 | const char *message, | 218 | enum GNUNET_CHAT_MsgOptions options, |
219 | enum GNUNET_CHAT_MsgOptions options, | 219 | const struct |
220 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 220 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
221 | *receiver, uint32_t * sequence_number); | 221 | *receiver, uint32_t * sequence_number); |
222 | 222 | ||
223 | 223 | ||
224 | /** | 224 | /** |
@@ -234,8 +234,8 @@ void GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room); | |||
234 | * | 234 | * |
235 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration | 235 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration |
236 | */ | 236 | */ |
237 | typedef int (*GNUNET_CHAT_RoomIterator) (const char *room, | 237 | typedef int (*GNUNET_CHAT_RoomIterator) (const char *room, const char *topic, |
238 | const char *topic, void *cls); | 238 | void *cls); |
239 | 239 | ||
240 | /** | 240 | /** |
241 | * List all of the (publically visible) chat rooms. | 241 | * List all of the (publically visible) chat rooms. |
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 343960426..3fad01222 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -66,9 +66,8 @@ struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char | |||
66 | * @param h client handle | 66 | * @param h client handle |
67 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 67 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
68 | */ | 68 | */ |
69 | void | 69 | void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, |
70 | GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, | 70 | int do_ignore); |
71 | int do_ignore); | ||
72 | 71 | ||
73 | 72 | ||
74 | 73 | ||
@@ -98,8 +97,8 @@ void GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock, | |||
98 | * @param msg message received, NULL on timeout or fatal error | 97 | * @param msg message received, NULL on timeout or fatal error |
99 | */ | 98 | */ |
100 | typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls, | 99 | typedef void (*GNUNET_CLIENT_MessageHandler) (void *cls, |
101 | const struct | 100 | const struct GNUNET_MessageHeader |
102 | GNUNET_MessageHeader * msg); | 101 | * msg); |
103 | 102 | ||
104 | /** | 103 | /** |
105 | * Type of a function to call when we have finished shutting | 104 | * Type of a function to call when we have finished shutting |
@@ -153,13 +152,20 @@ struct GNUNET_CLIENT_TransmitHandle; | |||
153 | * non-NULL if the notify callback was queued (can be used to cancel | 152 | * non-NULL if the notify callback was queued (can be used to cancel |
154 | * using GNUNET_CONNECTION_notify_transmit_ready_cancel) | 153 | * using GNUNET_CONNECTION_notify_transmit_ready_cancel) |
155 | */ | 154 | */ |
156 | struct GNUNET_CLIENT_TransmitHandle | 155 | struct GNUNET_CLIENT_TransmitHandle *GNUNET_CLIENT_notify_transmit_ready (struct |
157 | *GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock, | 156 | GNUNET_CLIENT_Connection |
158 | size_t size, | 157 | *sock, |
159 | struct GNUNET_TIME_Relative timeout, | 158 | size_t |
160 | int auto_retry, | 159 | size, |
161 | GNUNET_CONNECTION_TransmitReadyNotify | 160 | struct |
162 | notify, void *notify_cls); | 161 | GNUNET_TIME_Relative |
162 | timeout, | ||
163 | int | ||
164 | auto_retry, | ||
165 | GNUNET_CONNECTION_TransmitReadyNotify | ||
166 | notify, | ||
167 | void | ||
168 | *notify_cls); | ||
163 | 169 | ||
164 | 170 | ||
165 | /** | 171 | /** |
@@ -167,9 +173,9 @@ struct GNUNET_CLIENT_TransmitHandle | |||
167 | * | 173 | * |
168 | * @param th handle from the original request. | 174 | * @param th handle from the original request. |
169 | */ | 175 | */ |
170 | void | 176 | void GNUNET_CLIENT_notify_transmit_ready_cancel (struct |
171 | GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle | 177 | GNUNET_CLIENT_TransmitHandle |
172 | *th); | 178 | *th); |
173 | 179 | ||
174 | 180 | ||
175 | /** | 181 | /** |
@@ -193,13 +199,14 @@ GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle | |||
193 | * @return GNUNET_OK on success, GNUNET_SYSERR if a request | 199 | * @return GNUNET_OK on success, GNUNET_SYSERR if a request |
194 | * is already pending | 200 | * is already pending |
195 | */ | 201 | */ |
196 | int | 202 | int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection |
197 | GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock, | 203 | *sock, |
198 | const struct GNUNET_MessageHeader *hdr, | 204 | const struct GNUNET_MessageHeader |
199 | struct GNUNET_TIME_Relative timeout, | 205 | *hdr, |
200 | int auto_retry, | 206 | struct GNUNET_TIME_Relative |
201 | GNUNET_CLIENT_MessageHandler rn, | 207 | timeout, int auto_retry, |
202 | void *rn_cls); | 208 | GNUNET_CLIENT_MessageHandler rn, |
209 | void *rn_cls); | ||
203 | 210 | ||
204 | 211 | ||
205 | /** | 212 | /** |
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index 036249e34..f884d9a24 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h | |||
@@ -157,10 +157,9 @@ enum GNUNET_ErrorType | |||
157 | * @param date when was the message logged? | 157 | * @param date when was the message logged? |
158 | * @param message what is the message | 158 | * @param message what is the message |
159 | */ | 159 | */ |
160 | typedef void (*GNUNET_Logger) (void *cls, | 160 | typedef void (*GNUNET_Logger) (void *cls, enum GNUNET_ErrorType kind, |
161 | enum GNUNET_ErrorType kind, | 161 | const char *component, const char *date, |
162 | const char *component, | 162 | const char *message); |
163 | const char *date, const char *message); | ||
164 | 163 | ||
165 | /** | 164 | /** |
166 | * Main log function. | 165 | * Main log function. |
@@ -182,9 +181,8 @@ void GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); | |||
182 | * @param message what is the message (format string) | 181 | * @param message what is the message (format string) |
183 | * @param ... arguments for format string | 182 | * @param ... arguments for format string |
184 | */ | 183 | */ |
185 | void | 184 | void GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, |
186 | GNUNET_log_from (enum GNUNET_ErrorType kind, | 185 | const char *message, ...); |
187 | const char *comp, const char *message, ...); | ||
188 | 186 | ||
189 | 187 | ||
190 | /** | 188 | /** |
@@ -204,8 +202,8 @@ void GNUNET_log_skip (unsigned int n, int check_reset); | |||
204 | * @param logfile change logging to logfile (use NULL to keep stderr) | 202 | * @param logfile change logging to logfile (use NULL to keep stderr) |
205 | * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened | 203 | * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened |
206 | */ | 204 | */ |
207 | int | 205 | int GNUNET_log_setup (const char *comp, const char *loglevel, |
208 | GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile); | 206 | const char *logfile); |
209 | 207 | ||
210 | 208 | ||
211 | /** | 209 | /** |
@@ -528,15 +526,15 @@ void *GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, | |||
528 | * @param linenumber line where this call is being made (for debugging) | 526 | * @param linenumber line where this call is being made (for debugging) |
529 | * @return pointer to size bytes of memory, NULL if we do not have enough memory | 527 | * @return pointer to size bytes of memory, NULL if we do not have enough memory |
530 | */ | 528 | */ |
531 | void *GNUNET_xmalloc_unchecked_ (size_t size, | 529 | void *GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, |
532 | const char *filename, int linenumber); | 530 | int linenumber); |
533 | 531 | ||
534 | /** | 532 | /** |
535 | * Reallocate memory. Checks the return value, aborts if no more | 533 | * Reallocate memory. Checks the return value, aborts if no more |
536 | * memory is available. | 534 | * memory is available. |
537 | */ | 535 | */ |
538 | void *GNUNET_xrealloc_ (void *ptr, | 536 | void *GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, |
539 | size_t n, const char *filename, int linenumber); | 537 | int linenumber); |
540 | 538 | ||
541 | /** | 539 | /** |
542 | * Free memory. Merely a wrapper for the case that we | 540 | * Free memory. Merely a wrapper for the case that we |
@@ -585,11 +583,9 @@ char *GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, | |||
585 | * @param filename where is this call being made (for debugging) | 583 | * @param filename where is this call being made (for debugging) |
586 | * @param linenumber line where this call is being made (for debugging) | 584 | * @param linenumber line where this call is being made (for debugging) |
587 | */ | 585 | */ |
588 | void GNUNET_xgrow_ (void **old, | 586 | void GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount, |
589 | size_t elementSize, | 587 | unsigned int newCount, const char *filename, |
590 | unsigned int *oldCount, | 588 | int linenumber); |
591 | unsigned int newCount, | ||
592 | const char *filename, int linenumber); | ||
593 | 589 | ||
594 | 590 | ||
595 | 591 | ||
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 4ecb3539f..24705f0fb 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -113,11 +113,10 @@ int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
113 | * @param filename where to write the configuration diff between default and new | 113 | * @param filename where to write the configuration diff between default and new |
114 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 114 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
115 | */ | 115 | */ |
116 | int | 116 | int GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle |
117 | GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle | 117 | *cfgDefault, |
118 | *cfgDefault, | 118 | const struct GNUNET_CONFIGURATION_Handle |
119 | const struct GNUNET_CONFIGURATION_Handle | 119 | *cfgNew, const char *filename); |
120 | *cfgNew, const char *filename); | ||
121 | 120 | ||
122 | /** | 121 | /** |
123 | * Test if there are configuration options that were | 122 | * Test if there are configuration options that were |
@@ -138,8 +137,7 @@ int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle | |||
138 | * @param option name of the option | 137 | * @param option name of the option |
139 | * @param value value of the option | 138 | * @param value value of the option |
140 | */ | 139 | */ |
141 | typedef void (*GNUNET_CONFIGURATION_Iterator) (void *cls, | 140 | typedef void (*GNUNET_CONFIGURATION_Iterator) (void *cls, const char *section, |
142 | const char *section, | ||
143 | const char *option, | 141 | const char *option, |
144 | const char *value); | 142 | const char *value); |
145 | 143 | ||
@@ -277,11 +275,10 @@ int GNUNET_CONFIGURATION_get_value_filename (const struct | |||
277 | */ | 275 | */ |
278 | int GNUNET_CONFIGURATION_iterate_value_filenames (const struct | 276 | int GNUNET_CONFIGURATION_iterate_value_filenames (const struct |
279 | GNUNET_CONFIGURATION_Handle | 277 | GNUNET_CONFIGURATION_Handle |
280 | *cfg, | 278 | *cfg, const char *section, |
281 | const char *section, | ||
282 | const char *option, | 279 | const char *option, |
283 | GNUNET_FileNameCallback | 280 | GNUNET_FileNameCallback cb, |
284 | cb, void *cb_cls); | 281 | void *cb_cls); |
285 | 282 | ||
286 | /** | 283 | /** |
287 | * Iterate over values of a section in the configuration. | 284 | * Iterate over values of a section in the configuration. |
@@ -291,12 +288,11 @@ int GNUNET_CONFIGURATION_iterate_value_filenames (const struct | |||
291 | * @param iter function to call on each option | 288 | * @param iter function to call on each option |
292 | * @param iter_cls closure for iter | 289 | * @param iter_cls closure for iter |
293 | */ | 290 | */ |
294 | void | 291 | void GNUNET_CONFIGURATION_iterate_section_values (const struct |
295 | GNUNET_CONFIGURATION_iterate_section_values (const struct | 292 | GNUNET_CONFIGURATION_Handle |
296 | GNUNET_CONFIGURATION_Handle *cfg, | 293 | *cfg, const char *section, |
297 | const char *section, | 294 | GNUNET_CONFIGURATION_Iterator |
298 | GNUNET_CONFIGURATION_Iterator iter, | 295 | iter, void *iter_cls); |
299 | void *iter_cls); | ||
300 | 296 | ||
301 | /** | 297 | /** |
302 | * Get a configuration value that should be in a set of | 298 | * Get a configuration value that should be in a set of |
@@ -353,12 +349,10 @@ char *GNUNET_CONFIGURATION_expand_dollar (const struct | |||
353 | * @param option option of interest | 349 | * @param option option of interest |
354 | * @param number value to set | 350 | * @param number value to set |
355 | */ | 351 | */ |
356 | void | 352 | void GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle |
357 | GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle | 353 | *cfg, const char *section, |
358 | *cfg, | 354 | const char *option, |
359 | const char *section, | 355 | unsigned long long number); |
360 | const char *option, | ||
361 | unsigned long long number); | ||
362 | 356 | ||
363 | 357 | ||
364 | /** | 358 | /** |
@@ -369,11 +363,10 @@ GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle | |||
369 | * @param option option of interest | 363 | * @param option option of interest |
370 | * @param value value to set | 364 | * @param value value to set |
371 | */ | 365 | */ |
372 | void | 366 | void GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle |
373 | GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle | 367 | *cfg, const char *section, |
374 | *cfg, | 368 | const char *option, |
375 | const char *section, | 369 | const char *value); |
376 | const char *option, const char *value); | ||
377 | 370 | ||
378 | /** | 371 | /** |
379 | * Remove a filename from a configuration value that | 372 | * Remove a filename from a configuration value that |
@@ -388,8 +381,7 @@ GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle | |||
388 | */ | 381 | */ |
389 | int GNUNET_CONFIGURATION_remove_value_filename (struct | 382 | int GNUNET_CONFIGURATION_remove_value_filename (struct |
390 | GNUNET_CONFIGURATION_Handle | 383 | GNUNET_CONFIGURATION_Handle |
391 | *cfg, | 384 | *cfg, const char *section, |
392 | const char *section, | ||
393 | const char *option, | 385 | const char *option, |
394 | const char *value); | 386 | const char *value); |
395 | 387 | ||
diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index 00b97d903..af10c5966 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h | |||
@@ -99,8 +99,7 @@ typedef int (*GNUNET_CONNECTION_AccessCheck) (void *cls, | |||
99 | * @param addrlen size of addr | 99 | * @param addrlen size of addr |
100 | * @param errCode value of errno (on errors receiving) | 100 | * @param errCode value of errno (on errors receiving) |
101 | */ | 101 | */ |
102 | typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, | 102 | typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, const void *buf, |
103 | const void *buf, | ||
104 | size_t available, | 103 | size_t available, |
105 | const struct sockaddr * addr, | 104 | const struct sockaddr * addr, |
106 | socklen_t addrlen, int errCode); | 105 | socklen_t addrlen, int errCode); |
@@ -136,9 +135,9 @@ int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); | |||
136 | * @param osSocket existing socket to box | 135 | * @param osSocket existing socket to box |
137 | * @return the boxed socket handle | 136 | * @return the boxed socket handle |
138 | */ | 137 | */ |
139 | struct GNUNET_CONNECTION_Handle | 138 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct |
140 | *GNUNET_CONNECTION_create_from_existing (struct | 139 | GNUNET_NETWORK_Handle |
141 | GNUNET_NETWORK_Handle *osSocket); | 140 | *osSocket); |
142 | 141 | ||
143 | 142 | ||
144 | /** | 143 | /** |
@@ -151,8 +150,8 @@ struct GNUNET_CONNECTION_Handle | |||
151 | * @return the socket handle, NULL on error (for example, access refused) | 150 | * @return the socket handle, NULL on error (for example, access refused) |
152 | */ | 151 | */ |
153 | struct GNUNET_CONNECTION_Handle | 152 | struct GNUNET_CONNECTION_Handle |
154 | *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck | 153 | *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, |
155 | access, void *access_cls, | 154 | void *access_cls, |
156 | struct GNUNET_NETWORK_Handle *lsock); | 155 | struct GNUNET_NETWORK_Handle *lsock); |
157 | 156 | ||
158 | 157 | ||
@@ -166,11 +165,15 @@ struct GNUNET_CONNECTION_Handle | |||
166 | * @param port port to connect to | 165 | * @param port port to connect to |
167 | * @return the socket handle | 166 | * @return the socket handle |
168 | */ | 167 | */ |
169 | struct GNUNET_CONNECTION_Handle | 168 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const |
170 | *GNUNET_CONNECTION_create_from_connect (const struct | 169 | struct |
171 | GNUNET_CONFIGURATION_Handle *cfg, | 170 | GNUNET_CONFIGURATION_Handle |
172 | const char *hostname, | 171 | *cfg, |
173 | uint16_t port); | 172 | const |
173 | char | ||
174 | *hostname, | ||
175 | uint16_t | ||
176 | port); | ||
174 | 177 | ||
175 | 178 | ||
176 | /** | 179 | /** |
@@ -201,10 +204,14 @@ struct GNUNET_CONNECTION_Handle | |||
201 | * @param addrlen length of server address | 204 | * @param addrlen length of server address |
202 | * @return the socket handle | 205 | * @return the socket handle |
203 | */ | 206 | */ |
204 | struct GNUNET_CONNECTION_Handle | 207 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int |
205 | *GNUNET_CONNECTION_create_from_sockaddr (int af_family, | 208 | af_family, |
206 | const struct sockaddr | 209 | const |
207 | *serv_addr, socklen_t addrlen); | 210 | struct |
211 | sockaddr | ||
212 | *serv_addr, | ||
213 | socklen_t | ||
214 | addrlen); | ||
208 | 215 | ||
209 | /** | 216 | /** |
210 | * Check if socket is valid (no fatal errors have happened so far). | 217 | * Check if socket is valid (no fatal errors have happened so far). |
@@ -225,9 +232,8 @@ int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); | |||
225 | * @param addrlen where to store the length of the address | 232 | * @param addrlen where to store the length of the address |
226 | * @return GNUNET_OK on success | 233 | * @return GNUNET_OK on success |
227 | */ | 234 | */ |
228 | int GNUNET_CONNECTION_get_address (struct | 235 | int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, |
229 | GNUNET_CONNECTION_Handle | 236 | void **addr, size_t * addrlen); |
230 | *sock, void **addr, size_t * addrlen); | ||
231 | 237 | ||
232 | 238 | ||
233 | /** | 239 | /** |
@@ -243,9 +249,8 @@ int GNUNET_CONNECTION_get_address (struct | |||
243 | * read from the application; all other transmissions should be | 249 | * read from the application; all other transmissions should be |
244 | * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). | 250 | * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). |
245 | */ | 251 | */ |
246 | void | 252 | void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, |
247 | GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, | 253 | int finish_pending_write); |
248 | int finish_pending_write); | ||
249 | 254 | ||
250 | 255 | ||
251 | /** | 256 | /** |
@@ -261,12 +266,10 @@ GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, | |||
261 | * @param receiver function to call with received data | 266 | * @param receiver function to call with received data |
262 | * @param receiver_cls closure for receiver | 267 | * @param receiver_cls closure for receiver |
263 | */ | 268 | */ |
264 | void | 269 | void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, |
265 | GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle | 270 | size_t max, struct GNUNET_TIME_Relative timeout, |
266 | *sock, size_t max, | 271 | GNUNET_CONNECTION_Receiver receiver, |
267 | struct GNUNET_TIME_Relative timeout, | 272 | void *receiver_cls); |
268 | GNUNET_CONNECTION_Receiver receiver, | ||
269 | void *receiver_cls); | ||
270 | 273 | ||
271 | 274 | ||
272 | /** | 275 | /** |
@@ -291,8 +294,7 @@ void *GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock); | |||
291 | * @param buf where the callee should write the message | 294 | * @param buf where the callee should write the message |
292 | * @return number of bytes written to buf | 295 | * @return number of bytes written to buf |
293 | */ | 296 | */ |
294 | typedef size_t (*GNUNET_CONNECTION_TransmitReadyNotify) (void *cls, | 297 | typedef size_t (*GNUNET_CONNECTION_TransmitReadyNotify) (void *cls, size_t size, |
295 | size_t size, | ||
296 | void *buf); | 298 | void *buf); |
297 | 299 | ||
298 | 300 | ||
@@ -332,11 +334,9 @@ struct GNUNET_CONNECTION_TransmitHandle; | |||
332 | * NULL if we are already going to notify someone else (busy) | 334 | * NULL if we are already going to notify someone else (busy) |
333 | */ | 335 | */ |
334 | struct GNUNET_CONNECTION_TransmitHandle | 336 | struct GNUNET_CONNECTION_TransmitHandle |
335 | *GNUNET_CONNECTION_notify_transmit_ready (struct | 337 | *GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle |
336 | GNUNET_CONNECTION_Handle | ||
337 | *sock, size_t size, | 338 | *sock, size_t size, |
338 | struct | 339 | struct GNUNET_TIME_Relative |
339 | GNUNET_TIME_Relative | ||
340 | timeout, | 340 | timeout, |
341 | GNUNET_CONNECTION_TransmitReadyNotify | 341 | GNUNET_CONNECTION_TransmitReadyNotify |
342 | notify, void *notify_cls); | 342 | notify, void *notify_cls); |
@@ -348,10 +348,9 @@ struct GNUNET_CONNECTION_TransmitHandle | |||
348 | * | 348 | * |
349 | * @param h handle for notification to cancel | 349 | * @param h handle for notification to cancel |
350 | */ | 350 | */ |
351 | void | 351 | void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct |
352 | GNUNET_CONNECTION_notify_transmit_ready_cancel (struct | 352 | GNUNET_CONNECTION_TransmitHandle |
353 | GNUNET_CONNECTION_TransmitHandle | 353 | *h); |
354 | *h); | ||
355 | 354 | ||
356 | 355 | ||
357 | /** | 356 | /** |
@@ -360,9 +359,8 @@ GNUNET_CONNECTION_notify_transmit_ready_cancel (struct | |||
360 | * @param sock socket handle | 359 | * @param sock socket handle |
361 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 360 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
362 | */ | 361 | */ |
363 | void | 362 | void GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, |
364 | GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, | 363 | int do_ignore); |
365 | int do_ignore); | ||
366 | 364 | ||
367 | 365 | ||
368 | #if 0 /* keep Emacsens' auto-indent happy */ | 366 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index cfc7e0842..fde31ed34 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -115,8 +115,8 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_init (const | |||
115 | * @return GNUNET_SYSERR if the data array of the wrong size | 115 | * @return GNUNET_SYSERR if the data array of the wrong size |
116 | */ | 116 | */ |
117 | int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct | 117 | int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct |
118 | GNUNET_CONTAINER_BloomFilter | 118 | GNUNET_CONTAINER_BloomFilter *bf, |
119 | *bf, char *data, size_t size); | 119 | char *data, size_t size); |
120 | 120 | ||
121 | 121 | ||
122 | /** | 122 | /** |
@@ -134,8 +134,8 @@ int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter | |||
134 | * @param bf the filter | 134 | * @param bf the filter |
135 | * @param e the element | 135 | * @param e the element |
136 | */ | 136 | */ |
137 | void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter | 137 | void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, |
138 | *bf, const GNUNET_HashCode * e); | 138 | const GNUNET_HashCode * e); |
139 | 139 | ||
140 | 140 | ||
141 | /** | 141 | /** |
@@ -176,20 +176,9 @@ void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter | |||
176 | * @param bf the filter | 176 | * @param bf the filter |
177 | * @return number of bytes used for the data of the bloom filter | 177 | * @return number of bytes used for the data of the bloom filter |
178 | */ | 178 | */ |
179 | size_t | 179 | size_t GNUNET_CONTAINER_bloomfilter_get_size (const struct |
180 | 180 | GNUNET_CONTAINER_BloomFilter | |
181 | 181 | *bf); | |
182 | |||
183 | |||
184 | |||
185 | |||
186 | |||
187 | |||
188 | |||
189 | |||
190 | |||
191 | GNUNET_CONTAINER_bloomfilter_get_size (const struct GNUNET_CONTAINER_BloomFilter | ||
192 | *bf); | ||
193 | 182 | ||
194 | 183 | ||
195 | /** | 184 | /** |
@@ -223,10 +212,9 @@ int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
223 | * @param to_or the bloomfilter to or-in | 212 | * @param to_or the bloomfilter to or-in |
224 | * @param size number of bytes in data | 213 | * @param size number of bytes in data |
225 | */ | 214 | */ |
226 | int | 215 | int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, |
227 | GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, | 216 | const struct GNUNET_CONTAINER_BloomFilter |
228 | const struct GNUNET_CONTAINER_BloomFilter | 217 | *to_or, size_t size); |
229 | *to_or, size_t size); | ||
230 | 218 | ||
231 | /** | 219 | /** |
232 | * Resize a bloom filter. Note that this operation | 220 | * Resize a bloom filter. Note that this operation |
@@ -240,10 +228,9 @@ GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
240 | * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element | 228 | * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element |
241 | */ | 229 | */ |
242 | void GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter | 230 | void GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter |
243 | *bf, | 231 | *bf, GNUNET_HashCodeIterator iterator, |
244 | GNUNET_HashCodeIterator iterator, | 232 | void *iterator_cls, size_t size, |
245 | void *iterator_cls, | 233 | unsigned int k); |
246 | size_t size, unsigned int k); | ||
247 | 234 | ||
248 | /* ****************** metadata ******************* */ | 235 | /* ****************** metadata ******************* */ |
249 | 236 | ||
@@ -287,11 +274,10 @@ void GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); | |||
287 | * @param md2 other value to check | 274 | * @param md2 other value to check |
288 | * @return GNUNET_YES if they are equal | 275 | * @return GNUNET_YES if they are equal |
289 | */ | 276 | */ |
290 | int | 277 | int GNUNET_CONTAINER_meta_data_test_equal (const struct |
291 | GNUNET_CONTAINER_meta_data_test_equal (const struct | 278 | GNUNET_CONTAINER_MetaData *md1, |
292 | GNUNET_CONTAINER_MetaData *md1, | 279 | const struct |
293 | const struct | 280 | GNUNET_CONTAINER_MetaData *md2); |
294 | GNUNET_CONTAINER_MetaData *md2); | ||
295 | 281 | ||
296 | 282 | ||
297 | /** | 283 | /** |
@@ -311,13 +297,12 @@ GNUNET_CONTAINER_meta_data_test_equal (const struct | |||
311 | * @return GNUNET_OK on success, GNUNET_SYSERR if this entry already exists | 297 | * @return GNUNET_OK on success, GNUNET_SYSERR if this entry already exists |
312 | * data_mime_type and plugin_name are not considered for "exists" checks | 298 | * data_mime_type and plugin_name are not considered for "exists" checks |
313 | */ | 299 | */ |
314 | int | 300 | int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, |
315 | GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, | 301 | const char *plugin_name, |
316 | const char *plugin_name, | 302 | enum EXTRACTOR_MetaType type, |
317 | enum EXTRACTOR_MetaType type, | 303 | enum EXTRACTOR_MetaFormat format, |
318 | enum EXTRACTOR_MetaFormat format, | 304 | const char *data_mime_type, |
319 | const char *data_mime_type, | 305 | const char *data, size_t data_len); |
320 | const char *data, size_t data_len); | ||
321 | 306 | ||
322 | 307 | ||
323 | /** | 308 | /** |
@@ -327,9 +312,9 @@ GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, | |||
327 | * @param md metadata to extend | 312 | * @param md metadata to extend |
328 | * @param in metadata to merge | 313 | * @param in metadata to merge |
329 | */ | 314 | */ |
330 | void | 315 | void GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, |
331 | GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, | 316 | const struct GNUNET_CONTAINER_MetaData |
332 | const struct GNUNET_CONTAINER_MetaData *in); | 317 | *in); |
333 | 318 | ||
334 | 319 | ||
335 | /** | 320 | /** |
@@ -342,10 +327,9 @@ GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, | |||
342 | * @param data_len number of bytes in data | 327 | * @param data_len number of bytes in data |
343 | * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md | 328 | * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md |
344 | */ | 329 | */ |
345 | int | 330 | int GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, |
346 | GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, | 331 | enum EXTRACTOR_MetaType type, |
347 | enum EXTRACTOR_MetaType type, | 332 | const char *data, size_t data_len); |
348 | const char *data, size_t data_len); | ||
349 | 333 | ||
350 | 334 | ||
351 | /** | 335 | /** |
@@ -362,9 +346,9 @@ void GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); | |||
362 | * | 346 | * |
363 | * @param md metadata to modify | 347 | * @param md metadata to modify |
364 | */ | 348 | */ |
365 | void | 349 | void GNUNET_CONTAINER_meta_data_add_publication_date (struct |
366 | GNUNET_CONTAINER_meta_data_add_publication_date (struct | 350 | GNUNET_CONTAINER_MetaData |
367 | GNUNET_CONTAINER_MetaData *md); | 351 | *md); |
368 | 352 | ||
369 | 353 | ||
370 | /** | 354 | /** |
@@ -375,10 +359,9 @@ GNUNET_CONTAINER_meta_data_add_publication_date (struct | |||
375 | * @param iter_cls closure for iterator | 359 | * @param iter_cls closure for iterator |
376 | * @return number of entries | 360 | * @return number of entries |
377 | */ | 361 | */ |
378 | int GNUNET_CONTAINER_meta_data_iterate (const struct | 362 | int GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData |
379 | GNUNET_CONTAINER_MetaData *md, | 363 | *md, EXTRACTOR_MetaDataProcessor iter, |
380 | EXTRACTOR_MetaDataProcessor | 364 | void *iter_cls); |
381 | iter, void *iter_cls); | ||
382 | 365 | ||
383 | /** | 366 | /** |
384 | * Get the first MD entry of the given type. Caller | 367 | * Get the first MD entry of the given type. Caller |
@@ -419,10 +402,9 @@ char *GNUNET_CONTAINER_meta_data_get_first_by_types (const struct | |||
419 | * freed by the caller! | 402 | * freed by the caller! |
420 | * @return number of bytes in thumbnail, 0 if not available | 403 | * @return number of bytes in thumbnail, 0 if not available |
421 | */ | 404 | */ |
422 | size_t | 405 | size_t GNUNET_CONTAINER_meta_data_get_thumbnail (const struct |
423 | GNUNET_CONTAINER_meta_data_get_thumbnail (const struct | 406 | GNUNET_CONTAINER_MetaData *md, |
424 | GNUNET_CONTAINER_MetaData | 407 | unsigned char **thumb); |
425 | *md, unsigned char **thumb); | ||
426 | 408 | ||
427 | 409 | ||
428 | 410 | ||
@@ -463,30 +445,9 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions | |||
463 | * -1 on error (typically: not enough | 445 | * -1 on error (typically: not enough |
464 | * space) | 446 | * space) |
465 | */ | 447 | */ |
466 | ssize_t | 448 | ssize_t |
467 | 449 | GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData | |
468 | 450 | *md, char **target, size_t max, | |
469 | |||
470 | |||
471 | |||
472 | |||
473 | |||
474 | |||
475 | |||
476 | |||
477 | |||
478 | |||
479 | |||
480 | |||
481 | |||
482 | |||
483 | |||
484 | |||
485 | |||
486 | GNUNET_CONTAINER_meta_data_serialize (const struct | ||
487 | GNUNET_CONTAINER_MetaData *md, | ||
488 | char **target, | ||
489 | size_t max, | ||
490 | enum | 451 | enum |
491 | GNUNET_CONTAINER_MetaDataSerializationOptions | 452 | GNUNET_CONTAINER_MetaDataSerializationOptions |
492 | opt); | 453 | opt); |
@@ -498,26 +459,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct | |||
498 | * @param md metadata to inspect | 459 | * @param md metadata to inspect |
499 | * @return number of bytes needed for serialization, -1 on error | 460 | * @return number of bytes needed for serialization, -1 on error |
500 | */ | 461 | */ |
501 | ssize_t | 462 | ssize_t |
502 | |||
503 | |||
504 | |||
505 | |||
506 | |||
507 | |||
508 | |||
509 | |||
510 | |||
511 | |||
512 | |||
513 | |||
514 | |||
515 | |||
516 | |||
517 | |||
518 | |||
519 | |||
520 | |||
521 | GNUNET_CONTAINER_meta_data_get_serialized_size (const struct | 463 | GNUNET_CONTAINER_meta_data_get_serialized_size (const struct |
522 | GNUNET_CONTAINER_MetaData *md); | 464 | GNUNET_CONTAINER_MetaData *md); |
523 | 465 | ||
@@ -609,8 +551,8 @@ struct GNUNET_CONTAINER_MultiHashMap | |||
609 | * | 551 | * |
610 | * @param map the map | 552 | * @param map the map |
611 | */ | 553 | */ |
612 | void GNUNET_CONTAINER_multihashmap_destroy (struct | 554 | void GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap |
613 | GNUNET_CONTAINER_MultiHashMap *map); | 555 | *map); |
614 | 556 | ||
615 | 557 | ||
616 | /** | 558 | /** |
@@ -667,8 +609,8 @@ int GNUNET_CONTAINER_multihashmap_remove_all (struct | |||
667 | * GNUNET_NO if not | 609 | * GNUNET_NO if not |
668 | */ | 610 | */ |
669 | int GNUNET_CONTAINER_multihashmap_contains (const struct | 611 | int GNUNET_CONTAINER_multihashmap_contains (const struct |
670 | GNUNET_CONTAINER_MultiHashMap | 612 | GNUNET_CONTAINER_MultiHashMap *map, |
671 | *map, const GNUNET_HashCode * key); | 613 | const GNUNET_HashCode * key); |
672 | 614 | ||
673 | 615 | ||
674 | /** | 616 | /** |
@@ -703,8 +645,8 @@ int GNUNET_CONTAINER_multihashmap_contains_value (const struct | |||
703 | int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap | 645 | int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap |
704 | *map, const GNUNET_HashCode * key, | 646 | *map, const GNUNET_HashCode * key, |
705 | void *value, | 647 | void *value, |
706 | enum | 648 | enum GNUNET_CONTAINER_MultiHashMapOption |
707 | GNUNET_CONTAINER_MultiHashMapOption opt); | 649 | opt); |
708 | 650 | ||
709 | /** | 651 | /** |
710 | * Get the number of key-value pairs in the map. | 652 | * Get the number of key-value pairs in the map. |
@@ -728,8 +670,8 @@ unsigned int GNUNET_CONTAINER_multihashmap_size (const struct | |||
728 | */ | 670 | */ |
729 | int GNUNET_CONTAINER_multihashmap_iterate (const struct | 671 | int GNUNET_CONTAINER_multihashmap_iterate (const struct |
730 | GNUNET_CONTAINER_MultiHashMap *map, | 672 | GNUNET_CONTAINER_MultiHashMap *map, |
731 | GNUNET_CONTAINER_HashMapIterator | 673 | GNUNET_CONTAINER_HashMapIterator it, |
732 | it, void *it_cls); | 674 | void *it_cls); |
733 | 675 | ||
734 | 676 | ||
735 | /** | 677 | /** |
@@ -951,8 +893,8 @@ void *GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); | |||
951 | * @param heap the heap to get the size of | 893 | * @param heap the heap to get the size of |
952 | * @return number of elements stored | 894 | * @return number of elements stored |
953 | */ | 895 | */ |
954 | unsigned int | 896 | unsigned int GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap |
955 | GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); | 897 | *heap); |
956 | 898 | ||
957 | 899 | ||
958 | /** | 900 | /** |
@@ -961,9 +903,9 @@ GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); | |||
961 | * @param node the node to get the cost of | 903 | * @param node the node to get the cost of |
962 | * @return cost of the node | 904 | * @return cost of the node |
963 | */ | 905 | */ |
964 | GNUNET_CONTAINER_HeapCostType | 906 | GNUNET_CONTAINER_HeapCostType GNUNET_CONTAINER_heap_node_get_cost (const struct |
965 | GNUNET_CONTAINER_heap_node_get_cost (const struct GNUNET_CONTAINER_HeapNode | 907 | GNUNET_CONTAINER_HeapNode |
966 | *node); | 908 | *node); |
967 | 909 | ||
968 | /** | 910 | /** |
969 | * Iterator for heap | 911 | * Iterator for heap |
@@ -989,10 +931,9 @@ typedef int (*GNUNET_CONTAINER_HeapIterator) (void *cls, | |||
989 | * @param iterator function to call on each entry | 931 | * @param iterator function to call on each entry |
990 | * @param iterator_cls closure for iterator | 932 | * @param iterator_cls closure for iterator |
991 | */ | 933 | */ |
992 | void | 934 | void GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, |
993 | GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, | 935 | GNUNET_CONTAINER_HeapIterator iterator, |
994 | GNUNET_CONTAINER_HeapIterator iterator, | 936 | void *iterator_cls); |
995 | void *iterator_cls); | ||
996 | 937 | ||
997 | 938 | ||
998 | /** | 939 | /** |
@@ -1067,10 +1008,9 @@ void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode | |||
1067 | * @param node node for which the cost is to be changed | 1008 | * @param node node for which the cost is to be changed |
1068 | * @param new_cost new cost for the node | 1009 | * @param new_cost new cost for the node |
1069 | */ | 1010 | */ |
1070 | void | 1011 | void GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, |
1071 | GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, | 1012 | struct GNUNET_CONTAINER_HeapNode *node, |
1072 | struct GNUNET_CONTAINER_HeapNode *node, | 1013 | GNUNET_CONTAINER_HeapCostType new_cost); |
1073 | GNUNET_CONTAINER_HeapCostType new_cost); | ||
1074 | 1014 | ||
1075 | 1015 | ||
1076 | /* ******************** Singly linked list *************** */ | 1016 | /* ******************** Singly linked list *************** */ |
@@ -1139,9 +1079,8 @@ void GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, | |||
1139 | * @param dst list to append to | 1079 | * @param dst list to append to |
1140 | * @param src source | 1080 | * @param src source |
1141 | */ | 1081 | */ |
1142 | void | 1082 | void GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, |
1143 | GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, | 1083 | struct GNUNET_CONTAINER_SList *src); |
1144 | struct GNUNET_CONTAINER_SList *src); | ||
1145 | 1084 | ||
1146 | 1085 | ||
1147 | /** | 1086 | /** |
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 1bf82030d..94272a30a 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -116,12 +116,14 @@ typedef void (*GNUNET_CORE_DisconnectEventHandler) (void *cls, | |||
116 | * @return GNUNET_OK to keep the connection open, | 116 | * @return GNUNET_OK to keep the connection open, |
117 | * GNUNET_SYSERR to close it (signal serious error) | 117 | * GNUNET_SYSERR to close it (signal serious error) |
118 | */ | 118 | */ |
119 | typedef int | 119 | typedef int (*GNUNET_CORE_MessageCallback) (void *cls, |
120 | (*GNUNET_CORE_MessageCallback) (void *cls, | 120 | const struct GNUNET_PeerIdentity * |
121 | const struct GNUNET_PeerIdentity * other, | 121 | other, |
122 | const struct GNUNET_MessageHeader * message, | 122 | const struct GNUNET_MessageHeader * |
123 | const struct | 123 | message, |
124 | GNUNET_TRANSPORT_ATS_Information * atsi); | 124 | const struct |
125 | GNUNET_TRANSPORT_ATS_Information * | ||
126 | atsi); | ||
125 | 127 | ||
126 | 128 | ||
127 | /** | 129 | /** |
@@ -162,14 +164,13 @@ struct GNUNET_CORE_MessageHandler | |||
162 | * @param my_identity ID of this peer, NULL if we failed | 164 | * @param my_identity ID of this peer, NULL if we failed |
163 | * @param publicKey public key of this peer, NULL if we failed | 165 | * @param publicKey public key of this peer, NULL if we failed |
164 | */ | 166 | */ |
165 | typedef void | 167 | typedef void (*GNUNET_CORE_StartupCallback) (void *cls, |
166 | (*GNUNET_CORE_StartupCallback) (void *cls, | 168 | struct GNUNET_CORE_Handle * server, |
167 | struct GNUNET_CORE_Handle * server, | 169 | const struct GNUNET_PeerIdentity * |
168 | const struct GNUNET_PeerIdentity * | 170 | my_identity, |
169 | my_identity, | 171 | const struct |
170 | const struct | 172 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
171 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded * | 173 | * publicKey); |
172 | publicKey); | ||
173 | 174 | ||
174 | 175 | ||
175 | /** | 176 | /** |
@@ -308,9 +309,9 @@ struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct | |||
308 | * | 309 | * |
309 | * @param req request handle that was returned for the original request | 310 | * @param req request handle that was returned for the original request |
310 | */ | 311 | */ |
311 | void | 312 | void GNUNET_CORE_peer_request_connect_cancel (struct |
312 | GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle | 313 | GNUNET_CORE_PeerRequestHandle |
313 | *req); | 314 | *req); |
314 | 315 | ||
315 | 316 | ||
316 | /** | 317 | /** |
@@ -325,16 +326,18 @@ GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle | |||
325 | * long should the client wait until re-trying? | 326 | * long should the client wait until re-trying? |
326 | * @param preference current traffic preference for the given peer | 327 | * @param preference current traffic preference for the given peer |
327 | */ | 328 | */ |
328 | typedef void | 329 | typedef void (*GNUNET_CORE_PeerConfigurationInfoCallback) (void *cls, |
329 | (*GNUNET_CORE_PeerConfigurationInfoCallback) (void *cls, | 330 | const struct |
330 | const struct | 331 | GNUNET_PeerIdentity * |
331 | GNUNET_PeerIdentity * peer, | 332 | peer, |
332 | struct | 333 | struct |
333 | GNUNET_BANDWIDTH_Value32NBO | 334 | GNUNET_BANDWIDTH_Value32NBO |
334 | bandwidth_out, int32_t amount, | 335 | bandwidth_out, |
335 | struct GNUNET_TIME_Relative | 336 | int32_t amount, |
336 | res_delay, | 337 | struct |
337 | uint64_t preference); | 338 | GNUNET_TIME_Relative |
339 | res_delay, | ||
340 | uint64_t preference); | ||
338 | 341 | ||
339 | 342 | ||
340 | 343 | ||
@@ -391,10 +394,9 @@ struct GNUNET_CORE_InformationRequestContext | |||
391 | * | 394 | * |
392 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call | 395 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call |
393 | */ | 396 | */ |
394 | void | 397 | void GNUNET_CORE_peer_change_preference_cancel (struct |
395 | GNUNET_CORE_peer_change_preference_cancel (struct | 398 | GNUNET_CORE_InformationRequestContext |
396 | GNUNET_CORE_InformationRequestContext | 399 | *irc); |
397 | *irc); | ||
398 | 400 | ||
399 | 401 | ||
400 | /** | 402 | /** |
@@ -405,10 +407,9 @@ GNUNET_CORE_peer_change_preference_cancel (struct | |||
405 | * @param cb_cls closure for peer_cb | 407 | * @param cb_cls closure for peer_cb |
406 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors | 408 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors |
407 | */ | 409 | */ |
408 | int | 410 | int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, |
409 | GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | 411 | GNUNET_CORE_ConnectEventHandler peer_cb, |
410 | GNUNET_CORE_ConnectEventHandler peer_cb, | 412 | void *cb_cls); |
411 | void *cb_cls); | ||
412 | 413 | ||
413 | /** | 414 | /** |
414 | * Iterate over all currently connected peers. | 415 | * Iterate over all currently connected peers. |
@@ -423,11 +424,10 @@ GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
423 | * | 424 | * |
424 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error | 425 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error |
425 | */ | 426 | */ |
426 | int | 427 | int GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle |
427 | GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg, | 428 | *cfg, struct GNUNET_PeerIdentity *peer, |
428 | struct GNUNET_PeerIdentity *peer, | 429 | GNUNET_CORE_ConnectEventHandler peer_cb, |
429 | GNUNET_CORE_ConnectEventHandler peer_cb, | 430 | void *cb_cls); |
430 | void *cb_cls); | ||
431 | 431 | ||
432 | 432 | ||
433 | /** | 433 | /** |
@@ -490,9 +490,8 @@ struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct | |||
490 | * | 490 | * |
491 | * @param th handle that was returned by "notify_transmit_ready". | 491 | * @param th handle that was returned by "notify_transmit_ready". |
492 | */ | 492 | */ |
493 | void | 493 | void GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle |
494 | GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle | 494 | *th); |
495 | *th); | ||
496 | 495 | ||
497 | 496 | ||
498 | #if 0 /* keep Emacsens' auto-indent happy */ | 497 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index ec71a791b..30a7d9ee0 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -295,8 +295,7 @@ int GNUNET_CRYPTO_aes_check_session_key (const struct | |||
295 | * for streams. | 295 | * for streams. |
296 | * @return the size of the encrypted block, -1 for errors | 296 | * @return the size of the encrypted block, -1 for errors |
297 | */ | 297 | */ |
298 | ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, | 298 | ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, |
299 | size_t len, | ||
300 | const struct GNUNET_CRYPTO_AesSessionKey | 299 | const struct GNUNET_CRYPTO_AesSessionKey |
301 | *sessionkey, | 300 | *sessionkey, |
302 | const struct | 301 | const struct |
@@ -314,8 +313,7 @@ ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, | |||
314 | * @param result address to store the result at | 313 | * @param result address to store the result at |
315 | * @return -1 on failure, size of decrypted block on success | 314 | * @return -1 on failure, size of decrypted block on success |
316 | */ | 315 | */ |
317 | ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, | 316 | ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, |
318 | size_t size, | ||
319 | const struct GNUNET_CRYPTO_AesSessionKey | 317 | const struct GNUNET_CRYPTO_AesSessionKey |
320 | *sessionkey, | 318 | *sessionkey, |
321 | const struct | 319 | const struct |
@@ -331,10 +329,11 @@ ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, | |||
331 | * @param salt_len size of the salt | 329 | * @param salt_len size of the salt |
332 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL | 330 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL |
333 | */ | 331 | */ |
334 | void | 332 | void GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector |
335 | GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, | 333 | *iv, |
336 | const struct GNUNET_CRYPTO_AesSessionKey *skey, | 334 | const struct GNUNET_CRYPTO_AesSessionKey |
337 | const void *salt, size_t salt_len, ...); | 335 | *skey, const void *salt, size_t salt_len, |
336 | ...); | ||
338 | 337 | ||
339 | 338 | ||
340 | /** | 339 | /** |
@@ -345,10 +344,11 @@ GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, | |||
345 | * @param salt_len size of the salt | 344 | * @param salt_len size of the salt |
346 | * @param argp pairs of void * & size_t for context chunks, terminated by NULL | 345 | * @param argp pairs of void * & size_t for context chunks, terminated by NULL |
347 | */ | 346 | */ |
348 | void | 347 | void GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector |
349 | GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector *iv, | 348 | *iv, |
350 | const struct GNUNET_CRYPTO_AesSessionKey *skey, | 349 | const struct GNUNET_CRYPTO_AesSessionKey |
351 | const void *salt, size_t salt_len, va_list argp); | 350 | *skey, const void *salt, size_t salt_len, |
351 | va_list argp); | ||
352 | 352 | ||
353 | 353 | ||
354 | /** | 354 | /** |
@@ -403,10 +403,9 @@ void GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); | |||
403 | * @param plaintext_len length of plaintext | 403 | * @param plaintext_len length of plaintext |
404 | * @param hmac where to store the hmac | 404 | * @param hmac where to store the hmac |
405 | */ | 405 | */ |
406 | void | 406 | void GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, |
407 | GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, | 407 | const void *plaintext, size_t plaintext_len, |
408 | const void *plaintext, | 408 | GNUNET_HashCode * hmac); |
409 | size_t plaintext_len, GNUNET_HashCode * hmac); | ||
410 | 409 | ||
411 | 410 | ||
412 | /** | 411 | /** |
@@ -511,8 +510,8 @@ void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, | |||
511 | */ | 510 | */ |
512 | void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, | 511 | void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, |
513 | struct GNUNET_CRYPTO_AesSessionKey *skey, | 512 | struct GNUNET_CRYPTO_AesSessionKey *skey, |
514 | struct | 513 | struct GNUNET_CRYPTO_AesInitializationVector |
515 | GNUNET_CRYPTO_AesInitializationVector *iv); | 514 | *iv); |
516 | 515 | ||
517 | 516 | ||
518 | /** | 517 | /** |
@@ -574,11 +573,10 @@ int GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, | |||
574 | * @param salt_len size of the salt | 573 | * @param salt_len size of the salt |
575 | * @param argp pair of void * & size_t for context chunks, terminated by NULL | 574 | * @param argp pair of void * & size_t for context chunks, terminated by NULL |
576 | */ | 575 | */ |
577 | void | 576 | void GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, |
578 | GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, | 577 | const struct GNUNET_CRYPTO_AesSessionKey |
579 | const struct GNUNET_CRYPTO_AesSessionKey *rkey, | 578 | *rkey, const void *salt, size_t salt_len, |
580 | const void *salt, | 579 | va_list argp); |
581 | size_t salt_len, va_list argp); | ||
582 | 580 | ||
583 | 581 | ||
584 | /** | 582 | /** |
@@ -589,10 +587,10 @@ GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, | |||
589 | * @param salt_len size of the salt | 587 | * @param salt_len size of the salt |
590 | * @param ... pair of void * & size_t for context chunks, terminated by NULL | 588 | * @param ... pair of void * & size_t for context chunks, terminated by NULL |
591 | */ | 589 | */ |
592 | void | 590 | void GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, |
593 | GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, | 591 | const struct GNUNET_CRYPTO_AesSessionKey |
594 | const struct GNUNET_CRYPTO_AesSessionKey *rkey, | 592 | *rkey, const void *salt, size_t salt_len, |
595 | const void *salt, size_t salt_len, ...); | 593 | ...); |
596 | 594 | ||
597 | /** | 595 | /** |
598 | * @brief Derive key | 596 | * @brief Derive key |
@@ -606,12 +604,9 @@ GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, | |||
606 | * @param skm_len length of skm | 604 | * @param skm_len length of skm |
607 | * @return GNUNET_YES on success | 605 | * @return GNUNET_YES on success |
608 | */ | 606 | */ |
609 | int | 607 | int GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, |
610 | GNUNET_CRYPTO_hkdf (void *result, | 608 | int prf_algo, const void *xts, size_t xts_len, |
611 | size_t out_len, | 609 | const void *skm, size_t skm_len, ...); |
612 | int xtr_algo, int prf_algo, | ||
613 | const void *xts, size_t xts_len, | ||
614 | const void *skm, size_t skm_len, ...); | ||
615 | 610 | ||
616 | 611 | ||
617 | /** | 612 | /** |
@@ -627,13 +622,9 @@ GNUNET_CRYPTO_hkdf (void *result, | |||
627 | * @param argp va_list of void * & size_t pairs for context chunks | 622 | * @param argp va_list of void * & size_t pairs for context chunks |
628 | * @return GNUNET_YES on success | 623 | * @return GNUNET_YES on success |
629 | */ | 624 | */ |
630 | int | 625 | int GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, |
631 | GNUNET_CRYPTO_hkdf_v (void *result, | 626 | int prf_algo, const void *xts, size_t xts_len, |
632 | size_t out_len, | 627 | const void *skm, size_t skm_len, va_list argp); |
633 | int xtr_algo, | ||
634 | int prf_algo, | ||
635 | const void *xts, size_t xts_len, | ||
636 | const void *skm, size_t skm_len, va_list argp); | ||
637 | 628 | ||
638 | 629 | ||
639 | /** | 630 | /** |
@@ -647,11 +638,9 @@ GNUNET_CRYPTO_hkdf_v (void *result, | |||
647 | * @param argp va_list of void * & size_t pairs for context chunks | 638 | * @param argp va_list of void * & size_t pairs for context chunks |
648 | * @return GNUNET_YES on success | 639 | * @return GNUNET_YES on success |
649 | */ | 640 | */ |
650 | int | 641 | int GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, |
651 | GNUNET_CRYPTO_kdf_v (void *result, | 642 | size_t xts_len, const void *skm, size_t skm_len, |
652 | size_t out_len, | 643 | va_list argp); |
653 | const void *xts, size_t xts_len, | ||
654 | const void *skm, size_t skm_len, va_list argp); | ||
655 | 644 | ||
656 | 645 | ||
657 | /** | 646 | /** |
@@ -665,10 +654,8 @@ GNUNET_CRYPTO_kdf_v (void *result, | |||
665 | * @param ... void * & size_t pairs for context chunks | 654 | * @param ... void * & size_t pairs for context chunks |
666 | * @return GNUNET_YES on success | 655 | * @return GNUNET_YES on success |
667 | */ | 656 | */ |
668 | int | 657 | int GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, |
669 | GNUNET_CRYPTO_kdf (void *result, size_t out_len, | 658 | size_t xts_len, const void *skm, size_t skm_len, ...); |
670 | const void *xts, size_t xts_len, const void *skm, | ||
671 | size_t skm_len, ...); | ||
672 | 659 | ||
673 | 660 | ||
674 | /** | 661 | /** |
@@ -731,8 +718,8 @@ void GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); | |||
731 | * @param priv the private key | 718 | * @param priv the private key |
732 | * @param pub where to write the public key | 719 | * @param pub where to write the public key |
733 | */ | 720 | */ |
734 | void GNUNET_CRYPTO_rsa_key_get_public (const struct | 721 | void GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey |
735 | GNUNET_CRYPTO_RsaPrivateKey *priv, | 722 | *priv, |
736 | struct | 723 | struct |
737 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 724 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
738 | *pub); | 725 | *pub); |
@@ -748,8 +735,7 @@ void GNUNET_CRYPTO_rsa_key_get_public (const struct | |||
748 | * @param target where to store the encrypted block | 735 | * @param target where to store the encrypted block |
749 | * @return GNUNET_SYSERR on error, GNUNET_OK if ok | 736 | * @return GNUNET_SYSERR on error, GNUNET_OK if ok |
750 | */ | 737 | */ |
751 | int GNUNET_CRYPTO_rsa_encrypt (const void *block, | 738 | int GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, |
752 | size_t size, | ||
753 | const struct | 739 | const struct |
754 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 740 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
755 | *publicKey, | 741 | *publicKey, |
diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h index a1712b809..46d22d5ec 100644 --- a/src/include/gnunet_datacache_lib.h +++ b/src/include/gnunet_datacache_lib.h | |||
@@ -84,8 +84,7 @@ void GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); | |||
84 | typedef int (*GNUNET_DATACACHE_Iterator) (void *cls, | 84 | typedef int (*GNUNET_DATACACHE_Iterator) (void *cls, |
85 | struct GNUNET_TIME_Absolute exp, | 85 | struct GNUNET_TIME_Absolute exp, |
86 | const GNUNET_HashCode * key, | 86 | const GNUNET_HashCode * key, |
87 | size_t size, | 87 | size_t size, const char *data, |
88 | const char *data, | ||
89 | enum GNUNET_BLOCK_Type type); | 88 | enum GNUNET_BLOCK_Type type); |
90 | 89 | ||
91 | 90 | ||
@@ -100,13 +99,10 @@ typedef int (*GNUNET_DATACACHE_Iterator) (void *cls, | |||
100 | * @param discard_time when to discard the value in any case | 99 | * @param discard_time when to discard the value in any case |
101 | * @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) | 100 | * @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) |
102 | */ | 101 | */ |
103 | int | 102 | int GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, |
104 | GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, | 103 | const GNUNET_HashCode * key, size_t size, |
105 | const GNUNET_HashCode * key, | 104 | const char *data, enum GNUNET_BLOCK_Type type, |
106 | size_t size, | 105 | struct GNUNET_TIME_Absolute discard_time); |
107 | const char *data, | ||
108 | enum GNUNET_BLOCK_Type type, | ||
109 | struct GNUNET_TIME_Absolute discard_time); | ||
110 | 106 | ||
111 | 107 | ||
112 | /** | 108 | /** |
@@ -120,11 +116,11 @@ GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, | |||
120 | * @param iter_cls closure for iter | 116 | * @param iter_cls closure for iter |
121 | * @return the number of results found | 117 | * @return the number of results found |
122 | */ | 118 | */ |
123 | unsigned int | 119 | unsigned int GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, |
124 | GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, | 120 | const GNUNET_HashCode * key, |
125 | const GNUNET_HashCode * key, | 121 | enum GNUNET_BLOCK_Type type, |
126 | enum GNUNET_BLOCK_Type type, | 122 | GNUNET_DATACACHE_Iterator iter, |
127 | GNUNET_DATACACHE_Iterator iter, void *iter_cls); | 123 | void *iter_cls); |
128 | 124 | ||
129 | 125 | ||
130 | #if 0 /* keep Emacsens' auto-indent happy */ | 126 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_datacache_plugin.h b/src/include/gnunet_datacache_plugin.h index c7ce0bef1..6868d6b76 100644 --- a/src/include/gnunet_datacache_plugin.h +++ b/src/include/gnunet_datacache_plugin.h | |||
@@ -109,11 +109,8 @@ struct GNUNET_DATACACHE_PluginFunctions | |||
109 | * @param discard_time when to discard the value in any case | 109 | * @param discard_time when to discard the value in any case |
110 | * @return 0 on error, number of bytes used otherwise | 110 | * @return 0 on error, number of bytes used otherwise |
111 | */ | 111 | */ |
112 | size_t (*put) (void *cls, | 112 | size_t (*put) (void *cls, const GNUNET_HashCode * key, size_t size, |
113 | const GNUNET_HashCode * key, | 113 | const char *data, enum GNUNET_BLOCK_Type type, |
114 | size_t size, | ||
115 | const char *data, | ||
116 | enum GNUNET_BLOCK_Type type, | ||
117 | struct GNUNET_TIME_Absolute discard_time); | 114 | struct GNUNET_TIME_Absolute discard_time); |
118 | 115 | ||
119 | 116 | ||
@@ -128,8 +125,7 @@ struct GNUNET_DATACACHE_PluginFunctions | |||
128 | * @param iter_cls closure for iter | 125 | * @param iter_cls closure for iter |
129 | * @return the number of results found | 126 | * @return the number of results found |
130 | */ | 127 | */ |
131 | unsigned int (*get) (void *cls, | 128 | unsigned int (*get) (void *cls, const GNUNET_HashCode * key, |
132 | const GNUNET_HashCode * key, | ||
133 | enum GNUNET_BLOCK_Type type, | 129 | enum GNUNET_BLOCK_Type type, |
134 | GNUNET_DATACACHE_Iterator iter, void *iter_cls); | 130 | GNUNET_DATACACHE_Iterator iter, void *iter_cls); |
135 | 131 | ||
diff --git a/src/include/gnunet_datastore_plugin.h b/src/include/gnunet_datastore_plugin.h index f33588bce..b0aa0c6c9 100644 --- a/src/include/gnunet_datastore_plugin.h +++ b/src/include/gnunet_datastore_plugin.h | |||
@@ -92,15 +92,12 @@ struct GNUNET_DATASTORE_PluginEnvironment | |||
92 | * @return GNUNET_OK to keep the item | 92 | * @return GNUNET_OK to keep the item |
93 | * GNUNET_NO to delete the item | 93 | * GNUNET_NO to delete the item |
94 | */ | 94 | */ |
95 | typedef int (*PluginDatumProcessor) (void *cls, | 95 | typedef int (*PluginDatumProcessor) (void *cls, const GNUNET_HashCode * key, |
96 | const GNUNET_HashCode * key, | 96 | uint32_t size, const void *data, |
97 | uint32_t size, | ||
98 | const void *data, | ||
99 | enum GNUNET_BLOCK_Type type, | 97 | enum GNUNET_BLOCK_Type type, |
100 | uint32_t priority, | 98 | uint32_t priority, uint32_t anonymity, |
101 | uint32_t anonymity, | 99 | struct GNUNET_TIME_Absolute expiration, |
102 | struct GNUNET_TIME_Absolute | 100 | uint64_t uid); |
103 | expiration, uint64_t uid); | ||
104 | 101 | ||
105 | /** | 102 | /** |
106 | * Get an estimate of how much space the database is | 103 | * Get an estimate of how much space the database is |
@@ -130,13 +127,9 @@ typedef unsigned long long (*PluginEstimateSize) (void *cls); | |||
130 | * @return GNUNET_OK on success, | 127 | * @return GNUNET_OK on success, |
131 | * GNUNET_SYSERR on failure | 128 | * GNUNET_SYSERR on failure |
132 | */ | 129 | */ |
133 | typedef int (*PluginPut) (void *cls, | 130 | typedef int (*PluginPut) (void *cls, const GNUNET_HashCode * key, uint32_t size, |
134 | const GNUNET_HashCode * key, | 131 | const void *data, enum GNUNET_BLOCK_Type type, |
135 | uint32_t size, | 132 | uint32_t priority, uint32_t anonymity, |
136 | const void *data, | ||
137 | enum GNUNET_BLOCK_Type type, | ||
138 | uint32_t priority, | ||
139 | uint32_t anonymity, | ||
140 | uint32_t replication, | 133 | uint32_t replication, |
141 | struct GNUNET_TIME_Absolute expiration, char **msg); | 134 | struct GNUNET_TIME_Absolute expiration, char **msg); |
142 | 135 | ||
@@ -159,8 +152,7 @@ typedef int (*PluginPut) (void *cls, | |||
159 | * proc should be called with NULL if there is no result | 152 | * proc should be called with NULL if there is no result |
160 | * @param proc_cls closure for proc | 153 | * @param proc_cls closure for proc |
161 | */ | 154 | */ |
162 | typedef void (*PluginGetKey) (void *cls, | 155 | typedef void (*PluginGetKey) (void *cls, uint64_t offset, |
163 | uint64_t offset, | ||
164 | const GNUNET_HashCode * key, | 156 | const GNUNET_HashCode * key, |
165 | const GNUNET_HashCode * vhash, | 157 | const GNUNET_HashCode * vhash, |
166 | enum GNUNET_BLOCK_Type type, | 158 | enum GNUNET_BLOCK_Type type, |
@@ -178,8 +170,8 @@ typedef void (*PluginGetKey) (void *cls, | |||
178 | * @param proc function to call the value (once only). | 170 | * @param proc function to call the value (once only). |
179 | * @param proc_cls closure for proc | 171 | * @param proc_cls closure for proc |
180 | */ | 172 | */ |
181 | typedef void (*PluginGetRandom) (void *cls, | 173 | typedef void (*PluginGetRandom) (void *cls, PluginDatumProcessor proc, |
182 | PluginDatumProcessor proc, void *proc_cls); | 174 | void *proc_cls); |
183 | 175 | ||
184 | 176 | ||
185 | /** | 177 | /** |
@@ -205,9 +197,7 @@ typedef void (*PluginGetRandom) (void *cls, | |||
205 | * @param msg set to an error message (on error) | 197 | * @param msg set to an error message (on error) |
206 | * @return GNUNET_OK on success | 198 | * @return GNUNET_OK on success |
207 | */ | 199 | */ |
208 | typedef int (*PluginUpdate) (void *cls, | 200 | typedef int (*PluginUpdate) (void *cls, uint64_t uid, int delta, |
209 | uint64_t uid, | ||
210 | int delta, | ||
211 | struct GNUNET_TIME_Absolute expire, char **msg); | 201 | struct GNUNET_TIME_Absolute expire, char **msg); |
212 | 202 | ||
213 | 203 | ||
@@ -223,8 +213,7 @@ typedef int (*PluginUpdate) (void *cls, | |||
223 | * @param proc function to call on the matching value | 213 | * @param proc function to call on the matching value |
224 | * @param proc_cls closure for proc | 214 | * @param proc_cls closure for proc |
225 | */ | 215 | */ |
226 | typedef void (*PluginGetType) (void *cls, | 216 | typedef void (*PluginGetType) (void *cls, uint64_t offset, |
227 | uint64_t offset, | ||
228 | enum GNUNET_BLOCK_Type type, | 217 | enum GNUNET_BLOCK_Type type, |
229 | PluginDatumProcessor proc, void *proc_cls); | 218 | PluginDatumProcessor proc, void *proc_cls); |
230 | 219 | ||
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index 58c730aba..584537f39 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -313,8 +313,7 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_remove (struct | |||
313 | */ | 313 | */ |
314 | typedef void (*GNUNET_DATASTORE_DatumProcessor) (void *cls, | 314 | typedef void (*GNUNET_DATASTORE_DatumProcessor) (void *cls, |
315 | const GNUNET_HashCode * key, | 315 | const GNUNET_HashCode * key, |
316 | size_t size, | 316 | size_t size, const void *data, |
317 | const void *data, | ||
318 | enum GNUNET_BLOCK_Type type, | 317 | enum GNUNET_BLOCK_Type type, |
319 | uint32_t priority, | 318 | uint32_t priority, |
320 | uint32_t anonymity, | 319 | uint32_t anonymity, |
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index 7c7f646e6..46929c366 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -154,17 +154,14 @@ void GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); | |||
154 | * @param cont continuation to call when done (transmitting request to service) | 154 | * @param cont continuation to call when done (transmitting request to service) |
155 | * @param cont_cls closure for cont | 155 | * @param cont_cls closure for cont |
156 | */ | 156 | */ |
157 | void | 157 | void GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, |
158 | GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, | 158 | const GNUNET_HashCode * key, |
159 | const GNUNET_HashCode * key, | 159 | uint32_t desired_replication_level, |
160 | uint32_t desired_replication_level, | 160 | enum GNUNET_DHT_RouteOption options, |
161 | enum GNUNET_DHT_RouteOption options, | 161 | enum GNUNET_BLOCK_Type type, size_t size, const char *data, |
162 | enum GNUNET_BLOCK_Type type, | 162 | struct GNUNET_TIME_Absolute exp, |
163 | size_t size, | 163 | struct GNUNET_TIME_Relative timeout, |
164 | const char *data, | 164 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
165 | struct GNUNET_TIME_Absolute exp, | ||
166 | struct GNUNET_TIME_Relative timeout, | ||
167 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
168 | 165 | ||
169 | 166 | ||
170 | /** | 167 | /** |
@@ -292,8 +289,8 @@ struct GNUNET_DHT_FindPeerHandle *GNUNET_DHT_find_peer_start (struct | |||
292 | * | 289 | * |
293 | * @param find_peer_handle GET operation to stop. | 290 | * @param find_peer_handle GET operation to stop. |
294 | */ | 291 | */ |
295 | void | 292 | void GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle |
296 | GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle *find_peer_handle); | 293 | *find_peer_handle); |
297 | 294 | ||
298 | 295 | ||
299 | 296 | ||
@@ -384,9 +381,8 @@ void GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); | |||
384 | * @param cont_cls closure for cont | 381 | * @param cont_cls closure for cont |
385 | * @param handle handle to the DHT service | 382 | * @param handle handle to the DHT service |
386 | */ | 383 | */ |
387 | void | 384 | void GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, |
388 | GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, | 385 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
389 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
390 | 386 | ||
391 | /* ***** Special API for testing robustness with malicious peers ******* */ | 387 | /* ***** Special API for testing robustness with malicious peers ******* */ |
392 | 388 | ||
@@ -406,9 +402,9 @@ GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, | |||
406 | * @param cont_cls closure for cont | 402 | * @param cont_cls closure for cont |
407 | * | 403 | * |
408 | */ | 404 | */ |
409 | void | 405 | void GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, |
410 | GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, | 406 | GNUNET_SCHEDULER_Task cont, |
411 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 407 | void *cont_cls); |
412 | 408 | ||
413 | 409 | ||
414 | /** | 410 | /** |
@@ -420,10 +416,10 @@ GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, | |||
420 | * @param cont continuation to call when done (transmitting request to service) | 416 | * @param cont continuation to call when done (transmitting request to service) |
421 | * @param cont_cls closure for cont | 417 | * @param cont_cls closure for cont |
422 | */ | 418 | */ |
423 | void | 419 | void GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, |
424 | GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | 420 | struct GNUNET_TIME_Relative frequency, |
425 | struct GNUNET_TIME_Relative frequency, | 421 | GNUNET_SCHEDULER_Task cont, |
426 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 422 | void *cont_cls); |
427 | 423 | ||
428 | 424 | ||
429 | /** | 425 | /** |
@@ -435,10 +431,10 @@ GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | |||
435 | * @param cont continuation to call when done (transmitting request to service) | 431 | * @param cont continuation to call when done (transmitting request to service) |
436 | * @param cont_cls closure for cont | 432 | * @param cont_cls closure for cont |
437 | */ | 433 | */ |
438 | void | 434 | void GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, |
439 | GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, | 435 | struct GNUNET_TIME_Relative frequency, |
440 | struct GNUNET_TIME_Relative frequency, | 436 | GNUNET_SCHEDULER_Task cont, |
441 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 437 | void *cont_cls); |
442 | 438 | ||
443 | 439 | ||
444 | #endif | 440 | #endif |
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index 5732a27d6..f5fae80c9 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -292,9 +292,8 @@ int GNUNET_DISK_file_test (const char *fil); | |||
292 | * @param whence specification to which position the offset parameter relates to | 292 | * @param whence specification to which position the offset parameter relates to |
293 | * @return the new position on success, GNUNET_SYSERR otherwise | 293 | * @return the new position on success, GNUNET_SYSERR otherwise |
294 | */ | 294 | */ |
295 | off_t | 295 | off_t GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, |
296 | GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, | 296 | off_t offset, enum GNUNET_DISK_Seek whence); |
297 | off_t offset, enum GNUNET_DISK_Seek whence); | ||
298 | 297 | ||
299 | 298 | ||
300 | /** | 299 | /** |
@@ -309,8 +308,8 @@ GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, | |||
309 | * included? | 308 | * included? |
310 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 309 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
311 | */ | 310 | */ |
312 | int GNUNET_DISK_file_size (const char *filename, | 311 | int GNUNET_DISK_file_size (const char *filename, uint64_t * size, |
313 | uint64_t * size, int includeSymLinks); | 312 | int includeSymLinks); |
314 | 313 | ||
315 | 314 | ||
316 | /** | 315 | /** |
@@ -328,8 +327,8 @@ int GNUNET_DISK_file_size (const char *filename, | |||
328 | * @param ino set to the inode ID | 327 | * @param ino set to the inode ID |
329 | * @return GNUNET_OK on success | 328 | * @return GNUNET_OK on success |
330 | */ | 329 | */ |
331 | int GNUNET_DISK_file_get_identifiers (const char *filename, | 330 | int GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, |
332 | uint64_t * dev, uint64_t * ino); | 331 | uint64_t * ino); |
333 | 332 | ||
334 | 333 | ||
335 | /** | 334 | /** |
@@ -372,8 +371,7 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, | |||
372 | * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) | 371 | * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) |
373 | * @return handle to the new pipe, NULL on error | 372 | * @return handle to the new pipe, NULL on error |
374 | */ | 373 | */ |
375 | struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, | 374 | struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, int inherit_read, |
376 | int inherit_read, | ||
377 | int inherit_write); | 375 | int inherit_write); |
378 | 376 | ||
379 | 377 | ||
@@ -391,9 +389,8 @@ int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | |||
391 | * @param end which end of the pipe to close | 389 | * @param end which end of the pipe to close |
392 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 390 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
393 | */ | 391 | */ |
394 | int | 392 | int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, |
395 | GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | 393 | enum GNUNET_DISK_PipeEnd end); |
396 | enum GNUNET_DISK_PipeEnd end); | ||
397 | 394 | ||
398 | /** | 395 | /** |
399 | * Close an open file. | 396 | * Close an open file. |
@@ -462,9 +459,7 @@ ssize_t GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | |||
462 | * @param mode file permissions | 459 | * @param mode file permissions |
463 | * @return number of bytes written on success, GNUNET_SYSERR on error | 460 | * @return number of bytes written on success, GNUNET_SYSERR on error |
464 | */ | 461 | */ |
465 | ssize_t GNUNET_DISK_fn_write (const char *fn, | 462 | ssize_t GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, |
466 | const void *buffer, | ||
467 | size_t n, | ||
468 | enum GNUNET_DISK_AccessPermissions mode); | 463 | enum GNUNET_DISK_AccessPermissions mode); |
469 | 464 | ||
470 | 465 | ||
@@ -541,8 +536,8 @@ int GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator | |||
541 | * @param callback the method to call for each file | 536 | * @param callback the method to call for each file |
542 | * @param callback_cls closure for callback | 537 | * @param callback_cls closure for callback |
543 | */ | 538 | */ |
544 | void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority | 539 | void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, |
545 | prio, const char *dirName, | 540 | const char *dirName, |
546 | GNUNET_DISK_DirectoryIteratorCallback | 541 | GNUNET_DISK_DirectoryIteratorCallback |
547 | callback, void *callback_cls); | 542 | callback, void *callback_cls); |
548 | 543 | ||
@@ -599,9 +594,8 @@ int GNUNET_DISK_directory_create (const char *dir); | |||
599 | * @param excl GNUNET_YES for an exclusive lock | 594 | * @param excl GNUNET_YES for an exclusive lock |
600 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 595 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
601 | */ | 596 | */ |
602 | int | 597 | int GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, |
603 | GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, | 598 | off_t lockEnd, int excl); |
604 | off_t lockEnd, int excl); | ||
605 | 599 | ||
606 | 600 | ||
607 | /** | 601 | /** |
@@ -611,9 +605,8 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, | |||
611 | * @param unlockEnd absolute position until where to unlock | 605 | * @param unlockEnd absolute position until where to unlock |
612 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 606 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
613 | */ | 607 | */ |
614 | int | 608 | int GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, |
615 | GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, | 609 | off_t unlockStart, off_t unlockEnd); |
616 | off_t unlockStart, off_t unlockEnd); | ||
617 | 610 | ||
618 | 611 | ||
619 | /** | 612 | /** |
diff --git a/src/include/gnunet_dv_service.h b/src/include/gnunet_dv_service.h index 0da76c56c..2bb2319b9 100644 --- a/src/include/gnunet_dv_service.h +++ b/src/include/gnunet_dv_service.h | |||
@@ -70,12 +70,9 @@ struct GNUNET_DV_Handle; | |||
70 | */ | 70 | */ |
71 | int GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, | 71 | int GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, |
72 | const struct GNUNET_PeerIdentity *target, | 72 | const struct GNUNET_PeerIdentity *target, |
73 | const char *msgbuf, | 73 | const char *msgbuf, size_t msgbuf_size, |
74 | size_t msgbuf_size, | 74 | unsigned int priority, struct GNUNET_TIME_Relative timeout, |
75 | unsigned int priority, | 75 | const void *addr, size_t addrlen, |
76 | struct GNUNET_TIME_Relative timeout, | ||
77 | const void *addr, | ||
78 | size_t addrlen, | ||
79 | GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls); | 76 | GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls); |
80 | 77 | ||
81 | 78 | ||
diff --git a/src/include/gnunet_fragmentation_lib.h b/src/include/gnunet_fragmentation_lib.h index da236478c..1f1f85321 100644 --- a/src/include/gnunet_fragmentation_lib.h +++ b/src/include/gnunet_fragmentation_lib.h | |||
@@ -105,8 +105,8 @@ struct GNUNET_FRAGMENT_Context *GNUNET_FRAGMENT_context_create (struct | |||
105 | * | 105 | * |
106 | * @param fc fragmentation context | 106 | * @param fc fragmentation context |
107 | */ | 107 | */ |
108 | void | 108 | void GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context |
109 | GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc); | 109 | *fc); |
110 | 110 | ||
111 | 111 | ||
112 | /** | 112 | /** |
@@ -132,8 +132,9 @@ int GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | |||
132 | * @return average delay between transmission and ACK for the | 132 | * @return average delay between transmission and ACK for the |
133 | * last message, FOREVER if the message was not fully transmitted | 133 | * last message, FOREVER if the message was not fully transmitted |
134 | */ | 134 | */ |
135 | struct GNUNET_TIME_Relative | 135 | struct GNUNET_TIME_Relative GNUNET_FRAGMENT_context_destroy (struct |
136 | GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc); | 136 | GNUNET_FRAGMENT_Context |
137 | *fc); | ||
137 | 138 | ||
138 | 139 | ||
139 | /** | 140 | /** |
@@ -152,8 +153,7 @@ struct GNUNET_DEFRAGMENT_Context; | |||
152 | * @param id unique message ID (modulo collisions) | 153 | * @param id unique message ID (modulo collisions) |
153 | * @param msg the message that was created | 154 | * @param msg the message that was created |
154 | */ | 155 | */ |
155 | typedef void (*GNUNET_DEFRAGMENT_AckProcessor) (void *cls, | 156 | typedef void (*GNUNET_DEFRAGMENT_AckProcessor) (void *cls, uint32_t id, |
156 | uint32_t id, | ||
157 | const struct | 157 | const struct |
158 | GNUNET_MessageHeader * msg); | 158 | GNUNET_MessageHeader * msg); |
159 | 159 | ||
@@ -200,9 +200,8 @@ void GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); | |||
200 | * @param msg the message that was received | 200 | * @param msg the message that was received |
201 | * @return GNUNET_OK on success, GNUNET_NO if this was a duplicate, GNUNET_SYSERR on error | 201 | * @return GNUNET_OK on success, GNUNET_NO if this was a duplicate, GNUNET_SYSERR on error |
202 | */ | 202 | */ |
203 | int | 203 | int GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, |
204 | GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, | 204 | const struct GNUNET_MessageHeader *msg); |
205 | const struct GNUNET_MessageHeader *msg); | ||
206 | 205 | ||
207 | 206 | ||
208 | #if 0 /* keep Emacsens' auto-indent happy */ | 207 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index b6eb83609..2962a9cf2 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -79,8 +79,7 @@ struct GNUNET_FS_Uri; | |||
79 | * @param is_mandatory is the keyword mandatory (in a search) | 79 | * @param is_mandatory is the keyword mandatory (in a search) |
80 | * @return GNUNET_OK to continue to iterate, GNUNET_SYSERR to abort | 80 | * @return GNUNET_OK to continue to iterate, GNUNET_SYSERR to abort |
81 | */ | 81 | */ |
82 | typedef int (*GNUNET_FS_KeywordIterator) (void *cls, | 82 | typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword, |
83 | const char *keyword, | ||
84 | int is_mandatory); | 83 | int is_mandatory); |
85 | 84 | ||
86 | /** | 85 | /** |
@@ -90,8 +89,8 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, | |||
90 | * @param uri uri to convert to a unique key | 89 | * @param uri uri to convert to a unique key |
91 | * @param key wherer to store the unique key | 90 | * @param key wherer to store the unique key |
92 | */ | 91 | */ |
93 | void | 92 | void GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, |
94 | GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, GNUNET_HashCode * key); | 93 | GNUNET_HashCode * key); |
95 | 94 | ||
96 | /** | 95 | /** |
97 | * Convert a URI to a UTF-8 String. | 96 | * Convert a URI to a UTF-8 String. |
@@ -119,9 +118,8 @@ char *GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | |||
119 | * @param keyword keyword to add | 118 | * @param keyword keyword to add |
120 | * @param is_mandatory is this keyword mandatory? | 119 | * @param is_mandatory is this keyword mandatory? |
121 | */ | 120 | */ |
122 | void | 121 | void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, |
123 | GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | 122 | const char *keyword, int is_mandatory); |
124 | const char *keyword, int is_mandatory); | ||
125 | 123 | ||
126 | 124 | ||
127 | /** | 125 | /** |
@@ -131,9 +129,8 @@ GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | |||
131 | * @param uri ksk uri to modify | 129 | * @param uri ksk uri to modify |
132 | * @param keyword keyword to add | 130 | * @param keyword keyword to add |
133 | */ | 131 | */ |
134 | void | 132 | void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, |
135 | GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, | 133 | const char *keyword); |
136 | const char *keyword); | ||
137 | 134 | ||
138 | 135 | ||
139 | /** | 136 | /** |
@@ -159,8 +156,8 @@ void GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | |||
159 | * @param uri ksk uri to get the number of keywords from | 156 | * @param uri ksk uri to get the number of keywords from |
160 | * @return 0 if this is not a keyword URI | 157 | * @return 0 if this is not a keyword URI |
161 | */ | 158 | */ |
162 | unsigned int | 159 | unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri |
163 | GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); | 160 | *uri); |
164 | 161 | ||
165 | 162 | ||
166 | /** | 163 | /** |
@@ -172,10 +169,9 @@ GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); | |||
172 | * @return -1 if this is not a keyword URI, otherwise number of | 169 | * @return -1 if this is not a keyword URI, otherwise number of |
173 | * keywords iterated over until iterator aborted | 170 | * keywords iterated over until iterator aborted |
174 | */ | 171 | */ |
175 | int | 172 | int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, |
176 | GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | 173 | GNUNET_FS_KeywordIterator iterator, |
177 | GNUNET_FS_KeywordIterator iterator, | 174 | void *iterator_cls); |
178 | void *iterator_cls); | ||
179 | 175 | ||
180 | 176 | ||
181 | /** | 177 | /** |
@@ -185,9 +181,8 @@ GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | |||
185 | * @param peer where to store the identify of the peer (presumably) offering the content | 181 | * @param peer where to store the identify of the peer (presumably) offering the content |
186 | * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK | 182 | * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK |
187 | */ | 183 | */ |
188 | int | 184 | int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, |
189 | GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | 185 | struct GNUNET_PeerIdentity *peer); |
190 | struct GNUNET_PeerIdentity *peer); | ||
191 | 186 | ||
192 | 187 | ||
193 | /** | 188 | /** |
@@ -206,8 +201,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri | |||
206 | * @param uri location URI to get the expiration from | 201 | * @param uri location URI to get the expiration from |
207 | * @return expiration time of the URI | 202 | * @return expiration time of the URI |
208 | */ | 203 | */ |
209 | struct GNUNET_TIME_Absolute | 204 | struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration (const struct |
210 | GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri); | 205 | GNUNET_FS_Uri |
206 | *uri); | ||
211 | 207 | ||
212 | 208 | ||
213 | /** | 209 | /** |
@@ -310,9 +306,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, | |||
310 | * @param u2 the other URI | 306 | * @param u2 the other URI |
311 | * @return GNUNET_YES if the URIs are equal | 307 | * @return GNUNET_YES if the URIs are equal |
312 | */ | 308 | */ |
313 | int | 309 | int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, |
314 | GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | 310 | const struct GNUNET_FS_Uri *u2); |
315 | const struct GNUNET_FS_Uri *u2); | ||
316 | 311 | ||
317 | 312 | ||
318 | /** | 313 | /** |
@@ -361,9 +356,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * | |||
361 | * @param nsid where to store the ID of the namespace | 356 | * @param nsid where to store the ID of the namespace |
362 | * @return GNUNET_OK on success | 357 | * @return GNUNET_OK on success |
363 | */ | 358 | */ |
364 | int | 359 | int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
365 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 360 | GNUNET_HashCode * nsid); |
366 | GNUNET_HashCode * nsid); | ||
367 | 361 | ||
368 | 362 | ||
369 | /** | 363 | /** |
@@ -451,10 +445,10 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_meta_data (const struct | |||
451 | * @param value command line argument given | 445 | * @param value command line argument given |
452 | * @return GNUNET_OK on success | 446 | * @return GNUNET_OK on success |
453 | */ | 447 | */ |
454 | int | 448 | int GNUNET_FS_getopt_set_keywords (struct |
455 | GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext | 449 | GNUNET_GETOPT_CommandLineProcessorContext |
456 | *ctx, void *scls, const char *option, | 450 | *ctx, void *scls, const char *option, |
457 | const char *value); | 451 | const char *value); |
458 | 452 | ||
459 | 453 | ||
460 | /** | 454 | /** |
@@ -469,10 +463,10 @@ GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
469 | * @param value command line argument given | 463 | * @param value command line argument given |
470 | * @return GNUNET_OK on success | 464 | * @return GNUNET_OK on success |
471 | */ | 465 | */ |
472 | int | 466 | int GNUNET_FS_getopt_set_metadata (struct |
473 | GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext | 467 | GNUNET_GETOPT_CommandLineProcessorContext |
474 | *ctx, void *scls, const char *option, | 468 | *ctx, void *scls, const char *option, |
475 | const char *value); | 469 | const char *value); |
476 | 470 | ||
477 | 471 | ||
478 | 472 | ||
@@ -1522,8 +1516,9 @@ struct GNUNET_FS_ProgressInfo | |||
1522 | * will be passed to future callbacks in the respective | 1516 | * will be passed to future callbacks in the respective |
1523 | * field in the GNUNET_FS_ProgressInfo struct. | 1517 | * field in the GNUNET_FS_ProgressInfo struct. |
1524 | */ | 1518 | */ |
1525 | typedef void *(*GNUNET_FS_ProgressCallback) | 1519 | typedef void *(*GNUNET_FS_ProgressCallback) (void *cls, |
1526 | (void *cls, const struct GNUNET_FS_ProgressInfo * info); | 1520 | const struct GNUNET_FS_ProgressInfo |
1521 | * info); | ||
1527 | 1522 | ||
1528 | 1523 | ||
1529 | /** | 1524 | /** |
@@ -1682,11 +1677,10 @@ void GNUNET_FS_stop (struct GNUNET_FS_Handle *h); | |||
1682 | * @return GNUNET_SYSERR on error, otherwise the number | 1677 | * @return GNUNET_SYSERR on error, otherwise the number |
1683 | * of meta-data items obtained | 1678 | * of meta-data items obtained |
1684 | */ | 1679 | */ |
1685 | int | 1680 | int GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md, |
1686 | GNUNET_FS_meta_data_extract_from_file (struct | 1681 | const char *filename, |
1687 | GNUNET_CONTAINER_MetaData | 1682 | struct EXTRACTOR_PluginList |
1688 | *md, const char *filename, | 1683 | *extractors); |
1689 | struct EXTRACTOR_PluginList *extractors); | ||
1690 | 1684 | ||
1691 | 1685 | ||
1692 | /** | 1686 | /** |
@@ -1804,9 +1798,8 @@ struct GNUNET_FS_FileInformation | |||
1804 | * @param emsg location for the reader to store an error message | 1798 | * @param emsg location for the reader to store an error message |
1805 | * @return number of bytes written, usually "max", 0 on error | 1799 | * @return number of bytes written, usually "max", 0 on error |
1806 | */ | 1800 | */ |
1807 | typedef size_t (*GNUNET_FS_DataReader) (void *cls, | 1801 | typedef size_t (*GNUNET_FS_DataReader) (void *cls, uint64_t offset, size_t max, |
1808 | uint64_t offset, | 1802 | void *buf, char **emsg); |
1809 | size_t max, void *buf, char **emsg); | ||
1810 | 1803 | ||
1811 | 1804 | ||
1812 | /** | 1805 | /** |
@@ -1850,8 +1843,7 @@ struct GNUNET_FS_FileInformation | |||
1850 | * @param fi information about the file (should not be | 1843 | * @param fi information about the file (should not be |
1851 | * used henceforth by the caller) | 1844 | * used henceforth by the caller) |
1852 | */ | 1845 | */ |
1853 | typedef void (*GNUNET_FS_FileProcessor) (void *cls, | 1846 | typedef void (*GNUNET_FS_FileProcessor) (void *cls, const char *filename, |
1854 | const char *filename, | ||
1855 | struct GNUNET_FS_FileInformation * fi); | 1847 | struct GNUNET_FS_FileInformation * fi); |
1856 | 1848 | ||
1857 | 1849 | ||
@@ -1870,8 +1862,7 @@ typedef void (*GNUNET_FS_FileProcessor) (void *cls, | |||
1870 | */ | 1862 | */ |
1871 | typedef int (*GNUNET_FS_DirectoryScanner) (void *cls, | 1863 | typedef int (*GNUNET_FS_DirectoryScanner) (void *cls, |
1872 | struct GNUNET_FS_Handle * h, | 1864 | struct GNUNET_FS_Handle * h, |
1873 | const char *dirname, | 1865 | const char *dirname, int do_index, |
1874 | int do_index, | ||
1875 | const struct GNUNET_FS_BlockOptions * | 1866 | const struct GNUNET_FS_BlockOptions * |
1876 | bo, GNUNET_FS_FileProcessor proc, | 1867 | bo, GNUNET_FS_FileProcessor proc, |
1877 | void *proc_cls, char **emsg); | 1868 | void *proc_cls, char **emsg); |
@@ -1899,14 +1890,11 @@ typedef int (*GNUNET_FS_DirectoryScanner) (void *cls, | |||
1899 | * @param emsg where to store an error message (on errors) | 1890 | * @param emsg where to store an error message (on errors) |
1900 | * @return GNUNET_OK on success | 1891 | * @return GNUNET_OK on success |
1901 | */ | 1892 | */ |
1902 | int | 1893 | int GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, |
1903 | GNUNET_FS_directory_scanner_default (void *cls, | 1894 | const char *dirname, int do_index, |
1904 | struct GNUNET_FS_Handle *h, | 1895 | const struct GNUNET_FS_BlockOptions |
1905 | const char *dirname, | 1896 | *bo, GNUNET_FS_FileProcessor proc, |
1906 | int do_index, | 1897 | void *proc_cls, char **emsg); |
1907 | const struct GNUNET_FS_BlockOptions *bo, | ||
1908 | GNUNET_FS_FileProcessor proc, | ||
1909 | void *proc_cls, char **emsg); | ||
1910 | 1898 | ||
1911 | 1899 | ||
1912 | /** | 1900 | /** |
@@ -1975,9 +1963,8 @@ struct GNUNET_FS_FileInformation | |||
1975 | * @param ent check if this FI represents a directory | 1963 | * @param ent check if this FI represents a directory |
1976 | * @return GNUNET_YES if so, GNUNET_NO if not | 1964 | * @return GNUNET_YES if so, GNUNET_NO if not |
1977 | */ | 1965 | */ |
1978 | int | 1966 | int GNUNET_FS_file_information_is_directory (const struct |
1979 | GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation | 1967 | GNUNET_FS_FileInformation *ent); |
1980 | *ent); | ||
1981 | 1968 | ||
1982 | 1969 | ||
1983 | /** | 1970 | /** |
@@ -1991,9 +1978,8 @@ GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation | |||
1991 | * must not include "dir" in its structure | 1978 | * must not include "dir" in its structure |
1992 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 1979 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
1993 | */ | 1980 | */ |
1994 | int | 1981 | int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, |
1995 | GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | 1982 | struct GNUNET_FS_FileInformation *ent); |
1996 | struct GNUNET_FS_FileInformation *ent); | ||
1997 | 1983 | ||
1998 | 1984 | ||
1999 | /** | 1985 | /** |
@@ -2010,10 +1996,9 @@ GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | |||
2010 | * @param proc function to call on each entry | 1996 | * @param proc function to call on each entry |
2011 | * @param proc_cls closure for proc | 1997 | * @param proc_cls closure for proc |
2012 | */ | 1998 | */ |
2013 | void | 1999 | void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, |
2014 | GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | 2000 | GNUNET_FS_FileInformationProcessor |
2015 | GNUNET_FS_FileInformationProcessor proc, | 2001 | proc, void *proc_cls); |
2016 | void *proc_cls); | ||
2017 | 2002 | ||
2018 | 2003 | ||
2019 | /** | 2004 | /** |
@@ -2026,10 +2011,9 @@ GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | |||
2026 | * values are ignored | 2011 | * values are ignored |
2027 | * @param cleaner_cls closure for cleaner | 2012 | * @param cleaner_cls closure for cleaner |
2028 | */ | 2013 | */ |
2029 | void | 2014 | void GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, |
2030 | GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, | 2015 | GNUNET_FS_FileInformationProcessor |
2031 | GNUNET_FS_FileInformationProcessor cleaner, | 2016 | cleaner, void *cleaner_cls); |
2032 | void *cleaner_cls); | ||
2033 | 2017 | ||
2034 | 2018 | ||
2035 | /** | 2019 | /** |
@@ -2114,14 +2098,13 @@ typedef void (*GNUNET_FS_PublishContinuation) (void *cls, | |||
2114 | * @param cont continuation | 2098 | * @param cont continuation |
2115 | * @param cont_cls closure for cont | 2099 | * @param cont_cls closure for cont |
2116 | */ | 2100 | */ |
2117 | void | 2101 | void GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, |
2118 | GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | 2102 | const struct GNUNET_FS_Uri *ksk_uri, |
2119 | const struct GNUNET_FS_Uri *ksk_uri, | 2103 | const struct GNUNET_CONTAINER_MetaData *meta, |
2120 | const struct GNUNET_CONTAINER_MetaData *meta, | 2104 | const struct GNUNET_FS_Uri *uri, |
2121 | const struct GNUNET_FS_Uri *uri, | 2105 | const struct GNUNET_FS_BlockOptions *bo, |
2122 | const struct GNUNET_FS_BlockOptions *bo, | 2106 | enum GNUNET_FS_PublishOptions options, |
2123 | enum GNUNET_FS_PublishOptions options, | 2107 | GNUNET_FS_PublishContinuation cont, void *cont_cls); |
2124 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | ||
2125 | 2108 | ||
2126 | 2109 | ||
2127 | /** | 2110 | /** |
@@ -2138,16 +2121,14 @@ GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | |||
2138 | * @param cont continuation | 2121 | * @param cont continuation |
2139 | * @param cont_cls closure for cont | 2122 | * @param cont_cls closure for cont |
2140 | */ | 2123 | */ |
2141 | void | 2124 | void GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, |
2142 | GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | 2125 | struct GNUNET_FS_Namespace *namespace, |
2143 | struct GNUNET_FS_Namespace *namespace, | 2126 | const char *identifier, const char *update, |
2144 | const char *identifier, | 2127 | const struct GNUNET_CONTAINER_MetaData *meta, |
2145 | const char *update, | 2128 | const struct GNUNET_FS_Uri *uri, |
2146 | const struct GNUNET_CONTAINER_MetaData *meta, | 2129 | const struct GNUNET_FS_BlockOptions *bo, |
2147 | const struct GNUNET_FS_Uri *uri, | 2130 | enum GNUNET_FS_PublishOptions options, |
2148 | const struct GNUNET_FS_BlockOptions *bo, | 2131 | GNUNET_FS_PublishContinuation cont, void *cont_cls); |
2149 | enum GNUNET_FS_PublishOptions options, | ||
2150 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | ||
2151 | 2132 | ||
2152 | 2133 | ||
2153 | /** | 2134 | /** |
@@ -2158,8 +2139,7 @@ GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | |||
2158 | * @param file_id hash of the contents of the indexed file | 2139 | * @param file_id hash of the contents of the indexed file |
2159 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort | 2140 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort |
2160 | */ | 2141 | */ |
2161 | typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, | 2142 | typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, const char *filename, |
2162 | const char *filename, | ||
2163 | const GNUNET_HashCode * file_id); | 2143 | const GNUNET_HashCode * file_id); |
2164 | 2144 | ||
2165 | 2145 | ||
@@ -2174,11 +2154,10 @@ typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, | |||
2174 | * error) or "PREREQ_DONE" (on success) | 2154 | * error) or "PREREQ_DONE" (on success) |
2175 | * @param cont_cls closure for cont | 2155 | * @param cont_cls closure for cont |
2176 | */ | 2156 | */ |
2177 | void | 2157 | void GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, |
2178 | GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | 2158 | GNUNET_FS_IndexedFileProcessor iterator, |
2179 | GNUNET_FS_IndexedFileProcessor iterator, | 2159 | void *iterator_cls, |
2180 | void *iterator_cls, | 2160 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
2181 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
2182 | 2161 | ||
2183 | 2162 | ||
2184 | /** | 2163 | /** |
@@ -2215,15 +2194,15 @@ void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | |||
2215 | * @param cont continuation | 2194 | * @param cont continuation |
2216 | * @param cont_cls closure for cont | 2195 | * @param cont_cls closure for cont |
2217 | */ | 2196 | */ |
2218 | void | 2197 | void GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, |
2219 | GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, | 2198 | struct GNUNET_FS_Uri *ksk_uri, |
2220 | struct GNUNET_FS_Uri *ksk_uri, | 2199 | struct GNUNET_FS_Namespace *namespace, |
2221 | struct GNUNET_FS_Namespace *namespace, | 2200 | const struct GNUNET_CONTAINER_MetaData |
2222 | const struct GNUNET_CONTAINER_MetaData *meta, | 2201 | *meta, |
2223 | const struct GNUNET_FS_BlockOptions *bo, | 2202 | const struct GNUNET_FS_BlockOptions *bo, |
2224 | const char *rootEntry, | 2203 | const char *rootEntry, |
2225 | GNUNET_FS_PublishContinuation cont, | 2204 | GNUNET_FS_PublishContinuation cont, |
2226 | void *cont_cls); | 2205 | void *cont_cls); |
2227 | 2206 | ||
2228 | 2207 | ||
2229 | /** | 2208 | /** |
@@ -2249,8 +2228,8 @@ struct GNUNET_FS_Namespace *GNUNET_FS_namespace_create (struct GNUNET_FS_Handle | |||
2249 | * | 2228 | * |
2250 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 2229 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
2251 | */ | 2230 | */ |
2252 | int | 2231 | int GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, |
2253 | GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze); | 2232 | int freeze); |
2254 | 2233 | ||
2255 | 2234 | ||
2256 | /** | 2235 | /** |
@@ -2262,8 +2241,7 @@ GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze); | |||
2262 | * @param name human-readable identifier of the namespace | 2241 | * @param name human-readable identifier of the namespace |
2263 | * @param id hash identifier for the namespace | 2242 | * @param id hash identifier for the namespace |
2264 | */ | 2243 | */ |
2265 | typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, | 2244 | typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name, |
2266 | const char *name, | ||
2267 | const GNUNET_HashCode * id); | 2245 | const GNUNET_HashCode * id); |
2268 | 2246 | ||
2269 | 2247 | ||
@@ -2276,9 +2254,9 @@ typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, | |||
2276 | * @param cb function to call on each known namespace | 2254 | * @param cb function to call on each known namespace |
2277 | * @param cb_cls closure for cb | 2255 | * @param cb_cls closure for cb |
2278 | */ | 2256 | */ |
2279 | void | 2257 | void GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, |
2280 | GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, | 2258 | GNUNET_FS_NamespaceInfoProcessor cb, |
2281 | GNUNET_FS_NamespaceInfoProcessor cb, void *cb_cls); | 2259 | void *cb_cls); |
2282 | 2260 | ||
2283 | 2261 | ||
2284 | /** | 2262 | /** |
@@ -2290,12 +2268,12 @@ GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, | |||
2290 | * @param last_meta metadata associated with last_uri | 2268 | * @param last_meta metadata associated with last_uri |
2291 | * @param next_id identifier that should be used for updates | 2269 | * @param next_id identifier that should be used for updates |
2292 | */ | 2270 | */ |
2293 | typedef void | 2271 | typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, const char *last_id, |
2294 | (*GNUNET_FS_IdentifierProcessor) (void *cls, | 2272 | const struct GNUNET_FS_Uri * |
2295 | const char *last_id, | 2273 | last_uri, |
2296 | const struct GNUNET_FS_Uri * last_uri, | 2274 | const struct |
2297 | const struct GNUNET_CONTAINER_MetaData * | 2275 | GNUNET_CONTAINER_MetaData * |
2298 | last_meta, const char *next_id); | 2276 | last_meta, const char *next_id); |
2299 | 2277 | ||
2300 | 2278 | ||
2301 | /** | 2279 | /** |
@@ -2318,11 +2296,10 @@ typedef void | |||
2318 | * @param ip function to call on each updateable identifier | 2296 | * @param ip function to call on each updateable identifier |
2319 | * @param ip_cls closure for ip | 2297 | * @param ip_cls closure for ip |
2320 | */ | 2298 | */ |
2321 | void | 2299 | void GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, |
2322 | GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, | 2300 | const char *next_id, |
2323 | const char *next_id, | 2301 | GNUNET_FS_IdentifierProcessor ip, |
2324 | GNUNET_FS_IdentifierProcessor ip, | 2302 | void *ip_cls); |
2325 | void *ip_cls); | ||
2326 | 2303 | ||
2327 | 2304 | ||
2328 | /** | 2305 | /** |
@@ -2547,8 +2524,8 @@ struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start_from_search (struct | |||
2547 | * @param dc handle for the download | 2524 | * @param dc handle for the download |
2548 | * @param do_delete delete files of incomplete downloads | 2525 | * @param do_delete delete files of incomplete downloads |
2549 | */ | 2526 | */ |
2550 | void | 2527 | void GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, |
2551 | GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); | 2528 | int do_delete); |
2552 | 2529 | ||
2553 | 2530 | ||
2554 | 2531 | ||
@@ -2566,9 +2543,8 @@ GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); | |||
2566 | * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if | 2543 | * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if |
2567 | * we have no mime-type information (treat as 'GNUNET_NO') | 2544 | * we have no mime-type information (treat as 'GNUNET_NO') |
2568 | */ | 2545 | */ |
2569 | int | 2546 | int GNUNET_FS_meta_data_test_for_directory (const struct |
2570 | GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData | 2547 | GNUNET_CONTAINER_MetaData *md); |
2571 | *md); | ||
2572 | 2548 | ||
2573 | 2549 | ||
2574 | /** | 2550 | /** |
@@ -2634,12 +2610,10 @@ typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls, | |||
2634 | * GNUNET_NO if this could be part of a directory (but not 100% OK) | 2610 | * GNUNET_NO if this could be part of a directory (but not 100% OK) |
2635 | * GNUNET_SYSERR if 'data' does not represent a directory | 2611 | * GNUNET_SYSERR if 'data' does not represent a directory |
2636 | */ | 2612 | */ |
2637 | int | 2613 | int GNUNET_FS_directory_list_contents (size_t size, const void *data, |
2638 | GNUNET_FS_directory_list_contents (size_t size, | 2614 | uint64_t offset, |
2639 | const void *data, | 2615 | GNUNET_FS_DirectoryEntryProcessor dep, |
2640 | uint64_t offset, | 2616 | void *dep_cls); |
2641 | GNUNET_FS_DirectoryEntryProcessor dep, | ||
2642 | void *dep_cls); | ||
2643 | 2617 | ||
2644 | 2618 | ||
2645 | /** | 2619 | /** |
@@ -2668,11 +2642,10 @@ struct GNUNET_FS_DirectoryBuilder *GNUNET_FS_directory_builder_create (const | |||
2668 | * data must point to exactly the number of bytes specified | 2642 | * data must point to exactly the number of bytes specified |
2669 | * by the uri | 2643 | * by the uri |
2670 | */ | 2644 | */ |
2671 | void | 2645 | void GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, |
2672 | GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | 2646 | const struct GNUNET_FS_Uri *uri, |
2673 | const struct GNUNET_FS_Uri *uri, | 2647 | const struct GNUNET_CONTAINER_MetaData |
2674 | const struct GNUNET_CONTAINER_MetaData *md, | 2648 | *md, const void *data); |
2675 | const void *data); | ||
2676 | 2649 | ||
2677 | 2650 | ||
2678 | /** | 2651 | /** |
@@ -2685,9 +2658,8 @@ GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | |||
2685 | * @param rdata set to the encoded directory | 2658 | * @param rdata set to the encoded directory |
2686 | * @return GNUNET_OK on success | 2659 | * @return GNUNET_OK on success |
2687 | */ | 2660 | */ |
2688 | int | 2661 | int GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, |
2689 | GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, | 2662 | size_t * rsize, void **rdata); |
2690 | size_t * rsize, void **rdata); | ||
2691 | 2663 | ||
2692 | 2664 | ||
2693 | #if 0 /* keep Emacsens' auto-indent happy */ | 2665 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h index 9c34810b2..0fb7ec84e 100644 --- a/src/include/gnunet_getopt_lib.h +++ b/src/include/gnunet_getopt_lib.h | |||
@@ -85,12 +85,11 @@ struct GNUNET_GETOPT_CommandLineProcessorContext | |||
85 | * @param value argument, NULL if none was given | 85 | * @param value argument, NULL if none was given |
86 | * @return GNUNET_OK to continue processing other options, GNUNET_SYSERR to abort | 86 | * @return GNUNET_OK to continue processing other options, GNUNET_SYSERR to abort |
87 | */ | 87 | */ |
88 | typedef | 88 | typedef int (*GNUNET_GETOPT_CommandLineOptionProcessor) (struct |
89 | int (*GNUNET_GETOPT_CommandLineOptionProcessor) (struct | 89 | GNUNET_GETOPT_CommandLineProcessorContext |
90 | GNUNET_GETOPT_CommandLineProcessorContext | 90 | * ctx, void *scls, |
91 | * ctx, void *scls, | 91 | const char *option, |
92 | const char *option, | 92 | const char *value); |
93 | const char *value); | ||
94 | 93 | ||
95 | /** | 94 | /** |
96 | * @brief Definition of a command line option. | 95 | * @brief Definition of a command line option. |
@@ -209,8 +208,8 @@ struct GNUNET_GETOPT_CommandLineOption | |||
209 | * argument, or GNUNET_SYSERR on error | 208 | * argument, or GNUNET_SYSERR on error |
210 | */ | 209 | */ |
211 | int GNUNET_GETOPT_run (const char *binaryOptions, | 210 | int GNUNET_GETOPT_run (const char *binaryOptions, |
212 | const struct GNUNET_GETOPT_CommandLineOption | 211 | const struct GNUNET_GETOPT_CommandLineOption *allOptions, |
213 | *allOptions, unsigned int argc, char *const *argv); | 212 | unsigned int argc, char *const *argv); |
214 | 213 | ||
215 | 214 | ||
216 | /** | 215 | /** |
@@ -300,11 +299,10 @@ int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
300 | * @param value not used (NULL) | 299 | * @param value not used (NULL) |
301 | * @return GNUNET_OK | 300 | * @return GNUNET_OK |
302 | */ | 301 | */ |
303 | int | 302 | int GNUNET_GETOPT_increment_value (struct |
304 | GNUNET_GETOPT_increment_value (struct | 303 | GNUNET_GETOPT_CommandLineProcessorContext |
305 | GNUNET_GETOPT_CommandLineProcessorContext *ctx, | 304 | *ctx, void *scls, const char *option, |
306 | void *scls, const char *option, | 305 | const char *value); |
307 | const char *value); | ||
308 | 306 | ||
309 | 307 | ||
310 | /* *************** internal prototypes - use macros above! ************* */ | 308 | /* *************** internal prototypes - use macros above! ************* */ |
@@ -318,8 +316,7 @@ GNUNET_GETOPT_increment_value (struct | |||
318 | * @param value not used (NULL) | 316 | * @param value not used (NULL) |
319 | * @return GNUNET_SYSERR (do not continue) | 317 | * @return GNUNET_SYSERR (do not continue) |
320 | */ | 318 | */ |
321 | int GNUNET_GETOPT_format_help_ (struct | 319 | int GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext |
322 | GNUNET_GETOPT_CommandLineProcessorContext | ||
323 | *ctx, void *scls, const char *option, | 320 | *ctx, void *scls, const char *option, |
324 | const char *value); | 321 | const char *value); |
325 | 322 | ||
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index a3e4ba0f0..3c44b5048 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h | |||
@@ -60,18 +60,11 @@ struct GNUNET_HELLO_Message; | |||
60 | * @return number of bytes copied, 0 if | 60 | * @return number of bytes copied, 0 if |
61 | * the target buffer was not big enough. | 61 | * the target buffer was not big enough. |
62 | */ | 62 | */ |
63 | size_t | 63 | size_t GNUNET_HELLO_add_address (const char *tname, |
64 | 64 | struct GNUNET_TIME_Absolute | |
65 | 65 | expiration, const void *addr, | |
66 | 66 | uint16_t addr_len, char *target, | |
67 | 67 | size_t max); | |
68 | |||
69 | |||
70 | |||
71 | GNUNET_HELLO_add_address (const char *tname, | ||
72 | struct GNUNET_TIME_Absolute expiration, | ||
73 | const void *addr, | ||
74 | uint16_t addr_len, char *target, size_t max); | ||
75 | 68 | ||
76 | 69 | ||
77 | /** | 70 | /** |
@@ -85,9 +78,9 @@ GNUNET_HELLO_add_address (const char *tname, | |||
85 | * @return number of bytes written, 0 to signal the | 78 | * @return number of bytes written, 0 to signal the |
86 | * end of the iteration. | 79 | * end of the iteration. |
87 | */ | 80 | */ |
88 | typedef size_t | 81 | typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, |
89 | (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, | 82 | size_t max, |
90 | size_t max, void *buf); | 83 | void *buf); |
91 | 84 | ||
92 | 85 | ||
93 | /** | 86 | /** |
@@ -143,11 +136,12 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct | |||
143 | * zero if the some addresses with expirations >= now | 136 | * zero if the some addresses with expirations >= now |
144 | * do not match at all | 137 | * do not match at all |
145 | */ | 138 | */ |
146 | struct GNUNET_TIME_Absolute | 139 | struct GNUNET_TIME_Absolute GNUNET_HELLO_equals (const struct |
147 | GNUNET_HELLO_equals (const struct | 140 | GNUNET_HELLO_Message *h1, |
148 | GNUNET_HELLO_Message *h1, | 141 | const struct |
149 | const struct | 142 | GNUNET_HELLO_Message *h2, |
150 | GNUNET_HELLO_Message *h2, struct GNUNET_TIME_Absolute now); | 143 | struct GNUNET_TIME_Absolute |
144 | now); | ||
151 | 145 | ||
152 | 146 | ||
153 | /** | 147 | /** |
@@ -162,11 +156,10 @@ GNUNET_HELLO_equals (const struct | |||
162 | * GNUNET_NO to delete it from the HELLO | 156 | * GNUNET_NO to delete it from the HELLO |
163 | * GNUNET_SYSERR to stop iterating (but keep current address) | 157 | * GNUNET_SYSERR to stop iterating (but keep current address) |
164 | */ | 158 | */ |
165 | typedef int | 159 | typedef int (*GNUNET_HELLO_AddressIterator) (void *cls, const char *tname, |
166 | (*GNUNET_HELLO_AddressIterator) (void *cls, | 160 | struct GNUNET_TIME_Absolute |
167 | const char *tname, | 161 | expiration, const void *addr, |
168 | struct GNUNET_TIME_Absolute expiration, | 162 | uint16_t addrlen); |
169 | const void *addr, uint16_t addrlen); | ||
170 | 163 | ||
171 | 164 | ||
172 | /** | 165 | /** |
@@ -201,15 +194,14 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct | |||
201 | * @param it iterator to call on each address | 194 | * @param it iterator to call on each address |
202 | * @param it_cls closure for it | 195 | * @param it_cls closure for it |
203 | */ | 196 | */ |
204 | void | 197 | void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message |
205 | GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | 198 | *new_hello, |
206 | *new_hello, | 199 | const struct GNUNET_HELLO_Message |
207 | const struct GNUNET_HELLO_Message | 200 | *old_hello, |
208 | *old_hello, | 201 | struct GNUNET_TIME_Absolute |
209 | struct GNUNET_TIME_Absolute | 202 | expiration_limit, |
210 | expiration_limit, | 203 | GNUNET_HELLO_AddressIterator it, |
211 | GNUNET_HELLO_AddressIterator it, | 204 | void *it_cls); |
212 | void *it_cls); | ||
213 | 205 | ||
214 | 206 | ||
215 | /** | 207 | /** |
@@ -219,10 +211,9 @@ GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | |||
219 | * @param publicKey where to copy the public key information, can be NULL | 211 | * @param publicKey where to copy the public key information, can be NULL |
220 | * @return GNUNET_SYSERR if the HELLO was malformed | 212 | * @return GNUNET_SYSERR if the HELLO was malformed |
221 | */ | 213 | */ |
222 | int | 214 | int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, |
223 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | 215 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
224 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 216 | *publicKey); |
225 | *publicKey); | ||
226 | 217 | ||
227 | 218 | ||
228 | /** | 219 | /** |
@@ -232,9 +223,8 @@ GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | |||
232 | * @param peer where to store the peer's identity | 223 | * @param peer where to store the peer's identity |
233 | * @return GNUNET_SYSERR if the HELLO was malformed | 224 | * @return GNUNET_SYSERR if the HELLO was malformed |
234 | */ | 225 | */ |
235 | int | 226 | int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, |
236 | GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | 227 | struct GNUNET_PeerIdentity *peer); |
237 | struct GNUNET_PeerIdentity *peer); | ||
238 | 228 | ||
239 | 229 | ||
240 | /** | 230 | /** |
diff --git a/src/include/gnunet_load_lib.h b/src/include/gnunet_load_lib.h index 40323e709..d56522d40 100644 --- a/src/include/gnunet_load_lib.h +++ b/src/include/gnunet_load_lib.h | |||
@@ -61,9 +61,8 @@ struct GNUNET_LOAD_Value *GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative | |||
61 | * @param load load to update | 61 | * @param load load to update |
62 | * @param autodecline frequency of load decline | 62 | * @param autodecline frequency of load decline |
63 | */ | 63 | */ |
64 | void | 64 | void GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, |
65 | GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, | 65 | struct GNUNET_TIME_Relative autodecline); |
66 | struct GNUNET_TIME_Relative autodecline); | ||
67 | 66 | ||
68 | 67 | ||
69 | /** | 68 | /** |
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index 7e332c749..507b766d1 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h | |||
@@ -67,14 +67,16 @@ struct GNUNET_MESH_Tunnel; | |||
67 | * @return GNUNET_OK to keep the connection open, | 67 | * @return GNUNET_OK to keep the connection open, |
68 | * GNUNET_SYSERR to close it (signal serious error) | 68 | * GNUNET_SYSERR to close it (signal serious error) |
69 | */ | 69 | */ |
70 | typedef int | 70 | typedef int (*GNUNET_MESH_MessageCallback) (void *cls, |
71 | (*GNUNET_MESH_MessageCallback) (void *cls, | 71 | struct GNUNET_MESH_Tunnel * tunnel, |
72 | struct GNUNET_MESH_Tunnel * tunnel, | 72 | void **tunnel_ctx, |
73 | void **tunnel_ctx, | 73 | const struct GNUNET_PeerIdentity * |
74 | const struct GNUNET_PeerIdentity * sender, | 74 | sender, |
75 | const struct GNUNET_MessageHeader * message, | 75 | const struct GNUNET_MessageHeader * |
76 | const struct | 76 | message, |
77 | GNUNET_TRANSPORT_ATS_Information * atsi); | 77 | const struct |
78 | GNUNET_TRANSPORT_ATS_Information * | ||
79 | atsi); | ||
78 | 80 | ||
79 | 81 | ||
80 | /** | 82 | /** |
@@ -281,10 +283,10 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_all (struct | |||
281 | * @param timeout how long to try to establish a connection | 283 | * @param timeout how long to try to establish a connection |
282 | * @param peer peer to add | 284 | * @param peer peer to add |
283 | */ | 285 | */ |
284 | void | 286 | void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, |
285 | GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | 287 | struct GNUNET_TIME_Relative timeout, |
286 | struct GNUNET_TIME_Relative timeout, | 288 | const struct GNUNET_PeerIdentity |
287 | const struct GNUNET_PeerIdentity *peer); | 289 | *peer); |
288 | 290 | ||
289 | 291 | ||
290 | /** | 292 | /** |
@@ -294,9 +296,9 @@ GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | |||
294 | * @param tunnel handle to existing tunnel | 296 | * @param tunnel handle to existing tunnel |
295 | * @param peer peer to remove | 297 | * @param peer peer to remove |
296 | */ | 298 | */ |
297 | void | 299 | void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, |
298 | GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | 300 | const struct GNUNET_PeerIdentity |
299 | const struct GNUNET_PeerIdentity *peer); | 301 | *peer); |
300 | 302 | ||
301 | 303 | ||
302 | /** | 304 | /** |
@@ -394,9 +396,8 @@ struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | |||
394 | * | 396 | * |
395 | * @param th handle that was returned by "notify_transmit_ready". | 397 | * @param th handle that was returned by "notify_transmit_ready". |
396 | */ | 398 | */ |
397 | void | 399 | void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle |
398 | GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | 400 | *th); |
399 | *th); | ||
400 | 401 | ||
401 | void GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, | 402 | void GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, |
402 | void *head); | 403 | void *head); |
diff --git a/src/include/gnunet_mesh_service_new.h b/src/include/gnunet_mesh_service_new.h index 7146faa75..89b1c881e 100644 --- a/src/include/gnunet_mesh_service_new.h +++ b/src/include/gnunet_mesh_service_new.h | |||
@@ -67,14 +67,16 @@ struct GNUNET_MESH_Tunnel; | |||
67 | * @return GNUNET_OK to keep the connection open, | 67 | * @return GNUNET_OK to keep the connection open, |
68 | * GNUNET_SYSERR to close it (signal serious error) | 68 | * GNUNET_SYSERR to close it (signal serious error) |
69 | */ | 69 | */ |
70 | typedef int | 70 | typedef int (*GNUNET_MESH_MessageCallback) (void *cls, |
71 | (*GNUNET_MESH_MessageCallback) (void *cls, | 71 | struct GNUNET_MESH_Tunnel * tunnel, |
72 | struct GNUNET_MESH_Tunnel * tunnel, | 72 | void **tunnel_ctx, |
73 | void **tunnel_ctx, | 73 | const struct GNUNET_PeerIdentity * |
74 | const struct GNUNET_PeerIdentity * sender, | 74 | sender, |
75 | const struct GNUNET_MessageHeader * message, | 75 | const struct GNUNET_MessageHeader * |
76 | const struct | 76 | message, |
77 | GNUNET_TRANSPORT_ATS_Information * atsi); | 77 | const struct |
78 | GNUNET_TRANSPORT_ATS_Information * | ||
79 | atsi); | ||
78 | 80 | ||
79 | 81 | ||
80 | /** | 82 | /** |
@@ -113,8 +115,8 @@ struct GNUNET_MESH_MessageHandler | |||
113 | * with the tunnel is stored | 115 | * with the tunnel is stored |
114 | */ | 116 | */ |
115 | typedef void (GNUNET_MESH_TunnelEndHandler) (void *cls, | 117 | typedef void (GNUNET_MESH_TunnelEndHandler) (void *cls, |
116 | const struct GNUNET_MESH_Tunnel | 118 | const struct GNUNET_MESH_Tunnel * |
117 | * tunnel, void **tunnel_ctx); | 119 | tunnel, void **tunnel_ctx); |
118 | 120 | ||
119 | 121 | ||
120 | /** | 122 | /** |
@@ -220,10 +222,10 @@ void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | |||
220 | * @param timeout how long to try to establish a connection | 222 | * @param timeout how long to try to establish a connection |
221 | * @param peer peer to add | 223 | * @param peer peer to add |
222 | */ | 224 | */ |
223 | void | 225 | void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, |
224 | GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | 226 | struct GNUNET_TIME_Relative timeout, |
225 | struct GNUNET_TIME_Relative timeout, | 227 | const struct GNUNET_PeerIdentity |
226 | const struct GNUNET_PeerIdentity *peer); | 228 | *peer); |
227 | 229 | ||
228 | 230 | ||
229 | /** | 231 | /** |
@@ -233,9 +235,9 @@ GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | |||
233 | * @param tunnel handle to existing tunnel | 235 | * @param tunnel handle to existing tunnel |
234 | * @param peer peer to remove | 236 | * @param peer peer to remove |
235 | */ | 237 | */ |
236 | void | 238 | void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, |
237 | GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | 239 | const struct GNUNET_PeerIdentity |
238 | const struct GNUNET_PeerIdentity *peer); | 240 | *peer); |
239 | 241 | ||
240 | 242 | ||
241 | /** | 243 | /** |
@@ -247,10 +249,12 @@ GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | |||
247 | * @param app_type application type that must be supported by the peer | 249 | * @param app_type application type that must be supported by the peer |
248 | * (MESH should discover peer in proximity handling this type) | 250 | * (MESH should discover peer in proximity handling this type) |
249 | */ | 251 | */ |
250 | void | 252 | void GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel |
251 | GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel, | 253 | *tunnel, |
252 | struct GNUNET_TIME_Relative timeout, | 254 | struct GNUNET_TIME_Relative |
253 | GNUNET_MESH_ApplicationType app_type); | 255 | timeout, |
256 | GNUNET_MESH_ApplicationType | ||
257 | app_type); | ||
254 | 258 | ||
255 | 259 | ||
256 | /** | 260 | /** |
@@ -305,9 +309,8 @@ struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | |||
305 | * | 309 | * |
306 | * @param th handle that was returned by "notify_transmit_ready". | 310 | * @param th handle that was returned by "notify_transmit_ready". |
307 | */ | 311 | */ |
308 | void | 312 | void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle |
309 | GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | 313 | *th); |
310 | *th); | ||
311 | 314 | ||
312 | 315 | ||
313 | #if 0 /* keep Emacsens' auto-indent happy */ | 316 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index a84f684a7..30eb50dd8 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h | |||
@@ -41,8 +41,7 @@ | |||
41 | * @param addr either the previous or the new public IP address | 41 | * @param addr either the previous or the new public IP address |
42 | * @param addrlen actual lenght of the address | 42 | * @param addrlen actual lenght of the address |
43 | */ | 43 | */ |
44 | typedef void (*GNUNET_NAT_AddressCallback) (void *cls, | 44 | typedef void (*GNUNET_NAT_AddressCallback) (void *cls, int add_remove, |
45 | int add_remove, | ||
46 | const struct sockaddr * addr, | 45 | const struct sockaddr * addr, |
47 | socklen_t addrlen); | 46 | socklen_t addrlen); |
48 | 47 | ||
@@ -110,9 +109,8 @@ struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct | |||
110 | * GNUNET_NO if the address is not plausible, | 109 | * GNUNET_NO if the address is not plausible, |
111 | * GNUNET_SYSERR if the address is malformed | 110 | * GNUNET_SYSERR if the address is malformed |
112 | */ | 111 | */ |
113 | int | 112 | int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, |
114 | GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, | 113 | socklen_t addrlen); |
115 | const void *addr, socklen_t addrlen); | ||
116 | 114 | ||
117 | 115 | ||
118 | /** | 116 | /** |
@@ -123,9 +121,8 @@ GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, | |||
123 | * @param h handle (used for configuration) | 121 | * @param h handle (used for configuration) |
124 | * @param sa the address of the peer (IPv4-only) | 122 | * @param sa the address of the peer (IPv4-only) |
125 | */ | 123 | */ |
126 | void | 124 | void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, |
127 | GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, | 125 | const struct sockaddr_in *sa); |
128 | const struct sockaddr_in *sa); | ||
129 | 126 | ||
130 | 127 | ||
131 | 128 | ||
@@ -220,8 +217,8 @@ struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct | |||
220 | * | 217 | * |
221 | * @param eh operation to cancel | 218 | * @param eh operation to cancel |
222 | */ | 219 | */ |
223 | void | 220 | void GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle |
224 | GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh); | 221 | *eh); |
225 | 222 | ||
226 | 223 | ||
227 | /** | 224 | /** |
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index ecc4adf41..0f38b855f 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h | |||
@@ -145,9 +145,9 @@ int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | |||
145 | * @param optlen length of optval | 145 | * @param optlen length of optval |
146 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 146 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
147 | */ | 147 | */ |
148 | int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle | 148 | int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, |
149 | *desc, int level, int optname, | 149 | int level, int optname, void *optval, |
150 | void *optval, socklen_t * optlen); | 150 | socklen_t * optlen); |
151 | 151 | ||
152 | 152 | ||
153 | /** | 153 | /** |
@@ -165,9 +165,8 @@ int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, | |||
165 | * How much data is available to be read on this descriptor? | 165 | * How much data is available to be read on this descriptor? |
166 | * @param desc socket | 166 | * @param desc socket |
167 | */ | 167 | */ |
168 | ssize_t | 168 | ssize_t GNUNET_NETWORK_socket_recvfrom_amount (const struct |
169 | GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle | 169 | GNUNET_NETWORK_Handle *desc); |
170 | *desc); | ||
171 | 170 | ||
172 | 171 | ||
173 | /** | 172 | /** |
@@ -179,17 +178,12 @@ GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle | |||
179 | * to be filled in by recvfrom | 178 | * to be filled in by recvfrom |
180 | * @param addrlen length of the addr | 179 | * @param addrlen length of the addr |
181 | */ | 180 | */ |
182 | ssize_t | 181 | ssize_t GNUNET_NETWORK_socket_recvfrom (const struct |
183 | 182 | GNUNET_NETWORK_Handle | |
184 | 183 | *desc, void *buffer, | |
185 | 184 | size_t length, | |
186 | 185 | struct sockaddr *src_addr, | |
187 | 186 | socklen_t * addrlen); | |
188 | |||
189 | |||
190 | GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, | ||
191 | void *buffer, size_t length, | ||
192 | struct sockaddr *src_addr, socklen_t * addrlen); | ||
193 | 187 | ||
194 | 188 | ||
195 | /** | 189 | /** |
@@ -241,9 +235,8 @@ ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | |||
241 | * @param dest_len length of address | 235 | * @param dest_len length of address |
242 | * @return number of bytes sent, GNUNET_SYSERR on error | 236 | * @return number of bytes sent, GNUNET_SYSERR on error |
243 | */ | 237 | */ |
244 | ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle | 238 | ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, |
245 | *desc, const void *message, | 239 | const void *message, size_t length, |
246 | size_t length, | ||
247 | const struct sockaddr *dest_addr, | 240 | const struct sockaddr *dest_addr, |
248 | socklen_t dest_len); | 241 | socklen_t dest_len); |
249 | 242 | ||
@@ -326,9 +319,9 @@ void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | |||
326 | * @param fds fd set | 319 | * @param fds fd set |
327 | * @param h the file handle to add | 320 | * @param h the file handle to add |
328 | */ | 321 | */ |
329 | void | 322 | void GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct |
330 | GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet | 323 | GNUNET_NETWORK_FDSet |
331 | *fds, HANDLE h); | 324 | *fds, HANDLE h); |
332 | #endif | 325 | #endif |
333 | 326 | ||
334 | 327 | ||
@@ -395,9 +388,8 @@ void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); | |||
395 | * @param nfd native FD to test, -1 for none | 388 | * @param nfd native FD to test, -1 for none |
396 | * @return GNUNET_YES if to contains nfd | 389 | * @return GNUNET_YES if to contains nfd |
397 | */ | 390 | */ |
398 | int | 391 | int GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, |
399 | GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | 392 | int nfd); |
400 | int nfd); | ||
401 | 393 | ||
402 | 394 | ||
403 | /** | 395 | /** |
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index b285e3b60..d2474d2d8 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h | |||
@@ -149,8 +149,7 @@ char *GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind | |||
149 | * @param addrlen length of the address | 149 | * @param addrlen length of the address |
150 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort | 150 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort |
151 | */ | 151 | */ |
152 | typedef int (*GNUNET_OS_NetworkInterfaceProcessor) (void *cls, | 152 | typedef int (*GNUNET_OS_NetworkInterfaceProcessor) (void *cls, const char *name, |
153 | const char *name, | ||
154 | int isDefault, | 153 | int isDefault, |
155 | const struct sockaddr * | 154 | const struct sockaddr * |
156 | addr, socklen_t addrlen); | 155 | addr, socklen_t addrlen); |
@@ -342,10 +341,10 @@ int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | |||
342 | /** | 341 | /** |
343 | * Connects this process to its parent via pipe | 342 | * Connects this process to its parent via pipe |
344 | */ | 343 | */ |
345 | void | 344 | void GNUNET_OS_install_parent_control_handler (void *cls, |
346 | GNUNET_OS_install_parent_control_handler (void *cls, | 345 | const struct |
347 | const struct | 346 | GNUNET_SCHEDULER_TaskContext |
348 | GNUNET_SCHEDULER_TaskContext *tc); | 347 | *tc); |
349 | 348 | ||
350 | 349 | ||
351 | /** | 350 | /** |
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h index 04c63cbb1..2013eb60f 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h | |||
@@ -83,9 +83,8 @@ void GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | |||
83 | * @param h handle to the peerinfo service | 83 | * @param h handle to the peerinfo service |
84 | * @param hello the verified (!) HELLO message | 84 | * @param hello the verified (!) HELLO message |
85 | */ | 85 | */ |
86 | void | 86 | void GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, |
87 | GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, | 87 | const struct GNUNET_HELLO_Message *hello); |
88 | const struct GNUNET_HELLO_Message *hello); | ||
89 | 88 | ||
90 | 89 | ||
91 | /** | 90 | /** |
@@ -97,11 +96,11 @@ GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, | |||
97 | * @param hello hello message for the peer (can be NULL) | 96 | * @param hello hello message for the peer (can be NULL) |
98 | * @param error message | 97 | * @param error message |
99 | */ | 98 | */ |
100 | typedef void | 99 | typedef void (*GNUNET_PEERINFO_Processor) (void *cls, |
101 | (*GNUNET_PEERINFO_Processor) (void *cls, | 100 | const struct GNUNET_PeerIdentity * |
102 | const struct GNUNET_PeerIdentity * peer, | 101 | peer, |
103 | const struct GNUNET_HELLO_Message * hello, | 102 | const struct GNUNET_HELLO_Message * |
104 | const char *err_msg); | 103 | hello, const char *err_msg); |
105 | 104 | ||
106 | 105 | ||
107 | /** | 106 | /** |
@@ -148,8 +147,8 @@ struct GNUNET_PEERINFO_IteratorContext *GNUNET_PEERINFO_iterate (struct | |||
148 | * | 147 | * |
149 | * @param ic context of the iterator to cancel | 148 | * @param ic context of the iterator to cancel |
150 | */ | 149 | */ |
151 | void | 150 | void GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext |
152 | GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic); | 151 | *ic); |
153 | 152 | ||
154 | 153 | ||
155 | 154 | ||
diff --git a/src/include/gnunet_program_lib.h b/src/include/gnunet_program_lib.h index b01703f05..8881bfa9d 100644 --- a/src/include/gnunet_program_lib.h +++ b/src/include/gnunet_program_lib.h | |||
@@ -47,8 +47,7 @@ extern "C" | |||
47 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) | 47 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) |
48 | * @param cfg configuration | 48 | * @param cfg configuration |
49 | */ | 49 | */ |
50 | typedef void (*GNUNET_PROGRAM_Main) (void *cls, | 50 | typedef void (*GNUNET_PROGRAM_Main) (void *cls, char *const *args, |
51 | char *const *args, | ||
52 | const char *cfgfile, | 51 | const char *cfgfile, |
53 | const struct GNUNET_CONFIGURATION_Handle * | 52 | const struct GNUNET_CONFIGURATION_Handle * |
54 | cfg); | 53 | cfg); |
@@ -67,9 +66,7 @@ typedef void (*GNUNET_PROGRAM_Main) (void *cls, | |||
67 | * @param task_cls closure for task | 66 | * @param task_cls closure for task |
68 | * @return GNUNET_SYSERR on error, GNUNET_OK on success | 67 | * @return GNUNET_SYSERR on error, GNUNET_OK on success |
69 | */ | 68 | */ |
70 | int GNUNET_PROGRAM_run (int argc, | 69 | int GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName, |
71 | char *const *argv, | ||
72 | const char *binaryName, | ||
73 | const char *binaryHelp, | 70 | const char *binaryHelp, |
74 | const struct GNUNET_GETOPT_CommandLineOption *options, | 71 | const struct GNUNET_GETOPT_CommandLineOption *options, |
75 | GNUNET_PROGRAM_Main task, void *task_cls); | 72 | GNUNET_PROGRAM_Main task, void *task_cls); |
diff --git a/src/include/gnunet_pseudonym_lib.h b/src/include/gnunet_pseudonym_lib.h index a0f202a3c..7a9373cc4 100644 --- a/src/include/gnunet_pseudonym_lib.h +++ b/src/include/gnunet_pseudonym_lib.h | |||
@@ -49,11 +49,9 @@ extern "C" | |||
49 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort | 49 | * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort |
50 | */ | 50 | */ |
51 | typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls, | 51 | typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls, |
52 | const GNUNET_HashCode * | 52 | const GNUNET_HashCode * pseudonym, |
53 | pseudonym, | 53 | const struct GNUNET_CONTAINER_MetaData |
54 | const struct | 54 | * md, int rating); |
55 | GNUNET_CONTAINER_MetaData * md, | ||
56 | int rating); | ||
57 | 55 | ||
58 | /** | 56 | /** |
59 | * Change the ranking of a pseudonym. | 57 | * Change the ranking of a pseudonym. |
@@ -105,9 +103,8 @@ int GNUNET_PSEUDONYM_discovery_callback_register (const struct | |||
105 | /** | 103 | /** |
106 | * Unregister namespace discovery callback. | 104 | * Unregister namespace discovery callback. |
107 | */ | 105 | */ |
108 | int | 106 | int GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator |
109 | GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator | 107 | iterator, void *closure); |
110 | iterator, void *closure); | ||
111 | 108 | ||
112 | /** | 109 | /** |
113 | * Return the unique, human readable name for the given pseudonym. | 110 | * Return the unique, human readable name for the given pseudonym. |
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index c09153e31..9ab3a3a84 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h | |||
@@ -190,8 +190,8 @@ struct GNUNET_SCHEDULER_TaskContext | |||
190 | * @param tc context information (why was this task triggered now) | 190 | * @param tc context information (why was this task triggered now) |
191 | */ | 191 | */ |
192 | typedef void (*GNUNET_SCHEDULER_Task) (void *cls, | 192 | typedef void (*GNUNET_SCHEDULER_Task) (void *cls, |
193 | const struct | 193 | const struct GNUNET_SCHEDULER_TaskContext |
194 | GNUNET_SCHEDULER_TaskContext * tc); | 194 | * tc); |
195 | 195 | ||
196 | 196 | ||
197 | /** | 197 | /** |
@@ -280,10 +280,9 @@ void *GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); | |||
280 | * @param task_cls closure of task | 280 | * @param task_cls closure of task |
281 | * @param reason reason for task invocation | 281 | * @param reason reason for task invocation |
282 | */ | 282 | */ |
283 | void | 283 | void GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, |
284 | GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, | 284 | void *task_cls, |
285 | void *task_cls, | 285 | enum GNUNET_SCHEDULER_Reason reason); |
286 | enum GNUNET_SCHEDULER_Reason reason); | ||
287 | 286 | ||
288 | 287 | ||
289 | /** | 288 | /** |
@@ -316,9 +315,13 @@ GNUNET_SCHEDULER_add_after (GNUNET_SCHEDULER_TaskIdentifier prerequisite_task, | |||
316 | * @return unique task identifier for the job | 315 | * @return unique task identifier for the job |
317 | * only valid until "task" is started! | 316 | * only valid until "task" is started! |
318 | */ | 317 | */ |
319 | GNUNET_SCHEDULER_TaskIdentifier | 318 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_with_priority (enum |
320 | GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, | 319 | GNUNET_SCHEDULER_Priority |
321 | GNUNET_SCHEDULER_Task task, void *task_cls); | 320 | prio, |
321 | GNUNET_SCHEDULER_Task | ||
322 | task, | ||
323 | void | ||
324 | *task_cls); | ||
322 | 325 | ||
323 | 326 | ||
324 | /** | 327 | /** |
@@ -330,8 +333,8 @@ GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, | |||
330 | * @return unique task identifier for the job | 333 | * @return unique task identifier for the job |
331 | * only valid until "task" is started! | 334 | * only valid until "task" is started! |
332 | */ | 335 | */ |
333 | GNUNET_SCHEDULER_TaskIdentifier | 336 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task |
334 | GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls); | 337 | task, void *task_cls); |
335 | 338 | ||
336 | 339 | ||
337 | /** | 340 | /** |
@@ -348,10 +351,12 @@ GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls); | |||
348 | * @return unique task identifier for the job | 351 | * @return unique task identifier for the job |
349 | * only valid until "task" is started! | 352 | * only valid until "task" is started! |
350 | */ | 353 | */ |
351 | GNUNET_SCHEDULER_TaskIdentifier | 354 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now_with_lifeness (int |
352 | GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, | 355 | lifeness, |
353 | GNUNET_SCHEDULER_Task task, | 356 | GNUNET_SCHEDULER_Task |
354 | void *task_cls); | 357 | task, |
358 | void | ||
359 | *task_cls); | ||
355 | 360 | ||
356 | 361 | ||
357 | /** | 362 | /** |
@@ -366,9 +371,12 @@ GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, | |||
366 | * @return unique task identifier for the job | 371 | * @return unique task identifier for the job |
367 | * only valid until "task" is started! | 372 | * only valid until "task" is started! |
368 | */ | 373 | */ |
369 | GNUNET_SCHEDULER_TaskIdentifier | 374 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_delayed (struct |
370 | GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, | 375 | GNUNET_TIME_Relative |
371 | GNUNET_SCHEDULER_Task task, void *task_cls); | 376 | delay, |
377 | GNUNET_SCHEDULER_Task | ||
378 | task, | ||
379 | void *task_cls); | ||
372 | 380 | ||
373 | 381 | ||
374 | /** | 382 | /** |
@@ -387,10 +395,15 @@ GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, | |||
387 | * @return unique task identifier for the job | 395 | * @return unique task identifier for the job |
388 | * only valid until "task" is started! | 396 | * only valid until "task" is started! |
389 | */ | 397 | */ |
390 | GNUNET_SCHEDULER_TaskIdentifier | 398 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_net (struct |
391 | GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, | 399 | GNUNET_TIME_Relative |
392 | struct GNUNET_NETWORK_Handle *rfd, | 400 | delay, |
393 | GNUNET_SCHEDULER_Task task, void *task_cls); | 401 | struct |
402 | GNUNET_NETWORK_Handle | ||
403 | *rfd, | ||
404 | GNUNET_SCHEDULER_Task | ||
405 | task, | ||
406 | void *task_cls); | ||
394 | 407 | ||
395 | 408 | ||
396 | /** | 409 | /** |
@@ -409,10 +422,15 @@ GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, | |||
409 | * @return unique task identifier for the job | 422 | * @return unique task identifier for the job |
410 | * only valid until "task" is started! | 423 | * only valid until "task" is started! |
411 | */ | 424 | */ |
412 | GNUNET_SCHEDULER_TaskIdentifier | 425 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_net (struct |
413 | GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, | 426 | GNUNET_TIME_Relative |
414 | struct GNUNET_NETWORK_Handle *wfd, | 427 | delay, |
415 | GNUNET_SCHEDULER_Task task, void *task_cls); | 428 | struct |
429 | GNUNET_NETWORK_Handle | ||
430 | *wfd, | ||
431 | GNUNET_SCHEDULER_Task | ||
432 | task, | ||
433 | void *task_cls); | ||
416 | 434 | ||
417 | 435 | ||
418 | /** | 436 | /** |
@@ -431,10 +449,15 @@ GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, | |||
431 | * @return unique task identifier for the job | 449 | * @return unique task identifier for the job |
432 | * only valid until "task" is started! | 450 | * only valid until "task" is started! |
433 | */ | 451 | */ |
434 | GNUNET_SCHEDULER_TaskIdentifier | 452 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_file (struct |
435 | GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, | 453 | GNUNET_TIME_Relative |
436 | const struct GNUNET_DISK_FileHandle *rfd, | 454 | delay, |
437 | GNUNET_SCHEDULER_Task task, void *task_cls); | 455 | const struct |
456 | GNUNET_DISK_FileHandle | ||
457 | *rfd, | ||
458 | GNUNET_SCHEDULER_Task | ||
459 | task, | ||
460 | void *task_cls); | ||
438 | 461 | ||
439 | 462 | ||
440 | /** | 463 | /** |
@@ -453,10 +476,16 @@ GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, | |||
453 | * @return unique task identifier for the job | 476 | * @return unique task identifier for the job |
454 | * only valid until "task" is started! | 477 | * only valid until "task" is started! |
455 | */ | 478 | */ |
456 | GNUNET_SCHEDULER_TaskIdentifier | 479 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_file (struct |
457 | GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, | 480 | GNUNET_TIME_Relative |
458 | const struct GNUNET_DISK_FileHandle *wfd, | 481 | delay, |
459 | GNUNET_SCHEDULER_Task task, void *task_cls); | 482 | const struct |
483 | GNUNET_DISK_FileHandle | ||
484 | *wfd, | ||
485 | GNUNET_SCHEDULER_Task | ||
486 | task, | ||
487 | void | ||
488 | *task_cls); | ||
460 | 489 | ||
461 | 490 | ||
462 | /** | 491 | /** |
@@ -491,14 +520,23 @@ GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, | |||
491 | * @return unique task identifier for the job | 520 | * @return unique task identifier for the job |
492 | * only valid until "task" is started! | 521 | * only valid until "task" is started! |
493 | */ | 522 | */ |
494 | GNUNET_SCHEDULER_TaskIdentifier | 523 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_select (enum |
495 | GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, | 524 | GNUNET_SCHEDULER_Priority |
496 | GNUNET_SCHEDULER_TaskIdentifier | 525 | prio, |
497 | prerequisite_task, | 526 | GNUNET_SCHEDULER_TaskIdentifier |
498 | struct GNUNET_TIME_Relative delay, | 527 | prerequisite_task, |
499 | const struct GNUNET_NETWORK_FDSet *rs, | 528 | struct |
500 | const struct GNUNET_NETWORK_FDSet *ws, | 529 | GNUNET_TIME_Relative |
501 | GNUNET_SCHEDULER_Task task, void *task_cls); | 530 | delay, |
531 | const struct | ||
532 | GNUNET_NETWORK_FDSet | ||
533 | *rs, | ||
534 | const struct | ||
535 | GNUNET_NETWORK_FDSet | ||
536 | *ws, | ||
537 | GNUNET_SCHEDULER_Task | ||
538 | task, | ||
539 | void *task_cls); | ||
502 | 540 | ||
503 | /** | 541 | /** |
504 | * Sets the select function to use in the scheduler (scheduler_select). | 542 | * Sets the select function to use in the scheduler (scheduler_select). |
@@ -506,9 +544,8 @@ GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, | |||
506 | * @param new_select new select function to use (NULL to reset to default) | 544 | * @param new_select new select function to use (NULL to reset to default) |
507 | * @param new_select_cls closure for 'new_select' | 545 | * @param new_select_cls closure for 'new_select' |
508 | */ | 546 | */ |
509 | void | 547 | void GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, |
510 | GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, | 548 | void *new_select_cls); |
511 | void *new_select_cls); | ||
512 | 549 | ||
513 | 550 | ||
514 | #if 0 /* keep Emacsens' auto-indent happy */ | 551 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h index e4b856db0..d9663ac82 100644 --- a/src/include/gnunet_server_lib.h +++ b/src/include/gnunet_server_lib.h | |||
@@ -73,8 +73,8 @@ struct GNUNET_SERVER_Client; | |||
73 | typedef void (*GNUNET_SERVER_MessageCallback) (void *cls, | 73 | typedef void (*GNUNET_SERVER_MessageCallback) (void *cls, |
74 | struct GNUNET_SERVER_Client * | 74 | struct GNUNET_SERVER_Client * |
75 | client, | 75 | client, |
76 | const struct | 76 | const struct GNUNET_MessageHeader |
77 | GNUNET_MessageHeader * message); | 77 | * message); |
78 | 78 | ||
79 | 79 | ||
80 | 80 | ||
@@ -173,10 +173,9 @@ void GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); | |||
173 | * the handlers array must exist until removed | 173 | * the handlers array must exist until removed |
174 | * (or server is destroyed). | 174 | * (or server is destroyed). |
175 | */ | 175 | */ |
176 | void | 176 | void GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, |
177 | GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, | 177 | const struct GNUNET_SERVER_MessageHandler |
178 | const struct GNUNET_SERVER_MessageHandler | 178 | *handlers); |
179 | *handlers); | ||
180 | 179 | ||
181 | 180 | ||
182 | /** | 181 | /** |
@@ -222,8 +221,8 @@ void GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); | |||
222 | * GNUNET_SYSERR to close the connection (signal | 221 | * GNUNET_SYSERR to close the connection (signal |
223 | * serious error) | 222 | * serious error) |
224 | */ | 223 | */ |
225 | void | 224 | void GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, |
226 | GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, int success); | 225 | int success); |
227 | 226 | ||
228 | 227 | ||
229 | /** | 228 | /** |
@@ -234,9 +233,8 @@ GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, int success); | |||
234 | * @param client the client to update | 233 | * @param client the client to update |
235 | * @param timeout new timeout for activities on the socket | 234 | * @param timeout new timeout for activities on the socket |
236 | */ | 235 | */ |
237 | void | 236 | void GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, |
238 | GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, | 237 | struct GNUNET_TIME_Relative timeout); |
239 | struct GNUNET_TIME_Relative timeout); | ||
240 | 238 | ||
241 | 239 | ||
242 | /** | 240 | /** |
@@ -246,9 +244,8 @@ GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, | |||
246 | * | 244 | * |
247 | * @param client client for which to disable the warning | 245 | * @param client client for which to disable the warning |
248 | */ | 246 | */ |
249 | void | 247 | void GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client |
250 | GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client | 248 | *client); |
251 | *client); | ||
252 | 249 | ||
253 | 250 | ||
254 | /** | 251 | /** |
@@ -266,10 +263,9 @@ GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client | |||
266 | * GNUNET_SYSERR if the connection to the | 263 | * GNUNET_SYSERR if the connection to the |
267 | * client should be shut down | 264 | * client should be shut down |
268 | */ | 265 | */ |
269 | int | 266 | int GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, |
270 | GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, | 267 | struct GNUNET_SERVER_Client *sender, |
271 | struct GNUNET_SERVER_Client *sender, | 268 | const struct GNUNET_MessageHeader *message); |
272 | const struct GNUNET_MessageHeader *message); | ||
273 | 269 | ||
274 | 270 | ||
275 | /** | 271 | /** |
@@ -334,8 +330,8 @@ int GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, | |||
334 | * for the last call when the server is destroyed | 330 | * for the last call when the server is destroyed |
335 | */ | 331 | */ |
336 | typedef void (*GNUNET_SERVER_DisconnectCallback) (void *cls, | 332 | typedef void (*GNUNET_SERVER_DisconnectCallback) (void *cls, |
337 | struct GNUNET_SERVER_Client | 333 | struct GNUNET_SERVER_Client * |
338 | * client); | 334 | client); |
339 | 335 | ||
340 | 336 | ||
341 | /** | 337 | /** |
@@ -353,8 +349,8 @@ typedef void (*GNUNET_SERVER_DisconnectCallback) (void *cls, | |||
353 | * @param callback_cls closure for callback | 349 | * @param callback_cls closure for callback |
354 | */ | 350 | */ |
355 | void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, | 351 | void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, |
356 | GNUNET_SERVER_DisconnectCallback | 352 | GNUNET_SERVER_DisconnectCallback callback, |
357 | callback, void *callback_cls); | 353 | void *callback_cls); |
358 | 354 | ||
359 | 355 | ||
360 | /** | 356 | /** |
@@ -392,8 +388,8 @@ void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); | |||
392 | * @param h server handle | 388 | * @param h server handle |
393 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 389 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
394 | */ | 390 | */ |
395 | void | 391 | void GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, |
396 | GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, int do_ignore); | 392 | int do_ignore); |
397 | 393 | ||
398 | 394 | ||
399 | 395 | ||
@@ -438,10 +434,10 @@ struct GNUNET_SERVER_TransmitContext | |||
438 | * @param length length of data | 434 | * @param length length of data |
439 | * @param type type of the message | 435 | * @param type type of the message |
440 | */ | 436 | */ |
441 | void | 437 | void GNUNET_SERVER_transmit_context_append_data (struct |
442 | GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext | 438 | GNUNET_SERVER_TransmitContext |
443 | *tc, const void *data, | 439 | *tc, const void *data, |
444 | size_t length, uint16_t type); | 440 | size_t length, uint16_t type); |
445 | 441 | ||
446 | 442 | ||
447 | /** | 443 | /** |
@@ -452,12 +448,11 @@ GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext | |||
452 | * @param tc context to use | 448 | * @param tc context to use |
453 | * @param msg message to append | 449 | * @param msg message to append |
454 | */ | 450 | */ |
455 | void | 451 | void GNUNET_SERVER_transmit_context_append_message (struct |
456 | GNUNET_SERVER_transmit_context_append_message (struct | 452 | GNUNET_SERVER_TransmitContext |
457 | GNUNET_SERVER_TransmitContext | 453 | *tc, |
458 | *tc, | 454 | const struct |
459 | const struct GNUNET_MessageHeader | 455 | GNUNET_MessageHeader *msg); |
460 | *msg); | ||
461 | 456 | ||
462 | 457 | ||
463 | /** | 458 | /** |
@@ -469,9 +464,9 @@ GNUNET_SERVER_transmit_context_append_message (struct | |||
469 | * @param tc transmission context to use | 464 | * @param tc transmission context to use |
470 | * @param timeout when to time out and abort the transmission | 465 | * @param timeout when to time out and abort the transmission |
471 | */ | 466 | */ |
472 | void | 467 | void GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext |
473 | GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext *tc, | 468 | *tc, |
474 | struct GNUNET_TIME_Relative timeout); | 469 | struct GNUNET_TIME_Relative timeout); |
475 | 470 | ||
476 | 471 | ||
477 | 472 | ||
@@ -506,10 +501,9 @@ struct GNUNET_SERVER_NotificationContext | |||
506 | * | 501 | * |
507 | * @param nc context to destroy. | 502 | * @param nc context to destroy. |
508 | */ | 503 | */ |
509 | void | 504 | void GNUNET_SERVER_notification_context_destroy (struct |
510 | GNUNET_SERVER_notification_context_destroy (struct | 505 | GNUNET_SERVER_NotificationContext |
511 | GNUNET_SERVER_NotificationContext | 506 | *nc); |
512 | *nc); | ||
513 | 507 | ||
514 | 508 | ||
515 | /** | 509 | /** |
@@ -518,10 +512,11 @@ GNUNET_SERVER_notification_context_destroy (struct | |||
518 | * @param nc context to modify | 512 | * @param nc context to modify |
519 | * @param client client to add | 513 | * @param client client to add |
520 | */ | 514 | */ |
521 | void | 515 | void GNUNET_SERVER_notification_context_add (struct |
522 | GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext | 516 | GNUNET_SERVER_NotificationContext |
523 | *nc, | 517 | *nc, |
524 | struct GNUNET_SERVER_Client *client); | 518 | struct GNUNET_SERVER_Client |
519 | *client); | ||
525 | 520 | ||
526 | 521 | ||
527 | /** | 522 | /** |
@@ -533,13 +528,14 @@ GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext | |||
533 | * @param msg message to send | 528 | * @param msg message to send |
534 | * @param can_drop can this message be dropped due to queue length limitations | 529 | * @param can_drop can this message be dropped due to queue length limitations |
535 | */ | 530 | */ |
536 | void | 531 | void GNUNET_SERVER_notification_context_unicast (struct |
537 | GNUNET_SERVER_notification_context_unicast (struct | 532 | GNUNET_SERVER_NotificationContext |
538 | GNUNET_SERVER_NotificationContext | 533 | *nc, |
539 | *nc, | 534 | struct GNUNET_SERVER_Client |
540 | struct GNUNET_SERVER_Client *client, | 535 | *client, |
541 | const struct GNUNET_MessageHeader | 536 | const struct |
542 | *msg, int can_drop); | 537 | GNUNET_MessageHeader *msg, |
538 | int can_drop); | ||
543 | 539 | ||
544 | 540 | ||
545 | /** | 541 | /** |
@@ -549,12 +545,12 @@ GNUNET_SERVER_notification_context_unicast (struct | |||
549 | * @param msg message to send | 545 | * @param msg message to send |
550 | * @param can_drop can this message be dropped due to queue length limitations | 546 | * @param can_drop can this message be dropped due to queue length limitations |
551 | */ | 547 | */ |
552 | void | 548 | void GNUNET_SERVER_notification_context_broadcast (struct |
553 | GNUNET_SERVER_notification_context_broadcast (struct | 549 | GNUNET_SERVER_NotificationContext |
554 | GNUNET_SERVER_NotificationContext | 550 | *nc, |
555 | *nc, | 551 | const struct |
556 | const struct GNUNET_MessageHeader | 552 | GNUNET_MessageHeader *msg, |
557 | *msg, int can_drop); | 553 | int can_drop); |
558 | 554 | ||
559 | 555 | ||
560 | 556 | ||
@@ -571,8 +567,7 @@ struct GNUNET_SERVER_MessageStreamTokenizer; | |||
571 | * @param client identification of the client | 567 | * @param client identification of the client |
572 | * @param message the actual message | 568 | * @param message the actual message |
573 | */ | 569 | */ |
574 | typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, | 570 | typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, void *client, |
575 | void *client, | ||
576 | const struct | 571 | const struct |
577 | GNUNET_MessageHeader * | 572 | GNUNET_MessageHeader * |
578 | message); | 573 | message); |
@@ -606,11 +601,9 @@ struct GNUNET_SERVER_MessageStreamTokenizer | |||
606 | * GNUNET_NO if one_shot was set and we have another message ready | 601 | * GNUNET_NO if one_shot was set and we have another message ready |
607 | * GNUNET_SYSERR if the data stream is corrupt | 602 | * GNUNET_SYSERR if the data stream is corrupt |
608 | */ | 603 | */ |
609 | int | 604 | int GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, |
610 | GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, | 605 | void *client_identity, const char *buf, |
611 | void *client_identity, | 606 | size_t size, int purge, int one_shot); |
612 | const char *buf, | ||
613 | size_t size, int purge, int one_shot); | ||
614 | 607 | ||
615 | 608 | ||
616 | /** | 609 | /** |
@@ -618,8 +611,8 @@ GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, | |||
618 | * | 611 | * |
619 | * @param mst tokenizer to destroy | 612 | * @param mst tokenizer to destroy |
620 | */ | 613 | */ |
621 | void | 614 | void GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer |
622 | GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer *mst); | 615 | *mst); |
623 | 616 | ||
624 | 617 | ||
625 | #if 0 /* keep Emacsens' auto-indent happy */ | 618 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h index fca2ff329..79453cbf6 100644 --- a/src/include/gnunet_service_lib.h +++ b/src/include/gnunet_service_lib.h | |||
@@ -59,11 +59,11 @@ extern "C" | |||
59 | * zero (in this case, '*addrs' and '*addr_lens' will be | 59 | * zero (in this case, '*addrs' and '*addr_lens' will be |
60 | * set to NULL). | 60 | * set to NULL). |
61 | */ | 61 | */ |
62 | int | 62 | int GNUNET_SERVICE_get_server_addresses (const char *serviceName, |
63 | GNUNET_SERVICE_get_server_addresses (const char *serviceName, | 63 | const struct |
64 | const struct GNUNET_CONFIGURATION_Handle | 64 | GNUNET_CONFIGURATION_Handle *cfg, |
65 | *cfg, struct sockaddr ***addrs, | 65 | struct sockaddr ***addrs, |
66 | socklen_t ** addr_lens); | 66 | socklen_t ** addr_lens); |
67 | 67 | ||
68 | 68 | ||
69 | /** | 69 | /** |
@@ -111,12 +111,9 @@ enum GNUNET_SERVICE_Options | |||
111 | * @return GNUNET_SYSERR on error, GNUNET_OK | 111 | * @return GNUNET_SYSERR on error, GNUNET_OK |
112 | * if we shutdown nicely | 112 | * if we shutdown nicely |
113 | */ | 113 | */ |
114 | int | 114 | int GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName, |
115 | GNUNET_SERVICE_run (int argc, | 115 | enum GNUNET_SERVICE_Options opt, |
116 | char *const *argv, | 116 | GNUNET_SERVICE_Main task, void *task_cls); |
117 | const char *serviceName, | ||
118 | enum GNUNET_SERVICE_Options opt, | ||
119 | GNUNET_SERVICE_Main task, void *task_cls); | ||
120 | 117 | ||
121 | 118 | ||
122 | struct GNUNET_SERVICE_Context; | 119 | struct GNUNET_SERVICE_Context; |
diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h index 1807d3de0..90cc612df 100644 --- a/src/include/gnunet_statistics_service.h +++ b/src/include/gnunet_statistics_service.h | |||
@@ -61,10 +61,9 @@ struct GNUNET_STATISTICS_Handle; | |||
61 | * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not | 61 | * @param is_persistent GNUNET_YES if the value is persistent, GNUNET_NO if not |
62 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration | 62 | * @return GNUNET_OK to continue, GNUNET_SYSERR to abort iteration |
63 | */ | 63 | */ |
64 | typedef int (*GNUNET_STATISTICS_Iterator) (void *cls, | 64 | typedef int (*GNUNET_STATISTICS_Iterator) (void *cls, const char *subsystem, |
65 | const char *subsystem, | 65 | const char *name, uint64_t value, |
66 | const char *name, | 66 | int is_persistent); |
67 | uint64_t value, int is_persistent); | ||
68 | 67 | ||
69 | /** | 68 | /** |
70 | * Get handle for the statistics service. | 69 | * Get handle for the statistics service. |
@@ -73,9 +72,11 @@ typedef int (*GNUNET_STATISTICS_Iterator) (void *cls, | |||
73 | * @param cfg services configuration in use | 72 | * @param cfg services configuration in use |
74 | * @return handle to use | 73 | * @return handle to use |
75 | */ | 74 | */ |
76 | struct GNUNET_STATISTICS_Handle | 75 | struct GNUNET_STATISTICS_Handle *GNUNET_STATISTICS_create (const char |
77 | *GNUNET_STATISTICS_create (const char *subsystem, | 76 | *subsystem, |
78 | const struct GNUNET_CONFIGURATION_Handle *cfg); | 77 | const struct |
78 | GNUNET_CONFIGURATION_Handle | ||
79 | *cfg); | ||
79 | 80 | ||
80 | 81 | ||
81 | /** | 82 | /** |
@@ -102,11 +103,9 @@ void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, | |||
102 | * @param proc_cls closure for proc | 103 | * @param proc_cls closure for proc |
103 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 104 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
104 | */ | 105 | */ |
105 | int | 106 | int GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, |
106 | GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, | 107 | const char *subsystem, const char *name, |
107 | const char *subsystem, | 108 | GNUNET_STATISTICS_Iterator proc, void *proc_cls); |
108 | const char *name, | ||
109 | GNUNET_STATISTICS_Iterator proc, void *proc_cls); | ||
110 | 109 | ||
111 | 110 | ||
112 | /** | 111 | /** |
@@ -169,9 +168,9 @@ void GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); | |||
169 | * @param value new value to set | 168 | * @param value new value to set |
170 | * @param make_persistent should the value be kept across restarts? | 169 | * @param make_persistent should the value be kept across restarts? |
171 | */ | 170 | */ |
172 | void | 171 | void GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, |
173 | GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, | 172 | const char *name, uint64_t value, |
174 | const char *name, uint64_t value, int make_persistent); | 173 | int make_persistent); |
175 | 174 | ||
176 | /** | 175 | /** |
177 | * Set statistic value for the peer. Will always use our | 176 | * Set statistic value for the peer. Will always use our |
@@ -182,9 +181,9 @@ GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, | |||
182 | * @param delta change in value (added to existing value) | 181 | * @param delta change in value (added to existing value) |
183 | * @param make_persistent should the value be kept across restarts? | 182 | * @param make_persistent should the value be kept across restarts? |
184 | */ | 183 | */ |
185 | void | 184 | void GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, |
186 | GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, | 185 | const char *name, int64_t delta, |
187 | const char *name, int64_t delta, int make_persistent); | 186 | int make_persistent); |
188 | 187 | ||
189 | 188 | ||
190 | 189 | ||
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h index 3e15a24c8..dd78aee35 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h | |||
@@ -69,8 +69,8 @@ char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | |||
69 | * @param charset character set to convert from | 69 | * @param charset character set to convert from |
70 | * @return the converted string (0-terminated) | 70 | * @return the converted string (0-terminated) |
71 | */ | 71 | */ |
72 | char *GNUNET_STRINGS_to_utf8 (const char *input, | 72 | char *GNUNET_STRINGS_to_utf8 (const char *input, size_t len, |
73 | size_t len, const char *charset); | 73 | const char *charset); |
74 | 74 | ||
75 | 75 | ||
76 | /** | 76 | /** |
@@ -104,8 +104,8 @@ char *GNUNET_STRINGS_filename_expand (const char *fil); | |||
104 | * @return number of bytes written to the buffer | 104 | * @return number of bytes written to the buffer |
105 | * (or number of bytes that would have been written) | 105 | * (or number of bytes that would have been written) |
106 | */ | 106 | */ |
107 | size_t GNUNET_STRINGS_buffer_fill (char *buffer, | 107 | size_t GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, |
108 | size_t size, unsigned int count, ...); | 108 | unsigned int count, ...); |
109 | 109 | ||
110 | 110 | ||
111 | /** | 111 | /** |
@@ -122,8 +122,7 @@ size_t GNUNET_STRINGS_buffer_fill (char *buffer, | |||
122 | * @return offset of the character after the last 0-termination | 122 | * @return offset of the character after the last 0-termination |
123 | * in the buffer, or 0 on error. | 123 | * in the buffer, or 0 on error. |
124 | */ | 124 | */ |
125 | unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, | 125 | unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, |
126 | size_t size, | ||
127 | unsigned int count, ...); | 126 | unsigned int count, ...); |
128 | 127 | ||
129 | 128 | ||
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 1111f576c..cd673a082 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -490,8 +490,8 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_start (const struct | |||
490 | * | 490 | * |
491 | * @param daemon the daemon to finish starting | 491 | * @param daemon the daemon to finish starting |
492 | */ | 492 | */ |
493 | void | 493 | void GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon |
494 | GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon *daemon); | 494 | *daemon); |
495 | 495 | ||
496 | /** | 496 | /** |
497 | * Check whether the given daemon is running. | 497 | * Check whether the given daemon is running. |
@@ -510,10 +510,9 @@ int GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | |||
510 | * @param cb function called once the daemon is (re)started | 510 | * @param cb function called once the daemon is (re)started |
511 | * @param cb_cls closure for cb | 511 | * @param cb_cls closure for cb |
512 | */ | 512 | */ |
513 | void | 513 | void GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, |
514 | GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, | 514 | GNUNET_TESTING_NotifyDaemonRunning cb, |
515 | GNUNET_TESTING_NotifyDaemonRunning cb, | 515 | void *cb_cls); |
516 | void *cb_cls); | ||
517 | 516 | ||
518 | /** | 517 | /** |
519 | * Start a peer that has previously been stopped using the daemon_stop | 518 | * Start a peer that has previously been stopped using the daemon_stop |
@@ -524,11 +523,10 @@ GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, | |||
524 | * @param cb the callback for notification when the peer is running | 523 | * @param cb the callback for notification when the peer is running |
525 | * @param cb_cls closure for the callback | 524 | * @param cb_cls closure for the callback |
526 | */ | 525 | */ |
527 | void | 526 | void GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, |
528 | GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, | 527 | struct GNUNET_TIME_Relative timeout, |
529 | struct GNUNET_TIME_Relative timeout, | 528 | GNUNET_TESTING_NotifyDaemonRunning cb, |
530 | GNUNET_TESTING_NotifyDaemonRunning cb, | 529 | void *cb_cls); |
531 | void *cb_cls); | ||
532 | 530 | ||
533 | /** | 531 | /** |
534 | * Starts a GNUnet daemon's service. | 532 | * Starts a GNUnet daemon's service. |
@@ -539,12 +537,11 @@ GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, | |||
539 | * @param cb function called once gnunet-arm returns | 537 | * @param cb function called once gnunet-arm returns |
540 | * @param cb_cls closure for cb | 538 | * @param cb_cls closure for cb |
541 | */ | 539 | */ |
542 | void | 540 | void GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, |
543 | GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, | 541 | char *service, |
544 | char *service, | 542 | struct GNUNET_TIME_Relative timeout, |
545 | struct GNUNET_TIME_Relative timeout, | 543 | GNUNET_TESTING_NotifyDaemonRunning cb, |
546 | GNUNET_TESTING_NotifyDaemonRunning cb, | 544 | void *cb_cls); |
547 | void *cb_cls); | ||
548 | 545 | ||
549 | /** | 546 | /** |
550 | * Starts a GNUnet daemon's service which has been previously turned off. | 547 | * Starts a GNUnet daemon's service which has been previously turned off. |
@@ -555,13 +552,12 @@ GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, | |||
555 | * @param cb function called once gnunet-arm returns | 552 | * @param cb function called once gnunet-arm returns |
556 | * @param cb_cls closure for cb | 553 | * @param cb_cls closure for cb |
557 | */ | 554 | */ |
558 | void | 555 | void GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon |
559 | GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d, | 556 | *d, char *service, |
560 | char *service, | 557 | struct GNUNET_TIME_Relative |
561 | struct GNUNET_TIME_Relative | 558 | timeout, |
562 | timeout, | 559 | GNUNET_TESTING_NotifyDaemonRunning |
563 | GNUNET_TESTING_NotifyDaemonRunning | 560 | cb, void *cb_cls); |
564 | cb, void *cb_cls); | ||
565 | 561 | ||
566 | /** | 562 | /** |
567 | * Get a certain testing daemon handle. | 563 | * Get a certain testing daemon handle. |
@@ -603,11 +599,11 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get_by_id (struct | |||
603 | * @param allow_restart GNUNET_YES to restart peer later (using this API) | 599 | * @param allow_restart GNUNET_YES to restart peer later (using this API) |
604 | * GNUNET_NO to kill off and clean up for good | 600 | * GNUNET_NO to kill off and clean up for good |
605 | */ | 601 | */ |
606 | void | 602 | void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, |
607 | GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | 603 | struct GNUNET_TIME_Relative timeout, |
608 | struct GNUNET_TIME_Relative timeout, | 604 | GNUNET_TESTING_NotifyCompletion cb, |
609 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls, | 605 | void *cb_cls, int delete_files, |
610 | int delete_files, int allow_restart); | 606 | int allow_restart); |
611 | 607 | ||
612 | 608 | ||
613 | /** | 609 | /** |
@@ -635,12 +631,11 @@ void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | |||
635 | * @param cb function called once the service was stopped | 631 | * @param cb function called once the service was stopped |
636 | * @param cb_cls closure for cb | 632 | * @param cb_cls closure for cb |
637 | */ | 633 | */ |
638 | void | 634 | void GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, |
639 | GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, | 635 | char *service, |
640 | char *service, | 636 | struct GNUNET_TIME_Relative timeout, |
641 | struct GNUNET_TIME_Relative timeout, | 637 | GNUNET_TESTING_NotifyCompletion cb, |
642 | GNUNET_TESTING_NotifyCompletion cb, | 638 | void *cb_cls); |
643 | void *cb_cls); | ||
644 | 639 | ||
645 | /** | 640 | /** |
646 | * Read a testing hosts file based on a configuration. | 641 | * Read a testing hosts file based on a configuration. |
@@ -715,8 +710,8 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_daemons_start (const struct | |||
715 | * | 710 | * |
716 | * @param pg the peer group to continue starting | 711 | * @param pg the peer group to continue starting |
717 | */ | 712 | */ |
718 | void | 713 | void GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup |
719 | GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); | 714 | *pg); |
720 | 715 | ||
721 | 716 | ||
722 | /** | 717 | /** |
@@ -733,14 +728,13 @@ GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); | |||
733 | * @param cb function to call at the end | 728 | * @param cb function to call at the end |
734 | * @param cb_cls closure for cb | 729 | * @param cb_cls closure for cb |
735 | */ | 730 | */ |
736 | void | 731 | void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, |
737 | GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | 732 | struct GNUNET_TESTING_Daemon *d2, |
738 | struct GNUNET_TESTING_Daemon *d2, | 733 | struct GNUNET_TIME_Relative timeout, |
739 | struct GNUNET_TIME_Relative timeout, | 734 | unsigned int max_connect_attempts, |
740 | unsigned int max_connect_attempts, | 735 | int send_hello, |
741 | int send_hello, | 736 | GNUNET_TESTING_NotifyConnection cb, |
742 | GNUNET_TESTING_NotifyConnection cb, | 737 | void *cb_cls); |
743 | void *cb_cls); | ||
744 | 738 | ||
745 | 739 | ||
746 | /** | 740 | /** |
@@ -750,10 +744,9 @@ GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | |||
750 | * @param callback function to call on completion (or failure) | 744 | * @param callback function to call on completion (or failure) |
751 | * @param callback_cls closure for the callback function | 745 | * @param callback_cls closure for the callback function |
752 | */ | 746 | */ |
753 | void | 747 | void GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, |
754 | GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, | 748 | GNUNET_TESTING_NotifyCompletion callback, |
755 | GNUNET_TESTING_NotifyCompletion callback, | 749 | void *callback_cls); |
756 | void *callback_cls); | ||
757 | 750 | ||
758 | 751 | ||
759 | /** | 752 | /** |
@@ -764,10 +757,10 @@ GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, | |||
764 | * @param cb callback to notify upon success or failure | 757 | * @param cb callback to notify upon success or failure |
765 | * @param cb_cls closure for cb | 758 | * @param cb_cls closure for cb |
766 | */ | 759 | */ |
767 | void | 760 | void GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, |
768 | GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, | 761 | struct GNUNET_TIME_Relative timeout, |
769 | struct GNUNET_TIME_Relative timeout, | 762 | GNUNET_TESTING_NotifyCompletion cb, |
770 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); | 763 | void *cb_cls); |
771 | 764 | ||
772 | 765 | ||
773 | /** | 766 | /** |
@@ -777,8 +770,8 @@ GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, | |||
777 | * | 770 | * |
778 | * @return the number of currently running peers in the peer group | 771 | * @return the number of currently running peers in the peer group |
779 | */ | 772 | */ |
780 | unsigned int | 773 | unsigned int GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup |
781 | GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg); | 774 | *pg); |
782 | 775 | ||
783 | /** | 776 | /** |
784 | * Simulate churn by stopping some peers (and possibly | 777 | * Simulate churn by stopping some peers (and possibly |
@@ -803,13 +796,12 @@ GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg); | |||
803 | * @param cb function to call at the end | 796 | * @param cb function to call at the end |
804 | * @param cb_cls closure for cb | 797 | * @param cb_cls closure for cb |
805 | */ | 798 | */ |
806 | void | 799 | void GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, |
807 | GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, | 800 | char *service, unsigned int voff, |
808 | char *service, | 801 | unsigned int von, |
809 | unsigned int voff, | 802 | struct GNUNET_TIME_Relative timeout, |
810 | unsigned int von, | 803 | GNUNET_TESTING_NotifyCompletion cb, |
811 | struct GNUNET_TIME_Relative timeout, | 804 | void *cb_cls); |
812 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); | ||
813 | /* | 805 | /* |
814 | * Start a given service for each of the peers in the peer group. | 806 | * Start a given service for each of the peers in the peer group. |
815 | * | 807 | * |
@@ -821,12 +813,11 @@ GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, | |||
821 | * @param cb_cls closure for cb | 813 | * @param cb_cls closure for cb |
822 | * | 814 | * |
823 | */ | 815 | */ |
824 | void | 816 | void GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, |
825 | GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, | 817 | char *service, |
826 | char *service, | 818 | struct GNUNET_TIME_Relative timeout, |
827 | struct GNUNET_TIME_Relative timeout, | 819 | GNUNET_TESTING_NotifyCompletion cb, |
828 | GNUNET_TESTING_NotifyCompletion cb, | 820 | void *cb_cls); |
829 | void *cb_cls); | ||
830 | 821 | ||
831 | /** | 822 | /** |
832 | * Callback function to process statistic values. | 823 | * Callback function to process statistic values. |
@@ -856,11 +847,10 @@ typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, | |||
856 | * @param proc processing function for each statistic retrieved | 847 | * @param proc processing function for each statistic retrieved |
857 | * @param cls closure to pass to proc | 848 | * @param cls closure to pass to proc |
858 | */ | 849 | */ |
859 | void | 850 | void GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, |
860 | GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, | 851 | GNUNET_STATISTICS_Callback cont, |
861 | GNUNET_STATISTICS_Callback cont, | 852 | GNUNET_TESTING_STATISTICS_Iterator proc, |
862 | GNUNET_TESTING_STATISTICS_Iterator proc, | 853 | void *cls); |
863 | void *cls); | ||
864 | 854 | ||
865 | /** | 855 | /** |
866 | * Topologies supported for testbeds. | 856 | * Topologies supported for testbeds. |
@@ -975,9 +965,8 @@ enum GNUNET_TESTING_TopologyOption | |||
975 | * @return GNUNET_YES if topology string matched a | 965 | * @return GNUNET_YES if topology string matched a |
976 | * known topology, GNUNET_NO if not | 966 | * known topology, GNUNET_NO if not |
977 | */ | 967 | */ |
978 | int | 968 | int GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, |
979 | GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, | 969 | const char *topology_string); |
980 | const char *topology_string); | ||
981 | 970 | ||
982 | /** | 971 | /** |
983 | * Get connect topology option from string input. | 972 | * Get connect topology option from string input. |
@@ -988,10 +977,9 @@ GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, | |||
988 | * @return GNUNET_YES if topology string matched a | 977 | * @return GNUNET_YES if topology string matched a |
989 | * known topology, GNUNET_NO if not | 978 | * known topology, GNUNET_NO if not |
990 | */ | 979 | */ |
991 | int | 980 | int GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption |
992 | GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption | 981 | *topology_option, |
993 | *topology_option, | 982 | const char *topology_string); |
994 | const char *topology_string); | ||
995 | 983 | ||
996 | 984 | ||
997 | /** | 985 | /** |
@@ -1030,11 +1018,13 @@ GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption | |||
1030 | * @return the maximum number of connections were all allowed peers | 1018 | * @return the maximum number of connections were all allowed peers |
1031 | * connected to each other | 1019 | * connected to each other |
1032 | */ | 1020 | */ |
1033 | unsigned int | 1021 | unsigned int GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup |
1034 | GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg, | 1022 | *pg, |
1035 | enum GNUNET_TESTING_Topology topology, | 1023 | enum GNUNET_TESTING_Topology |
1036 | enum GNUNET_TESTING_Topology restrict_topology, | 1024 | topology, |
1037 | const char *restrict_transports); | 1025 | enum GNUNET_TESTING_Topology |
1026 | restrict_topology, | ||
1027 | const char *restrict_transports); | ||
1038 | 1028 | ||
1039 | /** | 1029 | /** |
1040 | * Iterate over all (running) peers in the peer group, retrieve | 1030 | * Iterate over all (running) peers in the peer group, retrieve |
@@ -1044,9 +1034,8 @@ GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg, | |||
1044 | * @param cb callback for topology information | 1034 | * @param cb callback for topology information |
1045 | * @param cls closure for callback | 1035 | * @param cls closure for callback |
1046 | */ | 1036 | */ |
1047 | void | 1037 | void GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1048 | GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, | 1038 | GNUNET_TESTING_NotifyTopology cb, void *cls); |
1049 | GNUNET_TESTING_NotifyTopology cb, void *cls); | ||
1050 | 1039 | ||
1051 | /** | 1040 | /** |
1052 | * Stop the connection process temporarily. | 1041 | * Stop the connection process temporarily. |
@@ -1084,15 +1073,15 @@ void GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); | |||
1084 | * | 1073 | * |
1085 | * @return the number of connections that will be attempted, GNUNET_SYSERR on error | 1074 | * @return the number of connections that will be attempted, GNUNET_SYSERR on error |
1086 | */ | 1075 | */ |
1087 | int | 1076 | int GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1088 | GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, | 1077 | enum GNUNET_TESTING_Topology topology, |
1089 | enum GNUNET_TESTING_Topology topology, | 1078 | enum GNUNET_TESTING_TopologyOption options, |
1090 | enum GNUNET_TESTING_TopologyOption options, | 1079 | double option_modifier, |
1091 | double option_modifier, | 1080 | struct GNUNET_TIME_Relative |
1092 | struct GNUNET_TIME_Relative connect_timeout, | 1081 | connect_timeout, |
1093 | unsigned int connect_attempts, | 1082 | unsigned int connect_attempts, |
1094 | GNUNET_TESTING_NotifyCompletion | 1083 | GNUNET_TESTING_NotifyCompletion |
1095 | notify_callback, void *notify_cls); | 1084 | notify_callback, void *notify_cls); |
1096 | 1085 | ||
1097 | /** | 1086 | /** |
1098 | * Start or stop an individual peer from the given group. | 1087 | * Start or stop an individual peer from the given group. |
@@ -1104,12 +1093,11 @@ GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, | |||
1104 | * @param cb function to call at the end | 1093 | * @param cb function to call at the end |
1105 | * @param cb_cls closure for cb | 1094 | * @param cb_cls closure for cb |
1106 | */ | 1095 | */ |
1107 | void | 1096 | void GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, |
1108 | GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | 1097 | unsigned int offset, int desired_status, |
1109 | unsigned int offset, | 1098 | struct GNUNET_TIME_Relative timeout, |
1110 | int desired_status, | 1099 | GNUNET_TESTING_NotifyCompletion cb, |
1111 | struct GNUNET_TIME_Relative timeout, | 1100 | void *cb_cls); |
1112 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); | ||
1113 | 1101 | ||
1114 | /** | 1102 | /** |
1115 | * Start a peer group with a given number of peers. Notify | 1103 | * Start a peer group with a given number of peers. Notify |
@@ -1155,11 +1143,11 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_peergroup_start (const struct | |||
1155 | * @param notify_cb_cls closure for notify_cb | 1143 | * @param notify_cb_cls closure for notify_cb |
1156 | * | 1144 | * |
1157 | */ | 1145 | */ |
1158 | void | 1146 | void GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup |
1159 | GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup *pg, | 1147 | *pg, |
1160 | const char *output_filename, | 1148 | const char *output_filename, |
1161 | GNUNET_TESTING_NotifyCompletion | 1149 | GNUNET_TESTING_NotifyCompletion |
1162 | notify_cb, void *notify_cb_cls); | 1150 | notify_cb, void *notify_cb_cls); |
1163 | 1151 | ||
1164 | 1152 | ||
1165 | #if 0 /* keep Emacsens' auto-indent happy */ | 1153 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index be35ff131..ffae1ce51 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h | |||
@@ -199,8 +199,7 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct | |||
199 | * @return timestamp that is smaller | 199 | * @return timestamp that is smaller |
200 | */ | 200 | */ |
201 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct | 201 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct |
202 | GNUNET_TIME_Relative | 202 | GNUNET_TIME_Relative t1, |
203 | t1, | ||
204 | struct | 203 | struct |
205 | GNUNET_TIME_Relative t2); | 204 | GNUNET_TIME_Relative t2); |
206 | 205 | ||
@@ -213,8 +212,7 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct | |||
213 | * @return timestamp that is larger | 212 | * @return timestamp that is larger |
214 | */ | 213 | */ |
215 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct | 214 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct |
216 | GNUNET_TIME_Relative | 215 | GNUNET_TIME_Relative t1, |
217 | t1, | ||
218 | struct | 216 | struct |
219 | GNUNET_TIME_Relative t2); | 217 | GNUNET_TIME_Relative t2); |
220 | 218 | ||
@@ -226,8 +224,7 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct | |||
226 | * @return timestamp that is smaller | 224 | * @return timestamp that is smaller |
227 | */ | 225 | */ |
228 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct | 226 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct |
229 | GNUNET_TIME_Absolute | 227 | GNUNET_TIME_Absolute t1, |
230 | t1, | ||
231 | struct | 228 | struct |
232 | GNUNET_TIME_Absolute t2); | 229 | GNUNET_TIME_Absolute t2); |
233 | 230 | ||
@@ -239,8 +236,7 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct | |||
239 | * @return timestamp that is smaller | 236 | * @return timestamp that is smaller |
240 | */ | 237 | */ |
241 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct | 238 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct |
242 | GNUNET_TIME_Absolute | 239 | GNUNET_TIME_Absolute t1, |
243 | t1, | ||
244 | struct | 240 | struct |
245 | GNUNET_TIME_Absolute t2); | 241 | GNUNET_TIME_Absolute t2); |
246 | 242 | ||
@@ -374,9 +370,12 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct | |||
374 | * @param a2 second timestamp | 370 | * @param a2 second timestamp |
375 | * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise | 371 | * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise |
376 | */ | 372 | */ |
377 | struct GNUNET_TIME_Relative | 373 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract (struct |
378 | GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, | 374 | GNUNET_TIME_Relative |
379 | struct GNUNET_TIME_Relative a2); | 375 | a1, |
376 | struct | ||
377 | GNUNET_TIME_Relative | ||
378 | a2); | ||
380 | 379 | ||
381 | 380 | ||
382 | /** | 381 | /** |
diff --git a/src/include/gnunet_transport_plugin.h b/src/include/gnunet_transport_plugin.h index b90f3f1cf..d7ca62219 100644 --- a/src/include/gnunet_transport_plugin.h +++ b/src/include/gnunet_transport_plugin.h | |||
@@ -138,8 +138,7 @@ typedef struct | |||
138 | * the specific address format depends on the transport | 138 | * the specific address format depends on the transport |
139 | * @param addrlen length of the address | 139 | * @param addrlen length of the address |
140 | */ | 140 | */ |
141 | typedef void (*GNUNET_TRANSPORT_AddressNotification) (void *cls, | 141 | typedef void (*GNUNET_TRANSPORT_AddressNotification) (void *cls, int add_remove, |
142 | int add_remove, | ||
143 | const void *addr, | 142 | const void *addr, |
144 | size_t addrlen); | 143 | size_t addrlen); |
145 | 144 | ||
@@ -254,10 +253,10 @@ struct GNUNET_TRANSPORT_PluginEnvironment | |||
254 | * disconnect will ALSO be signalled using | 253 | * disconnect will ALSO be signalled using |
255 | * the ReceiveCallback. | 254 | * the ReceiveCallback. |
256 | */ | 255 | */ |
257 | typedef void | 256 | typedef void (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls, |
258 | (*GNUNET_TRANSPORT_TransmitContinuation) (void *cls, | 257 | const struct |
259 | const struct GNUNET_PeerIdentity * | 258 | GNUNET_PeerIdentity * |
260 | target, int result); | 259 | target, int result); |
261 | 260 | ||
262 | 261 | ||
263 | /** | 262 | /** |
@@ -296,20 +295,22 @@ typedef void | |||
296 | * -1 on hard errors (i.e. address invalid); 0 is a legal value | 295 | * -1 on hard errors (i.e. address invalid); 0 is a legal value |
297 | * and does NOT mean that the message was not transmitted (DV) | 296 | * and does NOT mean that the message was not transmitted (DV) |
298 | */ | 297 | */ |
299 | typedef ssize_t | 298 | typedef ssize_t (*GNUNET_TRANSPORT_TransmitFunction) (void *cls, |
300 | (*GNUNET_TRANSPORT_TransmitFunction) (void *cls, | 299 | const struct |
301 | const struct GNUNET_PeerIdentity * | 300 | GNUNET_PeerIdentity * |
302 | target, | 301 | target, |
303 | const char *msgbuf, | 302 | const char *msgbuf, |
304 | size_t msgbuf_size, | 303 | size_t msgbuf_size, |
305 | uint32_t priority, | 304 | uint32_t priority, |
306 | struct GNUNET_TIME_Relative timeout, | 305 | struct |
307 | struct Session * session, | 306 | GNUNET_TIME_Relative |
308 | const void *addr, | 307 | timeout, |
309 | size_t addrlen, | 308 | struct Session * session, |
310 | int force_address, | 309 | const void *addr, |
311 | GNUNET_TRANSPORT_TransmitContinuation | 310 | size_t addrlen, |
312 | cont, void *cont_cls); | 311 | int force_address, |
312 | GNUNET_TRANSPORT_TransmitContinuation | ||
313 | cont, void *cont_cls); | ||
313 | 314 | ||
314 | 315 | ||
315 | /** | 316 | /** |
@@ -328,10 +329,10 @@ typedef ssize_t | |||
328 | * @param target peer for which the last transmission is | 329 | * @param target peer for which the last transmission is |
329 | * to be cancelled | 330 | * to be cancelled |
330 | */ | 331 | */ |
331 | typedef void | 332 | typedef void (*GNUNET_TRANSPORT_DisconnectFunction) (void *cls, |
332 | (*GNUNET_TRANSPORT_DisconnectFunction) (void *cls, | 333 | const struct |
333 | const struct GNUNET_PeerIdentity * | 334 | GNUNET_PeerIdentity * |
334 | target); | 335 | target); |
335 | 336 | ||
336 | 337 | ||
337 | /** | 338 | /** |
@@ -360,16 +361,16 @@ typedef void (*GNUNET_TRANSPORT_AddressStringCallback) (void *cls, | |||
360 | * @param asc function to call on each string | 361 | * @param asc function to call on each string |
361 | * @param asc_cls closure for asc | 362 | * @param asc_cls closure for asc |
362 | */ | 363 | */ |
363 | typedef void | 364 | typedef void (*GNUNET_TRANSPORT_AddressPrettyPrinter) (void *cls, |
364 | (*GNUNET_TRANSPORT_AddressPrettyPrinter) (void *cls, | 365 | const char *type, |
365 | const char *type, | 366 | const void *addr, |
366 | const void *addr, | 367 | size_t addrlen, |
367 | size_t addrlen, | 368 | int numeric, |
368 | int numeric, | 369 | struct |
369 | struct GNUNET_TIME_Relative | 370 | GNUNET_TIME_Relative |
370 | timeout, | 371 | timeout, |
371 | GNUNET_TRANSPORT_AddressStringCallback | 372 | GNUNET_TRANSPORT_AddressStringCallback |
372 | asc, void *asc_cls); | 373 | asc, void *asc_cls); |
373 | 374 | ||
374 | 375 | ||
375 | /** | 376 | /** |
@@ -386,9 +387,8 @@ typedef void | |||
386 | * @return GNUNET_OK if this is a plausible address for this peer | 387 | * @return GNUNET_OK if this is a plausible address for this peer |
387 | * and transport, GNUNET_SYSERR if not | 388 | * and transport, GNUNET_SYSERR if not |
388 | */ | 389 | */ |
389 | typedef int | 390 | typedef int (*GNUNET_TRANSPORT_CheckAddress) (void *cls, const void *addr, |
390 | (*GNUNET_TRANSPORT_CheckAddress) (void *cls, | 391 | size_t addrlen); |
391 | const void *addr, size_t addrlen); | ||
392 | 392 | ||
393 | 393 | ||
394 | /** | 394 | /** |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index f4cc88e55..7e0656956 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -426,12 +426,12 @@ struct GNUNET_TRANSPORT_Handle; | |||
426 | * @param ats performance data | 426 | * @param ats performance data |
427 | * @param ats_count number of entries in ats (excluding 0-termination) | 427 | * @param ats_count number of entries in ats (excluding 0-termination) |
428 | */ | 428 | */ |
429 | typedef void | 429 | typedef void (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, |
430 | (*GNUNET_TRANSPORT_NotifyConnect) (void *cls, | 430 | const struct GNUNET_PeerIdentity |
431 | const struct GNUNET_PeerIdentity * peer, | 431 | * peer, |
432 | const struct | 432 | const struct |
433 | GNUNET_TRANSPORT_ATS_Information * ats, | 433 | GNUNET_TRANSPORT_ATS_Information |
434 | uint32_t ats_count); | 434 | * ats, uint32_t ats_count); |
435 | 435 | ||
436 | /** | 436 | /** |
437 | * Function called to notify transport users that another | 437 | * Function called to notify transport users that another |
@@ -440,10 +440,9 @@ typedef void | |||
440 | * @param cls closure | 440 | * @param cls closure |
441 | * @param peer the peer that disconnected | 441 | * @param peer the peer that disconnected |
442 | */ | 442 | */ |
443 | typedef void | 443 | typedef void (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls, |
444 | (*GNUNET_TRANSPORT_NotifyDisconnect) (void *cls, | 444 | const struct |
445 | const struct GNUNET_PeerIdentity * | 445 | GNUNET_PeerIdentity * peer); |
446 | peer); | ||
447 | 446 | ||
448 | 447 | ||
449 | /** | 448 | /** |
@@ -452,8 +451,8 @@ typedef void | |||
452 | * @param cls closure | 451 | * @param cls closure |
453 | * @param address NULL on error, otherwise 0-terminated printable UTF-8 string | 452 | * @param address NULL on error, otherwise 0-terminated printable UTF-8 string |
454 | */ | 453 | */ |
455 | typedef void | 454 | typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, |
456 | (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, const char *address); | 455 | const char *address); |
457 | 456 | ||
458 | 457 | ||
459 | /** | 458 | /** |
@@ -498,9 +497,8 @@ void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); | |||
498 | * @param handle connection to transport service | 497 | * @param handle connection to transport service |
499 | * @param target who we should try to connect to | 498 | * @param target who we should try to connect to |
500 | */ | 499 | */ |
501 | void | 500 | void GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, |
502 | GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, | 501 | const struct GNUNET_PeerIdentity *target); |
503 | const struct GNUNET_PeerIdentity *target); | ||
504 | 502 | ||
505 | 503 | ||
506 | /** | 504 | /** |
@@ -512,11 +510,10 @@ GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, | |||
512 | * @param quota_in incoming bandwidth quota | 510 | * @param quota_in incoming bandwidth quota |
513 | * @param quota_out outgoing bandwidth quota | 511 | * @param quota_out outgoing bandwidth quota |
514 | */ | 512 | */ |
515 | void | 513 | void GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, |
516 | GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, | 514 | const struct GNUNET_PeerIdentity *target, |
517 | const struct GNUNET_PeerIdentity *target, | 515 | struct GNUNET_BANDWIDTH_Value32NBO quota_in, |
518 | struct GNUNET_BANDWIDTH_Value32NBO quota_in, | 516 | struct GNUNET_BANDWIDTH_Value32NBO quota_out); |
519 | struct GNUNET_BANDWIDTH_Value32NBO quota_out); | ||
520 | 517 | ||
521 | 518 | ||
522 | /** | 519 | /** |
@@ -561,10 +558,9 @@ struct GNUNET_TRANSPORT_TransmitHandle | |||
561 | * | 558 | * |
562 | * @param th handle of the transmission notification request to cancel | 559 | * @param th handle of the transmission notification request to cancel |
563 | */ | 560 | */ |
564 | void | 561 | void GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct |
565 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct | 562 | GNUNET_TRANSPORT_TransmitHandle |
566 | GNUNET_TRANSPORT_TransmitHandle | 563 | *th); |
567 | *th); | ||
568 | 564 | ||
569 | 565 | ||
570 | 566 | ||
@@ -588,10 +584,9 @@ typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback) (void *cls, | |||
588 | * @param rec function to call with the HELLO | 584 | * @param rec function to call with the HELLO |
589 | * @param rec_cls closure for rec | 585 | * @param rec_cls closure for rec |
590 | */ | 586 | */ |
591 | void | 587 | void GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, |
592 | GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, | 588 | GNUNET_TRANSPORT_HelloUpdateCallback rec, |
593 | GNUNET_TRANSPORT_HelloUpdateCallback rec, | 589 | void *rec_cls); |
594 | void *rec_cls); | ||
595 | 590 | ||
596 | 591 | ||
597 | /** | 592 | /** |
@@ -601,10 +596,9 @@ GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
601 | * @param rec function previously registered to be called with the HELLOs | 596 | * @param rec function previously registered to be called with the HELLOs |
602 | * @param rec_cls closure for rec | 597 | * @param rec_cls closure for rec |
603 | */ | 598 | */ |
604 | void | 599 | void GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, |
605 | GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, | 600 | GNUNET_TRANSPORT_HelloUpdateCallback |
606 | GNUNET_TRANSPORT_HelloUpdateCallback rec, | 601 | rec, void *rec_cls); |
607 | void *rec_cls); | ||
608 | 602 | ||
609 | 603 | ||
610 | /** | 604 | /** |
@@ -618,10 +612,9 @@ GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, | |||
618 | * @param cls closure for continuation | 612 | * @param cls closure for continuation |
619 | * | 613 | * |
620 | */ | 614 | */ |
621 | void | 615 | void GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, |
622 | GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, | 616 | const struct GNUNET_MessageHeader *hello, |
623 | const struct GNUNET_MessageHeader *hello, | 617 | GNUNET_SCHEDULER_Task cont, void *cls); |
624 | GNUNET_SCHEDULER_Task cont, void *cls); | ||
625 | 618 | ||
626 | 619 | ||
627 | /** | 620 | /** |
@@ -637,15 +630,13 @@ GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
637 | * @param aluc function to call with the results | 630 | * @param aluc function to call with the results |
638 | * @param aluc_cls closure for aluc | 631 | * @param aluc_cls closure for aluc |
639 | */ | 632 | */ |
640 | void | 633 | void GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle |
641 | GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, | 634 | *cfg, const char *address, |
642 | const char *address, | 635 | size_t addressLen, int numeric, |
643 | size_t addressLen, | 636 | const char *nameTrans, |
644 | int numeric, | 637 | struct GNUNET_TIME_Relative timeout, |
645 | const char *nameTrans, | 638 | GNUNET_TRANSPORT_AddressLookUpCallback |
646 | struct GNUNET_TIME_Relative timeout, | 639 | aluc, void *aluc_cls); |
647 | GNUNET_TRANSPORT_AddressLookUpCallback aluc, | ||
648 | void *aluc_cls); | ||
649 | 640 | ||
650 | 641 | ||
651 | /** | 642 | /** |
@@ -658,14 +649,14 @@ GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
658 | * @param peer_address_callback function to call with the results | 649 | * @param peer_address_callback function to call with the results |
659 | * @param peer_address_callback_cls closure for peer_address_callback | 650 | * @param peer_address_callback_cls closure for peer_address_callback |
660 | */ | 651 | */ |
661 | void | 652 | void GNUNET_TRANSPORT_peer_address_lookup (const struct |
662 | GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle | 653 | GNUNET_CONFIGURATION_Handle *cfg, |
663 | *cfg, | 654 | const struct GNUNET_PeerIdentity |
664 | const struct GNUNET_PeerIdentity *peer, | 655 | *peer, |
665 | struct GNUNET_TIME_Relative timeout, | 656 | struct GNUNET_TIME_Relative timeout, |
666 | GNUNET_TRANSPORT_AddressLookUpCallback | 657 | GNUNET_TRANSPORT_AddressLookUpCallback |
667 | peer_address_callback, | 658 | peer_address_callback, |
668 | void *peer_address_callback_cls); | 659 | void *peer_address_callback_cls); |
669 | 660 | ||
670 | 661 | ||
671 | /** | 662 | /** |
@@ -677,12 +668,12 @@ GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle | |||
677 | * @param peer_address_callback function to call with the results | 668 | * @param peer_address_callback function to call with the results |
678 | * @param peer_address_callback_cls closure for peer_address_callback | 669 | * @param peer_address_callback_cls closure for peer_address_callback |
679 | */ | 670 | */ |
680 | void | 671 | void GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle |
681 | GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, | 672 | *cfg, |
682 | struct GNUNET_TIME_Relative timeout, | 673 | struct GNUNET_TIME_Relative timeout, |
683 | GNUNET_TRANSPORT_AddressLookUpCallback | 674 | GNUNET_TRANSPORT_AddressLookUpCallback |
684 | peer_address_callback, | 675 | peer_address_callback, |
685 | void *peer_address_callback_cls); | 676 | void *peer_address_callback_cls); |
686 | 677 | ||
687 | 678 | ||
688 | /** | 679 | /** |
diff --git a/src/include/gnunet_upnp_service.h b/src/include/gnunet_upnp_service.h index 7e6ea5180..70e50b354 100644 --- a/src/include/gnunet_upnp_service.h +++ b/src/include/gnunet_upnp_service.h | |||
@@ -54,11 +54,8 @@ extern "C" | |||
54 | * function will be called with NULL on error | 54 | * function will be called with NULL on error |
55 | * @param cls closure for callback | 55 | * @param cls closure for callback |
56 | */ | 56 | */ |
57 | int GNUNET_UPNP_get_ip (struct GNUNET_CONFIGURATION_Handle *cfg, | 57 | int GNUNET_UPNP_get_ip (struct GNUNET_CONFIGURATION_Handle *cfg, int domain, |
58 | int domain, | 58 | int type, int protocol, uint16_t port, |
59 | int type, | ||
60 | int protocol, | ||
61 | uint16_t port, | ||
62 | struct GNUNET_TIME_Relative timeout, | 59 | struct GNUNET_TIME_Relative timeout, |
63 | GNUNET_RESOLVER_AddressCallback callback, void *cls); | 60 | GNUNET_RESOLVER_AddressCallback callback, void *cls); |
64 | 61 | ||
diff --git a/src/include/plibc.h b/src/include/plibc.h index 82079faf1..8314f2146 100644 --- a/src/include/plibc.h +++ b/src/include/plibc.h | |||
@@ -770,8 +770,7 @@ extern "C" | |||
770 | PLIBC_SEARCH__compar_fn_t __compar); | 770 | PLIBC_SEARCH__compar_fn_t __compar); |
771 | 771 | ||
772 | /* Remove the element matching KEY from the tree pointed to by *ROOTP. */ | 772 | /* Remove the element matching KEY from the tree pointed to by *ROOTP. */ |
773 | void *_win_tdelete (__const void *__restrict __key, | 773 | void *_win_tdelete (__const void *__restrict __key, void **__restrict __rootp, |
774 | void **__restrict __rootp, | ||
775 | PLIBC_SEARCH__compar_fn_t __compar); | 774 | PLIBC_SEARCH__compar_fn_t __compar); |
776 | 775 | ||
777 | typedef void (*PLIBC_SEARCH__action_fn_t) (__const void *__nodep, | 776 | typedef void (*PLIBC_SEARCH__action_fn_t) (__const void *__nodep, |
@@ -792,15 +791,13 @@ extern "C" | |||
792 | 791 | ||
793 | /* Perform linear search for KEY by comparing by COMPAR in an array | 792 | /* Perform linear search for KEY by comparing by COMPAR in an array |
794 | [BASE,BASE+NMEMB*SIZE). */ | 793 | [BASE,BASE+NMEMB*SIZE). */ |
795 | void *_win_lfind (__const void *__key, __const void *__base, | 794 | void *_win_lfind (__const void *__key, __const void *__base, size_t * __nmemb, |
796 | size_t * __nmemb, size_t __size, | 795 | size_t __size, PLIBC_SEARCH__compar_fn_t __compar); |
797 | PLIBC_SEARCH__compar_fn_t __compar); | ||
798 | 796 | ||
799 | /* Perform linear search for KEY by comparing by COMPAR function in | 797 | /* Perform linear search for KEY by comparing by COMPAR function in |
800 | array [BASE,BASE+NMEMB*SIZE) and insert entry if not found. */ | 798 | array [BASE,BASE+NMEMB*SIZE) and insert entry if not found. */ |
801 | void *_win_lsearch (__const void *__key, void *__base, | 799 | void *_win_lsearch (__const void *__key, void *__base, size_t * __nmemb, |
802 | size_t * __nmemb, size_t __size, | 800 | size_t __size, PLIBC_SEARCH__compar_fn_t __compar); |
803 | PLIBC_SEARCH__compar_fn_t __compar); | ||
804 | 801 | ||
805 | 802 | ||
806 | #ifdef __cplusplus | 803 | #ifdef __cplusplus |
diff --git a/src/include/winproc.h b/src/include/winproc.h index 1c7703799..05c4ac1bf 100644 --- a/src/include/winproc.h +++ b/src/include/winproc.h | |||
@@ -109,12 +109,11 @@ extern "C" | |||
109 | DWORD level, LPBYTE buf, | 109 | DWORD level, LPBYTE buf, |
110 | LPDWORD parm_err); | 110 | LPDWORD parm_err); |
111 | typedef NTSTATUS NTAPI (*TLsaOpenPolicy) (PLSA_UNICODE_STRING, | 111 | typedef NTSTATUS NTAPI (*TLsaOpenPolicy) (PLSA_UNICODE_STRING, |
112 | PLSA_OBJECT_ATTRIBUTES, | 112 | PLSA_OBJECT_ATTRIBUTES, ACCESS_MASK, |
113 | ACCESS_MASK, PLSA_HANDLE); | 113 | PLSA_HANDLE); |
114 | typedef NTSTATUS NTAPI (*TLsaAddAccountRights) (LSA_HANDLE, PSID, | 114 | typedef NTSTATUS NTAPI (*TLsaAddAccountRights) (LSA_HANDLE, PSID, |
115 | PLSA_UNICODE_STRING, ULONG); | 115 | PLSA_UNICODE_STRING, ULONG); |
116 | typedef NTSTATUS NTAPI (*TLsaRemoveAccountRights) (LSA_HANDLE, PSID, | 116 | typedef NTSTATUS NTAPI (*TLsaRemoveAccountRights) (LSA_HANDLE, PSID, BOOLEAN, |
117 | BOOLEAN, | ||
118 | PLSA_UNICODE_STRING, | 117 | PLSA_UNICODE_STRING, |
119 | ULONG); | 118 | ULONG); |
120 | typedef NTSTATUS NTAPI (*TLsaClose) (LSA_HANDLE); | 119 | typedef NTSTATUS NTAPI (*TLsaClose) (LSA_HANDLE); |
@@ -139,8 +138,7 @@ extern "C" | |||
139 | LPBOOL lpbDaclPresent, | 138 | LPBOOL lpbDaclPresent, |
140 | PACL * pDacl, | 139 | PACL * pDacl, |
141 | LPBOOL lpbDaclDefaulted); | 140 | LPBOOL lpbDaclDefaulted); |
142 | typedef BOOL WINAPI (*TGetAclInformation) (PACL pAcl, | 141 | typedef BOOL WINAPI (*TGetAclInformation) (PACL pAcl, LPVOID pAclInformation, |
143 | LPVOID pAclInformation, | ||
144 | DWORD nAclInformationLength, | 142 | DWORD nAclInformationLength, |
145 | ACL_INFORMATION_CLASS | 143 | ACL_INFORMATION_CLASS |
146 | dwAclInformationClass); | 144 | dwAclInformationClass); |