diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-08-16 16:03:20 +0000 |
commit | 16a6919a9f98ee9fa1fee9dd262906c321004a19 (patch) | |
tree | e09d4fe5191dc329b3e1b667f2914f8313bcba59 /src/include | |
parent | 4d7904c62bb867c44e90b8e9f7cdbb4b283abc44 (diff) | |
download | gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.tar.gz gnunet-16a6919a9f98ee9fa1fee9dd262906c321004a19.zip |
even nicer indentation, thanks to LRN's indent patch
Diffstat (limited to 'src/include')
46 files changed, 2307 insertions, 2490 deletions
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h index 76529ede4..6d52773de 100644 --- a/src/include/gnunet_arm_service.h +++ b/src/include/gnunet_arm_service.h | |||
@@ -73,9 +73,9 @@ struct GNUNET_ARM_Handle; | |||
73 | * @param service service that *this* process is implementing/providing, can be NULL | 73 | * @param service service that *this* process is implementing/providing, can be NULL |
74 | * @return context to use for further ARM operations, NULL on error | 74 | * @return context to use for further ARM operations, NULL on error |
75 | */ | 75 | */ |
76 | struct GNUNET_ARM_Handle *GNUNET_ARM_connect (const struct | 76 | struct GNUNET_ARM_Handle * |
77 | GNUNET_CONFIGURATION_Handle *cfg, | 77 | GNUNET_ARM_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
78 | const char *service); | 78 | const char *service); |
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
@@ -83,7 +83,8 @@ struct GNUNET_ARM_Handle *GNUNET_ARM_connect (const struct | |||
83 | * | 83 | * |
84 | * @param h the handle that was being used | 84 | * @param h the handle that was being used |
85 | */ | 85 | */ |
86 | void GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); | 86 | void |
87 | GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); | ||
87 | 88 | ||
88 | 89 | ||
89 | /** | 90 | /** |
@@ -104,10 +105,10 @@ void GNUNET_ARM_disconnect (struct GNUNET_ARM_Handle *h); | |||
104 | * @param cb callback to invoke when service is ready | 105 | * @param cb callback to invoke when service is ready |
105 | * @param cb_cls closure for callback | 106 | * @param cb_cls closure for callback |
106 | */ | 107 | */ |
107 | void GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, | 108 | void |
108 | const char *service_name, | 109 | GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, 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); |
111 | 112 | ||
112 | 113 | ||
113 | /** | 114 | /** |
@@ -121,10 +122,10 @@ void GNUNET_ARM_start_service (struct GNUNET_ARM_Handle *h, | |||
121 | * @param cb callback to invoke when service is ready | 122 | * @param cb callback to invoke when service is ready |
122 | * @param cb_cls closure for callback | 123 | * @param cb_cls closure for callback |
123 | */ | 124 | */ |
124 | void GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, | 125 | void |
125 | const char *service_name, | 126 | GNUNET_ARM_stop_service (struct GNUNET_ARM_Handle *h, const char *service_name, |
126 | struct GNUNET_TIME_Relative timeout, | 127 | struct GNUNET_TIME_Relative timeout, |
127 | GNUNET_ARM_Callback cb, void *cb_cls); | 128 | GNUNET_ARM_Callback cb, void *cb_cls); |
128 | 129 | ||
129 | 130 | ||
130 | 131 | ||
diff --git a/src/include/gnunet_ats_service.h b/src/include/gnunet_ats_service.h index dd648dd75..1de3d1041 100644 --- a/src/include/gnunet_ats_service.h +++ b/src/include/gnunet_ats_service.h | |||
@@ -83,10 +83,10 @@ typedef void (*GNUNET_TRANSPORT_ATS_AllocationNotification) (void *cls, | |||
83 | * @param alloc_cb_cls closure for 'alloc_cb' | 83 | * @param alloc_cb_cls closure for 'alloc_cb' |
84 | * @return ats context | 84 | * @return ats context |
85 | */ | 85 | */ |
86 | struct GNUNET_ATS_Handle *GNUNET_ATS_init (const struct | 86 | struct GNUNET_ATS_Handle * |
87 | GNUNET_CONFIGURATION_Handle *cfg, | 87 | GNUNET_ATS_init (const struct GNUNET_CONFIGURATION_Handle *cfg, |
88 | GNUNET_TRANSPORT_ATS_AllocationNotification | 88 | GNUNET_TRANSPORT_ATS_AllocationNotification alloc_cb, |
89 | alloc_cb, void *alloc_cb_cls); | 89 | void *alloc_cb_cls); |
90 | 90 | ||
91 | 91 | ||
92 | /** | 92 | /** |
@@ -94,7 +94,8 @@ struct GNUNET_ATS_Handle *GNUNET_ATS_init (const struct | |||
94 | * | 94 | * |
95 | * @param atc handle | 95 | * @param atc handle |
96 | */ | 96 | */ |
97 | void GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); | 97 | void |
98 | GNUNET_ATS_shutdown (struct GNUNET_ATS_Handle *atc); | ||
98 | 99 | ||
99 | 100 | ||
100 | /** | 101 | /** |
@@ -140,15 +141,11 @@ struct GNUNET_ATS_SuggestionContext; | |||
140 | * @param cb function to call with the address | 141 | * @param cb function to call with the address |
141 | * @param cb_cls closure for cb | 142 | * @param cb_cls closure for cb |
142 | */ | 143 | */ |
143 | struct GNUNET_ATS_SuggestionContext *GNUNET_ATS_suggest_address (struct | 144 | struct GNUNET_ATS_SuggestionContext * |
144 | GNUNET_ATS_Handle | 145 | GNUNET_ATS_suggest_address (struct GNUNET_ATS_Handle *atc, |
145 | *atc, | 146 | const struct GNUNET_PeerIdentity *peer, |
146 | const struct | 147 | GNUNET_ATS_AddressSuggestionCallback cb, |
147 | GNUNET_PeerIdentity | 148 | void *cb_cls); |
148 | *peer, | ||
149 | GNUNET_ATS_AddressSuggestionCallback | ||
150 | cb, | ||
151 | void *cb_cls); | ||
152 | 149 | ||
153 | 150 | ||
154 | /** | 151 | /** |
@@ -156,8 +153,8 @@ struct GNUNET_ATS_SuggestionContext *GNUNET_ATS_suggest_address (struct | |||
156 | * | 153 | * |
157 | * @param asc handle of the request to cancel | 154 | * @param asc handle of the request to cancel |
158 | */ | 155 | */ |
159 | void GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext | 156 | void |
160 | *asc); | 157 | GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext *asc); |
161 | 158 | ||
162 | 159 | ||
163 | /** | 160 | /** |
@@ -174,12 +171,13 @@ void GNUNET_ATS_suggest_address_cancel (struct GNUNET_ATS_SuggestionContext | |||
174 | * @param ats performance data for the connection | 171 | * @param ats performance data for the connection |
175 | * @param ats_count number of performance records in 'ats' | 172 | * @param ats_count number of performance records in 'ats' |
176 | */ | 173 | */ |
177 | void GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, | 174 | void |
178 | const struct GNUNET_PeerIdentity *peer, | 175 | GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, |
179 | const char *plugin_name, struct Session *session, | 176 | const struct GNUNET_PeerIdentity *peer, |
180 | const void *plugin_addr, size_t plugin_addr_len, | 177 | const char *plugin_name, struct Session *session, |
181 | const struct GNUNET_TRANSPORT_ATS_Information | 178 | const void *plugin_addr, size_t plugin_addr_len, |
182 | *ats, uint32_t ats_count); | 179 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
180 | uint32_t ats_count); | ||
183 | 181 | ||
184 | 182 | ||
185 | /** | 183 | /** |
@@ -190,8 +188,9 @@ void GNUNET_ATS_peer_connect (struct GNUNET_ATS_Handle *atc, | |||
190 | * @param atc handle | 188 | * @param atc handle |
191 | * @param peer identity of the peer | 189 | * @param peer identity of the peer |
192 | */ | 190 | */ |
193 | void GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, | 191 | void |
194 | const struct GNUNET_PeerIdentity *peer); | 192 | GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, |
193 | const struct GNUNET_PeerIdentity *peer); | ||
195 | 194 | ||
196 | 195 | ||
197 | /** | 196 | /** |
@@ -201,9 +200,10 @@ void GNUNET_ATS_peer_disconnect (struct GNUNET_ATS_Handle *atc, | |||
201 | * @param peer identity of the peer | 200 | * @param peer identity of the peer |
202 | * @param session session handle that is no longer valid | 201 | * @param session session handle that is no longer valid |
203 | */ | 202 | */ |
204 | void GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, | 203 | void |
205 | const struct GNUNET_PeerIdentity *peer, | 204 | GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, |
206 | const struct Session *session); | 205 | const struct GNUNET_PeerIdentity *peer, |
206 | const struct Session *session); | ||
207 | 207 | ||
208 | 208 | ||
209 | /** | 209 | /** |
@@ -224,14 +224,14 @@ void GNUNET_ATS_session_destroyed (struct GNUNET_ATS_Handle *atc, | |||
224 | * @param ats performance data for the address | 224 | * @param ats performance data for the address |
225 | * @param ats_count number of performance records in 'ats' | 225 | * @param ats_count number of performance records in 'ats' |
226 | */ | 226 | */ |
227 | void GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, | 227 | void |
228 | const struct GNUNET_PeerIdentity *peer, | 228 | GNUNET_ATS_address_update (struct GNUNET_ATS_Handle *atc, |
229 | struct GNUNET_TIME_Absolute valid_until, | 229 | const struct GNUNET_PeerIdentity *peer, |
230 | const char *plugin_name, | 230 | struct GNUNET_TIME_Absolute valid_until, |
231 | struct Session *session, | 231 | const char *plugin_name, struct Session *session, |
232 | const void *plugin_addr, size_t plugin_addr_len, | 232 | const void *plugin_addr, size_t plugin_addr_len, |
233 | const struct GNUNET_TRANSPORT_ATS_Information | 233 | const struct GNUNET_TRANSPORT_ATS_Information *ats, |
234 | *ats, uint32_t ats_count); | 234 | uint32_t ats_count); |
235 | 235 | ||
236 | 236 | ||
237 | #endif | 237 | #endif |
diff --git a/src/include/gnunet_bandwidth_lib.h b/src/include/gnunet_bandwidth_lib.h index e78d16552..75f71b32c 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 GNUNET_BANDWIDTH_value_init (uint32_t | 92 | struct GNUNET_BANDWIDTH_Value32NBO |
93 | bytes_per_second); | 93 | GNUNET_BANDWIDTH_value_init (uint32_t bytes_per_second); |
94 | 94 | ||
95 | 95 | ||
96 | /** | 96 | /** |
@@ -107,12 +107,11 @@ struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_init (uint32_t | |||
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 GNUNET_BANDWIDTH_value_get_available_until (struct | 110 | uint64_t |
111 | GNUNET_BANDWIDTH_Value32NBO | 111 | GNUNET_BANDWIDTH_value_get_available_until (struct GNUNET_BANDWIDTH_Value32NBO |
112 | bps, | 112 | bps, |
113 | struct | 113 | struct GNUNET_TIME_Relative |
114 | GNUNET_TIME_Relative | 114 | deadline); |
115 | deadline); | ||
116 | 115 | ||
117 | 116 | ||
118 | /** | 117 | /** |
@@ -123,11 +122,9 @@ uint64_t GNUNET_BANDWIDTH_value_get_available_until (struct | |||
123 | * @param size number of bytes we want to have available | 122 | * @param size number of bytes we want to have available |
124 | * @return how long it would take | 123 | * @return how long it would take |
125 | */ | 124 | */ |
126 | struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct | 125 | struct GNUNET_TIME_Relative |
127 | GNUNET_BANDWIDTH_Value32NBO | 126 | GNUNET_BANDWIDTH_value_get_delay_for (struct GNUNET_BANDWIDTH_Value32NBO bps, |
128 | bps, | 127 | uint64_t size); |
129 | uint64_t | ||
130 | size); | ||
131 | 128 | ||
132 | 129 | ||
133 | 130 | ||
@@ -138,12 +135,9 @@ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_value_get_delay_for (struct | |||
138 | * @param b2 second value | 135 | * @param b2 second value |
139 | * @return the min of b1 and b2 | 136 | * @return the min of b1 and b2 |
140 | */ | 137 | */ |
141 | struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct | 138 | struct GNUNET_BANDWIDTH_Value32NBO |
142 | GNUNET_BANDWIDTH_Value32NBO | 139 | GNUNET_BANDWIDTH_value_min (struct GNUNET_BANDWIDTH_Value32NBO b1, |
143 | b1, | 140 | struct GNUNET_BANDWIDTH_Value32NBO b2); |
144 | struct | ||
145 | GNUNET_BANDWIDTH_Value32NBO | ||
146 | b2); | ||
147 | 141 | ||
148 | 142 | ||
149 | /** | 143 | /** |
@@ -160,10 +154,10 @@ struct GNUNET_BANDWIDTH_Value32NBO GNUNET_BANDWIDTH_value_min (struct | |||
160 | * @param max_carry_s maximum number of seconds unused bandwidth | 154 | * @param max_carry_s maximum number of seconds unused bandwidth |
161 | * may accumulate before it expires | 155 | * may accumulate before it expires |
162 | */ | 156 | */ |
163 | void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, | 157 | void |
164 | struct GNUNET_BANDWIDTH_Value32NBO | 158 | GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, |
165 | bytes_per_second_limit, | 159 | struct GNUNET_BANDWIDTH_Value32NBO |
166 | uint32_t max_carry_s); | 160 | bytes_per_second_limit, uint32_t max_carry_s); |
167 | 161 | ||
168 | 162 | ||
169 | /** | 163 | /** |
@@ -177,8 +171,9 @@ void GNUNET_BANDWIDTH_tracker_init (struct GNUNET_BANDWIDTH_Tracker *av, | |||
177 | * @param size number of bytes consumed | 171 | * @param size number of bytes consumed |
178 | * @return GNUNET_YES if this consumption is above the limit | 172 | * @return GNUNET_YES if this consumption is above the limit |
179 | */ | 173 | */ |
180 | int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | 174 | int |
181 | ssize_t size); | 175 | GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, |
176 | ssize_t size); | ||
182 | 177 | ||
183 | 178 | ||
184 | /** | 179 | /** |
@@ -190,10 +185,9 @@ int GNUNET_BANDWIDTH_tracker_consume (struct GNUNET_BANDWIDTH_Tracker *av, | |||
190 | * @param size number of bytes we would like to consume | 185 | * @param size number of bytes we would like to consume |
191 | * @return time to wait for consumption to be OK | 186 | * @return time to wait for consumption to be OK |
192 | */ | 187 | */ |
193 | struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct | 188 | struct GNUNET_TIME_Relative |
194 | GNUNET_BANDWIDTH_Tracker | 189 | GNUNET_BANDWIDTH_tracker_get_delay (struct GNUNET_BANDWIDTH_Tracker *av, |
195 | *av, | 190 | size_t size); |
196 | size_t size); | ||
197 | 191 | ||
198 | 192 | ||
199 | /** | 193 | /** |
@@ -203,9 +197,8 @@ struct GNUNET_TIME_Relative GNUNET_BANDWIDTH_tracker_get_delay (struct | |||
203 | * @param av tracker to query | 197 | * @param av tracker to query |
204 | * @return number of bytes available for consumption right now | 198 | * @return number of bytes available for consumption right now |
205 | */ | 199 | */ |
206 | int64_t GNUNET_BANDWIDTH_tracker_get_available (struct | 200 | int64_t |
207 | GNUNET_BANDWIDTH_Tracker | 201 | GNUNET_BANDWIDTH_tracker_get_available (struct GNUNET_BANDWIDTH_Tracker *av); |
208 | *av); | ||
209 | 202 | ||
210 | 203 | ||
211 | /** | 204 | /** |
@@ -214,9 +207,10 @@ int64_t GNUNET_BANDWIDTH_tracker_get_available (struct | |||
214 | * @param av tracker to initialize | 207 | * @param av tracker to initialize |
215 | * @param bytes_per_second_limit new limit to assume | 208 | * @param bytes_per_second_limit new limit to assume |
216 | */ | 209 | */ |
217 | void GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, | 210 | void |
218 | struct GNUNET_BANDWIDTH_Value32NBO | 211 | GNUNET_BANDWIDTH_tracker_update_quota (struct GNUNET_BANDWIDTH_Tracker *av, |
219 | bytes_per_second_limit); | 212 | struct GNUNET_BANDWIDTH_Value32NBO |
213 | bytes_per_second_limit); | ||
220 | 214 | ||
221 | 215 | ||
222 | #if 0 /* keep Emacsens' auto-indent happy */ | 216 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_bio_lib.h b/src/include/gnunet_bio_lib.h index 74512ec40..de356d1e5 100644 --- a/src/include/gnunet_bio_lib.h +++ b/src/include/gnunet_bio_lib.h | |||
@@ -49,7 +49,8 @@ struct GNUNET_BIO_ReadHandle; | |||
49 | * @param fn file name to be opened | 49 | * @param fn file name to be opened |
50 | * @return IO handle on success, NULL on error | 50 | * @return IO handle on success, NULL on error |
51 | */ | 51 | */ |
52 | struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn); | 52 | struct GNUNET_BIO_ReadHandle * |
53 | GNUNET_BIO_read_open (const char *fn); | ||
53 | 54 | ||
54 | 55 | ||
55 | /** | 56 | /** |
@@ -60,7 +61,8 @@ struct GNUNET_BIO_ReadHandle *GNUNET_BIO_read_open (const char *fn); | |||
60 | * @param emsg set to the error message | 61 | * @param emsg set to the error message |
61 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 62 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
62 | */ | 63 | */ |
63 | int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | 64 | int |
65 | GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | ||
64 | 66 | ||
65 | 67 | ||
66 | /** | 68 | /** |
@@ -72,8 +74,9 @@ int GNUNET_BIO_read_close (struct GNUNET_BIO_ReadHandle *h, char **emsg); | |||
72 | * @param len the number of bytes to read | 74 | * @param len the number of bytes to read |
73 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 75 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
74 | */ | 76 | */ |
75 | int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, | 77 | int |
76 | void *result, size_t len); | 78 | GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, |
79 | void *result, size_t len); | ||
77 | 80 | ||
78 | 81 | ||
79 | /** | 82 | /** |
@@ -86,8 +89,9 @@ int GNUNET_BIO_read (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
86 | * @param len the number of bytes to read | 89 | * @param len the number of bytes to read |
87 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 90 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
88 | */ | 91 | */ |
89 | int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, | 92 | int |
90 | int line, void *result, size_t len); | 93 | GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, int line, |
94 | void *result, size_t len); | ||
91 | 95 | ||
92 | /** | 96 | /** |
93 | * Read 0-terminated string from a file. | 97 | * Read 0-terminated string from a file. |
@@ -99,8 +103,9 @@ int GNUNET_BIO_read_fn (struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
99 | * @param maxLen maximum allowed length for the string | 103 | * @param maxLen maximum allowed length for the string |
100 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 104 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
101 | */ | 105 | */ |
102 | int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, | 106 | int |
103 | char **result, size_t maxLen); | 107 | GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, |
108 | char **result, size_t maxLen); | ||
104 | 109 | ||
105 | 110 | ||
106 | /** | 111 | /** |
@@ -111,9 +116,9 @@ int GNUNET_BIO_read_string (struct GNUNET_BIO_ReadHandle *h, const char *what, | |||
111 | * @param result the buffer to store a pointer to the (allocated) metadata | 116 | * @param result the buffer to store a pointer to the (allocated) metadata |
112 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 117 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
113 | */ | 118 | */ |
114 | int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, | 119 | int |
115 | const char *what, | 120 | GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, const char *what, |
116 | struct GNUNET_CONTAINER_MetaData **result); | 121 | struct GNUNET_CONTAINER_MetaData **result); |
117 | 122 | ||
118 | 123 | ||
119 | /** | 124 | /** |
@@ -144,8 +149,9 @@ int GNUNET_BIO_read_meta_data (struct GNUNET_BIO_ReadHandle *h, | |||
144 | * @param i address of 32-bit integer to read | 149 | * @param i address of 32-bit integer to read |
145 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 150 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
146 | */ | 151 | */ |
147 | int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | 152 | int |
148 | int line, int32_t * i); | 153 | GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
154 | int line, int32_t * i); | ||
149 | 155 | ||
150 | 156 | ||
151 | /** | 157 | /** |
@@ -166,8 +172,9 @@ int GNUNET_BIO_read_int32__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | |||
166 | * @param i address of 64-bit integer to read | 172 | * @param i address of 64-bit integer to read |
167 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 173 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
168 | */ | 174 | */ |
169 | int GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, | 175 | int |
170 | int line, int64_t * i); | 176 | GNUNET_BIO_read_int64__ (struct GNUNET_BIO_ReadHandle *h, const char *file, |
177 | int line, int64_t * i); | ||
171 | 178 | ||
172 | 179 | ||
173 | /** | 180 | /** |
@@ -190,7 +197,8 @@ struct GNUNET_BIO_WriteHandle; | |||
190 | * @param fn file name to be opened | 197 | * @param fn file name to be opened |
191 | * @return IO handle on success, NULL on error | 198 | * @return IO handle on success, NULL on error |
192 | */ | 199 | */ |
193 | struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn); | 200 | struct GNUNET_BIO_WriteHandle * |
201 | GNUNET_BIO_write_open (const char *fn); | ||
194 | 202 | ||
195 | 203 | ||
196 | /** | 204 | /** |
@@ -199,7 +207,8 @@ struct GNUNET_BIO_WriteHandle *GNUNET_BIO_write_open (const char *fn); | |||
199 | * @param h file handle | 207 | * @param h file handle |
200 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 208 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
201 | */ | 209 | */ |
202 | int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | 210 | int |
211 | GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | ||
203 | 212 | ||
204 | 213 | ||
205 | /** | 214 | /** |
@@ -210,8 +219,9 @@ int GNUNET_BIO_write_close (struct GNUNET_BIO_WriteHandle *h); | |||
210 | * @param n number of bytes to write | 219 | * @param n number of bytes to write |
211 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 220 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
212 | */ | 221 | */ |
213 | int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, | 222 | int |
214 | size_t n); | 223 | GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, |
224 | size_t n); | ||
215 | 225 | ||
216 | 226 | ||
217 | /** | 227 | /** |
@@ -221,7 +231,8 @@ int GNUNET_BIO_write (struct GNUNET_BIO_WriteHandle *h, const void *buffer, | |||
221 | * @param s string to write (can be NULL) | 231 | * @param s string to write (can be NULL) |
222 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 232 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
223 | */ | 233 | */ |
224 | int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | 234 | int |
235 | GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | ||
225 | 236 | ||
226 | 237 | ||
227 | 238 | ||
@@ -233,8 +244,9 @@ int GNUNET_BIO_write_string (struct GNUNET_BIO_WriteHandle *h, const char *s); | |||
233 | * @param m metadata to write | 244 | * @param m metadata to write |
234 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 245 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
235 | */ | 246 | */ |
236 | int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | 247 | int |
237 | const struct GNUNET_CONTAINER_MetaData *m); | 248 | GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, |
249 | const struct GNUNET_CONTAINER_MetaData *m); | ||
238 | 250 | ||
239 | 251 | ||
240 | 252 | ||
@@ -264,7 +276,8 @@ int GNUNET_BIO_write_meta_data (struct GNUNET_BIO_WriteHandle *h, | |||
264 | * @param i address of 32-bit integer to write | 276 | * @param i address of 32-bit integer to write |
265 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 277 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
266 | */ | 278 | */ |
267 | int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | 279 | int |
280 | GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | ||
268 | 281 | ||
269 | 282 | ||
270 | /** | 283 | /** |
@@ -274,7 +287,8 @@ int GNUNET_BIO_write_int32 (struct GNUNET_BIO_WriteHandle *h, int32_t i); | |||
274 | * @param i address of 64-bit integer to write | 287 | * @param i address of 64-bit integer to write |
275 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 288 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
276 | */ | 289 | */ |
277 | int GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); | 290 | int |
291 | GNUNET_BIO_write_int64 (struct GNUNET_BIO_WriteHandle *h, int64_t i); | ||
278 | 292 | ||
279 | 293 | ||
280 | #if 0 /* keep Emacsens' auto-indent happy */ | 294 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_block_lib.h b/src/include/gnunet_block_lib.h index 51b8254d0..66b2490c0 100644 --- a/src/include/gnunet_block_lib.h +++ b/src/include/gnunet_block_lib.h | |||
@@ -161,8 +161,9 @@ 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 GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, | 164 | void |
165 | uint32_t mingle_number, GNUNET_HashCode * hc); | 165 | GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, uint32_t mingle_number, |
166 | GNUNET_HashCode * hc); | ||
166 | 167 | ||
167 | 168 | ||
168 | /** | 169 | /** |
@@ -171,9 +172,8 @@ void GNUNET_BLOCK_mingle_hash (const GNUNET_HashCode * in, | |||
171 | * @param cfg configuration to use | 172 | * @param cfg configuration to use |
172 | * @return NULL on error | 173 | * @return NULL on error |
173 | */ | 174 | */ |
174 | struct GNUNET_BLOCK_Context *GNUNET_BLOCK_context_create (const struct | 175 | struct GNUNET_BLOCK_Context * |
175 | GNUNET_CONFIGURATION_Handle | 176 | GNUNET_BLOCK_context_create (const struct GNUNET_CONFIGURATION_Handle *cfg); |
176 | *cfg); | ||
177 | 177 | ||
178 | 178 | ||
179 | /** | 179 | /** |
@@ -181,7 +181,8 @@ struct GNUNET_BLOCK_Context *GNUNET_BLOCK_context_create (const struct | |||
181 | * | 181 | * |
182 | * @param ctx context to destroy | 182 | * @param ctx context to destroy |
183 | */ | 183 | */ |
184 | void GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); | 184 | void |
185 | GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); | ||
185 | 186 | ||
186 | 187 | ||
187 | /** | 188 | /** |
@@ -202,23 +203,14 @@ void GNUNET_BLOCK_context_destroy (struct GNUNET_BLOCK_Context *ctx); | |||
202 | * @param reply_block_size number of bytes in reply block | 203 | * @param reply_block_size number of bytes in reply block |
203 | * @return characterization of result | 204 | * @return characterization of result |
204 | */ | 205 | */ |
205 | enum GNUNET_BLOCK_EvaluationResult GNUNET_BLOCK_evaluate (struct | 206 | enum GNUNET_BLOCK_EvaluationResult |
206 | GNUNET_BLOCK_Context | 207 | GNUNET_BLOCK_evaluate (struct GNUNET_BLOCK_Context *ctx, |
207 | *ctx, | 208 | enum GNUNET_BLOCK_Type type, |
208 | enum GNUNET_BLOCK_Type | 209 | const GNUNET_HashCode * query, |
209 | type, | 210 | struct GNUNET_CONTAINER_BloomFilter **bf, |
210 | const GNUNET_HashCode | 211 | int32_t bf_mutator, const void *xquery, |
211 | * query, | 212 | size_t xquery_size, const void *reply_block, |
212 | struct | 213 | 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); | ||
222 | 214 | ||
223 | 215 | ||
224 | /** | 216 | /** |
@@ -234,9 +226,10 @@ enum GNUNET_BLOCK_EvaluationResult GNUNET_BLOCK_evaluate (struct | |||
234 | * GNUNET_SYSERR if type not supported | 226 | * GNUNET_SYSERR if type not supported |
235 | * (or if extracting a key from a block of this type does not work) | 227 | * (or if extracting a key from a block of this type does not work) |
236 | */ | 228 | */ |
237 | int GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, | 229 | int |
238 | enum GNUNET_BLOCK_Type type, const void *block, | 230 | GNUNET_BLOCK_get_key (struct GNUNET_BLOCK_Context *ctx, |
239 | size_t block_size, GNUNET_HashCode * key); | 231 | enum GNUNET_BLOCK_Type type, const void *block, |
232 | size_t block_size, GNUNET_HashCode * key); | ||
240 | 233 | ||
241 | 234 | ||
242 | #if 0 /* keep Emacsens' auto-indent happy */ | 235 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_chat_service.h b/src/include/gnunet_chat_service.h index d9c3ec76f..5eb0daf3f 100644 --- a/src/include/gnunet_chat_service.h +++ b/src/include/gnunet_chat_service.h | |||
@@ -183,26 +183,19 @@ typedef int (*GNUNET_CHAT_MessageConfirmation) (void *cls, | |||
183 | * @param me member ID (pseudonym) | 183 | * @param me member ID (pseudonym) |
184 | * @return NULL on error | 184 | * @return NULL on error |
185 | */ | 185 | */ |
186 | struct GNUNET_CHAT_Room *GNUNET_CHAT_join_room (const struct | 186 | struct GNUNET_CHAT_Room * |
187 | GNUNET_CONFIGURATION_Handle | 187 | GNUNET_CHAT_join_room (const struct GNUNET_CONFIGURATION_Handle *cfg, |
188 | *cfg, const char *nick_name, | 188 | const char *nick_name, |
189 | struct GNUNET_CONTAINER_MetaData | 189 | struct GNUNET_CONTAINER_MetaData *member_info, |
190 | *member_info, | 190 | const char *room_name, |
191 | const char *room_name, | 191 | enum GNUNET_CHAT_MsgOptions msg_options, |
192 | enum GNUNET_CHAT_MsgOptions | 192 | GNUNET_CHAT_JoinCallback joinCallback, void *join_cls, |
193 | msg_options, | 193 | GNUNET_CHAT_MessageCallback messageCallback, |
194 | GNUNET_CHAT_JoinCallback | 194 | void *message_cls, |
195 | joinCallback, void *join_cls, | 195 | GNUNET_CHAT_MemberListCallback memberCallback, |
196 | GNUNET_CHAT_MessageCallback | 196 | void *member_cls, |
197 | messageCallback, | 197 | GNUNET_CHAT_MessageConfirmation confirmationCallback, |
198 | void *message_cls, | 198 | void *confirmation_cls, GNUNET_HashCode * me); |
199 | GNUNET_CHAT_MemberListCallback | ||
200 | memberCallback, | ||
201 | void *member_cls, | ||
202 | GNUNET_CHAT_MessageConfirmation | ||
203 | confirmationCallback, | ||
204 | void *confirmation_cls, | ||
205 | GNUNET_HashCode * me); | ||
206 | 199 | ||
207 | /** | 200 | /** |
208 | * Send a message. | 201 | * Send a message. |
@@ -213,18 +206,18 @@ struct GNUNET_CHAT_Room *GNUNET_CHAT_join_room (const struct | |||
213 | * @param receiver use NULL to send to everyone in the room | 206 | * @param receiver use NULL to send to everyone in the room |
214 | * @param sequence_number where to write the sequence id of the message | 207 | * @param sequence_number where to write the sequence id of the message |
215 | */ | 208 | */ |
216 | void GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, | 209 | void |
217 | const char *message, | 210 | GNUNET_CHAT_send_message (struct GNUNET_CHAT_Room *room, const char *message, |
218 | enum GNUNET_CHAT_MsgOptions options, | 211 | enum GNUNET_CHAT_MsgOptions options, |
219 | const struct | 212 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
220 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 213 | *receiver, uint32_t * sequence_number); |
221 | *receiver, uint32_t * sequence_number); | ||
222 | 214 | ||
223 | 215 | ||
224 | /** | 216 | /** |
225 | * Leave a chat room. | 217 | * Leave a chat room. |
226 | */ | 218 | */ |
227 | void GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room); | 219 | void |
220 | GNUNET_CHAT_leave_room (struct GNUNET_CHAT_Room *chat_room); | ||
228 | 221 | ||
229 | 222 | ||
230 | #if 0 | 223 | #if 0 |
@@ -241,9 +234,10 @@ typedef int (*GNUNET_CHAT_RoomIterator) (const char *room, const char *topic, | |||
241 | * List all of the (publically visible) chat rooms. | 234 | * List all of the (publically visible) chat rooms. |
242 | * @return number of rooms on success, GNUNET_SYSERR if iterator aborted | 235 | * @return number of rooms on success, GNUNET_SYSERR if iterator aborted |
243 | */ | 236 | */ |
244 | int GNUNET_CHAT_list_rooms (struct GNUNET_GE_Context *ectx, | 237 | int |
245 | struct GNUNET_GC_Configuration *cfg, | 238 | GNUNET_CHAT_list_rooms (struct GNUNET_GE_Context *ectx, |
246 | GNUNET_CHAT_RoomIterator it, void *cls); | 239 | struct GNUNET_GC_Configuration *cfg, |
240 | GNUNET_CHAT_RoomIterator it, void *cls); | ||
247 | #endif | 241 | #endif |
248 | 242 | ||
249 | 243 | ||
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 3fad01222..ed033d031 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -53,11 +53,9 @@ struct GNUNET_CLIENT_Connection; | |||
53 | * @param cfg configuration to use | 53 | * @param cfg configuration to use |
54 | * @return NULL on error (service unknown to configuration) | 54 | * @return NULL on error (service unknown to configuration) |
55 | */ | 55 | */ |
56 | struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char | 56 | struct GNUNET_CLIENT_Connection * |
57 | *service_name, | 57 | GNUNET_CLIENT_connect (const char *service_name, |
58 | const struct | 58 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
59 | GNUNET_CONFIGURATION_Handle | ||
60 | *cfg); | ||
61 | 59 | ||
62 | 60 | ||
63 | /** | 61 | /** |
@@ -66,8 +64,9 @@ struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (const char | |||
66 | * @param h client handle | 64 | * @param h client handle |
67 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 65 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
68 | */ | 66 | */ |
69 | void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, | 67 | void |
70 | int do_ignore); | 68 | GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, |
69 | int do_ignore); | ||
71 | 70 | ||
72 | 71 | ||
73 | 72 | ||
@@ -86,8 +85,9 @@ void GNUNET_CLIENT_ignore_shutdown (struct GNUNET_CLIENT_Connection *h, | |||
86 | * @param finish_pending_write should a transmission already passed to the | 85 | * @param finish_pending_write should a transmission already passed to the |
87 | * handle be completed? | 86 | * handle be completed? |
88 | */ | 87 | */ |
89 | void GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock, | 88 | void |
90 | int finish_pending_write); | 89 | GNUNET_CLIENT_disconnect (struct GNUNET_CLIENT_Connection *sock, |
90 | int finish_pending_write); | ||
91 | 91 | ||
92 | /** | 92 | /** |
93 | * Type of a function to call when we receive a message | 93 | * Type of a function to call when we receive a message |
@@ -120,10 +120,10 @@ typedef void (*GNUNET_CLIENT_ShutdownTask) (void *cls, int reason); | |||
120 | * @param handler_cls closure for handler | 120 | * @param handler_cls closure for handler |
121 | * @param timeout how long to wait until timing out | 121 | * @param timeout how long to wait until timing out |
122 | */ | 122 | */ |
123 | void GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, | 123 | void |
124 | GNUNET_CLIENT_MessageHandler handler, | 124 | GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, |
125 | void *handler_cls, | 125 | GNUNET_CLIENT_MessageHandler handler, void *handler_cls, |
126 | struct GNUNET_TIME_Relative timeout); | 126 | struct GNUNET_TIME_Relative timeout); |
127 | 127 | ||
128 | 128 | ||
129 | /** | 129 | /** |
@@ -152,20 +152,13 @@ struct GNUNET_CLIENT_TransmitHandle; | |||
152 | * 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 |
153 | * using GNUNET_CONNECTION_notify_transmit_ready_cancel) | 153 | * using GNUNET_CONNECTION_notify_transmit_ready_cancel) |
154 | */ | 154 | */ |
155 | struct GNUNET_CLIENT_TransmitHandle *GNUNET_CLIENT_notify_transmit_ready (struct | 155 | struct GNUNET_CLIENT_TransmitHandle * |
156 | GNUNET_CLIENT_Connection | 156 | GNUNET_CLIENT_notify_transmit_ready (struct GNUNET_CLIENT_Connection *sock, |
157 | *sock, | 157 | size_t size, |
158 | size_t | 158 | struct GNUNET_TIME_Relative timeout, |
159 | size, | 159 | int auto_retry, |
160 | struct | 160 | GNUNET_CONNECTION_TransmitReadyNotify |
161 | GNUNET_TIME_Relative | 161 | notify, void *notify_cls); |
162 | timeout, | ||
163 | int | ||
164 | auto_retry, | ||
165 | GNUNET_CONNECTION_TransmitReadyNotify | ||
166 | notify, | ||
167 | void | ||
168 | *notify_cls); | ||
169 | 162 | ||
170 | 163 | ||
171 | /** | 164 | /** |
@@ -173,9 +166,9 @@ struct GNUNET_CLIENT_TransmitHandle *GNUNET_CLIENT_notify_transmit_ready (struct | |||
173 | * | 166 | * |
174 | * @param th handle from the original request. | 167 | * @param th handle from the original request. |
175 | */ | 168 | */ |
176 | void GNUNET_CLIENT_notify_transmit_ready_cancel (struct | 169 | void |
177 | GNUNET_CLIENT_TransmitHandle | 170 | GNUNET_CLIENT_notify_transmit_ready_cancel (struct GNUNET_CLIENT_TransmitHandle |
178 | *th); | 171 | *th); |
179 | 172 | ||
180 | 173 | ||
181 | /** | 174 | /** |
@@ -199,14 +192,13 @@ void GNUNET_CLIENT_notify_transmit_ready_cancel (struct | |||
199 | * @return GNUNET_OK on success, GNUNET_SYSERR if a request | 192 | * @return GNUNET_OK on success, GNUNET_SYSERR if a request |
200 | * is already pending | 193 | * is already pending |
201 | */ | 194 | */ |
202 | int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection | 195 | int |
203 | *sock, | 196 | GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection *sock, |
204 | const struct GNUNET_MessageHeader | 197 | const struct GNUNET_MessageHeader *hdr, |
205 | *hdr, | 198 | struct GNUNET_TIME_Relative timeout, |
206 | struct GNUNET_TIME_Relative | 199 | int auto_retry, |
207 | timeout, int auto_retry, | 200 | GNUNET_CLIENT_MessageHandler rn, |
208 | GNUNET_CLIENT_MessageHandler rn, | 201 | void *rn_cls); |
209 | void *rn_cls); | ||
210 | 202 | ||
211 | 203 | ||
212 | /** | 204 | /** |
@@ -220,10 +212,11 @@ int GNUNET_CLIENT_transmit_and_get_response (struct GNUNET_CLIENT_Connection | |||
220 | * or "TIMEOUT" (service not known to be running)) | 212 | * or "TIMEOUT" (service not known to be running)) |
221 | * @param task_cls closure for task | 213 | * @param task_cls closure for task |
222 | */ | 214 | */ |
223 | void GNUNET_CLIENT_service_test (const char *service, | 215 | void |
224 | const struct GNUNET_CONFIGURATION_Handle *cfg, | 216 | GNUNET_CLIENT_service_test (const char *service, |
225 | struct GNUNET_TIME_Relative timeout, | 217 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
226 | GNUNET_SCHEDULER_Task task, void *task_cls); | 218 | struct GNUNET_TIME_Relative timeout, |
219 | GNUNET_SCHEDULER_Task task, void *task_cls); | ||
227 | 220 | ||
228 | 221 | ||
229 | #if 0 /* keep Emacsens' auto-indent happy */ | 222 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index f884d9a24..2636824d3 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h | |||
@@ -168,7 +168,8 @@ typedef void (*GNUNET_Logger) (void *cls, enum GNUNET_ErrorType kind, | |||
168 | * @param message what is the message (format string) | 168 | * @param message what is the message (format string) |
169 | * @param ... arguments for format string | 169 | * @param ... arguments for format string |
170 | */ | 170 | */ |
171 | void GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); | 171 | void |
172 | GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); | ||
172 | 173 | ||
173 | 174 | ||
174 | 175 | ||
@@ -181,8 +182,9 @@ void GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...); | |||
181 | * @param message what is the message (format string) | 182 | * @param message what is the message (format string) |
182 | * @param ... arguments for format string | 183 | * @param ... arguments for format string |
183 | */ | 184 | */ |
184 | void GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, | 185 | void |
185 | const char *message, ...); | 186 | GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, |
187 | const char *message, ...); | ||
186 | 188 | ||
187 | 189 | ||
188 | /** | 190 | /** |
@@ -191,7 +193,8 @@ void GNUNET_log_from (enum GNUNET_ErrorType kind, const char *comp, | |||
191 | * @param n number of log calls to ignore | 193 | * @param n number of log calls to ignore |
192 | * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero | 194 | * @param check_reset GNUNET_YES to assert that the log skip counter is currently zero |
193 | */ | 195 | */ |
194 | void GNUNET_log_skip (unsigned int n, int check_reset); | 196 | void |
197 | GNUNET_log_skip (unsigned int n, int check_reset); | ||
195 | 198 | ||
196 | 199 | ||
197 | /** | 200 | /** |
@@ -202,8 +205,8 @@ void GNUNET_log_skip (unsigned int n, int check_reset); | |||
202 | * @param logfile change logging to logfile (use NULL to keep stderr) | 205 | * @param logfile change logging to logfile (use NULL to keep stderr) |
203 | * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened | 206 | * @return GNUNET_OK on success, GNUNET_SYSERR if logfile could not be opened |
204 | */ | 207 | */ |
205 | int GNUNET_log_setup (const char *comp, const char *loglevel, | 208 | int |
206 | const char *logfile); | 209 | GNUNET_log_setup (const char *comp, const char *loglevel, const char *logfile); |
207 | 210 | ||
208 | 211 | ||
209 | /** | 212 | /** |
@@ -212,7 +215,8 @@ int GNUNET_log_setup (const char *comp, const char *loglevel, | |||
212 | * @param logger log function | 215 | * @param logger log function |
213 | * @param logger_cls closure for logger | 216 | * @param logger_cls closure for logger |
214 | */ | 217 | */ |
215 | void GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); | 218 | void |
219 | GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); | ||
216 | 220 | ||
217 | 221 | ||
218 | /** | 222 | /** |
@@ -221,7 +225,8 @@ void GNUNET_logger_add (GNUNET_Logger logger, void *logger_cls); | |||
221 | * @param logger log function | 225 | * @param logger log function |
222 | * @param logger_cls closure for logger | 226 | * @param logger_cls closure for logger |
223 | */ | 227 | */ |
224 | void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); | 228 | void |
229 | GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); | ||
225 | 230 | ||
226 | 231 | ||
227 | /** | 232 | /** |
@@ -232,7 +237,8 @@ void GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls); | |||
232 | * @param hc the hash code | 237 | * @param hc the hash code |
233 | * @return string | 238 | * @return string |
234 | */ | 239 | */ |
235 | const char *GNUNET_h2s (const GNUNET_HashCode * hc); | 240 | const char * |
241 | GNUNET_h2s (const GNUNET_HashCode * hc); | ||
236 | 242 | ||
237 | 243 | ||
238 | /** | 244 | /** |
@@ -244,7 +250,8 @@ const char *GNUNET_h2s (const GNUNET_HashCode * hc); | |||
244 | * @param hc the hash code | 250 | * @param hc the hash code |
245 | * @return string | 251 | * @return string |
246 | */ | 252 | */ |
247 | const char *GNUNET_h2s_full (const GNUNET_HashCode * hc); | 253 | const char * |
254 | GNUNET_h2s_full (const GNUNET_HashCode * hc); | ||
248 | 255 | ||
249 | 256 | ||
250 | /** | 257 | /** |
@@ -256,7 +263,8 @@ const char *GNUNET_h2s_full (const GNUNET_HashCode * hc); | |||
256 | * @return string form of the pid; will be overwritten by next | 263 | * @return string form of the pid; will be overwritten by next |
257 | * call to GNUNET_i2s. | 264 | * call to GNUNET_i2s. |
258 | */ | 265 | */ |
259 | const char *GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); | 266 | const char * |
267 | GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); | ||
260 | 268 | ||
261 | 269 | ||
262 | /** | 270 | /** |
@@ -269,7 +277,8 @@ const char *GNUNET_i2s (const struct GNUNET_PeerIdentity *pid); | |||
269 | * @return nicely formatted string for the address | 277 | * @return nicely formatted string for the address |
270 | * will be overwritten by next call to GNUNET_a2s. | 278 | * will be overwritten by next call to GNUNET_a2s. |
271 | */ | 279 | */ |
272 | const char *GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); | 280 | const char * |
281 | GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); | ||
273 | 282 | ||
274 | /** | 283 | /** |
275 | * Convert error type to string. | 284 | * Convert error type to string. |
@@ -277,7 +286,8 @@ const char *GNUNET_a2s (const struct sockaddr *addr, socklen_t addrlen); | |||
277 | * @param kind type to convert | 286 | * @param kind type to convert |
278 | * @return string corresponding to the type | 287 | * @return string corresponding to the type |
279 | */ | 288 | */ |
280 | const char *GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | 289 | const char * |
290 | GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | ||
281 | 291 | ||
282 | 292 | ||
283 | /** | 293 | /** |
@@ -327,14 +337,16 @@ const char *GNUNET_error_type_to_string (enum GNUNET_ErrorType kind); | |||
327 | * @param n the value in network byte order | 337 | * @param n the value in network byte order |
328 | * @return the same value in host byte order | 338 | * @return the same value in host byte order |
329 | */ | 339 | */ |
330 | unsigned long long GNUNET_ntohll (unsigned long long n); | 340 | unsigned long long |
341 | GNUNET_ntohll (unsigned long long n); | ||
331 | 342 | ||
332 | /** | 343 | /** |
333 | * Convert a long long to network-byte-order. | 344 | * Convert a long long to network-byte-order. |
334 | * @param n the value in host byte order | 345 | * @param n the value in host byte order |
335 | * @return the same value in network byte order | 346 | * @return the same value in network byte order |
336 | */ | 347 | */ |
337 | unsigned long long GNUNET_htonll (unsigned long long n); | 348 | unsigned long long |
349 | GNUNET_htonll (unsigned long long n); | ||
338 | 350 | ||
339 | 351 | ||
340 | /* ************************* allocation functions ****************** */ | 352 | /* ************************* allocation functions ****************** */ |
@@ -468,7 +480,8 @@ unsigned long long GNUNET_htonll (unsigned long long n); | |||
468 | * @param ... data for format string | 480 | * @param ... data for format string |
469 | * @return number of bytes written to buf or negative value on error | 481 | * @return number of bytes written to buf or negative value on error |
470 | */ | 482 | */ |
471 | int GNUNET_snprintf (char *buf, size_t size, const char *format, ...); | 483 | int |
484 | GNUNET_snprintf (char *buf, size_t size, const char *format, ...); | ||
472 | 485 | ||
473 | 486 | ||
474 | /** | 487 | /** |
@@ -479,7 +492,8 @@ int GNUNET_snprintf (char *buf, size_t size, const char *format, ...); | |||
479 | * @param ... data for format string | 492 | * @param ... data for format string |
480 | * @return number of bytes in "*buf" excluding 0-termination | 493 | * @return number of bytes in "*buf" excluding 0-termination |
481 | */ | 494 | */ |
482 | int GNUNET_asprintf (char **buf, const char *format, ...); | 495 | int |
496 | GNUNET_asprintf (char **buf, const char *format, ...); | ||
483 | 497 | ||
484 | 498 | ||
485 | /* ************** internal implementations, use macros above! ************** */ | 499 | /* ************** internal implementations, use macros above! ************** */ |
@@ -495,7 +509,8 @@ int GNUNET_asprintf (char **buf, const char *format, ...); | |||
495 | * @param linenumber line where this call is being made (for debugging) | 509 | * @param linenumber line where this call is being made (for debugging) |
496 | * @return allocated memory, never NULL | 510 | * @return allocated memory, never NULL |
497 | */ | 511 | */ |
498 | void *GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); | 512 | void * |
513 | GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); | ||
499 | 514 | ||
500 | 515 | ||
501 | 516 | ||
@@ -510,8 +525,9 @@ void *GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber); | |||
510 | * @param linenumber line where this call is being made (for debugging) | 525 | * @param linenumber line where this call is being made (for debugging) |
511 | * @return allocated memory, never NULL | 526 | * @return allocated memory, never NULL |
512 | */ | 527 | */ |
513 | void *GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, | 528 | void * |
514 | int linenumber); | 529 | GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, |
530 | int linenumber); | ||
515 | 531 | ||
516 | 532 | ||
517 | /** | 533 | /** |
@@ -526,15 +542,15 @@ void *GNUNET_xmemdup_ (const void *buf, size_t size, const char *filename, | |||
526 | * @param linenumber line where this call is being made (for debugging) | 542 | * @param linenumber line where this call is being made (for debugging) |
527 | * @return pointer to size bytes of memory, NULL if we do not have enough memory | 543 | * @return pointer to size bytes of memory, NULL if we do not have enough memory |
528 | */ | 544 | */ |
529 | void *GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, | 545 | void * |
530 | int linenumber); | 546 | GNUNET_xmalloc_unchecked_ (size_t size, const char *filename, int linenumber); |
531 | 547 | ||
532 | /** | 548 | /** |
533 | * Reallocate memory. Checks the return value, aborts if no more | 549 | * Reallocate memory. Checks the return value, aborts if no more |
534 | * memory is available. | 550 | * memory is available. |
535 | */ | 551 | */ |
536 | void *GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, | 552 | void * |
537 | int linenumber); | 553 | GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, int linenumber); |
538 | 554 | ||
539 | /** | 555 | /** |
540 | * Free memory. Merely a wrapper for the case that we | 556 | * Free memory. Merely a wrapper for the case that we |
@@ -545,7 +561,8 @@ void *GNUNET_xrealloc_ (void *ptr, size_t n, const char *filename, | |||
545 | * @param filename where is this call being made (for debugging) | 561 | * @param filename where is this call being made (for debugging) |
546 | * @param linenumber line where this call is being made (for debugging) | 562 | * @param linenumber line where this call is being made (for debugging) |
547 | */ | 563 | */ |
548 | void GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); | 564 | void |
565 | GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); | ||
549 | 566 | ||
550 | 567 | ||
551 | /** | 568 | /** |
@@ -555,7 +572,8 @@ void GNUNET_xfree_ (void *ptr, const char *filename, int linenumber); | |||
555 | * @param linenumber line where this call is being made (for debugging) | 572 | * @param linenumber line where this call is being made (for debugging) |
556 | * @return the duplicated string | 573 | * @return the duplicated string |
557 | */ | 574 | */ |
558 | char *GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); | 575 | char * |
576 | GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); | ||
559 | 577 | ||
560 | /** | 578 | /** |
561 | * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the GNUNET_strndup macro. | 579 | * Dup partially a string. Don't call GNUNET_xstrndup_ directly. Use the GNUNET_strndup macro. |
@@ -565,8 +583,9 @@ char *GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber); | |||
565 | * @param linenumber line where this call is being made (for debugging) | 583 | * @param linenumber line where this call is being made (for debugging) |
566 | * @return the duplicated string | 584 | * @return the duplicated string |
567 | */ | 585 | */ |
568 | char *GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, | 586 | char * |
569 | int linenumber); | 587 | GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, |
588 | int linenumber); | ||
570 | 589 | ||
571 | /** | 590 | /** |
572 | * Grow an array, the new elements are zeroed out. | 591 | * Grow an array, the new elements are zeroed out. |
@@ -583,9 +602,9 @@ char *GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, | |||
583 | * @param filename where is this call being made (for debugging) | 602 | * @param filename where is this call being made (for debugging) |
584 | * @param linenumber line where this call is being made (for debugging) | 603 | * @param linenumber line where this call is being made (for debugging) |
585 | */ | 604 | */ |
586 | void GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount, | 605 | void |
587 | unsigned int newCount, const char *filename, | 606 | GNUNET_xgrow_ (void **old, size_t elementSize, unsigned int *oldCount, |
588 | int linenumber); | 607 | unsigned int newCount, const char *filename, int linenumber); |
589 | 608 | ||
590 | 609 | ||
591 | 610 | ||
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 24705f0fb..7167d8bd6 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -49,7 +49,8 @@ struct GNUNET_CONFIGURATION_Handle; | |||
49 | * Create a new configuration object. | 49 | * Create a new configuration object. |
50 | * @return fresh configuration object | 50 | * @return fresh configuration object |
51 | */ | 51 | */ |
52 | struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_create (void); | 52 | struct GNUNET_CONFIGURATION_Handle * |
53 | GNUNET_CONFIGURATION_create (void); | ||
53 | 54 | ||
54 | 55 | ||
55 | /** | 56 | /** |
@@ -58,9 +59,8 @@ struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_create (void); | |||
58 | * @param cfg configuration to duplicate | 59 | * @param cfg configuration to duplicate |
59 | * @return duplicate configuration | 60 | * @return duplicate configuration |
60 | */ | 61 | */ |
61 | struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_dup (const struct | 62 | struct GNUNET_CONFIGURATION_Handle * |
62 | GNUNET_CONFIGURATION_Handle | 63 | GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg); |
63 | *cfg); | ||
64 | 64 | ||
65 | 65 | ||
66 | /** | 66 | /** |
@@ -68,7 +68,8 @@ struct GNUNET_CONFIGURATION_Handle *GNUNET_CONFIGURATION_dup (const struct | |||
68 | * | 68 | * |
69 | * @param cfg configuration to destroy | 69 | * @param cfg configuration to destroy |
70 | */ | 70 | */ |
71 | void GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); | 71 | void |
72 | GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); | ||
72 | 73 | ||
73 | 74 | ||
74 | /** | 75 | /** |
@@ -80,8 +81,9 @@ void GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg); | |||
80 | * @param filename name of the configuration file, NULL to load defaults | 81 | * @param filename name of the configuration file, NULL to load defaults |
81 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 82 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
82 | */ | 83 | */ |
83 | int GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | 84 | int |
84 | const char *filename); | 85 | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, |
86 | const char *filename); | ||
85 | 87 | ||
86 | 88 | ||
87 | /** | 89 | /** |
@@ -92,8 +94,9 @@ int GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
92 | * @param filename name of the configuration file | 94 | * @param filename name of the configuration file |
93 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 95 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
94 | */ | 96 | */ |
95 | int GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | 97 | int |
96 | const char *filename); | 98 | GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, |
99 | const char *filename); | ||
97 | 100 | ||
98 | 101 | ||
99 | /** | 102 | /** |
@@ -103,8 +106,9 @@ int GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
103 | * @param filename where to write the configuration | 106 | * @param filename where to write the configuration |
104 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 107 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
105 | */ | 108 | */ |
106 | int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | 109 | int |
107 | const char *filename); | 110 | GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, |
111 | const char *filename); | ||
108 | 112 | ||
109 | /** | 113 | /** |
110 | * Write only configuration entries that have been changed to configuration file | 114 | * Write only configuration entries that have been changed to configuration file |
@@ -113,10 +117,11 @@ int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
113 | * @param filename where to write the configuration diff between default and new | 117 | * @param filename where to write the configuration diff between default and new |
114 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 118 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
115 | */ | 119 | */ |
116 | int GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle | 120 | int |
117 | *cfgDefault, | 121 | GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle |
118 | const struct GNUNET_CONFIGURATION_Handle | 122 | *cfgDefault, |
119 | *cfgNew, const char *filename); | 123 | const struct GNUNET_CONFIGURATION_Handle |
124 | *cfgNew, const char *filename); | ||
120 | 125 | ||
121 | /** | 126 | /** |
122 | * Test if there are configuration options that were | 127 | * Test if there are configuration options that were |
@@ -125,8 +130,8 @@ int GNUNET_CONFIGURATION_write_diffs (const struct GNUNET_CONFIGURATION_Handle | |||
125 | * @param cfg configuration to inspect | 130 | * @param cfg configuration to inspect |
126 | * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) | 131 | * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) |
127 | */ | 132 | */ |
128 | int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle | 133 | int |
129 | *cfg); | 134 | GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); |
130 | 135 | ||
131 | 136 | ||
132 | /** | 137 | /** |
@@ -159,9 +164,10 @@ typedef void (*GNUNET_CONFIGURATION_Section_Iterator) (void *cls, | |||
159 | * @param iter function to call on each option | 164 | * @param iter function to call on each option |
160 | * @param iter_cls closure for iter | 165 | * @param iter_cls closure for iter |
161 | */ | 166 | */ |
162 | void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle | 167 | void |
163 | *cfg, GNUNET_CONFIGURATION_Iterator iter, | 168 | GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, |
164 | void *iter_cls); | 169 | GNUNET_CONFIGURATION_Iterator iter, |
170 | void *iter_cls); | ||
165 | 171 | ||
166 | 172 | ||
167 | /** | 173 | /** |
@@ -171,10 +177,11 @@ void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle | |||
171 | * @param iter function to call on each section | 177 | * @param iter function to call on each section |
172 | * @param iter_cls closure for iter | 178 | * @param iter_cls closure for iter |
173 | */ | 179 | */ |
174 | void GNUNET_CONFIGURATION_iterate_sections (const struct | 180 | void |
175 | GNUNET_CONFIGURATION_Handle *cfg, | 181 | GNUNET_CONFIGURATION_iterate_sections (const struct GNUNET_CONFIGURATION_Handle |
176 | GNUNET_CONFIGURATION_Section_Iterator | 182 | *cfg, |
177 | iter, void *iter_cls); | 183 | GNUNET_CONFIGURATION_Section_Iterator |
184 | iter, void *iter_cls); | ||
178 | 185 | ||
179 | 186 | ||
180 | /** | 187 | /** |
@@ -183,8 +190,9 @@ void GNUNET_CONFIGURATION_iterate_sections (const struct | |||
183 | * @param cfg configuration to inspect | 190 | * @param cfg configuration to inspect |
184 | * @param section name of the section to remove | 191 | * @param section name of the section to remove |
185 | */ | 192 | */ |
186 | void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle | 193 | void |
187 | *cfg, const char *section); | 194 | GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle *cfg, |
195 | const char *section); | ||
188 | 196 | ||
189 | /** | 197 | /** |
190 | * Get a configuration value that should be a number. | 198 | * Get a configuration value that should be a number. |
@@ -195,11 +203,11 @@ void GNUNET_CONFIGURATION_remove_section (struct GNUNET_CONFIGURATION_Handle | |||
195 | * @param number where to store the numeric value of the option | 203 | * @param number where to store the numeric value of the option |
196 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 204 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
197 | */ | 205 | */ |
198 | int GNUNET_CONFIGURATION_get_value_number (const struct | 206 | int |
199 | GNUNET_CONFIGURATION_Handle *cfg, | 207 | GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle |
200 | const char *section, | 208 | *cfg, const char *section, |
201 | const char *option, | 209 | const char *option, |
202 | unsigned long long *number); | 210 | unsigned long long *number); |
203 | 211 | ||
204 | 212 | ||
205 | /** | 213 | /** |
@@ -211,11 +219,11 @@ int GNUNET_CONFIGURATION_get_value_number (const struct | |||
211 | * @param time set to the time value stored in the configuration | 219 | * @param time set to the time value stored in the configuration |
212 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 220 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
213 | */ | 221 | */ |
214 | int GNUNET_CONFIGURATION_get_value_time (const struct | 222 | int |
215 | GNUNET_CONFIGURATION_Handle *cfg, | 223 | GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle |
216 | const char *section, | 224 | *cfg, const char *section, |
217 | const char *option, | 225 | const char *option, |
218 | struct GNUNET_TIME_Relative *time); | 226 | struct GNUNET_TIME_Relative *time); |
219 | 227 | ||
220 | 228 | ||
221 | /** | 229 | /** |
@@ -226,9 +234,9 @@ int GNUNET_CONFIGURATION_get_value_time (const struct | |||
226 | * @param option option of interest | 234 | * @param option option of interest |
227 | * @return GNUNET_YES if so, GNUNET_NO if not. | 235 | * @return GNUNET_YES if so, GNUNET_NO if not. |
228 | */ | 236 | */ |
229 | int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle | 237 | int |
230 | *cfg, const char *section, | 238 | GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, |
231 | const char *option); | 239 | const char *section, const char *option); |
232 | 240 | ||
233 | 241 | ||
234 | /** | 242 | /** |
@@ -241,10 +249,10 @@ int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle | |||
241 | * value, or NULL if option is not specified | 249 | * value, or NULL if option is not specified |
242 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 250 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
243 | */ | 251 | */ |
244 | int GNUNET_CONFIGURATION_get_value_string (const struct | 252 | int |
245 | GNUNET_CONFIGURATION_Handle *cfg, | 253 | GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle |
246 | const char *section, | 254 | *cfg, const char *section, |
247 | const char *option, char **value); | 255 | const char *option, char **value); |
248 | 256 | ||
249 | 257 | ||
250 | /** | 258 | /** |
@@ -258,10 +266,11 @@ int GNUNET_CONFIGURATION_get_value_string (const struct | |||
258 | * value, or NULL if option is not specified | 266 | * value, or NULL if option is not specified |
259 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 267 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
260 | */ | 268 | */ |
261 | int GNUNET_CONFIGURATION_get_value_filename (const struct | 269 | int |
262 | GNUNET_CONFIGURATION_Handle *cfg, | 270 | GNUNET_CONFIGURATION_get_value_filename (const struct |
263 | const char *section, | 271 | GNUNET_CONFIGURATION_Handle *cfg, |
264 | const char *option, char **value); | 272 | const char *section, |
273 | const char *option, char **value); | ||
265 | 274 | ||
266 | /** | 275 | /** |
267 | * Iterate over the set of filenames stored in a configuration value. | 276 | * Iterate over the set of filenames stored in a configuration value. |
@@ -273,12 +282,13 @@ int GNUNET_CONFIGURATION_get_value_filename (const struct | |||
273 | * @param cb_cls closure for cb | 282 | * @param cb_cls closure for cb |
274 | * @return number of filenames iterated over, -1 on error | 283 | * @return number of filenames iterated over, -1 on error |
275 | */ | 284 | */ |
276 | int GNUNET_CONFIGURATION_iterate_value_filenames (const struct | 285 | int |
277 | GNUNET_CONFIGURATION_Handle | 286 | GNUNET_CONFIGURATION_iterate_value_filenames (const struct |
278 | *cfg, const char *section, | 287 | GNUNET_CONFIGURATION_Handle *cfg, |
279 | const char *option, | 288 | const char *section, |
280 | GNUNET_FileNameCallback cb, | 289 | const char *option, |
281 | void *cb_cls); | 290 | GNUNET_FileNameCallback cb, |
291 | void *cb_cls); | ||
282 | 292 | ||
283 | /** | 293 | /** |
284 | * Iterate over values of a section in the configuration. | 294 | * Iterate over values of a section in the configuration. |
@@ -288,11 +298,12 @@ int GNUNET_CONFIGURATION_iterate_value_filenames (const struct | |||
288 | * @param iter function to call on each option | 298 | * @param iter function to call on each option |
289 | * @param iter_cls closure for iter | 299 | * @param iter_cls closure for iter |
290 | */ | 300 | */ |
291 | void GNUNET_CONFIGURATION_iterate_section_values (const struct | 301 | void |
292 | GNUNET_CONFIGURATION_Handle | 302 | GNUNET_CONFIGURATION_iterate_section_values (const struct |
293 | *cfg, const char *section, | 303 | GNUNET_CONFIGURATION_Handle *cfg, |
294 | GNUNET_CONFIGURATION_Iterator | 304 | const char *section, |
295 | iter, void *iter_cls); | 305 | GNUNET_CONFIGURATION_Iterator iter, |
306 | void *iter_cls); | ||
296 | 307 | ||
297 | /** | 308 | /** |
298 | * Get a configuration value that should be in a set of | 309 | * Get a configuration value that should be in a set of |
@@ -306,12 +317,11 @@ void GNUNET_CONFIGURATION_iterate_section_values (const struct | |||
306 | * or NULL if option is not specified and no default given | 317 | * or NULL if option is not specified and no default given |
307 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 318 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
308 | */ | 319 | */ |
309 | int GNUNET_CONFIGURATION_get_value_choice (const struct | 320 | int |
310 | GNUNET_CONFIGURATION_Handle *cfg, | 321 | GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle |
311 | const char *section, | 322 | *cfg, const char *section, |
312 | const char *option, | 323 | const char *option, const char **choices, |
313 | const char **choices, | 324 | const char **value); |
314 | const char **value); | ||
315 | 325 | ||
316 | /** | 326 | /** |
317 | * Get a configuration value that should be in a set of | 327 | * Get a configuration value that should be in a set of |
@@ -322,10 +332,10 @@ int GNUNET_CONFIGURATION_get_value_choice (const struct | |||
322 | * @param option option of interest | 332 | * @param option option of interest |
323 | * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR | 333 | * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR |
324 | */ | 334 | */ |
325 | int GNUNET_CONFIGURATION_get_value_yesno (const struct | 335 | int |
326 | GNUNET_CONFIGURATION_Handle *cfg, | 336 | GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle |
327 | const char *section, | 337 | *cfg, const char *section, |
328 | const char *option); | 338 | const char *option); |
329 | 339 | ||
330 | /** | 340 | /** |
331 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" | 341 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" |
@@ -336,9 +346,9 @@ int GNUNET_CONFIGURATION_get_value_yesno (const struct | |||
336 | * @param orig string to $-expand (will be freed!) | 346 | * @param orig string to $-expand (will be freed!) |
337 | * @return $-expanded string | 347 | * @return $-expanded string |
338 | */ | 348 | */ |
339 | char *GNUNET_CONFIGURATION_expand_dollar (const struct | 349 | char * |
340 | GNUNET_CONFIGURATION_Handle *cfg, | 350 | GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle |
341 | char *orig); | 351 | *cfg, char *orig); |
342 | 352 | ||
343 | 353 | ||
344 | /** | 354 | /** |
@@ -349,10 +359,10 @@ char *GNUNET_CONFIGURATION_expand_dollar (const struct | |||
349 | * @param option option of interest | 359 | * @param option option of interest |
350 | * @param number value to set | 360 | * @param number value to set |
351 | */ | 361 | */ |
352 | void GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle | 362 | void |
353 | *cfg, const char *section, | 363 | GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle *cfg, |
354 | const char *option, | 364 | const char *section, const char *option, |
355 | unsigned long long number); | 365 | unsigned long long number); |
356 | 366 | ||
357 | 367 | ||
358 | /** | 368 | /** |
@@ -363,10 +373,10 @@ void GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle | |||
363 | * @param option option of interest | 373 | * @param option option of interest |
364 | * @param value value to set | 374 | * @param value value to set |
365 | */ | 375 | */ |
366 | void GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle | 376 | void |
367 | *cfg, const char *section, | 377 | GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle *cfg, |
368 | const char *option, | 378 | const char *section, const char *option, |
369 | const char *value); | 379 | const char *value); |
370 | 380 | ||
371 | /** | 381 | /** |
372 | * Remove a filename from a configuration value that | 382 | * Remove a filename from a configuration value that |
@@ -379,11 +389,11 @@ void GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle | |||
379 | * @return GNUNET_OK on success, | 389 | * @return GNUNET_OK on success, |
380 | * GNUNET_SYSERR if the filename is not in the list | 390 | * GNUNET_SYSERR if the filename is not in the list |
381 | */ | 391 | */ |
382 | int GNUNET_CONFIGURATION_remove_value_filename (struct | 392 | int |
383 | GNUNET_CONFIGURATION_Handle | 393 | GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle |
384 | *cfg, const char *section, | 394 | *cfg, const char *section, |
385 | const char *option, | 395 | const char *option, |
386 | const char *value); | 396 | const char *value); |
387 | 397 | ||
388 | /** | 398 | /** |
389 | * Append a filename to a configuration value that | 399 | * Append a filename to a configuration value that |
@@ -396,11 +406,11 @@ int GNUNET_CONFIGURATION_remove_value_filename (struct | |||
396 | * @return GNUNET_OK on success, | 406 | * @return GNUNET_OK on success, |
397 | * GNUNET_SYSERR if the filename already in the list | 407 | * GNUNET_SYSERR if the filename already in the list |
398 | */ | 408 | */ |
399 | int GNUNET_CONFIGURATION_append_value_filename (struct | 409 | int |
400 | GNUNET_CONFIGURATION_Handle | 410 | GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle |
401 | *cfg, const char *section, | 411 | *cfg, const char *section, |
402 | const char *option, | 412 | const char *option, |
403 | const char *value); | 413 | const char *value); |
404 | 414 | ||
405 | 415 | ||
406 | #if 0 /* keep Emacsens' auto-indent happy */ | 416 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_connection_lib.h b/src/include/gnunet_connection_lib.h index af10c5966..f7a6e5078 100644 --- a/src/include/gnunet_connection_lib.h +++ b/src/include/gnunet_connection_lib.h | |||
@@ -111,7 +111,8 @@ typedef void (*GNUNET_CONNECTION_Receiver) (void *cls, const void *buf, | |||
111 | * | 111 | * |
112 | * @param sock the connection to set persistent | 112 | * @param sock the connection to set persistent |
113 | */ | 113 | */ |
114 | void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock); | 114 | void |
115 | GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock); | ||
115 | 116 | ||
116 | /** | 117 | /** |
117 | * Disable the "CORK" feature for communication with the given socket, | 118 | * Disable the "CORK" feature for communication with the given socket, |
@@ -124,7 +125,8 @@ void GNUNET_CONNECTION_persist_ (struct GNUNET_CONNECTION_Handle *sock); | |||
124 | * @param sock the connection to make flushing and blocking | 125 | * @param sock the connection to make flushing and blocking |
125 | * @return GNUNET_OK on success | 126 | * @return GNUNET_OK on success |
126 | */ | 127 | */ |
127 | int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); | 128 | int |
129 | GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); | ||
128 | 130 | ||
129 | 131 | ||
130 | /** | 132 | /** |
@@ -135,9 +137,8 @@ int GNUNET_CONNECTION_disable_corking (struct GNUNET_CONNECTION_Handle *sock); | |||
135 | * @param osSocket existing socket to box | 137 | * @param osSocket existing socket to box |
136 | * @return the boxed socket handle | 138 | * @return the boxed socket handle |
137 | */ | 139 | */ |
138 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct | 140 | struct GNUNET_CONNECTION_Handle * |
139 | GNUNET_NETWORK_Handle | 141 | GNUNET_CONNECTION_create_from_existing (struct GNUNET_NETWORK_Handle *osSocket); |
140 | *osSocket); | ||
141 | 142 | ||
142 | 143 | ||
143 | /** | 144 | /** |
@@ -149,10 +150,10 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_existing (struct | |||
149 | * @param lsock listen socket | 150 | * @param lsock listen socket |
150 | * @return the socket handle, NULL on error (for example, access refused) | 151 | * @return the socket handle, NULL on error (for example, access refused) |
151 | */ | 152 | */ |
152 | struct GNUNET_CONNECTION_Handle | 153 | struct GNUNET_CONNECTION_Handle * |
153 | *GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, | 154 | GNUNET_CONNECTION_create_from_accept (GNUNET_CONNECTION_AccessCheck access, |
154 | void *access_cls, | 155 | void *access_cls, |
155 | struct GNUNET_NETWORK_Handle *lsock); | 156 | struct GNUNET_NETWORK_Handle *lsock); |
156 | 157 | ||
157 | 158 | ||
158 | /** | 159 | /** |
@@ -165,15 +166,10 @@ struct GNUNET_CONNECTION_Handle | |||
165 | * @param port port to connect to | 166 | * @param port port to connect to |
166 | * @return the socket handle | 167 | * @return the socket handle |
167 | */ | 168 | */ |
168 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const | 169 | struct GNUNET_CONNECTION_Handle * |
169 | struct | 170 | GNUNET_CONNECTION_create_from_connect (const struct GNUNET_CONFIGURATION_Handle |
170 | GNUNET_CONFIGURATION_Handle | 171 | *cfg, const char *hostname, |
171 | *cfg, | 172 | uint16_t port); |
172 | const | ||
173 | char | ||
174 | *hostname, | ||
175 | uint16_t | ||
176 | port); | ||
177 | 173 | ||
178 | 174 | ||
179 | /** | 175 | /** |
@@ -185,11 +181,10 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_connect (const | |||
185 | * @param unixpath path to connect to) | 181 | * @param unixpath path to connect to) |
186 | * @return the socket handle, NULL on systems without UNIX support | 182 | * @return the socket handle, NULL on systems without UNIX support |
187 | */ | 183 | */ |
188 | struct GNUNET_CONNECTION_Handle | 184 | struct GNUNET_CONNECTION_Handle * |
189 | *GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct | 185 | GNUNET_CONNECTION_create_from_connect_to_unixpath (const struct |
190 | GNUNET_CONFIGURATION_Handle | 186 | GNUNET_CONFIGURATION_Handle |
191 | *cfg, | 187 | *cfg, const char *unixpath); |
192 | const char *unixpath); | ||
193 | 188 | ||
194 | 189 | ||
195 | 190 | ||
@@ -204,14 +199,10 @@ struct GNUNET_CONNECTION_Handle | |||
204 | * @param addrlen length of server address | 199 | * @param addrlen length of server address |
205 | * @return the socket handle | 200 | * @return the socket handle |
206 | */ | 201 | */ |
207 | struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int | 202 | struct GNUNET_CONNECTION_Handle * |
208 | af_family, | 203 | GNUNET_CONNECTION_create_from_sockaddr (int af_family, |
209 | const | 204 | const struct sockaddr *serv_addr, |
210 | struct | 205 | socklen_t addrlen); |
211 | sockaddr | ||
212 | *serv_addr, | ||
213 | socklen_t | ||
214 | addrlen); | ||
215 | 206 | ||
216 | /** | 207 | /** |
217 | * Check if socket is valid (no fatal errors have happened so far). | 208 | * Check if socket is valid (no fatal errors have happened so far). |
@@ -221,7 +212,8 @@ struct GNUNET_CONNECTION_Handle *GNUNET_CONNECTION_create_from_sockaddr (int | |||
221 | * @param sock socket to check | 212 | * @param sock socket to check |
222 | * @return GNUNET_YES if valid, GNUNET_NO otherwise | 213 | * @return GNUNET_YES if valid, GNUNET_NO otherwise |
223 | */ | 214 | */ |
224 | int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); | 215 | int |
216 | GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); | ||
225 | 217 | ||
226 | 218 | ||
227 | /** | 219 | /** |
@@ -232,8 +224,9 @@ int GNUNET_CONNECTION_check (struct GNUNET_CONNECTION_Handle *sock); | |||
232 | * @param addrlen where to store the length of the address | 224 | * @param addrlen where to store the length of the address |
233 | * @return GNUNET_OK on success | 225 | * @return GNUNET_OK on success |
234 | */ | 226 | */ |
235 | int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, | 227 | int |
236 | void **addr, size_t * addrlen); | 228 | GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, |
229 | void **addr, size_t * addrlen); | ||
237 | 230 | ||
238 | 231 | ||
239 | /** | 232 | /** |
@@ -249,8 +242,9 @@ int GNUNET_CONNECTION_get_address (struct GNUNET_CONNECTION_Handle *sock, | |||
249 | * read from the application; all other transmissions should be | 242 | * read from the application; all other transmissions should be |
250 | * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). | 243 | * aborted using 'GNUNET_CONNECTION_notify_transmit_ready_cancel'). |
251 | */ | 244 | */ |
252 | void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, | 245 | void |
253 | int finish_pending_write); | 246 | GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, |
247 | int finish_pending_write); | ||
254 | 248 | ||
255 | 249 | ||
256 | /** | 250 | /** |
@@ -266,10 +260,11 @@ void GNUNET_CONNECTION_destroy (struct GNUNET_CONNECTION_Handle *sock, | |||
266 | * @param receiver function to call with received data | 260 | * @param receiver function to call with received data |
267 | * @param receiver_cls closure for receiver | 261 | * @param receiver_cls closure for receiver |
268 | */ | 262 | */ |
269 | void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, | 263 | void |
270 | size_t max, struct GNUNET_TIME_Relative timeout, | 264 | GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, size_t max, |
271 | GNUNET_CONNECTION_Receiver receiver, | 265 | struct GNUNET_TIME_Relative timeout, |
272 | void *receiver_cls); | 266 | GNUNET_CONNECTION_Receiver receiver, |
267 | void *receiver_cls); | ||
273 | 268 | ||
274 | 269 | ||
275 | /** | 270 | /** |
@@ -280,7 +275,8 @@ void GNUNET_CONNECTION_receive (struct GNUNET_CONNECTION_Handle *sock, | |||
280 | * @param sock socket handle | 275 | * @param sock socket handle |
281 | * @return closure of the original receiver callback closure | 276 | * @return closure of the original receiver callback closure |
282 | */ | 277 | */ |
283 | void *GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock); | 278 | void * |
279 | GNUNET_CONNECTION_receive_cancel (struct GNUNET_CONNECTION_Handle *sock); | ||
284 | 280 | ||
285 | 281 | ||
286 | /** | 282 | /** |
@@ -333,13 +329,12 @@ struct GNUNET_CONNECTION_TransmitHandle; | |||
333 | * @return non-NULL if the notify callback was queued, | 329 | * @return non-NULL if the notify callback was queued, |
334 | * NULL if we are already going to notify someone else (busy) | 330 | * NULL if we are already going to notify someone else (busy) |
335 | */ | 331 | */ |
336 | struct GNUNET_CONNECTION_TransmitHandle | 332 | struct GNUNET_CONNECTION_TransmitHandle * |
337 | *GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle | 333 | GNUNET_CONNECTION_notify_transmit_ready (struct GNUNET_CONNECTION_Handle *sock, |
338 | *sock, size_t size, | 334 | size_t size, |
339 | struct GNUNET_TIME_Relative | 335 | struct GNUNET_TIME_Relative timeout, |
340 | timeout, | 336 | GNUNET_CONNECTION_TransmitReadyNotify |
341 | GNUNET_CONNECTION_TransmitReadyNotify | 337 | notify, void *notify_cls); |
342 | notify, void *notify_cls); | ||
343 | 338 | ||
344 | 339 | ||
345 | /** | 340 | /** |
@@ -348,9 +343,10 @@ struct GNUNET_CONNECTION_TransmitHandle | |||
348 | * | 343 | * |
349 | * @param h handle for notification to cancel | 344 | * @param h handle for notification to cancel |
350 | */ | 345 | */ |
351 | void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct | 346 | void |
352 | GNUNET_CONNECTION_TransmitHandle | 347 | GNUNET_CONNECTION_notify_transmit_ready_cancel (struct |
353 | *h); | 348 | GNUNET_CONNECTION_TransmitHandle |
349 | *h); | ||
354 | 350 | ||
355 | 351 | ||
356 | /** | 352 | /** |
@@ -359,8 +355,9 @@ void GNUNET_CONNECTION_notify_transmit_ready_cancel (struct | |||
359 | * @param sock socket handle | 355 | * @param sock socket handle |
360 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 356 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
361 | */ | 357 | */ |
362 | void GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, | 358 | void |
363 | int do_ignore); | 359 | GNUNET_CONNECTION_ignore_shutdown (struct GNUNET_CONNECTION_Handle *sock, |
360 | int do_ignore); | ||
364 | 361 | ||
365 | 362 | ||
366 | #if 0 /* keep Emacsens' auto-indent happy */ | 363 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index fde31ed34..cad85d016 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -75,13 +75,9 @@ typedef int (*GNUNET_HashCodeIterator) (void *cls, GNUNET_HashCode * next); | |||
75 | * element (number of bits set per element in the set) | 75 | * element (number of bits set per element in the set) |
76 | * @return the bloomfilter | 76 | * @return the bloomfilter |
77 | */ | 77 | */ |
78 | struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_load (const | 78 | struct GNUNET_CONTAINER_BloomFilter * |
79 | char | 79 | GNUNET_CONTAINER_bloomfilter_load (const char *filename, size_t size, |
80 | *filename, | 80 | unsigned int k); |
81 | size_t | ||
82 | size, | ||
83 | unsigned | ||
84 | int k); | ||
85 | 81 | ||
86 | 82 | ||
87 | /** | 83 | /** |
@@ -97,13 +93,9 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_load (const | |||
97 | * element (number of bits set per element in the set) | 93 | * element (number of bits set per element in the set) |
98 | * @return the bloomfilter | 94 | * @return the bloomfilter |
99 | */ | 95 | */ |
100 | struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_init (const | 96 | struct GNUNET_CONTAINER_BloomFilter * |
101 | char | 97 | GNUNET_CONTAINER_bloomfilter_init (const char *data, size_t size, |
102 | *data, | 98 | unsigned int k); |
103 | size_t | ||
104 | size, | ||
105 | unsigned | ||
106 | int k); | ||
107 | 99 | ||
108 | 100 | ||
109 | /** | 101 | /** |
@@ -114,9 +106,10 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_init (const | |||
114 | * @param size the size of the given data array | 106 | * @param size the size of the given data array |
115 | * @return GNUNET_SYSERR if the data array of the wrong size | 107 | * @return GNUNET_SYSERR if the data array of the wrong size |
116 | */ | 108 | */ |
117 | int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct | 109 | int |
118 | GNUNET_CONTAINER_BloomFilter *bf, | 110 | GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct |
119 | char *data, size_t size); | 111 | GNUNET_CONTAINER_BloomFilter *bf, |
112 | char *data, size_t size); | ||
120 | 113 | ||
121 | 114 | ||
122 | /** | 115 | /** |
@@ -125,8 +118,9 @@ int GNUNET_CONTAINER_bloomfilter_get_raw_data (const struct | |||
125 | * @param bf the filter | 118 | * @param bf the filter |
126 | * @return GNUNET_YES if the element is in the filter, GNUNET_NO if not | 119 | * @return GNUNET_YES if the element is in the filter, GNUNET_NO if not |
127 | */ | 120 | */ |
128 | int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter | 121 | int |
129 | *bf, const GNUNET_HashCode * e); | 122 | GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter |
123 | *bf, const GNUNET_HashCode * e); | ||
130 | 124 | ||
131 | 125 | ||
132 | /** | 126 | /** |
@@ -134,8 +128,9 @@ int GNUNET_CONTAINER_bloomfilter_test (const struct GNUNET_CONTAINER_BloomFilter | |||
134 | * @param bf the filter | 128 | * @param bf the filter |
135 | * @param e the element | 129 | * @param e the element |
136 | */ | 130 | */ |
137 | void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, | 131 | void |
138 | const GNUNET_HashCode * e); | 132 | GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, |
133 | const GNUNET_HashCode * e); | ||
139 | 134 | ||
140 | 135 | ||
141 | /** | 136 | /** |
@@ -143,8 +138,9 @@ void GNUNET_CONTAINER_bloomfilter_add (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
143 | * @param bf the filter | 138 | * @param bf the filter |
144 | * @param e the element to remove | 139 | * @param e the element to remove |
145 | */ | 140 | */ |
146 | void GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter | 141 | void |
147 | *bf, const GNUNET_HashCode * e); | 142 | GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter *bf, |
143 | const GNUNET_HashCode * e); | ||
148 | 144 | ||
149 | 145 | ||
150 | /** | 146 | /** |
@@ -153,10 +149,9 @@ void GNUNET_CONTAINER_bloomfilter_remove (struct GNUNET_CONTAINER_BloomFilter | |||
153 | * @param bf the filter | 149 | * @param bf the filter |
154 | * @return copy of bf | 150 | * @return copy of bf |
155 | */ | 151 | */ |
156 | struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_copy (const | 152 | struct GNUNET_CONTAINER_BloomFilter * |
157 | struct | 153 | GNUNET_CONTAINER_bloomfilter_copy (const struct GNUNET_CONTAINER_BloomFilter |
158 | GNUNET_CONTAINER_BloomFilter | 154 | *bf); |
159 | *bf); | ||
160 | 155 | ||
161 | 156 | ||
162 | 157 | ||
@@ -166,8 +161,8 @@ struct GNUNET_CONTAINER_BloomFilter *GNUNET_CONTAINER_bloomfilter_copy (const | |||
166 | * free the space on the drive) | 161 | * free the space on the drive) |
167 | * @param bf the filter | 162 | * @param bf the filter |
168 | */ | 163 | */ |
169 | void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter | 164 | void |
170 | *bf); | 165 | GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter *bf); |
171 | 166 | ||
172 | 167 | ||
173 | /** | 168 | /** |
@@ -176,17 +171,17 @@ void GNUNET_CONTAINER_bloomfilter_free (struct GNUNET_CONTAINER_BloomFilter | |||
176 | * @param bf the filter | 171 | * @param bf the filter |
177 | * @return number of bytes used for the data of the bloom filter | 172 | * @return number of bytes used for the data of the bloom filter |
178 | */ | 173 | */ |
179 | size_t GNUNET_CONTAINER_bloomfilter_get_size (const struct | 174 | size_t |
180 | GNUNET_CONTAINER_BloomFilter | 175 | GNUNET_CONTAINER_bloomfilter_get_size (const struct GNUNET_CONTAINER_BloomFilter |
181 | *bf); | 176 | *bf); |
182 | 177 | ||
183 | 178 | ||
184 | /** | 179 | /** |
185 | * Reset a bloom filter to empty. | 180 | * Reset a bloom filter to empty. |
186 | * @param bf the filter | 181 | * @param bf the filter |
187 | */ | 182 | */ |
188 | void GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter | 183 | void |
189 | *bf); | 184 | GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter *bf); |
190 | 185 | ||
191 | /** | 186 | /** |
192 | * Or the entries of the given raw data array with the | 187 | * Or the entries of the given raw data array with the |
@@ -199,8 +194,9 @@ void GNUNET_CONTAINER_bloomfilter_clear (struct GNUNET_CONTAINER_BloomFilter | |||
199 | * @param size size of data | 194 | * @param size size of data |
200 | * @return GNUNET_OK on success | 195 | * @return GNUNET_OK on success |
201 | */ | 196 | */ |
202 | int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, | 197 | int |
203 | const char *data, size_t size); | 198 | GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, |
199 | const char *data, size_t size); | ||
204 | 200 | ||
205 | /** | 201 | /** |
206 | * Or the entries of the given raw data array with the | 202 | * Or the entries of the given raw data array with the |
@@ -212,9 +208,10 @@ int GNUNET_CONTAINER_bloomfilter_or (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
212 | * @param to_or the bloomfilter to or-in | 208 | * @param to_or the bloomfilter to or-in |
213 | * @param size number of bytes in data | 209 | * @param size number of bytes in data |
214 | */ | 210 | */ |
215 | int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, | 211 | int |
216 | const struct GNUNET_CONTAINER_BloomFilter | 212 | GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, |
217 | *to_or, size_t size); | 213 | const struct GNUNET_CONTAINER_BloomFilter |
214 | *to_or, size_t size); | ||
218 | 215 | ||
219 | /** | 216 | /** |
220 | * Resize a bloom filter. Note that this operation | 217 | * Resize a bloom filter. Note that this operation |
@@ -227,10 +224,11 @@ int GNUNET_CONTAINER_bloomfilter_or2 (struct GNUNET_CONTAINER_BloomFilter *bf, | |||
227 | * @param size the new size for the filter | 224 | * @param size the new size for the filter |
228 | * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element | 225 | * @param k the new number of GNUNET_CRYPTO_hash-function to apply per element |
229 | */ | 226 | */ |
230 | void GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter | 227 | void |
231 | *bf, GNUNET_HashCodeIterator iterator, | 228 | GNUNET_CONTAINER_bloomfilter_resize (struct GNUNET_CONTAINER_BloomFilter *bf, |
232 | void *iterator_cls, size_t size, | 229 | GNUNET_HashCodeIterator iterator, |
233 | unsigned int k); | 230 | void *iterator_cls, size_t size, |
231 | unsigned int k); | ||
234 | 232 | ||
235 | /* ****************** metadata ******************* */ | 233 | /* ****************** metadata ******************* */ |
236 | 234 | ||
@@ -244,7 +242,8 @@ struct GNUNET_CONTAINER_MetaData; | |||
244 | * | 242 | * |
245 | * @return empty meta-data container | 243 | * @return empty meta-data container |
246 | */ | 244 | */ |
247 | struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_create (void); | 245 | struct GNUNET_CONTAINER_MetaData * |
246 | GNUNET_CONTAINER_meta_data_create (void); | ||
248 | 247 | ||
249 | /** | 248 | /** |
250 | * Duplicate a MetaData token. | 249 | * Duplicate a MetaData token. |
@@ -252,17 +251,17 @@ struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_create (void); | |||
252 | * @param md what to duplicate | 251 | * @param md what to duplicate |
253 | * @return duplicate meta-data container | 252 | * @return duplicate meta-data container |
254 | */ | 253 | */ |
255 | struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_duplicate (const | 254 | struct GNUNET_CONTAINER_MetaData * |
256 | struct | 255 | GNUNET_CONTAINER_meta_data_duplicate (const struct GNUNET_CONTAINER_MetaData |
257 | GNUNET_CONTAINER_MetaData | 256 | *md); |
258 | *md); | ||
259 | 257 | ||
260 | /** | 258 | /** |
261 | * Free meta data. | 259 | * Free meta data. |
262 | * | 260 | * |
263 | * @param md what to free | 261 | * @param md what to free |
264 | */ | 262 | */ |
265 | void GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); | 263 | void |
264 | GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); | ||
266 | 265 | ||
267 | /** | 266 | /** |
268 | * Test if two MDs are equal. We consider them equal if | 267 | * Test if two MDs are equal. We consider them equal if |
@@ -274,10 +273,11 @@ void GNUNET_CONTAINER_meta_data_destroy (struct GNUNET_CONTAINER_MetaData *md); | |||
274 | * @param md2 other value to check | 273 | * @param md2 other value to check |
275 | * @return GNUNET_YES if they are equal | 274 | * @return GNUNET_YES if they are equal |
276 | */ | 275 | */ |
277 | int GNUNET_CONTAINER_meta_data_test_equal (const struct | 276 | int |
278 | GNUNET_CONTAINER_MetaData *md1, | 277 | GNUNET_CONTAINER_meta_data_test_equal (const struct GNUNET_CONTAINER_MetaData |
279 | const struct | 278 | *md1, |
280 | GNUNET_CONTAINER_MetaData *md2); | 279 | const struct GNUNET_CONTAINER_MetaData |
280 | *md2); | ||
281 | 281 | ||
282 | 282 | ||
283 | /** | 283 | /** |
@@ -297,12 +297,13 @@ int GNUNET_CONTAINER_meta_data_test_equal (const struct | |||
297 | * @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 |
298 | * 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 |
299 | */ | 299 | */ |
300 | int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, | 300 | int |
301 | const char *plugin_name, | 301 | GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, |
302 | enum EXTRACTOR_MetaType type, | 302 | const char *plugin_name, |
303 | enum EXTRACTOR_MetaFormat format, | 303 | enum EXTRACTOR_MetaType type, |
304 | const char *data_mime_type, | 304 | enum EXTRACTOR_MetaFormat format, |
305 | const char *data, size_t data_len); | 305 | const char *data_mime_type, const char *data, |
306 | size_t data_len); | ||
306 | 307 | ||
307 | 308 | ||
308 | /** | 309 | /** |
@@ -312,9 +313,9 @@ int GNUNET_CONTAINER_meta_data_insert (struct GNUNET_CONTAINER_MetaData *md, | |||
312 | * @param md metadata to extend | 313 | * @param md metadata to extend |
313 | * @param in metadata to merge | 314 | * @param in metadata to merge |
314 | */ | 315 | */ |
315 | void GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, | 316 | void |
316 | const struct GNUNET_CONTAINER_MetaData | 317 | GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, |
317 | *in); | 318 | const struct GNUNET_CONTAINER_MetaData *in); |
318 | 319 | ||
319 | 320 | ||
320 | /** | 321 | /** |
@@ -327,9 +328,10 @@ void GNUNET_CONTAINER_meta_data_merge (struct GNUNET_CONTAINER_MetaData *md, | |||
327 | * @param data_len number of bytes in data | 328 | * @param data_len number of bytes in data |
328 | * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md | 329 | * @return GNUNET_OK on success, GNUNET_SYSERR if the item does not exist in md |
329 | */ | 330 | */ |
330 | int GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, | 331 | int |
331 | enum EXTRACTOR_MetaType type, | 332 | GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, |
332 | const char *data, size_t data_len); | 333 | enum EXTRACTOR_MetaType type, |
334 | const char *data, size_t data_len); | ||
333 | 335 | ||
334 | 336 | ||
335 | /** | 337 | /** |
@@ -337,7 +339,8 @@ int GNUNET_CONTAINER_meta_data_delete (struct GNUNET_CONTAINER_MetaData *md, | |||
337 | * | 339 | * |
338 | * @param md metadata to manipulate | 340 | * @param md metadata to manipulate |
339 | */ | 341 | */ |
340 | void GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); | 342 | void |
343 | GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); | ||
341 | 344 | ||
342 | 345 | ||
343 | /** | 346 | /** |
@@ -346,9 +349,9 @@ void GNUNET_CONTAINER_meta_data_clear (struct GNUNET_CONTAINER_MetaData *md); | |||
346 | * | 349 | * |
347 | * @param md metadata to modify | 350 | * @param md metadata to modify |
348 | */ | 351 | */ |
349 | void GNUNET_CONTAINER_meta_data_add_publication_date (struct | 352 | void |
350 | GNUNET_CONTAINER_MetaData | 353 | GNUNET_CONTAINER_meta_data_add_publication_date (struct |
351 | *md); | 354 | GNUNET_CONTAINER_MetaData *md); |
352 | 355 | ||
353 | 356 | ||
354 | /** | 357 | /** |
@@ -359,9 +362,10 @@ void GNUNET_CONTAINER_meta_data_add_publication_date (struct | |||
359 | * @param iter_cls closure for iterator | 362 | * @param iter_cls closure for iterator |
360 | * @return number of entries | 363 | * @return number of entries |
361 | */ | 364 | */ |
362 | int GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData | 365 | int |
363 | *md, EXTRACTOR_MetaDataProcessor iter, | 366 | GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData *md, |
364 | void *iter_cls); | 367 | EXTRACTOR_MetaDataProcessor iter, |
368 | void *iter_cls); | ||
365 | 369 | ||
366 | /** | 370 | /** |
367 | * Get the first MD entry of the given type. Caller | 371 | * Get the first MD entry of the given type. Caller |
@@ -373,9 +377,9 @@ int GNUNET_CONTAINER_meta_data_iterate (const struct GNUNET_CONTAINER_MetaData | |||
373 | * @param type type to look for | 377 | * @param type type to look for |
374 | * @return NULL if no entry was found | 378 | * @return NULL if no entry was found |
375 | */ | 379 | */ |
376 | char *GNUNET_CONTAINER_meta_data_get_by_type (const struct | 380 | char * |
377 | GNUNET_CONTAINER_MetaData *md, | 381 | GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData |
378 | enum EXTRACTOR_MetaType type); | 382 | *md, enum EXTRACTOR_MetaType type); |
379 | 383 | ||
380 | 384 | ||
381 | /** | 385 | /** |
@@ -389,9 +393,10 @@ char *GNUNET_CONTAINER_meta_data_get_by_type (const struct | |||
389 | * @return NULL if we do not have any such entry, | 393 | * @return NULL if we do not have any such entry, |
390 | * otherwise client is responsible for freeing the value! | 394 | * otherwise client is responsible for freeing the value! |
391 | */ | 395 | */ |
392 | char *GNUNET_CONTAINER_meta_data_get_first_by_types (const struct | 396 | char * |
393 | GNUNET_CONTAINER_MetaData | 397 | GNUNET_CONTAINER_meta_data_get_first_by_types (const struct |
394 | *md, ...); | 398 | GNUNET_CONTAINER_MetaData *md, |
399 | ...); | ||
395 | 400 | ||
396 | /** | 401 | /** |
397 | * Get a thumbnail from the meta-data (if present). Only matches meta | 402 | * Get a thumbnail from the meta-data (if present). Only matches meta |
@@ -402,9 +407,9 @@ char *GNUNET_CONTAINER_meta_data_get_first_by_types (const struct | |||
402 | * freed by the caller! | 407 | * freed by the caller! |
403 | * @return number of bytes in thumbnail, 0 if not available | 408 | * @return number of bytes in thumbnail, 0 if not available |
404 | */ | 409 | */ |
405 | size_t GNUNET_CONTAINER_meta_data_get_thumbnail (const struct | 410 | size_t |
406 | GNUNET_CONTAINER_MetaData *md, | 411 | GNUNET_CONTAINER_meta_data_get_thumbnail (const struct GNUNET_CONTAINER_MetaData |
407 | unsigned char **thumb); | 412 | *md, unsigned char **thumb); |
408 | 413 | ||
409 | 414 | ||
410 | 415 | ||
@@ -445,7 +450,7 @@ enum GNUNET_CONTAINER_MetaDataSerializationOptions | |||
445 | * -1 on error (typically: not enough | 450 | * -1 on error (typically: not enough |
446 | * space) | 451 | * space) |
447 | */ | 452 | */ |
448 | ssize_t | 453 | ssize_t |
449 | GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData | 454 | GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData |
450 | *md, char **target, size_t max, | 455 | *md, char **target, size_t max, |
451 | enum | 456 | enum |
@@ -459,7 +464,7 @@ GNUNET_CONTAINER_meta_data_serialize (const struct GNUNET_CONTAINER_MetaData | |||
459 | * @param md metadata to inspect | 464 | * @param md metadata to inspect |
460 | * @return number of bytes needed for serialization, -1 on error | 465 | * @return number of bytes needed for serialization, -1 on error |
461 | */ | 466 | */ |
462 | ssize_t | 467 | ssize_t |
463 | GNUNET_CONTAINER_meta_data_get_serialized_size (const struct | 468 | GNUNET_CONTAINER_meta_data_get_serialized_size (const struct |
464 | GNUNET_CONTAINER_MetaData *md); | 469 | GNUNET_CONTAINER_MetaData *md); |
465 | 470 | ||
@@ -472,11 +477,8 @@ GNUNET_CONTAINER_meta_data_get_serialized_size (const struct | |||
472 | * @return MD on success, NULL on error (i.e. | 477 | * @return MD on success, NULL on error (i.e. |
473 | * bad format) | 478 | * bad format) |
474 | */ | 479 | */ |
475 | struct GNUNET_CONTAINER_MetaData *GNUNET_CONTAINER_meta_data_deserialize (const | 480 | struct GNUNET_CONTAINER_MetaData * |
476 | char | 481 | GNUNET_CONTAINER_meta_data_deserialize (const char *input, size_t size); |
477 | *input, | ||
478 | size_t | ||
479 | size); | ||
480 | 482 | ||
481 | 483 | ||
482 | /* ******************************* HashMap **************************** */ | 484 | /* ******************************* HashMap **************************** */ |
@@ -541,8 +543,8 @@ typedef int (*GNUNET_CONTAINER_HashMapIterator) (void *cls, | |||
541 | * @param len initial size (map will grow as needed) | 543 | * @param len initial size (map will grow as needed) |
542 | * @return NULL on error | 544 | * @return NULL on error |
543 | */ | 545 | */ |
544 | struct GNUNET_CONTAINER_MultiHashMap | 546 | struct GNUNET_CONTAINER_MultiHashMap * |
545 | *GNUNET_CONTAINER_multihashmap_create (unsigned int len); | 547 | GNUNET_CONTAINER_multihashmap_create (unsigned int len); |
546 | 548 | ||
547 | 549 | ||
548 | /** | 550 | /** |
@@ -551,8 +553,9 @@ struct GNUNET_CONTAINER_MultiHashMap | |||
551 | * | 553 | * |
552 | * @param map the map | 554 | * @param map the map |
553 | */ | 555 | */ |
554 | void GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap | 556 | void |
555 | *map); | 557 | GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap |
558 | *map); | ||
556 | 559 | ||
557 | 560 | ||
558 | /** | 561 | /** |
@@ -565,9 +568,9 @@ void GNUNET_CONTAINER_multihashmap_destroy (struct GNUNET_CONTAINER_MultiHashMap | |||
565 | * happen to be NULL; use "contains" to test for | 568 | * happen to be NULL; use "contains" to test for |
566 | * key-value pairs with value NULL | 569 | * key-value pairs with value NULL |
567 | */ | 570 | */ |
568 | void *GNUNET_CONTAINER_multihashmap_get (const struct | 571 | void * |
569 | GNUNET_CONTAINER_MultiHashMap *map, | 572 | GNUNET_CONTAINER_multihashmap_get (const struct GNUNET_CONTAINER_MultiHashMap |
570 | const GNUNET_HashCode * key); | 573 | *map, const GNUNET_HashCode * key); |
571 | 574 | ||
572 | 575 | ||
573 | /** | 576 | /** |
@@ -581,9 +584,9 @@ void *GNUNET_CONTAINER_multihashmap_get (const struct | |||
581 | * @return GNUNET_YES on success, GNUNET_NO if the key-value pair | 584 | * @return GNUNET_YES on success, GNUNET_NO if the key-value pair |
582 | * is not in the map | 585 | * is not in the map |
583 | */ | 586 | */ |
584 | int GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap | 587 | int |
585 | *map, const GNUNET_HashCode * key, | 588 | GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap *map, |
586 | void *value); | 589 | const GNUNET_HashCode * key, void *value); |
587 | 590 | ||
588 | /** | 591 | /** |
589 | * Remove all entries for the given key from the map. | 592 | * Remove all entries for the given key from the map. |
@@ -593,10 +596,9 @@ int GNUNET_CONTAINER_multihashmap_remove (struct GNUNET_CONTAINER_MultiHashMap | |||
593 | * @param key identifies values to be removed | 596 | * @param key identifies values to be removed |
594 | * @return number of values removed | 597 | * @return number of values removed |
595 | */ | 598 | */ |
596 | int GNUNET_CONTAINER_multihashmap_remove_all (struct | 599 | int |
597 | GNUNET_CONTAINER_MultiHashMap | 600 | GNUNET_CONTAINER_multihashmap_remove_all (struct GNUNET_CONTAINER_MultiHashMap |
598 | *map, | 601 | *map, const GNUNET_HashCode * key); |
599 | const GNUNET_HashCode * key); | ||
600 | 602 | ||
601 | 603 | ||
602 | /** | 604 | /** |
@@ -608,9 +610,10 @@ int GNUNET_CONTAINER_multihashmap_remove_all (struct | |||
608 | * @return GNUNET_YES if such a value exists, | 610 | * @return GNUNET_YES if such a value exists, |
609 | * GNUNET_NO if not | 611 | * GNUNET_NO if not |
610 | */ | 612 | */ |
611 | int GNUNET_CONTAINER_multihashmap_contains (const struct | 613 | int |
612 | GNUNET_CONTAINER_MultiHashMap *map, | 614 | GNUNET_CONTAINER_multihashmap_contains (const struct |
613 | const GNUNET_HashCode * key); | 615 | GNUNET_CONTAINER_MultiHashMap *map, |
616 | const GNUNET_HashCode * key); | ||
614 | 617 | ||
615 | 618 | ||
616 | /** | 619 | /** |
@@ -623,11 +626,11 @@ int GNUNET_CONTAINER_multihashmap_contains (const struct | |||
623 | * @return GNUNET_YES if such a value exists, | 626 | * @return GNUNET_YES if such a value exists, |
624 | * GNUNET_NO if not | 627 | * GNUNET_NO if not |
625 | */ | 628 | */ |
626 | int GNUNET_CONTAINER_multihashmap_contains_value (const struct | 629 | int |
627 | GNUNET_CONTAINER_MultiHashMap | 630 | GNUNET_CONTAINER_multihashmap_contains_value (const struct |
628 | *map, | 631 | GNUNET_CONTAINER_MultiHashMap |
629 | const GNUNET_HashCode * key, | 632 | *map, const GNUNET_HashCode * key, |
630 | const void *value); | 633 | const void *value); |
631 | 634 | ||
632 | 635 | ||
633 | /** | 636 | /** |
@@ -642,11 +645,11 @@ int GNUNET_CONTAINER_multihashmap_contains_value (const struct | |||
642 | * GNUNET_SYSERR if UNIQUE_ONLY was the option and the | 645 | * GNUNET_SYSERR if UNIQUE_ONLY was the option and the |
643 | * value already exists | 646 | * value already exists |
644 | */ | 647 | */ |
645 | int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap | 648 | int |
646 | *map, const GNUNET_HashCode * key, | 649 | GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap *map, |
647 | void *value, | 650 | const GNUNET_HashCode * key, void *value, |
648 | enum GNUNET_CONTAINER_MultiHashMapOption | 651 | enum GNUNET_CONTAINER_MultiHashMapOption |
649 | opt); | 652 | opt); |
650 | 653 | ||
651 | /** | 654 | /** |
652 | * Get the number of key-value pairs in the map. | 655 | * Get the number of key-value pairs in the map. |
@@ -654,9 +657,9 @@ int GNUNET_CONTAINER_multihashmap_put (struct GNUNET_CONTAINER_MultiHashMap | |||
654 | * @param map the map | 657 | * @param map the map |
655 | * @return the number of key value pairs | 658 | * @return the number of key value pairs |
656 | */ | 659 | */ |
657 | unsigned int GNUNET_CONTAINER_multihashmap_size (const struct | 660 | unsigned int |
658 | GNUNET_CONTAINER_MultiHashMap | 661 | GNUNET_CONTAINER_multihashmap_size (const struct GNUNET_CONTAINER_MultiHashMap |
659 | *map); | 662 | *map); |
660 | 663 | ||
661 | 664 | ||
662 | /** | 665 | /** |
@@ -668,10 +671,11 @@ unsigned int GNUNET_CONTAINER_multihashmap_size (const struct | |||
668 | * @return the number of key value pairs processed, | 671 | * @return the number of key value pairs processed, |
669 | * GNUNET_SYSERR if it aborted iteration | 672 | * GNUNET_SYSERR if it aborted iteration |
670 | */ | 673 | */ |
671 | int GNUNET_CONTAINER_multihashmap_iterate (const struct | 674 | int |
672 | GNUNET_CONTAINER_MultiHashMap *map, | 675 | GNUNET_CONTAINER_multihashmap_iterate (const struct |
673 | GNUNET_CONTAINER_HashMapIterator it, | 676 | GNUNET_CONTAINER_MultiHashMap *map, |
674 | void *it_cls); | 677 | GNUNET_CONTAINER_HashMapIterator it, |
678 | void *it_cls); | ||
675 | 679 | ||
676 | 680 | ||
677 | /** | 681 | /** |
@@ -684,12 +688,12 @@ int GNUNET_CONTAINER_multihashmap_iterate (const struct | |||
684 | * @return the number of key value pairs processed, | 688 | * @return the number of key value pairs processed, |
685 | * GNUNET_SYSERR if it aborted iteration | 689 | * GNUNET_SYSERR if it aborted iteration |
686 | */ | 690 | */ |
687 | int GNUNET_CONTAINER_multihashmap_get_multiple (const struct | 691 | int |
688 | GNUNET_CONTAINER_MultiHashMap | 692 | GNUNET_CONTAINER_multihashmap_get_multiple (const struct |
689 | *map, | 693 | GNUNET_CONTAINER_MultiHashMap *map, |
690 | const GNUNET_HashCode * key, | 694 | const GNUNET_HashCode * key, |
691 | GNUNET_CONTAINER_HashMapIterator | 695 | GNUNET_CONTAINER_HashMapIterator it, |
692 | it, void *it_cls); | 696 | void *it_cls); |
693 | 697 | ||
694 | 698 | ||
695 | /* ******************** doubly-linked list *************** */ | 699 | /* ******************** doubly-linked list *************** */ |
@@ -864,9 +868,8 @@ struct GNUNET_CONTAINER_HeapNode; | |||
864 | * @param order how should the heap be sorted? | 868 | * @param order how should the heap be sorted? |
865 | * @return handle to the heap | 869 | * @return handle to the heap |
866 | */ | 870 | */ |
867 | struct GNUNET_CONTAINER_Heap *GNUNET_CONTAINER_heap_create (enum | 871 | struct GNUNET_CONTAINER_Heap * |
868 | GNUNET_CONTAINER_HeapOrder | 872 | GNUNET_CONTAINER_heap_create (enum GNUNET_CONTAINER_HeapOrder order); |
869 | order); | ||
870 | 873 | ||
871 | 874 | ||
872 | /** | 875 | /** |
@@ -875,7 +878,8 @@ struct GNUNET_CONTAINER_Heap *GNUNET_CONTAINER_heap_create (enum | |||
875 | * | 878 | * |
876 | * @param heap heap to destroy | 879 | * @param heap heap to destroy |
877 | */ | 880 | */ |
878 | void GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); | 881 | void |
882 | GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); | ||
879 | 883 | ||
880 | 884 | ||
881 | /** | 885 | /** |
@@ -884,7 +888,8 @@ void GNUNET_CONTAINER_heap_destroy (struct GNUNET_CONTAINER_Heap *heap); | |||
884 | * @param heap heap to inspect | 888 | * @param heap heap to inspect |
885 | * @return NULL if heap is empty | 889 | * @return NULL if heap is empty |
886 | */ | 890 | */ |
887 | void *GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); | 891 | void * |
892 | GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); | ||
888 | 893 | ||
889 | 894 | ||
890 | /** | 895 | /** |
@@ -893,8 +898,8 @@ void *GNUNET_CONTAINER_heap_peek (const struct GNUNET_CONTAINER_Heap *heap); | |||
893 | * @param heap the heap to get the size of | 898 | * @param heap the heap to get the size of |
894 | * @return number of elements stored | 899 | * @return number of elements stored |
895 | */ | 900 | */ |
896 | unsigned int GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap | 901 | unsigned int |
897 | *heap); | 902 | GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap *heap); |
898 | 903 | ||
899 | 904 | ||
900 | /** | 905 | /** |
@@ -903,9 +908,9 @@ unsigned int GNUNET_CONTAINER_heap_get_size (const struct GNUNET_CONTAINER_Heap | |||
903 | * @param node the node to get the cost of | 908 | * @param node the node to get the cost of |
904 | * @return cost of the node | 909 | * @return cost of the node |
905 | */ | 910 | */ |
906 | GNUNET_CONTAINER_HeapCostType GNUNET_CONTAINER_heap_node_get_cost (const struct | 911 | GNUNET_CONTAINER_HeapCostType |
907 | GNUNET_CONTAINER_HeapNode | 912 | GNUNET_CONTAINER_heap_node_get_cost (const struct GNUNET_CONTAINER_HeapNode |
908 | *node); | 913 | *node); |
909 | 914 | ||
910 | /** | 915 | /** |
911 | * Iterator for heap | 916 | * Iterator for heap |
@@ -931,9 +936,10 @@ typedef int (*GNUNET_CONTAINER_HeapIterator) (void *cls, | |||
931 | * @param iterator function to call on each entry | 936 | * @param iterator function to call on each entry |
932 | * @param iterator_cls closure for iterator | 937 | * @param iterator_cls closure for iterator |
933 | */ | 938 | */ |
934 | void GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, | 939 | void |
935 | GNUNET_CONTAINER_HeapIterator iterator, | 940 | GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, |
936 | void *iterator_cls); | 941 | GNUNET_CONTAINER_HeapIterator iterator, |
942 | void *iterator_cls); | ||
937 | 943 | ||
938 | 944 | ||
939 | /** | 945 | /** |
@@ -948,8 +954,9 @@ void GNUNET_CONTAINER_heap_iterate (const struct GNUNET_CONTAINER_Heap *heap, | |||
948 | * NULL if the heap is empty. | 954 | * NULL if the heap is empty. |
949 | * | 955 | * |
950 | */ | 956 | */ |
951 | void *GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, | 957 | void * |
952 | uint32_t max); | 958 | GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, |
959 | uint32_t max); | ||
953 | 960 | ||
954 | 961 | ||
955 | /** | 962 | /** |
@@ -963,7 +970,8 @@ void *GNUNET_CONTAINER_heap_get_random (struct GNUNET_CONTAINER_Heap *heap, | |||
963 | * @return data stored at the next random node in the walk; | 970 | * @return data stored at the next random node in the walk; |
964 | * NULL if the tree is empty. | 971 | * NULL if the tree is empty. |
965 | */ | 972 | */ |
966 | void *GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); | 973 | void * |
974 | GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); | ||
967 | 975 | ||
968 | 976 | ||
969 | /** | 977 | /** |
@@ -974,12 +982,9 @@ void *GNUNET_CONTAINER_heap_walk_get_next (struct GNUNET_CONTAINER_Heap *heap); | |||
974 | * @param cost cost for the element | 982 | * @param cost cost for the element |
975 | * @return node for the new element | 983 | * @return node for the new element |
976 | */ | 984 | */ |
977 | struct GNUNET_CONTAINER_HeapNode *GNUNET_CONTAINER_heap_insert (struct | 985 | struct GNUNET_CONTAINER_HeapNode * |
978 | GNUNET_CONTAINER_Heap | 986 | GNUNET_CONTAINER_heap_insert (struct GNUNET_CONTAINER_Heap *heap, void *element, |
979 | *heap, | 987 | GNUNET_CONTAINER_HeapCostType cost); |
980 | void *element, | ||
981 | GNUNET_CONTAINER_HeapCostType | ||
982 | cost); | ||
983 | 988 | ||
984 | 989 | ||
985 | /** | 990 | /** |
@@ -988,7 +993,8 @@ struct GNUNET_CONTAINER_HeapNode *GNUNET_CONTAINER_heap_insert (struct | |||
988 | * @param heap heap to modify | 993 | * @param heap heap to modify |
989 | * @return element data stored at the root node | 994 | * @return element data stored at the root node |
990 | */ | 995 | */ |
991 | void *GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); | 996 | void * |
997 | GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); | ||
992 | 998 | ||
993 | 999 | ||
994 | /** | 1000 | /** |
@@ -997,8 +1003,8 @@ void *GNUNET_CONTAINER_heap_remove_root (struct GNUNET_CONTAINER_Heap *heap); | |||
997 | * @param node node to remove | 1003 | * @param node node to remove |
998 | * @return element data stored at the node, NULL if heap is empty | 1004 | * @return element data stored at the node, NULL if heap is empty |
999 | */ | 1005 | */ |
1000 | void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode | 1006 | void * |
1001 | *node); | 1007 | GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode *node); |
1002 | 1008 | ||
1003 | 1009 | ||
1004 | /** | 1010 | /** |
@@ -1008,9 +1014,10 @@ void *GNUNET_CONTAINER_heap_remove_node (struct GNUNET_CONTAINER_HeapNode | |||
1008 | * @param node node for which the cost is to be changed | 1014 | * @param node node for which the cost is to be changed |
1009 | * @param new_cost new cost for the node | 1015 | * @param new_cost new cost for the node |
1010 | */ | 1016 | */ |
1011 | void GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, | 1017 | void |
1012 | struct GNUNET_CONTAINER_HeapNode *node, | 1018 | GNUNET_CONTAINER_heap_update_cost (struct GNUNET_CONTAINER_Heap *heap, |
1013 | GNUNET_CONTAINER_HeapCostType new_cost); | 1019 | struct GNUNET_CONTAINER_HeapNode *node, |
1020 | GNUNET_CONTAINER_HeapCostType new_cost); | ||
1014 | 1021 | ||
1015 | 1022 | ||
1016 | /* ******************** Singly linked list *************** */ | 1023 | /* ******************** Singly linked list *************** */ |
@@ -1057,9 +1064,10 @@ struct GNUNET_CONTAINER_SList_Iterator; | |||
1057 | * @param buf payload buffer | 1064 | * @param buf payload buffer |
1058 | * @param len length of the buffer | 1065 | * @param len length of the buffer |
1059 | */ | 1066 | */ |
1060 | void GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, | 1067 | void |
1061 | enum GNUNET_CONTAINER_SListDisposition disp, | 1068 | GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, |
1062 | const void *buf, size_t len); | 1069 | enum GNUNET_CONTAINER_SListDisposition disp, |
1070 | const void *buf, size_t len); | ||
1063 | 1071 | ||
1064 | 1072 | ||
1065 | /** | 1073 | /** |
@@ -1069,9 +1077,10 @@ void GNUNET_CONTAINER_slist_add (struct GNUNET_CONTAINER_SList *l, | |||
1069 | * @param buf payload buffer | 1077 | * @param buf payload buffer |
1070 | * @param len length of the buffer | 1078 | * @param len length of the buffer |
1071 | */ | 1079 | */ |
1072 | void GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, | 1080 | void |
1073 | enum GNUNET_CONTAINER_SListDisposition | 1081 | GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, |
1074 | disp, const void *buf, size_t len); | 1082 | enum GNUNET_CONTAINER_SListDisposition disp, |
1083 | const void *buf, size_t len); | ||
1075 | 1084 | ||
1076 | 1085 | ||
1077 | /** | 1086 | /** |
@@ -1079,22 +1088,25 @@ void GNUNET_CONTAINER_slist_add_end (struct GNUNET_CONTAINER_SList *l, | |||
1079 | * @param dst list to append to | 1088 | * @param dst list to append to |
1080 | * @param src source | 1089 | * @param src source |
1081 | */ | 1090 | */ |
1082 | void GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, | 1091 | void |
1083 | struct GNUNET_CONTAINER_SList *src); | 1092 | GNUNET_CONTAINER_slist_append (struct GNUNET_CONTAINER_SList *dst, |
1093 | struct GNUNET_CONTAINER_SList *src); | ||
1084 | 1094 | ||
1085 | 1095 | ||
1086 | /** | 1096 | /** |
1087 | * Create a new singly linked list | 1097 | * Create a new singly linked list |
1088 | * @return the new list | 1098 | * @return the new list |
1089 | */ | 1099 | */ |
1090 | struct GNUNET_CONTAINER_SList *GNUNET_CONTAINER_slist_create (void); | 1100 | struct GNUNET_CONTAINER_SList * |
1101 | GNUNET_CONTAINER_slist_create (void); | ||
1091 | 1102 | ||
1092 | 1103 | ||
1093 | /** | 1104 | /** |
1094 | * Destroy a singly linked list | 1105 | * Destroy a singly linked list |
1095 | * @param l the list to be destroyed | 1106 | * @param l the list to be destroyed |
1096 | */ | 1107 | */ |
1097 | void GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l); | 1108 | void |
1109 | GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l); | ||
1098 | 1110 | ||
1099 | 1111 | ||
1100 | /** | 1112 | /** |
@@ -1103,9 +1115,8 @@ void GNUNET_CONTAINER_slist_destroy (struct GNUNET_CONTAINER_SList *l); | |||
1103 | * @param l list | 1115 | * @param l list |
1104 | * @return iterator pointing to the beginning, free using "GNUNET_free" | 1116 | * @return iterator pointing to the beginning, free using "GNUNET_free" |
1105 | */ | 1117 | */ |
1106 | struct GNUNET_CONTAINER_SList_Iterator *GNUNET_CONTAINER_slist_begin (struct | 1118 | struct GNUNET_CONTAINER_SList_Iterator * |
1107 | GNUNET_CONTAINER_SList | 1119 | GNUNET_CONTAINER_slist_begin (struct GNUNET_CONTAINER_SList *l); |
1108 | *l); | ||
1109 | 1120 | ||
1110 | 1121 | ||
1111 | /** | 1122 | /** |
@@ -1113,7 +1124,8 @@ struct GNUNET_CONTAINER_SList_Iterator *GNUNET_CONTAINER_slist_begin (struct | |||
1113 | * | 1124 | * |
1114 | * @param l list | 1125 | * @param l list |
1115 | */ | 1126 | */ |
1116 | void GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l); | 1127 | void |
1128 | GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l); | ||
1117 | 1129 | ||
1118 | 1130 | ||
1119 | /** | 1131 | /** |
@@ -1122,8 +1134,9 @@ void GNUNET_CONTAINER_slist_clear (struct GNUNET_CONTAINER_SList *l); | |||
1122 | * @param buf payload buffer to find | 1134 | * @param buf payload buffer to find |
1123 | * @param len length of the payload (number of bytes in buf) | 1135 | * @param len length of the payload (number of bytes in buf) |
1124 | */ | 1136 | */ |
1125 | int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, | 1137 | int |
1126 | const void *buf, size_t len); | 1138 | GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, |
1139 | const void *buf, size_t len); | ||
1127 | 1140 | ||
1128 | 1141 | ||
1129 | /** | 1142 | /** |
@@ -1131,14 +1144,16 @@ int GNUNET_CONTAINER_slist_contains (const struct GNUNET_CONTAINER_SList *l, | |||
1131 | * @param l list | 1144 | * @param l list |
1132 | * @return number of elements in the list | 1145 | * @return number of elements in the list |
1133 | */ | 1146 | */ |
1134 | int GNUNET_CONTAINER_slist_count (const struct GNUNET_CONTAINER_SList *l); | 1147 | int |
1148 | GNUNET_CONTAINER_slist_count (const struct GNUNET_CONTAINER_SList *l); | ||
1135 | 1149 | ||
1136 | 1150 | ||
1137 | /** | 1151 | /** |
1138 | * Remove an element from the list | 1152 | * Remove an element from the list |
1139 | * @param i iterator that points to the element to be removed | 1153 | * @param i iterator that points to the element to be removed |
1140 | */ | 1154 | */ |
1141 | void GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i); | 1155 | void |
1156 | GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i); | ||
1142 | 1157 | ||
1143 | 1158 | ||
1144 | /** | 1159 | /** |
@@ -1148,10 +1163,10 @@ void GNUNET_CONTAINER_slist_erase (struct GNUNET_CONTAINER_SList_Iterator *i); | |||
1148 | * @param buf payload buffer | 1163 | * @param buf payload buffer |
1149 | * @param len length of the payload | 1164 | * @param len length of the payload |
1150 | */ | 1165 | */ |
1151 | void GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator | 1166 | void |
1152 | *before, | 1167 | GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator *before, |
1153 | enum GNUNET_CONTAINER_SListDisposition disp, | 1168 | enum GNUNET_CONTAINER_SListDisposition disp, |
1154 | const void *buf, size_t len); | 1169 | const void *buf, size_t len); |
1155 | 1170 | ||
1156 | 1171 | ||
1157 | /** | 1172 | /** |
@@ -1159,7 +1174,8 @@ void GNUNET_CONTAINER_slist_insert (struct GNUNET_CONTAINER_SList_Iterator | |||
1159 | * @param i iterator | 1174 | * @param i iterator |
1160 | * @return GNUNET_YES on success, GNUNET_NO if the end has been reached | 1175 | * @return GNUNET_YES on success, GNUNET_NO if the end has been reached |
1161 | */ | 1176 | */ |
1162 | int GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i); | 1177 | int |
1178 | GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i); | ||
1163 | 1179 | ||
1164 | 1180 | ||
1165 | /** | 1181 | /** |
@@ -1168,7 +1184,8 @@ int GNUNET_CONTAINER_slist_next (struct GNUNET_CONTAINER_SList_Iterator *i); | |||
1168 | * @return GNUNET_YES if the end has been reached, GNUNET_NO if the iterator | 1184 | * @return GNUNET_YES if the end has been reached, GNUNET_NO if the iterator |
1169 | * points to a valid element | 1185 | * points to a valid element |
1170 | */ | 1186 | */ |
1171 | int GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); | 1187 | int |
1188 | GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); | ||
1172 | 1189 | ||
1173 | 1190 | ||
1174 | /** | 1191 | /** |
@@ -1178,16 +1195,17 @@ int GNUNET_CONTAINER_slist_end (struct GNUNET_CONTAINER_SList_Iterator *i); | |||
1178 | * @param len set to the payload length | 1195 | * @param len set to the payload length |
1179 | * @return payload | 1196 | * @return payload |
1180 | */ | 1197 | */ |
1181 | void *GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator | 1198 | void * |
1182 | *i, size_t * len); | 1199 | GNUNET_CONTAINER_slist_get (const struct GNUNET_CONTAINER_SList_Iterator *i, |
1200 | size_t * len); | ||
1183 | 1201 | ||
1184 | 1202 | ||
1185 | /** | 1203 | /** |
1186 | * Release an iterator | 1204 | * Release an iterator |
1187 | * @param i iterator | 1205 | * @param i iterator |
1188 | */ | 1206 | */ |
1189 | void GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator | 1207 | void |
1190 | *i); | 1208 | GNUNET_CONTAINER_slist_iter_destroy (struct GNUNET_CONTAINER_SList_Iterator *i); |
1191 | 1209 | ||
1192 | 1210 | ||
1193 | #if 0 /* keep Emacsens' auto-indent happy */ | 1211 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index 94272a30a..083276804 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -219,27 +219,18 @@ typedef void (*GNUNET_CORE_StartupCallback) (void *cls, | |||
219 | * @return handle to the core service (only useful for disconnect until 'init' is called), | 219 | * @return handle to the core service (only useful for disconnect until 'init' is called), |
220 | * NULL on error (in this case, init is never called) | 220 | * NULL on error (in this case, init is never called) |
221 | */ | 221 | */ |
222 | struct GNUNET_CORE_Handle *GNUNET_CORE_connect (const struct | 222 | struct GNUNET_CORE_Handle * |
223 | GNUNET_CONFIGURATION_Handle | 223 | GNUNET_CORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
224 | *cfg, unsigned int queue_size, | 224 | unsigned int queue_size, void *cls, |
225 | void *cls, | 225 | GNUNET_CORE_StartupCallback init, |
226 | GNUNET_CORE_StartupCallback | 226 | GNUNET_CORE_ConnectEventHandler connects, |
227 | init, | 227 | GNUNET_CORE_DisconnectEventHandler disconnects, |
228 | GNUNET_CORE_ConnectEventHandler | 228 | GNUNET_CORE_PeerStatusEventHandler status_events, |
229 | connects, | 229 | GNUNET_CORE_MessageCallback inbound_notify, |
230 | GNUNET_CORE_DisconnectEventHandler | 230 | int inbound_hdr_only, |
231 | disconnects, | 231 | GNUNET_CORE_MessageCallback outbound_notify, |
232 | GNUNET_CORE_PeerStatusEventHandler | 232 | int outbound_hdr_only, |
233 | status_events, | 233 | const struct GNUNET_CORE_MessageHandler *handlers); |
234 | GNUNET_CORE_MessageCallback | ||
235 | inbound_notify, | ||
236 | int inbound_hdr_only, | ||
237 | GNUNET_CORE_MessageCallback | ||
238 | outbound_notify, | ||
239 | int outbound_hdr_only, | ||
240 | const struct | ||
241 | GNUNET_CORE_MessageHandler | ||
242 | *handlers); | ||
243 | 234 | ||
244 | 235 | ||
245 | /** | 236 | /** |
@@ -249,7 +240,8 @@ struct GNUNET_CORE_Handle *GNUNET_CORE_connect (const struct | |||
249 | * | 240 | * |
250 | * @param handle connection to core to disconnect | 241 | * @param handle connection to core to disconnect |
251 | */ | 242 | */ |
252 | void GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | 243 | void |
244 | GNUNET_CORE_disconnect (struct GNUNET_CORE_Handle *handle); | ||
253 | 245 | ||
254 | 246 | ||
255 | /** | 247 | /** |
@@ -290,17 +282,11 @@ typedef void (*GNUNET_CORE_ControlContinuation) (void *cls, int success); | |||
290 | * @param cont_cls closure for cont | 282 | * @param cont_cls closure for cont |
291 | * @return NULL on error (cont will not be called), otherwise handle for cancellation | 283 | * @return NULL on error (cont will not be called), otherwise handle for cancellation |
292 | */ | 284 | */ |
293 | struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct | 285 | struct GNUNET_CORE_PeerRequestHandle * |
294 | GNUNET_CORE_Handle | 286 | GNUNET_CORE_peer_request_connect (struct GNUNET_CORE_Handle *h, |
295 | *h, | 287 | const struct GNUNET_PeerIdentity *peer, |
296 | const | 288 | GNUNET_CORE_ControlContinuation cont, |
297 | struct | 289 | void *cont_cls); |
298 | GNUNET_PeerIdentity | ||
299 | *peer, | ||
300 | GNUNET_CORE_ControlContinuation | ||
301 | cont, | ||
302 | void | ||
303 | *cont_cls); | ||
304 | 290 | ||
305 | 291 | ||
306 | /** | 292 | /** |
@@ -309,9 +295,9 @@ struct GNUNET_CORE_PeerRequestHandle *GNUNET_CORE_peer_request_connect (struct | |||
309 | * | 295 | * |
310 | * @param req request handle that was returned for the original request | 296 | * @param req request handle that was returned for the original request |
311 | */ | 297 | */ |
312 | void GNUNET_CORE_peer_request_connect_cancel (struct | 298 | void |
313 | GNUNET_CORE_PeerRequestHandle | 299 | GNUNET_CORE_peer_request_connect_cancel (struct GNUNET_CORE_PeerRequestHandle |
314 | *req); | 300 | *req); |
315 | 301 | ||
316 | 302 | ||
317 | /** | 303 | /** |
@@ -372,15 +358,14 @@ struct GNUNET_CORE_InformationRequestContext; | |||
372 | * @param info_cls closure for info | 358 | * @param info_cls closure for info |
373 | * @return NULL on error | 359 | * @return NULL on error |
374 | */ | 360 | */ |
375 | struct GNUNET_CORE_InformationRequestContext | 361 | struct GNUNET_CORE_InformationRequestContext * |
376 | *GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, | 362 | GNUNET_CORE_peer_change_preference (struct GNUNET_CORE_Handle *h, |
377 | const struct GNUNET_PeerIdentity *peer, | 363 | const struct GNUNET_PeerIdentity *peer, |
378 | struct GNUNET_TIME_Relative timeout, | 364 | struct GNUNET_TIME_Relative timeout, |
379 | struct GNUNET_BANDWIDTH_Value32NBO | 365 | struct GNUNET_BANDWIDTH_Value32NBO bw_out, |
380 | bw_out, int32_t amount, | 366 | int32_t amount, uint64_t preference, |
381 | uint64_t preference, | 367 | GNUNET_CORE_PeerConfigurationInfoCallback |
382 | GNUNET_CORE_PeerConfigurationInfoCallback | 368 | info, void *info_cls); |
383 | info, void *info_cls); | ||
384 | 369 | ||
385 | 370 | ||
386 | /** | 371 | /** |
@@ -394,9 +379,10 @@ struct GNUNET_CORE_InformationRequestContext | |||
394 | * | 379 | * |
395 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call | 380 | * @param irc context returned by the original GNUNET_CORE_peer_get_info call |
396 | */ | 381 | */ |
397 | void GNUNET_CORE_peer_change_preference_cancel (struct | 382 | void |
398 | GNUNET_CORE_InformationRequestContext | 383 | GNUNET_CORE_peer_change_preference_cancel (struct |
399 | *irc); | 384 | GNUNET_CORE_InformationRequestContext |
385 | *irc); | ||
400 | 386 | ||
401 | 387 | ||
402 | /** | 388 | /** |
@@ -407,9 +393,10 @@ void GNUNET_CORE_peer_change_preference_cancel (struct | |||
407 | * @param cb_cls closure for peer_cb | 393 | * @param cb_cls closure for peer_cb |
408 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors | 394 | * @return GNUNET_OK on success, GNUNET_SYSERR on errors |
409 | */ | 395 | */ |
410 | int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | 396 | int |
411 | GNUNET_CORE_ConnectEventHandler peer_cb, | 397 | GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, |
412 | void *cb_cls); | 398 | GNUNET_CORE_ConnectEventHandler peer_cb, |
399 | void *cb_cls); | ||
413 | 400 | ||
414 | /** | 401 | /** |
415 | * Iterate over all currently connected peers. | 402 | * Iterate over all currently connected peers. |
@@ -424,10 +411,11 @@ int GNUNET_CORE_iterate_peers (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
424 | * | 411 | * |
425 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error | 412 | * @return GNUNET_OK if iterating, GNUNET_SYSERR on error |
426 | */ | 413 | */ |
427 | int GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle | 414 | int |
428 | *cfg, struct GNUNET_PeerIdentity *peer, | 415 | GNUNET_CORE_is_peer_connected (const struct GNUNET_CONFIGURATION_Handle *cfg, |
429 | GNUNET_CORE_ConnectEventHandler peer_cb, | 416 | struct GNUNET_PeerIdentity *peer, |
430 | void *cb_cls); | 417 | GNUNET_CORE_ConnectEventHandler peer_cb, |
418 | void *cb_cls); | ||
431 | 419 | ||
432 | 420 | ||
433 | /** | 421 | /** |
@@ -464,25 +452,14 @@ struct GNUNET_CORE_TransmitHandle; | |||
464 | * NULL if we can not even queue the request (insufficient | 452 | * NULL if we can not even queue the request (insufficient |
465 | * memory); if NULL is returned, "notify" will NOT be called. | 453 | * memory); if NULL is returned, "notify" will NOT be called. |
466 | */ | 454 | */ |
467 | struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct | 455 | struct GNUNET_CORE_TransmitHandle * |
468 | GNUNET_CORE_Handle | 456 | GNUNET_CORE_notify_transmit_ready (struct GNUNET_CORE_Handle *handle, int cork, |
469 | *handle, | 457 | uint32_t priority, |
470 | int cork, | 458 | struct GNUNET_TIME_Relative maxdelay, |
471 | uint32_t | 459 | const struct GNUNET_PeerIdentity *target, |
472 | priority, | 460 | size_t notify_size, |
473 | struct | 461 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
474 | GNUNET_TIME_Relative | 462 | void *notify_cls); |
475 | maxdelay, | ||
476 | const | ||
477 | struct | ||
478 | GNUNET_PeerIdentity | ||
479 | *target, | ||
480 | size_t | ||
481 | notify_size, | ||
482 | GNUNET_CONNECTION_TransmitReadyNotify | ||
483 | notify, | ||
484 | void | ||
485 | *notify_cls); | ||
486 | 463 | ||
487 | 464 | ||
488 | /** | 465 | /** |
@@ -490,8 +467,9 @@ struct GNUNET_CORE_TransmitHandle *GNUNET_CORE_notify_transmit_ready (struct | |||
490 | * | 467 | * |
491 | * @param th handle that was returned by "notify_transmit_ready". | 468 | * @param th handle that was returned by "notify_transmit_ready". |
492 | */ | 469 | */ |
493 | void GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle | 470 | void |
494 | *th); | 471 | GNUNET_CORE_notify_transmit_ready_cancel (struct GNUNET_CORE_TransmitHandle |
472 | *th); | ||
495 | 473 | ||
496 | 474 | ||
497 | #if 0 /* keep Emacsens' auto-indent happy */ | 475 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_crypto_lib.h b/src/include/gnunet_crypto_lib.h index 30a7d9ee0..d5a1685d1 100644 --- a/src/include/gnunet_crypto_lib.h +++ b/src/include/gnunet_crypto_lib.h | |||
@@ -231,7 +231,8 @@ struct GNUNET_CRYPTO_AuthKey | |||
231 | * @param len the length of the buffer in bytes | 231 | * @param len the length of the buffer in bytes |
232 | * @return the resulting CRC32 checksum | 232 | * @return the resulting CRC32 checksum |
233 | */ | 233 | */ |
234 | int32_t GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); | 234 | int32_t |
235 | GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); | ||
235 | 236 | ||
236 | 237 | ||
237 | /** | 238 | /** |
@@ -241,7 +242,8 @@ int32_t GNUNET_CRYPTO_crc32_n (const void *buf, size_t len); | |||
241 | * @param i the upper limit (exclusive) for the random number | 242 | * @param i the upper limit (exclusive) for the random number |
242 | * @return a random value in the interval [0,i) (exclusive). | 243 | * @return a random value in the interval [0,i) (exclusive). |
243 | */ | 244 | */ |
244 | uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); | 245 | uint32_t |
246 | GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); | ||
245 | 247 | ||
246 | 248 | ||
247 | /** | 249 | /** |
@@ -251,8 +253,8 @@ uint32_t GNUNET_CRYPTO_random_u32 (enum GNUNET_CRYPTO_Quality mode, uint32_t i); | |||
251 | * @param max value returned will be in range [0,max) (exclusive) | 253 | * @param max value returned will be in range [0,max) (exclusive) |
252 | * @return random 64-bit number | 254 | * @return random 64-bit number |
253 | */ | 255 | */ |
254 | uint64_t GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, | 256 | uint64_t |
255 | uint64_t max); | 257 | GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, uint64_t max); |
256 | 258 | ||
257 | 259 | ||
258 | /** | 260 | /** |
@@ -262,8 +264,8 @@ uint64_t GNUNET_CRYPTO_random_u64 (enum GNUNET_CRYPTO_Quality mode, | |||
262 | * @param n the size of the array | 264 | * @param n the size of the array |
263 | * @return the permutation array (allocated from heap) | 265 | * @return the permutation array (allocated from heap) |
264 | */ | 266 | */ |
265 | unsigned int *GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, | 267 | unsigned int * |
266 | unsigned int n); | 268 | GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, unsigned int n); |
267 | 269 | ||
268 | 270 | ||
269 | /** | 271 | /** |
@@ -271,8 +273,8 @@ unsigned int *GNUNET_CRYPTO_random_permute (enum GNUNET_CRYPTO_Quality mode, | |||
271 | * | 273 | * |
272 | * @param key key to initialize | 274 | * @param key key to initialize |
273 | */ | 275 | */ |
274 | void GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey | 276 | void |
275 | *key); | 277 | GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey *key); |
276 | 278 | ||
277 | /** | 279 | /** |
278 | * Check that a new session key is well-formed. | 280 | * Check that a new session key is well-formed. |
@@ -280,8 +282,9 @@ void GNUNET_CRYPTO_aes_create_session_key (struct GNUNET_CRYPTO_AesSessionKey | |||
280 | * @param key key to check | 282 | * @param key key to check |
281 | * @return GNUNET_OK if the key is valid | 283 | * @return GNUNET_OK if the key is valid |
282 | */ | 284 | */ |
283 | int GNUNET_CRYPTO_aes_check_session_key (const struct | 285 | int |
284 | GNUNET_CRYPTO_AesSessionKey *key); | 286 | GNUNET_CRYPTO_aes_check_session_key (const struct GNUNET_CRYPTO_AesSessionKey |
287 | *key); | ||
285 | 288 | ||
286 | 289 | ||
287 | /** | 290 | /** |
@@ -295,12 +298,11 @@ int GNUNET_CRYPTO_aes_check_session_key (const struct | |||
295 | * for streams. | 298 | * for streams. |
296 | * @return the size of the encrypted block, -1 for errors | 299 | * @return the size of the encrypted block, -1 for errors |
297 | */ | 300 | */ |
298 | ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, | 301 | ssize_t |
299 | const struct GNUNET_CRYPTO_AesSessionKey | 302 | GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, |
300 | *sessionkey, | 303 | const struct GNUNET_CRYPTO_AesSessionKey *sessionkey, |
301 | const struct | 304 | const struct GNUNET_CRYPTO_AesInitializationVector |
302 | GNUNET_CRYPTO_AesInitializationVector *iv, | 305 | *iv, void *result); |
303 | void *result); | ||
304 | 306 | ||
305 | 307 | ||
306 | /** | 308 | /** |
@@ -313,12 +315,11 @@ ssize_t GNUNET_CRYPTO_aes_encrypt (const void *block, size_t len, | |||
313 | * @param result address to store the result at | 315 | * @param result address to store the result at |
314 | * @return -1 on failure, size of decrypted block on success | 316 | * @return -1 on failure, size of decrypted block on success |
315 | */ | 317 | */ |
316 | ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, | 318 | ssize_t |
317 | const struct GNUNET_CRYPTO_AesSessionKey | 319 | GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, |
318 | *sessionkey, | 320 | const struct GNUNET_CRYPTO_AesSessionKey *sessionkey, |
319 | const struct | 321 | const struct GNUNET_CRYPTO_AesInitializationVector |
320 | GNUNET_CRYPTO_AesInitializationVector *iv, | 322 | *iv, void *result); |
321 | void *result); | ||
322 | 323 | ||
323 | 324 | ||
324 | /** | 325 | /** |
@@ -329,11 +330,10 @@ ssize_t GNUNET_CRYPTO_aes_decrypt (const void *block, size_t size, | |||
329 | * @param salt_len size of the salt | 330 | * @param salt_len size of the salt |
330 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL | 331 | * @param ... pairs of void * & size_t for context chunks, terminated by NULL |
331 | */ | 332 | */ |
332 | void GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector | 333 | void |
333 | *iv, | 334 | GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector *iv, |
334 | const struct GNUNET_CRYPTO_AesSessionKey | 335 | const struct GNUNET_CRYPTO_AesSessionKey *skey, |
335 | *skey, const void *salt, size_t salt_len, | 336 | const void *salt, size_t salt_len, ...); |
336 | ...); | ||
337 | 337 | ||
338 | 338 | ||
339 | /** | 339 | /** |
@@ -344,11 +344,10 @@ void GNUNET_CRYPTO_aes_derive_iv (struct GNUNET_CRYPTO_AesInitializationVector | |||
344 | * @param salt_len size of the salt | 344 | * @param salt_len size of the salt |
345 | * @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 |
346 | */ | 346 | */ |
347 | void GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector | 347 | void |
348 | *iv, | 348 | GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector *iv, |
349 | const struct GNUNET_CRYPTO_AesSessionKey | 349 | const struct GNUNET_CRYPTO_AesSessionKey *skey, |
350 | *skey, const void *salt, size_t salt_len, | 350 | const void *salt, size_t salt_len, va_list argp); |
351 | va_list argp); | ||
352 | 351 | ||
353 | 352 | ||
354 | /** | 353 | /** |
@@ -357,8 +356,9 @@ void GNUNET_CRYPTO_aes_derive_iv_v (struct GNUNET_CRYPTO_AesInitializationVector | |||
357 | * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be | 356 | * @param result where to store the encoding (struct GNUNET_CRYPTO_HashAsciiEncoded can be |
358 | * safely cast to char*, a '\\0' termination is set). | 357 | * safely cast to char*, a '\\0' termination is set). |
359 | */ | 358 | */ |
360 | void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, | 359 | void |
361 | struct GNUNET_CRYPTO_HashAsciiEncoded *result); | 360 | GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, |
361 | struct GNUNET_CRYPTO_HashAsciiEncoded *result); | ||
362 | 362 | ||
363 | 363 | ||
364 | /** | 364 | /** |
@@ -367,7 +367,8 @@ void GNUNET_CRYPTO_hash_to_enc (const GNUNET_HashCode * block, | |||
367 | * @param result where to store the GNUNET_CRYPTO_hash code | 367 | * @param result where to store the GNUNET_CRYPTO_hash code |
368 | * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding | 368 | * @return GNUNET_OK on success, GNUNET_SYSERR if result has the wrong encoding |
369 | */ | 369 | */ |
370 | int GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); | 370 | int |
371 | GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); | ||
371 | 372 | ||
372 | 373 | ||
373 | /** | 374 | /** |
@@ -381,8 +382,9 @@ int GNUNET_CRYPTO_hash_from_string (const char *enc, GNUNET_HashCode * result); | |||
381 | * @param b some hash code | 382 | * @param b some hash code |
382 | * @return number between 0 and UINT32_MAX | 383 | * @return number between 0 and UINT32_MAX |
383 | */ | 384 | */ |
384 | uint32_t GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, | 385 | uint32_t |
385 | const GNUNET_HashCode * b); | 386 | GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, |
387 | const GNUNET_HashCode * b); | ||
386 | 388 | ||
387 | 389 | ||
388 | /** | 390 | /** |
@@ -392,7 +394,8 @@ uint32_t GNUNET_CRYPTO_hash_distance_u32 (const GNUNET_HashCode * a, | |||
392 | * @param size size of the block | 394 | * @param size size of the block |
393 | * @param ret pointer to where to write the hashcode | 395 | * @param ret pointer to where to write the hashcode |
394 | */ | 396 | */ |
395 | void GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); | 397 | void |
398 | GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); | ||
396 | 399 | ||
397 | 400 | ||
398 | /** | 401 | /** |
@@ -403,9 +406,10 @@ void GNUNET_CRYPTO_hash (const void *block, size_t size, GNUNET_HashCode * ret); | |||
403 | * @param plaintext_len length of plaintext | 406 | * @param plaintext_len length of plaintext |
404 | * @param hmac where to store the hmac | 407 | * @param hmac where to store the hmac |
405 | */ | 408 | */ |
406 | void GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, | 409 | void |
407 | const void *plaintext, size_t plaintext_len, | 410 | GNUNET_CRYPTO_hmac (const struct GNUNET_CRYPTO_AuthKey *key, |
408 | GNUNET_HashCode * hmac); | 411 | const void *plaintext, size_t plaintext_len, |
412 | GNUNET_HashCode * hmac); | ||
409 | 413 | ||
410 | 414 | ||
411 | /** | 415 | /** |
@@ -435,16 +439,11 @@ struct GNUNET_CRYPTO_FileHashContext; | |||
435 | * @param callback_cls closure for callback | 439 | * @param callback_cls closure for callback |
436 | * @return NULL on (immediate) errror | 440 | * @return NULL on (immediate) errror |
437 | */ | 441 | */ |
438 | struct GNUNET_CRYPTO_FileHashContext *GNUNET_CRYPTO_hash_file (enum | 442 | struct GNUNET_CRYPTO_FileHashContext * |
439 | GNUNET_SCHEDULER_Priority | 443 | GNUNET_CRYPTO_hash_file (enum GNUNET_SCHEDULER_Priority priority, |
440 | priority, | 444 | const char *filename, size_t blocksize, |
441 | const char | 445 | GNUNET_CRYPTO_HashCompletedCallback callback, |
442 | *filename, | 446 | void *callback_cls); |
443 | size_t blocksize, | ||
444 | GNUNET_CRYPTO_HashCompletedCallback | ||
445 | callback, | ||
446 | void | ||
447 | *callback_cls); | ||
448 | 447 | ||
449 | 448 | ||
450 | /** | 449 | /** |
@@ -452,7 +451,8 @@ struct GNUNET_CRYPTO_FileHashContext *GNUNET_CRYPTO_hash_file (enum | |||
452 | * | 451 | * |
453 | * @param fhc operation to cancel (callback must not yet have been invoked) | 452 | * @param fhc operation to cancel (callback must not yet have been invoked) |
454 | */ | 453 | */ |
455 | void GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); | 454 | void |
455 | GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); | ||
456 | 456 | ||
457 | 457 | ||
458 | /** | 458 | /** |
@@ -461,8 +461,9 @@ void GNUNET_CRYPTO_hash_file_cancel (struct GNUNET_CRYPTO_FileHashContext *fhc); | |||
461 | * @param mode desired quality level | 461 | * @param mode desired quality level |
462 | * @param result hash code that is randomized | 462 | * @param result hash code that is randomized |
463 | */ | 463 | */ |
464 | void GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, | 464 | void |
465 | GNUNET_HashCode * result); | 465 | GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, |
466 | GNUNET_HashCode * result); | ||
466 | 467 | ||
467 | 468 | ||
468 | /** | 469 | /** |
@@ -472,9 +473,10 @@ void GNUNET_CRYPTO_hash_create_random (enum GNUNET_CRYPTO_Quality mode, | |||
472 | * @param b some hash code | 473 | * @param b some hash code |
473 | * @param result set to b - a | 474 | * @param result set to b - a |
474 | */ | 475 | */ |
475 | void GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, | 476 | void |
476 | const GNUNET_HashCode * b, | 477 | GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, |
477 | GNUNET_HashCode * result); | 478 | const GNUNET_HashCode * b, |
479 | GNUNET_HashCode * result); | ||
478 | 480 | ||
479 | 481 | ||
480 | /** | 482 | /** |
@@ -484,9 +486,10 @@ void GNUNET_CRYPTO_hash_difference (const GNUNET_HashCode * a, | |||
484 | * @param delta some hash code | 486 | * @param delta some hash code |
485 | * @param result set to a + delta | 487 | * @param result set to a + delta |
486 | */ | 488 | */ |
487 | void GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, | 489 | void |
488 | const GNUNET_HashCode * delta, | 490 | GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, |
489 | GNUNET_HashCode * result); | 491 | const GNUNET_HashCode * delta, |
492 | GNUNET_HashCode * result); | ||
490 | 493 | ||
491 | 494 | ||
492 | /** | 495 | /** |
@@ -496,9 +499,9 @@ void GNUNET_CRYPTO_hash_sum (const GNUNET_HashCode * a, | |||
496 | * @param b some hash code | 499 | * @param b some hash code |
497 | * @param result set to a ^ b | 500 | * @param result set to a ^ b |
498 | */ | 501 | */ |
499 | void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, | 502 | void |
500 | const GNUNET_HashCode * b, | 503 | GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, const GNUNET_HashCode * b, |
501 | GNUNET_HashCode * result); | 504 | GNUNET_HashCode * result); |
502 | 505 | ||
503 | 506 | ||
504 | /** | 507 | /** |
@@ -508,10 +511,11 @@ void GNUNET_CRYPTO_hash_xor (const GNUNET_HashCode * a, | |||
508 | * @param skey set to a valid session key | 511 | * @param skey set to a valid session key |
509 | * @param iv set to a valid initialization vector | 512 | * @param iv set to a valid initialization vector |
510 | */ | 513 | */ |
511 | void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, | 514 | void |
512 | struct GNUNET_CRYPTO_AesSessionKey *skey, | 515 | GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, |
513 | struct GNUNET_CRYPTO_AesInitializationVector | 516 | struct GNUNET_CRYPTO_AesSessionKey *skey, |
514 | *iv); | 517 | struct GNUNET_CRYPTO_AesInitializationVector |
518 | *iv); | ||
515 | 519 | ||
516 | 520 | ||
517 | /** | 521 | /** |
@@ -521,7 +525,8 @@ void GNUNET_CRYPTO_hash_to_aes_key (const GNUNET_HashCode * hc, | |||
521 | * @param bit index into the hashcode, [0...159] | 525 | * @param bit index into the hashcode, [0...159] |
522 | * @return Bit \a bit from hashcode \a code, -1 for invalid index | 526 | * @return Bit \a bit from hashcode \a code, -1 for invalid index |
523 | */ | 527 | */ |
524 | int GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); | 528 | int |
529 | GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); | ||
525 | 530 | ||
526 | /** | 531 | /** |
527 | * Determine how many low order bits match in two | 532 | * Determine how many low order bits match in two |
@@ -535,8 +540,9 @@ int GNUNET_CRYPTO_hash_get_bit (const GNUNET_HashCode * code, unsigned int bit); | |||
535 | * | 540 | * |
536 | * @return the number of bits that match | 541 | * @return the number of bits that match |
537 | */ | 542 | */ |
538 | unsigned int GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, | 543 | unsigned int |
539 | const GNUNET_HashCode * second); | 544 | GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, |
545 | const GNUNET_HashCode * second); | ||
540 | 546 | ||
541 | 547 | ||
542 | /** | 548 | /** |
@@ -547,8 +553,8 @@ unsigned int GNUNET_CRYPTO_hash_matching_bits (const GNUNET_HashCode * first, | |||
547 | * @param h2 some hash code | 553 | * @param h2 some hash code |
548 | * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2. | 554 | * @return 1 if h1 > h2, -1 if h1 < h2 and 0 if h1 == h2. |
549 | */ | 555 | */ |
550 | int GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, | 556 | int |
551 | const GNUNET_HashCode * h2); | 557 | GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, const GNUNET_HashCode * h2); |
552 | 558 | ||
553 | 559 | ||
554 | /** | 560 | /** |
@@ -560,9 +566,10 @@ int GNUNET_CRYPTO_hash_cmp (const GNUNET_HashCode * h1, | |||
560 | * @param target some hash code | 566 | * @param target some hash code |
561 | * @return -1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2. | 567 | * @return -1 if h1 is closer, 1 if h2 is closer and 0 if h1==h2. |
562 | */ | 568 | */ |
563 | int GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, | 569 | int |
564 | const GNUNET_HashCode * h2, | 570 | GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, |
565 | const GNUNET_HashCode * target); | 571 | const GNUNET_HashCode * h2, |
572 | const GNUNET_HashCode * target); | ||
566 | 573 | ||
567 | 574 | ||
568 | /** | 575 | /** |
@@ -573,10 +580,11 @@ int GNUNET_CRYPTO_hash_xorcmp (const GNUNET_HashCode * h1, | |||
573 | * @param salt_len size of the salt | 580 | * @param salt_len size of the salt |
574 | * @param argp pair of void * & size_t for context chunks, terminated by NULL | 581 | * @param argp pair of void * & size_t for context chunks, terminated by NULL |
575 | */ | 582 | */ |
576 | void GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, | 583 | void |
577 | const struct GNUNET_CRYPTO_AesSessionKey | 584 | GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, |
578 | *rkey, const void *salt, size_t salt_len, | 585 | const struct GNUNET_CRYPTO_AesSessionKey *rkey, |
579 | va_list argp); | 586 | const void *salt, size_t salt_len, |
587 | va_list argp); | ||
580 | 588 | ||
581 | 589 | ||
582 | /** | 590 | /** |
@@ -587,10 +595,10 @@ void GNUNET_CRYPTO_hmac_derive_key_v (struct GNUNET_CRYPTO_AuthKey *key, | |||
587 | * @param salt_len size of the salt | 595 | * @param salt_len size of the salt |
588 | * @param ... pair of void * & size_t for context chunks, terminated by NULL | 596 | * @param ... pair of void * & size_t for context chunks, terminated by NULL |
589 | */ | 597 | */ |
590 | void GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, | 598 | void |
591 | const struct GNUNET_CRYPTO_AesSessionKey | 599 | GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, |
592 | *rkey, const void *salt, size_t salt_len, | 600 | const struct GNUNET_CRYPTO_AesSessionKey *rkey, |
593 | ...); | 601 | const void *salt, size_t salt_len, ...); |
594 | 602 | ||
595 | /** | 603 | /** |
596 | * @brief Derive key | 604 | * @brief Derive key |
@@ -604,9 +612,10 @@ void GNUNET_CRYPTO_hmac_derive_key (struct GNUNET_CRYPTO_AuthKey *key, | |||
604 | * @param skm_len length of skm | 612 | * @param skm_len length of skm |
605 | * @return GNUNET_YES on success | 613 | * @return GNUNET_YES on success |
606 | */ | 614 | */ |
607 | int GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, | 615 | int |
608 | int prf_algo, const void *xts, size_t xts_len, | 616 | GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, int prf_algo, |
609 | const void *skm, size_t skm_len, ...); | 617 | const void *xts, size_t xts_len, const void *skm, |
618 | size_t skm_len, ...); | ||
610 | 619 | ||
611 | 620 | ||
612 | /** | 621 | /** |
@@ -622,9 +631,10 @@ int GNUNET_CRYPTO_hkdf (void *result, size_t out_len, int xtr_algo, | |||
622 | * @param argp va_list of void * & size_t pairs for context chunks | 631 | * @param argp va_list of void * & size_t pairs for context chunks |
623 | * @return GNUNET_YES on success | 632 | * @return GNUNET_YES on success |
624 | */ | 633 | */ |
625 | int GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, | 634 | int |
626 | int prf_algo, const void *xts, size_t xts_len, | 635 | GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo, |
627 | const void *skm, size_t skm_len, va_list argp); | 636 | const void *xts, size_t xts_len, const void *skm, |
637 | size_t skm_len, va_list argp); | ||
628 | 638 | ||
629 | 639 | ||
630 | /** | 640 | /** |
@@ -638,9 +648,10 @@ int GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, | |||
638 | * @param argp va_list of void * & size_t pairs for context chunks | 648 | * @param argp va_list of void * & size_t pairs for context chunks |
639 | * @return GNUNET_YES on success | 649 | * @return GNUNET_YES on success |
640 | */ | 650 | */ |
641 | int GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, | 651 | int |
642 | size_t xts_len, const void *skm, size_t skm_len, | 652 | GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, |
643 | va_list argp); | 653 | size_t xts_len, const void *skm, size_t skm_len, |
654 | va_list argp); | ||
644 | 655 | ||
645 | 656 | ||
646 | /** | 657 | /** |
@@ -654,8 +665,9 @@ int GNUNET_CRYPTO_kdf_v (void *result, size_t out_len, const void *xts, | |||
654 | * @param ... void * & size_t pairs for context chunks | 665 | * @param ... void * & size_t pairs for context chunks |
655 | * @return GNUNET_YES on success | 666 | * @return GNUNET_YES on success |
656 | */ | 667 | */ |
657 | int GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, | 668 | int |
658 | size_t xts_len, const void *skm, size_t skm_len, ...); | 669 | GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, |
670 | size_t xts_len, const void *skm, size_t skm_len, ...); | ||
659 | 671 | ||
660 | 672 | ||
661 | /** | 673 | /** |
@@ -663,7 +675,8 @@ int GNUNET_CRYPTO_kdf (void *result, size_t out_len, const void *xts, | |||
663 | * | 675 | * |
664 | * @return fresh private key | 676 | * @return fresh private key |
665 | */ | 677 | */ |
666 | struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_key_create (void); | 678 | struct GNUNET_CRYPTO_RsaPrivateKey * |
679 | GNUNET_CRYPTO_rsa_key_create (void); | ||
667 | 680 | ||
668 | /** | 681 | /** |
669 | * Decode the private key from the data-format back | 682 | * Decode the private key from the data-format back |
@@ -672,9 +685,8 @@ struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_key_create (void); | |||
672 | * @param buf the buffer where the private key data is stored | 685 | * @param buf the buffer where the private key data is stored |
673 | * @param len the length of the data in 'buffer' | 686 | * @param len the length of the data in 'buffer' |
674 | */ | 687 | */ |
675 | struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_decode_key (const char | 688 | struct GNUNET_CRYPTO_RsaPrivateKey * |
676 | *buf, | 689 | GNUNET_CRYPTO_rsa_decode_key (const char *buf, uint16_t len); |
677 | uint16_t len); | ||
678 | 690 | ||
679 | /** | 691 | /** |
680 | * Create a new private key by reading it from a file. If the | 692 | * Create a new private key by reading it from a file. If the |
@@ -690,8 +702,8 @@ struct GNUNET_CRYPTO_RsaPrivateKey *GNUNET_CRYPTO_rsa_decode_key (const char | |||
690 | * @return new private key, NULL on error (for example, | 702 | * @return new private key, NULL on error (for example, |
691 | * permission denied) | 703 | * permission denied) |
692 | */ | 704 | */ |
693 | struct GNUNET_CRYPTO_RsaPrivateKey | 705 | struct GNUNET_CRYPTO_RsaPrivateKey * |
694 | *GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename); | 706 | GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename); |
695 | 707 | ||
696 | 708 | ||
697 | /** | 709 | /** |
@@ -701,15 +713,16 @@ struct GNUNET_CRYPTO_RsaPrivateKey | |||
701 | * @param hc "random" input to PRNG | 713 | * @param hc "random" input to PRNG |
702 | * @return some private key purely dependent on input | 714 | * @return some private key purely dependent on input |
703 | */ | 715 | */ |
704 | struct GNUNET_CRYPTO_RsaPrivateKey | 716 | struct GNUNET_CRYPTO_RsaPrivateKey * |
705 | *GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc); | 717 | GNUNET_CRYPTO_rsa_key_create_from_hash (const GNUNET_HashCode * hc); |
706 | 718 | ||
707 | 719 | ||
708 | /** | 720 | /** |
709 | * Free memory occupied by the private key. | 721 | * Free memory occupied by the private key. |
710 | * @param hostkey pointer to the memory to free | 722 | * @param hostkey pointer to the memory to free |
711 | */ | 723 | */ |
712 | void GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); | 724 | void |
725 | GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); | ||
713 | 726 | ||
714 | 727 | ||
715 | /** | 728 | /** |
@@ -718,11 +731,11 @@ void GNUNET_CRYPTO_rsa_key_free (struct GNUNET_CRYPTO_RsaPrivateKey *hostkey); | |||
718 | * @param priv the private key | 731 | * @param priv the private key |
719 | * @param pub where to write the public key | 732 | * @param pub where to write the public key |
720 | */ | 733 | */ |
721 | void GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey | 734 | void |
722 | *priv, | 735 | GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey |
723 | struct | 736 | *priv, |
724 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 737 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
725 | *pub); | 738 | *pub); |
726 | 739 | ||
727 | 740 | ||
728 | /** | 741 | /** |
@@ -735,11 +748,11 @@ void GNUNET_CRYPTO_rsa_key_get_public (const struct GNUNET_CRYPTO_RsaPrivateKey | |||
735 | * @param target where to store the encrypted block | 748 | * @param target where to store the encrypted block |
736 | * @return GNUNET_SYSERR on error, GNUNET_OK if ok | 749 | * @return GNUNET_SYSERR on error, GNUNET_OK if ok |
737 | */ | 750 | */ |
738 | int GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, | 751 | int |
739 | const struct | 752 | GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, |
740 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 753 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
741 | *publicKey, | 754 | *publicKey, |
742 | struct GNUNET_CRYPTO_RsaEncryptedData *target); | 755 | struct GNUNET_CRYPTO_RsaEncryptedData *target); |
743 | 756 | ||
744 | 757 | ||
745 | /** | 758 | /** |
@@ -751,10 +764,10 @@ int GNUNET_CRYPTO_rsa_encrypt (const void *block, size_t size, | |||
751 | * @param max how many bytes of a result are expected? Must be exact. | 764 | * @param max how many bytes of a result are expected? Must be exact. |
752 | * @return the size of the decrypted block (that is, size) or -1 on error | 765 | * @return the size of the decrypted block (that is, size) or -1 on error |
753 | */ | 766 | */ |
754 | ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey | 767 | ssize_t |
755 | *key, | 768 | GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey *key, |
756 | const struct GNUNET_CRYPTO_RsaEncryptedData | 769 | const struct GNUNET_CRYPTO_RsaEncryptedData *block, |
757 | *block, void *result, size_t max); | 770 | void *result, size_t max); |
758 | 771 | ||
759 | 772 | ||
760 | /** | 773 | /** |
@@ -765,9 +778,10 @@ ssize_t GNUNET_CRYPTO_rsa_decrypt (const struct GNUNET_CRYPTO_RsaPrivateKey | |||
765 | * @param sig where to write the signature | 778 | * @param sig where to write the signature |
766 | * @return GNUNET_SYSERR on error, GNUNET_OK on success | 779 | * @return GNUNET_SYSERR on error, GNUNET_OK on success |
767 | */ | 780 | */ |
768 | int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | 781 | int |
769 | const struct GNUNET_CRYPTO_RsaSignaturePurpose | 782 | GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, |
770 | *purpose, struct GNUNET_CRYPTO_RsaSignature *sig); | 783 | const struct GNUNET_CRYPTO_RsaSignaturePurpose *purpose, |
784 | struct GNUNET_CRYPTO_RsaSignature *sig); | ||
771 | 785 | ||
772 | 786 | ||
773 | /** | 787 | /** |
@@ -780,13 +794,13 @@ int GNUNET_CRYPTO_rsa_sign (const struct GNUNET_CRYPTO_RsaPrivateKey *key, | |||
780 | * @param publicKey public key of the signer | 794 | * @param publicKey public key of the signer |
781 | * @return GNUNET_OK if ok, GNUNET_SYSERR if invalid | 795 | * @return GNUNET_OK if ok, GNUNET_SYSERR if invalid |
782 | */ | 796 | */ |
783 | int GNUNET_CRYPTO_rsa_verify (uint32_t purpose, | 797 | int |
784 | const struct GNUNET_CRYPTO_RsaSignaturePurpose | 798 | GNUNET_CRYPTO_rsa_verify (uint32_t purpose, |
785 | *validate, | 799 | const struct GNUNET_CRYPTO_RsaSignaturePurpose |
786 | const struct GNUNET_CRYPTO_RsaSignature *sig, | 800 | *validate, |
787 | const struct | 801 | const struct GNUNET_CRYPTO_RsaSignature *sig, |
788 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 802 | const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
789 | *publicKey); | 803 | *publicKey); |
790 | 804 | ||
791 | 805 | ||
792 | 806 | ||
@@ -795,7 +809,8 @@ int GNUNET_CRYPTO_rsa_verify (uint32_t purpose, | |||
795 | * where strong entropy gathering is not desired | 809 | * where strong entropy gathering is not desired |
796 | * (for example, for hostkey generation). | 810 | * (for example, for hostkey generation). |
797 | */ | 811 | */ |
798 | void GNUNET_CRYPTO_random_disable_entropy_gathering (void); | 812 | void |
813 | GNUNET_CRYPTO_random_disable_entropy_gathering (void); | ||
799 | 814 | ||
800 | #if 0 /* keep Emacsens' auto-indent happy */ | 815 | #if 0 /* keep Emacsens' auto-indent happy */ |
801 | { | 816 | { |
diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h index 46d22d5ec..84cb4d600 100644 --- a/src/include/gnunet_datacache_lib.h +++ b/src/include/gnunet_datacache_lib.h | |||
@@ -56,10 +56,9 @@ struct GNUNET_DATACACHE_Handle; | |||
56 | * @param section section in the configuration that contains our options | 56 | * @param section section in the configuration that contains our options |
57 | * @return handle to use to access the service | 57 | * @return handle to use to access the service |
58 | */ | 58 | */ |
59 | struct GNUNET_DATACACHE_Handle *GNUNET_DATACACHE_create (const struct | 59 | struct GNUNET_DATACACHE_Handle * |
60 | GNUNET_CONFIGURATION_Handle | 60 | GNUNET_DATACACHE_create (const struct GNUNET_CONFIGURATION_Handle *cfg, |
61 | *cfg, | 61 | const char *section); |
62 | const char *section); | ||
63 | 62 | ||
64 | 63 | ||
65 | /** | 64 | /** |
@@ -67,7 +66,8 @@ struct GNUNET_DATACACHE_Handle *GNUNET_DATACACHE_create (const struct | |||
67 | * | 66 | * |
68 | * @param h handle to the datastore | 67 | * @param h handle to the datastore |
69 | */ | 68 | */ |
70 | void GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); | 69 | void |
70 | GNUNET_DATACACHE_destroy (struct GNUNET_DATACACHE_Handle *h); | ||
71 | 71 | ||
72 | 72 | ||
73 | /** | 73 | /** |
@@ -99,10 +99,11 @@ typedef int (*GNUNET_DATACACHE_Iterator) (void *cls, | |||
99 | * @param discard_time when to discard the value in any case | 99 | * @param discard_time when to discard the value in any case |
100 | * @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) | 100 | * @return GNUNET_OK on success, GNUNET_SYSERR on error (full, etc.) |
101 | */ | 101 | */ |
102 | int GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, | 102 | int |
103 | const GNUNET_HashCode * key, size_t size, | 103 | GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, |
104 | const char *data, enum GNUNET_BLOCK_Type type, | 104 | const GNUNET_HashCode * key, size_t size, |
105 | struct GNUNET_TIME_Absolute discard_time); | 105 | const char *data, enum GNUNET_BLOCK_Type type, |
106 | struct GNUNET_TIME_Absolute discard_time); | ||
106 | 107 | ||
107 | 108 | ||
108 | /** | 109 | /** |
@@ -116,11 +117,10 @@ int GNUNET_DATACACHE_put (struct GNUNET_DATACACHE_Handle *h, | |||
116 | * @param iter_cls closure for iter | 117 | * @param iter_cls closure for iter |
117 | * @return the number of results found | 118 | * @return the number of results found |
118 | */ | 119 | */ |
119 | unsigned int GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, | 120 | unsigned int |
120 | const GNUNET_HashCode * key, | 121 | GNUNET_DATACACHE_get (struct GNUNET_DATACACHE_Handle *h, |
121 | enum GNUNET_BLOCK_Type type, | 122 | const GNUNET_HashCode * key, enum GNUNET_BLOCK_Type type, |
122 | GNUNET_DATACACHE_Iterator iter, | 123 | GNUNET_DATACACHE_Iterator iter, void *iter_cls); |
123 | void *iter_cls); | ||
124 | 124 | ||
125 | 125 | ||
126 | #if 0 /* keep Emacsens' auto-indent happy */ | 126 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index 584537f39..3d2cc35c9 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -63,9 +63,8 @@ struct GNUNET_DATASTORE_Handle; | |||
63 | * @param cfg configuration to use | 63 | * @param cfg configuration to use |
64 | * @return handle to use to access the service | 64 | * @return handle to use to access the service |
65 | */ | 65 | */ |
66 | struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct | 66 | struct GNUNET_DATASTORE_Handle * |
67 | GNUNET_CONFIGURATION_Handle | 67 | GNUNET_DATASTORE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); |
68 | *cfg); | ||
69 | 68 | ||
70 | 69 | ||
71 | /** | 70 | /** |
@@ -75,7 +74,8 @@ struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct | |||
75 | * @param h handle to the datastore | 74 | * @param h handle to the datastore |
76 | * @param drop set to GNUNET_YES to delete all data in datastore (!) | 75 | * @param drop set to GNUNET_YES to delete all data in datastore (!) |
77 | */ | 76 | */ |
78 | void GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); | 77 | void |
78 | GNUNET_DATASTORE_disconnect (struct GNUNET_DATASTORE_Handle *h, int drop); | ||
79 | 79 | ||
80 | 80 | ||
81 | /** | 81 | /** |
@@ -112,21 +112,13 @@ typedef void (*GNUNET_DATASTORE_ContinuationWithStatus) (void *cls, | |||
112 | * cancel; note that even if NULL is returned, the callback will be invoked | 112 | * cancel; note that even if NULL is returned, the callback will be invoked |
113 | * (or rather, will already have been invoked) | 113 | * (or rather, will already have been invoked) |
114 | */ | 114 | */ |
115 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_reserve (struct | 115 | struct GNUNET_DATASTORE_QueueEntry * |
116 | GNUNET_DATASTORE_Handle | 116 | GNUNET_DATASTORE_reserve (struct GNUNET_DATASTORE_Handle *h, uint64_t amount, |
117 | *h, | 117 | uint32_t entries, unsigned int queue_priority, |
118 | uint64_t amount, | 118 | unsigned int max_queue_size, |
119 | uint32_t entries, | 119 | struct GNUNET_TIME_Relative timeout, |
120 | unsigned int | 120 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
121 | queue_priority, | 121 | void *cont_cls); |
122 | unsigned int | ||
123 | max_queue_size, | ||
124 | struct | ||
125 | GNUNET_TIME_Relative | ||
126 | timeout, | ||
127 | GNUNET_DATASTORE_ContinuationWithStatus | ||
128 | cont, | ||
129 | void *cont_cls); | ||
130 | 122 | ||
131 | 123 | ||
132 | /** | 124 | /** |
@@ -155,29 +147,17 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_reserve (struct | |||
155 | * cancel; note that even if NULL is returned, the callback will be invoked | 147 | * cancel; note that even if NULL is returned, the callback will be invoked |
156 | * (or rather, will already have been invoked) | 148 | * (or rather, will already have been invoked) |
157 | */ | 149 | */ |
158 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_put (struct | 150 | struct GNUNET_DATASTORE_QueueEntry * |
159 | GNUNET_DATASTORE_Handle | 151 | GNUNET_DATASTORE_put (struct GNUNET_DATASTORE_Handle *h, uint32_t rid, |
160 | *h, uint32_t rid, | 152 | const GNUNET_HashCode * key, size_t size, |
161 | const GNUNET_HashCode | 153 | const void *data, enum GNUNET_BLOCK_Type type, |
162 | * key, size_t size, | 154 | uint32_t priority, uint32_t anonymity, |
163 | const void *data, | 155 | uint32_t replication, |
164 | enum GNUNET_BLOCK_Type | 156 | struct GNUNET_TIME_Absolute expiration, |
165 | type, | 157 | unsigned int queue_priority, unsigned int max_queue_size, |
166 | uint32_t priority, | 158 | struct GNUNET_TIME_Relative timeout, |
167 | uint32_t anonymity, | 159 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
168 | uint32_t replication, | 160 | void *cont_cls); |
169 | struct | ||
170 | GNUNET_TIME_Absolute | ||
171 | expiration, | ||
172 | unsigned int | ||
173 | queue_priority, | ||
174 | unsigned int | ||
175 | max_queue_size, | ||
176 | struct | ||
177 | GNUNET_TIME_Relative | ||
178 | timeout, | ||
179 | GNUNET_DATASTORE_ContinuationWithStatus | ||
180 | cont, void *cont_cls); | ||
181 | 161 | ||
182 | 162 | ||
183 | /** | 163 | /** |
@@ -201,24 +181,13 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_put (struct | |||
201 | * cancel; note that even if NULL is returned, the callback will be invoked | 181 | * cancel; note that even if NULL is returned, the callback will be invoked |
202 | * (or rather, will already have been invoked) | 182 | * (or rather, will already have been invoked) |
203 | */ | 183 | */ |
204 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_release_reserve (struct | 184 | struct GNUNET_DATASTORE_QueueEntry * |
205 | GNUNET_DATASTORE_Handle | 185 | GNUNET_DATASTORE_release_reserve (struct GNUNET_DATASTORE_Handle *h, |
206 | *h, | 186 | uint32_t rid, unsigned int queue_priority, |
207 | uint32_t | 187 | unsigned int max_queue_size, |
208 | rid, | 188 | struct GNUNET_TIME_Relative timeout, |
209 | unsigned | 189 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
210 | int | 190 | void *cont_cls); |
211 | queue_priority, | ||
212 | unsigned | ||
213 | int | ||
214 | max_queue_size, | ||
215 | struct | ||
216 | GNUNET_TIME_Relative | ||
217 | timeout, | ||
218 | GNUNET_DATASTORE_ContinuationWithStatus | ||
219 | cont, | ||
220 | void | ||
221 | *cont_cls); | ||
222 | 191 | ||
223 | 192 | ||
224 | /** | 193 | /** |
@@ -238,23 +207,15 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_release_reserve (struct | |||
238 | * cancel; note that even if NULL is returned, the callback will be invoked | 207 | * cancel; note that even if NULL is returned, the callback will be invoked |
239 | * (or rather, will already have been invoked) | 208 | * (or rather, will already have been invoked) |
240 | */ | 209 | */ |
241 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_update (struct | 210 | struct GNUNET_DATASTORE_QueueEntry * |
242 | GNUNET_DATASTORE_Handle | 211 | GNUNET_DATASTORE_update (struct GNUNET_DATASTORE_Handle *h, uint64_t uid, |
243 | *h, uint64_t uid, | 212 | uint32_t priority, |
244 | uint32_t priority, | 213 | struct GNUNET_TIME_Absolute expiration, |
245 | struct | 214 | unsigned int queue_priority, |
246 | GNUNET_TIME_Absolute | 215 | unsigned int max_queue_size, |
247 | expiration, | 216 | struct GNUNET_TIME_Relative timeout, |
248 | unsigned int | 217 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
249 | queue_priority, | 218 | void *cont_cls); |
250 | unsigned int | ||
251 | max_queue_size, | ||
252 | struct | ||
253 | GNUNET_TIME_Relative | ||
254 | timeout, | ||
255 | GNUNET_DATASTORE_ContinuationWithStatus | ||
256 | cont, | ||
257 | void *cont_cls); | ||
258 | 219 | ||
259 | 220 | ||
260 | /** | 221 | /** |
@@ -278,23 +239,14 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_update (struct | |||
278 | * cancel; note that even if NULL is returned, the callback will be invoked | 239 | * cancel; note that even if NULL is returned, the callback will be invoked |
279 | * (or rather, will already have been invoked) | 240 | * (or rather, will already have been invoked) |
280 | */ | 241 | */ |
281 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_remove (struct | 242 | struct GNUNET_DATASTORE_QueueEntry * |
282 | GNUNET_DATASTORE_Handle | 243 | GNUNET_DATASTORE_remove (struct GNUNET_DATASTORE_Handle *h, |
283 | *h, | 244 | const GNUNET_HashCode * key, size_t size, |
284 | const | 245 | const void *data, unsigned int queue_priority, |
285 | GNUNET_HashCode * | 246 | unsigned int max_queue_size, |
286 | key, size_t size, | 247 | struct GNUNET_TIME_Relative timeout, |
287 | const void *data, | 248 | GNUNET_DATASTORE_ContinuationWithStatus cont, |
288 | unsigned int | 249 | void *cont_cls); |
289 | queue_priority, | ||
290 | unsigned int | ||
291 | max_queue_size, | ||
292 | struct | ||
293 | GNUNET_TIME_Relative | ||
294 | timeout, | ||
295 | GNUNET_DATASTORE_ContinuationWithStatus | ||
296 | cont, | ||
297 | void *cont_cls); | ||
298 | 250 | ||
299 | 251 | ||
300 | /** | 252 | /** |
@@ -342,26 +294,14 @@ typedef void (*GNUNET_DATASTORE_DatumProcessor) (void *cls, | |||
342 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | 294 | * @return NULL if the entry was not queued, otherwise a handle that can be used to |
343 | * cancel | 295 | * cancel |
344 | */ | 296 | */ |
345 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_key (struct | 297 | struct GNUNET_DATASTORE_QueueEntry * |
346 | GNUNET_DATASTORE_Handle | 298 | GNUNET_DATASTORE_get_key (struct GNUNET_DATASTORE_Handle *h, uint64_t offset, |
347 | *h, | 299 | const GNUNET_HashCode * key, |
348 | uint64_t offset, | 300 | enum GNUNET_BLOCK_Type type, |
349 | const | 301 | unsigned int queue_priority, |
350 | GNUNET_HashCode * | 302 | unsigned int max_queue_size, |
351 | key, | 303 | struct GNUNET_TIME_Relative timeout, |
352 | enum | 304 | GNUNET_DATASTORE_DatumProcessor proc, void *proc_cls); |
353 | GNUNET_BLOCK_Type | ||
354 | type, | ||
355 | unsigned int | ||
356 | queue_priority, | ||
357 | unsigned int | ||
358 | max_queue_size, | ||
359 | struct | ||
360 | GNUNET_TIME_Relative | ||
361 | timeout, | ||
362 | GNUNET_DATASTORE_DatumProcessor | ||
363 | proc, | ||
364 | void *proc_cls); | ||
365 | 305 | ||
366 | 306 | ||
367 | /** | 307 | /** |
@@ -388,27 +328,15 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_key (struct | |||
388 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | 328 | * @return NULL if the entry was not queued, otherwise a handle that can be used to |
389 | * cancel | 329 | * cancel |
390 | */ | 330 | */ |
391 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_zero_anonymity (struct | 331 | struct GNUNET_DATASTORE_QueueEntry * |
392 | GNUNET_DATASTORE_Handle | 332 | GNUNET_DATASTORE_get_zero_anonymity (struct GNUNET_DATASTORE_Handle *h, |
393 | *h, | 333 | uint64_t offset, |
394 | uint64_t | 334 | unsigned int queue_priority, |
395 | offset, | 335 | unsigned int max_queue_size, |
396 | unsigned | 336 | struct GNUNET_TIME_Relative timeout, |
397 | int | 337 | enum GNUNET_BLOCK_Type type, |
398 | queue_priority, | 338 | GNUNET_DATASTORE_DatumProcessor proc, |
399 | unsigned | 339 | void *proc_cls); |
400 | int | ||
401 | max_queue_size, | ||
402 | struct | ||
403 | GNUNET_TIME_Relative | ||
404 | timeout, | ||
405 | enum | ||
406 | GNUNET_BLOCK_Type | ||
407 | type, | ||
408 | GNUNET_DATASTORE_DatumProcessor | ||
409 | proc, | ||
410 | void | ||
411 | *proc_cls); | ||
412 | 340 | ||
413 | 341 | ||
414 | /** | 342 | /** |
@@ -430,22 +358,13 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_zero_anonymity (struct | |||
430 | * @return NULL if the entry was not queued, otherwise a handle that can be used to | 358 | * @return NULL if the entry was not queued, otherwise a handle that can be used to |
431 | * cancel | 359 | * cancel |
432 | */ | 360 | */ |
433 | struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_for_replication (struct | 361 | struct GNUNET_DATASTORE_QueueEntry * |
434 | GNUNET_DATASTORE_Handle | 362 | GNUNET_DATASTORE_get_for_replication (struct GNUNET_DATASTORE_Handle *h, |
435 | *h, | 363 | unsigned int queue_priority, |
436 | unsigned | 364 | unsigned int max_queue_size, |
437 | int | 365 | struct GNUNET_TIME_Relative timeout, |
438 | queue_priority, | 366 | GNUNET_DATASTORE_DatumProcessor proc, |
439 | unsigned | 367 | void *proc_cls); |
440 | int | ||
441 | max_queue_size, | ||
442 | struct | ||
443 | GNUNET_TIME_Relative | ||
444 | timeout, | ||
445 | GNUNET_DATASTORE_DatumProcessor | ||
446 | proc, | ||
447 | void | ||
448 | *proc_cls); | ||
449 | 368 | ||
450 | 369 | ||
451 | 370 | ||
@@ -455,7 +374,8 @@ struct GNUNET_DATASTORE_QueueEntry *GNUNET_DATASTORE_get_for_replication (struct | |||
455 | * | 374 | * |
456 | * @param qe operation to cancel | 375 | * @param qe operation to cancel |
457 | */ | 376 | */ |
458 | void GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe); | 377 | void |
378 | GNUNET_DATASTORE_cancel (struct GNUNET_DATASTORE_QueueEntry *qe); | ||
459 | 379 | ||
460 | 380 | ||
461 | #if 0 /* keep Emacsens' auto-indent happy */ | 381 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_dht_service.h b/src/include/gnunet_dht_service.h index 46929c366..55038d99a 100644 --- a/src/include/gnunet_dht_service.h +++ b/src/include/gnunet_dht_service.h | |||
@@ -123,9 +123,9 @@ enum GNUNET_DHT_RouteOption | |||
123 | * processing multiple GET/FIND requests in parallel | 123 | * processing multiple GET/FIND requests in parallel |
124 | * @return NULL on error | 124 | * @return NULL on error |
125 | */ | 125 | */ |
126 | struct GNUNET_DHT_Handle *GNUNET_DHT_connect (const struct | 126 | struct GNUNET_DHT_Handle * |
127 | GNUNET_CONFIGURATION_Handle *cfg, | 127 | GNUNET_DHT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
128 | unsigned int ht_len); | 128 | unsigned int ht_len); |
129 | 129 | ||
130 | 130 | ||
131 | /** | 131 | /** |
@@ -133,7 +133,8 @@ struct GNUNET_DHT_Handle *GNUNET_DHT_connect (const struct | |||
133 | * | 133 | * |
134 | * @param handle connection to shut down | 134 | * @param handle connection to shut down |
135 | */ | 135 | */ |
136 | void GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); | 136 | void |
137 | GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); | ||
137 | 138 | ||
138 | 139 | ||
139 | /* *************** Standard API: get and put ******************* */ | 140 | /* *************** Standard API: get and put ******************* */ |
@@ -154,14 +155,14 @@ void GNUNET_DHT_disconnect (struct GNUNET_DHT_Handle *handle); | |||
154 | * @param cont continuation to call when done (transmitting request to service) | 155 | * @param cont continuation to call when done (transmitting request to service) |
155 | * @param cont_cls closure for cont | 156 | * @param cont_cls closure for cont |
156 | */ | 157 | */ |
157 | void GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, | 158 | void |
158 | const GNUNET_HashCode * key, | 159 | GNUNET_DHT_put (struct GNUNET_DHT_Handle *handle, 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, size_t size, const char *data, |
162 | struct GNUNET_TIME_Absolute exp, | 163 | struct GNUNET_TIME_Absolute exp, |
163 | struct GNUNET_TIME_Relative timeout, | 164 | struct GNUNET_TIME_Relative timeout, GNUNET_SCHEDULER_Task cont, |
164 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 165 | void *cont_cls); |
165 | 166 | ||
166 | 167 | ||
167 | /** | 168 | /** |
@@ -211,23 +212,16 @@ typedef void (*GNUNET_DHT_GetIterator) (void *cls, | |||
211 | * | 212 | * |
212 | * @return handle to stop the async get | 213 | * @return handle to stop the async get |
213 | */ | 214 | */ |
214 | struct GNUNET_DHT_GetHandle *GNUNET_DHT_get_start (struct GNUNET_DHT_Handle | 215 | struct GNUNET_DHT_GetHandle * |
215 | *handle, | 216 | GNUNET_DHT_get_start (struct GNUNET_DHT_Handle *handle, |
216 | struct GNUNET_TIME_Relative | 217 | struct GNUNET_TIME_Relative timeout, |
217 | timeout, | 218 | enum GNUNET_BLOCK_Type type, const GNUNET_HashCode * key, |
218 | enum GNUNET_BLOCK_Type type, | 219 | uint32_t desired_replication_level, |
219 | const GNUNET_HashCode * key, | 220 | enum GNUNET_DHT_RouteOption options, |
220 | uint32_t | 221 | const struct GNUNET_CONTAINER_BloomFilter *bf, |
221 | desired_replication_level, | 222 | int32_t bf_mutator, const void *xquery, |
222 | enum GNUNET_DHT_RouteOption | 223 | size_t xquery_size, GNUNET_DHT_GetIterator iter, |
223 | options, | 224 | void *iter_cls); |
224 | const struct | ||
225 | GNUNET_CONTAINER_BloomFilter | ||
226 | *bf, int32_t bf_mutator, | ||
227 | const void *xquery, | ||
228 | size_t xquery_size, | ||
229 | GNUNET_DHT_GetIterator iter, | ||
230 | void *iter_cls); | ||
231 | 225 | ||
232 | 226 | ||
233 | /** | 227 | /** |
@@ -238,7 +232,8 @@ struct GNUNET_DHT_GetHandle *GNUNET_DHT_get_start (struct GNUNET_DHT_Handle | |||
238 | * On return get_handle will no longer be valid, caller | 232 | * On return get_handle will no longer be valid, caller |
239 | * must not use again!!! | 233 | * must not use again!!! |
240 | */ | 234 | */ |
241 | void GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); | 235 | void |
236 | GNUNET_DHT_get_stop (struct GNUNET_DHT_GetHandle *get_handle); | ||
242 | 237 | ||
243 | 238 | ||
244 | /* ******** Special high-level API for finding peers *********** */ | 239 | /* ******** Special high-level API for finding peers *********** */ |
@@ -267,21 +262,12 @@ typedef void (*GNUNET_DHT_FindPeerProcessor) (void *cls, | |||
267 | * @param proc_cls closure for proc | 262 | * @param proc_cls closure for proc |
268 | * @return handle to stop the async get, NULL on error | 263 | * @return handle to stop the async get, NULL on error |
269 | */ | 264 | */ |
270 | struct GNUNET_DHT_FindPeerHandle *GNUNET_DHT_find_peer_start (struct | 265 | struct GNUNET_DHT_FindPeerHandle * |
271 | GNUNET_DHT_Handle | 266 | GNUNET_DHT_find_peer_start (struct GNUNET_DHT_Handle *handle, |
272 | *handle, | 267 | struct GNUNET_TIME_Relative timeout, |
273 | struct | 268 | const GNUNET_HashCode * key, |
274 | GNUNET_TIME_Relative | 269 | enum GNUNET_DHT_RouteOption options, |
275 | timeout, | 270 | GNUNET_DHT_FindPeerProcessor proc, void *proc_cls); |
276 | const | ||
277 | GNUNET_HashCode * | ||
278 | key, | ||
279 | enum | ||
280 | GNUNET_DHT_RouteOption | ||
281 | options, | ||
282 | GNUNET_DHT_FindPeerProcessor | ||
283 | proc, | ||
284 | void *proc_cls); | ||
285 | 271 | ||
286 | 272 | ||
287 | /** | 273 | /** |
@@ -289,8 +275,8 @@ struct GNUNET_DHT_FindPeerHandle *GNUNET_DHT_find_peer_start (struct | |||
289 | * | 275 | * |
290 | * @param find_peer_handle GET operation to stop. | 276 | * @param find_peer_handle GET operation to stop. |
291 | */ | 277 | */ |
292 | void GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle | 278 | void |
293 | *find_peer_handle); | 279 | GNUNET_DHT_find_peer_stop (struct GNUNET_DHT_FindPeerHandle *find_peer_handle); |
294 | 280 | ||
295 | 281 | ||
296 | 282 | ||
@@ -337,25 +323,15 @@ typedef void (*GNUNET_DHT_ReplyProcessor) (void *cls, | |||
337 | * @param cont_cls closure for cont | 323 | * @param cont_cls closure for cont |
338 | * @return handle to stop the request, NULL if the request is "fire and forget" | 324 | * @return handle to stop the request, NULL if the request is "fire and forget" |
339 | */ | 325 | */ |
340 | struct GNUNET_DHT_RouteHandle *GNUNET_DHT_route_start (struct GNUNET_DHT_Handle | 326 | struct GNUNET_DHT_RouteHandle * |
341 | *handle, | 327 | GNUNET_DHT_route_start (struct GNUNET_DHT_Handle *handle, |
342 | const GNUNET_HashCode * | 328 | const GNUNET_HashCode * key, |
343 | key, | 329 | uint32_t desired_replication_level, |
344 | uint32_t | 330 | enum GNUNET_DHT_RouteOption options, |
345 | desired_replication_level, | 331 | const struct GNUNET_MessageHeader *enc, |
346 | enum | 332 | struct GNUNET_TIME_Relative timeout, |
347 | GNUNET_DHT_RouteOption | 333 | GNUNET_DHT_ReplyProcessor iter, void *iter_cls, |
348 | options, | 334 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
349 | const struct | ||
350 | GNUNET_MessageHeader | ||
351 | *enc, | ||
352 | struct | ||
353 | GNUNET_TIME_Relative | ||
354 | timeout, | ||
355 | GNUNET_DHT_ReplyProcessor | ||
356 | iter, void *iter_cls, | ||
357 | GNUNET_SCHEDULER_Task | ||
358 | cont, void *cont_cls); | ||
359 | 335 | ||
360 | 336 | ||
361 | 337 | ||
@@ -364,7 +340,8 @@ struct GNUNET_DHT_RouteHandle *GNUNET_DHT_route_start (struct GNUNET_DHT_Handle | |||
364 | * | 340 | * |
365 | * @param route_handle operation to stop. | 341 | * @param route_handle operation to stop. |
366 | */ | 342 | */ |
367 | void GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); | 343 | void |
344 | GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); | ||
368 | 345 | ||
369 | 346 | ||
370 | /* ***** Special API for controlling DHT routing maintenance ******* */ | 347 | /* ***** Special API for controlling DHT routing maintenance ******* */ |
@@ -381,8 +358,9 @@ void GNUNET_DHT_route_stop (struct GNUNET_DHT_RouteHandle *route_handle); | |||
381 | * @param cont_cls closure for cont | 358 | * @param cont_cls closure for cont |
382 | * @param handle handle to the DHT service | 359 | * @param handle handle to the DHT service |
383 | */ | 360 | */ |
384 | void GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, | 361 | void |
385 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 362 | GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, |
363 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | ||
386 | 364 | ||
387 | /* ***** Special API for testing robustness with malicious peers ******* */ | 365 | /* ***** Special API for testing robustness with malicious peers ******* */ |
388 | 366 | ||
@@ -402,9 +380,9 @@ void GNUNET_DHT_find_peers (struct GNUNET_DHT_Handle *handle, | |||
402 | * @param cont_cls closure for cont | 380 | * @param cont_cls closure for cont |
403 | * | 381 | * |
404 | */ | 382 | */ |
405 | void GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, | 383 | void |
406 | GNUNET_SCHEDULER_Task cont, | 384 | GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, |
407 | void *cont_cls); | 385 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
408 | 386 | ||
409 | 387 | ||
410 | /** | 388 | /** |
@@ -416,10 +394,10 @@ void GNUNET_DHT_set_malicious_dropper (struct GNUNET_DHT_Handle *handle, | |||
416 | * @param cont continuation to call when done (transmitting request to service) | 394 | * @param cont continuation to call when done (transmitting request to service) |
417 | * @param cont_cls closure for cont | 395 | * @param cont_cls closure for cont |
418 | */ | 396 | */ |
419 | void GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | 397 | void |
420 | struct GNUNET_TIME_Relative frequency, | 398 | GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, |
421 | GNUNET_SCHEDULER_Task cont, | 399 | struct GNUNET_TIME_Relative frequency, |
422 | void *cont_cls); | 400 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
423 | 401 | ||
424 | 402 | ||
425 | /** | 403 | /** |
@@ -431,10 +409,10 @@ void GNUNET_DHT_set_malicious_putter (struct GNUNET_DHT_Handle *handle, | |||
431 | * @param cont continuation to call when done (transmitting request to service) | 409 | * @param cont continuation to call when done (transmitting request to service) |
432 | * @param cont_cls closure for cont | 410 | * @param cont_cls closure for cont |
433 | */ | 411 | */ |
434 | void GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, | 412 | void |
435 | struct GNUNET_TIME_Relative frequency, | 413 | GNUNET_DHT_set_malicious_getter (struct GNUNET_DHT_Handle *handle, |
436 | GNUNET_SCHEDULER_Task cont, | 414 | struct GNUNET_TIME_Relative frequency, |
437 | void *cont_cls); | 415 | GNUNET_SCHEDULER_Task cont, void *cont_cls); |
438 | 416 | ||
439 | 417 | ||
440 | #endif | 418 | #endif |
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index f5fae80c9..abca17370 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -262,7 +262,8 @@ enum GNUNET_DISK_PipeEnd | |||
262 | * @param part a file on the partition to check | 262 | * @param part a file on the partition to check |
263 | * @return -1 on errors, otherwise the number of free blocks | 263 | * @return -1 on errors, otherwise the number of free blocks |
264 | */ | 264 | */ |
265 | long GNUNET_DISK_get_blocks_available (const char *part); | 265 | long |
266 | GNUNET_DISK_get_blocks_available (const char *part); | ||
266 | 267 | ||
267 | 268 | ||
268 | /** | 269 | /** |
@@ -271,7 +272,8 @@ long GNUNET_DISK_get_blocks_available (const char *part); | |||
271 | * @param h handle to check | 272 | * @param h handle to check |
272 | * @return GNUNET_YES if invalid, GNUNET_NO if valid | 273 | * @return GNUNET_YES if invalid, GNUNET_NO if valid |
273 | */ | 274 | */ |
274 | int GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | 275 | int |
276 | GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | ||
275 | 277 | ||
276 | 278 | ||
277 | /** | 279 | /** |
@@ -282,7 +284,8 @@ int GNUNET_DISK_handle_invalid (const struct GNUNET_DISK_FileHandle *h); | |||
282 | * @return GNUNET_YES if yes, GNUNET_NO if not a file, GNUNET_SYSERR if something | 284 | * @return GNUNET_YES if yes, GNUNET_NO if not a file, GNUNET_SYSERR if something |
283 | * else (will print an error message in that case, too). | 285 | * else (will print an error message in that case, too). |
284 | */ | 286 | */ |
285 | int GNUNET_DISK_file_test (const char *fil); | 287 | int |
288 | GNUNET_DISK_file_test (const char *fil); | ||
286 | 289 | ||
287 | 290 | ||
288 | /** | 291 | /** |
@@ -292,8 +295,9 @@ int GNUNET_DISK_file_test (const char *fil); | |||
292 | * @param whence specification to which position the offset parameter relates to | 295 | * @param whence specification to which position the offset parameter relates to |
293 | * @return the new position on success, GNUNET_SYSERR otherwise | 296 | * @return the new position on success, GNUNET_SYSERR otherwise |
294 | */ | 297 | */ |
295 | off_t GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, | 298 | off_t |
296 | off_t offset, enum GNUNET_DISK_Seek whence); | 299 | GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, off_t offset, |
300 | enum GNUNET_DISK_Seek whence); | ||
297 | 301 | ||
298 | 302 | ||
299 | /** | 303 | /** |
@@ -308,8 +312,9 @@ off_t GNUNET_DISK_file_seek (const struct GNUNET_DISK_FileHandle *h, | |||
308 | * included? | 312 | * included? |
309 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 313 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
310 | */ | 314 | */ |
311 | int GNUNET_DISK_file_size (const char *filename, uint64_t * size, | 315 | int |
312 | int includeSymLinks); | 316 | GNUNET_DISK_file_size (const char *filename, uint64_t * size, |
317 | int includeSymLinks); | ||
313 | 318 | ||
314 | 319 | ||
315 | /** | 320 | /** |
@@ -327,8 +332,9 @@ int GNUNET_DISK_file_size (const char *filename, uint64_t * size, | |||
327 | * @param ino set to the inode ID | 332 | * @param ino set to the inode ID |
328 | * @return GNUNET_OK on success | 333 | * @return GNUNET_OK on success |
329 | */ | 334 | */ |
330 | int GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, | 335 | int |
331 | uint64_t * ino); | 336 | GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, |
337 | uint64_t * ino); | ||
332 | 338 | ||
333 | 339 | ||
334 | /** | 340 | /** |
@@ -342,7 +348,8 @@ int GNUNET_DISK_file_get_identifiers (const char *filename, uint64_t * dev, | |||
342 | * @return NULL on error, otherwise name of fresh | 348 | * @return NULL on error, otherwise name of fresh |
343 | * file on disk in directory for temporary files | 349 | * file on disk in directory for temporary files |
344 | */ | 350 | */ |
345 | char *GNUNET_DISK_mktemp (const char *t); | 351 | char * |
352 | GNUNET_DISK_mktemp (const char *t); | ||
346 | 353 | ||
347 | 354 | ||
348 | /** | 355 | /** |
@@ -357,12 +364,9 @@ char *GNUNET_DISK_mktemp (const char *t); | |||
357 | * call (because of flags) | 364 | * call (because of flags) |
358 | * @return IO handle on success, NULL on error | 365 | * @return IO handle on success, NULL on error |
359 | */ | 366 | */ |
360 | struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, | 367 | struct GNUNET_DISK_FileHandle * |
361 | enum GNUNET_DISK_OpenFlags | 368 | GNUNET_DISK_file_open (const char *fn, enum GNUNET_DISK_OpenFlags flags, |
362 | flags, | 369 | enum GNUNET_DISK_AccessPermissions perm); |
363 | enum | ||
364 | GNUNET_DISK_AccessPermissions | ||
365 | perm); | ||
366 | 370 | ||
367 | /** | 371 | /** |
368 | * Creates an interprocess channel | 372 | * Creates an interprocess channel |
@@ -371,8 +375,8 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_file_open (const char *fn, | |||
371 | * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) | 375 | * @param inherit_write 1 to make write handle inheritable, 0 otherwise (NT only) |
372 | * @return handle to the new pipe, NULL on error | 376 | * @return handle to the new pipe, NULL on error |
373 | */ | 377 | */ |
374 | struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, int inherit_read, | 378 | struct GNUNET_DISK_PipeHandle * |
375 | int inherit_write); | 379 | GNUNET_DISK_pipe (int blocking, int inherit_read, int inherit_write); |
376 | 380 | ||
377 | 381 | ||
378 | /** | 382 | /** |
@@ -380,7 +384,8 @@ struct GNUNET_DISK_PipeHandle *GNUNET_DISK_pipe (int blocking, int inherit_read, | |||
380 | * @param p pipe | 384 | * @param p pipe |
381 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 385 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
382 | */ | 386 | */ |
383 | int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | 387 | int |
388 | GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | ||
384 | 389 | ||
385 | /** | 390 | /** |
386 | * Closes one half of an interprocess channel | 391 | * Closes one half of an interprocess channel |
@@ -389,8 +394,9 @@ int GNUNET_DISK_pipe_close (struct GNUNET_DISK_PipeHandle *p); | |||
389 | * @param end which end of the pipe to close | 394 | * @param end which end of the pipe to close |
390 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 395 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
391 | */ | 396 | */ |
392 | int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | 397 | int |
393 | enum GNUNET_DISK_PipeEnd end); | 398 | GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, |
399 | enum GNUNET_DISK_PipeEnd end); | ||
394 | 400 | ||
395 | /** | 401 | /** |
396 | * Close an open file. | 402 | * Close an open file. |
@@ -398,7 +404,8 @@ int GNUNET_DISK_pipe_close_end (struct GNUNET_DISK_PipeHandle *p, | |||
398 | * @param h file handle | 404 | * @param h file handle |
399 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 405 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
400 | */ | 406 | */ |
401 | int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | 407 | int |
408 | GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | ||
402 | 409 | ||
403 | 410 | ||
404 | /** | 411 | /** |
@@ -408,12 +415,9 @@ int GNUNET_DISK_file_close (struct GNUNET_DISK_FileHandle *h); | |||
408 | * @param n end to access | 415 | * @param n end to access |
409 | * @return handle for the respective end | 416 | * @return handle for the respective end |
410 | */ | 417 | */ |
411 | const struct GNUNET_DISK_FileHandle *GNUNET_DISK_pipe_handle (const struct | 418 | const struct GNUNET_DISK_FileHandle * |
412 | GNUNET_DISK_PipeHandle | 419 | GNUNET_DISK_pipe_handle (const struct GNUNET_DISK_PipeHandle *p, |
413 | *p, | 420 | enum GNUNET_DISK_PipeEnd n); |
414 | enum | ||
415 | GNUNET_DISK_PipeEnd | ||
416 | n); | ||
417 | 421 | ||
418 | /** | 422 | /** |
419 | * Read the contents of a binary file into a buffer. | 423 | * Read the contents of a binary file into a buffer. |
@@ -422,8 +426,9 @@ const struct GNUNET_DISK_FileHandle *GNUNET_DISK_pipe_handle (const struct | |||
422 | * @param len the maximum number of bytes to read | 426 | * @param len the maximum number of bytes to read |
423 | * @return the number of bytes read on success, GNUNET_SYSERR on failure | 427 | * @return the number of bytes read on success, GNUNET_SYSERR on failure |
424 | */ | 428 | */ |
425 | ssize_t GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, | 429 | ssize_t |
426 | void *result, size_t len); | 430 | GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, void *result, |
431 | size_t len); | ||
427 | 432 | ||
428 | 433 | ||
429 | /** | 434 | /** |
@@ -434,7 +439,8 @@ ssize_t GNUNET_DISK_file_read (const struct GNUNET_DISK_FileHandle *h, | |||
434 | * @param len the maximum number of bytes to read | 439 | * @param len the maximum number of bytes to read |
435 | * @return number of bytes read, GNUNET_SYSERR on failure | 440 | * @return number of bytes read, GNUNET_SYSERR on failure |
436 | */ | 441 | */ |
437 | ssize_t GNUNET_DISK_fn_read (const char *fn, void *result, size_t len); | 442 | ssize_t |
443 | GNUNET_DISK_fn_read (const char *fn, void *result, size_t len); | ||
438 | 444 | ||
439 | 445 | ||
440 | /** | 446 | /** |
@@ -445,8 +451,9 @@ ssize_t GNUNET_DISK_fn_read (const char *fn, void *result, size_t len); | |||
445 | * @param n number of bytes to write | 451 | * @param n number of bytes to write |
446 | * @return number of bytes written on success, GNUNET_SYSERR on error | 452 | * @return number of bytes written on success, GNUNET_SYSERR on error |
447 | */ | 453 | */ |
448 | ssize_t GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | 454 | ssize_t |
449 | const void *buffer, size_t n); | 455 | GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, |
456 | const void *buffer, size_t n); | ||
450 | 457 | ||
451 | 458 | ||
452 | /** | 459 | /** |
@@ -459,8 +466,9 @@ ssize_t GNUNET_DISK_file_write (const struct GNUNET_DISK_FileHandle *h, | |||
459 | * @param mode file permissions | 466 | * @param mode file permissions |
460 | * @return number of bytes written on success, GNUNET_SYSERR on error | 467 | * @return number of bytes written on success, GNUNET_SYSERR on error |
461 | */ | 468 | */ |
462 | ssize_t GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, | 469 | ssize_t |
463 | enum GNUNET_DISK_AccessPermissions mode); | 470 | GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, |
471 | enum GNUNET_DISK_AccessPermissions mode); | ||
464 | 472 | ||
465 | 473 | ||
466 | /** | 474 | /** |
@@ -470,7 +478,8 @@ ssize_t GNUNET_DISK_fn_write (const char *fn, const void *buffer, size_t n, | |||
470 | * @param dst destination file name | 478 | * @param dst destination file name |
471 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 479 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
472 | */ | 480 | */ |
473 | int GNUNET_DISK_file_copy (const char *src, const char *dst); | 481 | int |
482 | GNUNET_DISK_file_copy (const char *src, const char *dst); | ||
474 | 483 | ||
475 | 484 | ||
476 | /** | 485 | /** |
@@ -481,9 +490,10 @@ int GNUNET_DISK_file_copy (const char *src, const char *dst); | |||
481 | * @param callback_cls closure for callback | 490 | * @param callback_cls closure for callback |
482 | * @return the number of files found, -1 on error | 491 | * @return the number of files found, -1 on error |
483 | */ | 492 | */ |
484 | int GNUNET_DISK_directory_scan (const char *dirName, | 493 | int |
485 | GNUNET_FileNameCallback callback, | 494 | GNUNET_DISK_directory_scan (const char *dirName, |
486 | void *callback_cls); | 495 | GNUNET_FileNameCallback callback, |
496 | void *callback_cls); | ||
487 | 497 | ||
488 | 498 | ||
489 | /** | 499 | /** |
@@ -521,8 +531,9 @@ typedef void (*GNUNET_DISK_DirectoryIteratorCallback) (void *cls, | |||
521 | * GNUNET_NO if this was the last entry (and iteration is complete), | 531 | * GNUNET_NO if this was the last entry (and iteration is complete), |
522 | * GNUNET_SYSERR if "can" was YES | 532 | * GNUNET_SYSERR if "can" was YES |
523 | */ | 533 | */ |
524 | int GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator | 534 | int |
525 | *iter, int can); | 535 | GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator *iter, |
536 | int can); | ||
526 | 537 | ||
527 | 538 | ||
528 | /** | 539 | /** |
@@ -536,10 +547,11 @@ int GNUNET_DISK_directory_iterator_next (struct GNUNET_DISK_DirectoryIterator | |||
536 | * @param callback the method to call for each file | 547 | * @param callback the method to call for each file |
537 | * @param callback_cls closure for callback | 548 | * @param callback_cls closure for callback |
538 | */ | 549 | */ |
539 | void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, | 550 | void |
540 | const char *dirName, | 551 | GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, |
541 | GNUNET_DISK_DirectoryIteratorCallback | 552 | const char *dirName, |
542 | callback, void *callback_cls); | 553 | GNUNET_DISK_DirectoryIteratorCallback |
554 | callback, void *callback_cls); | ||
543 | 555 | ||
544 | 556 | ||
545 | /** | 557 | /** |
@@ -550,7 +562,8 @@ void GNUNET_DISK_directory_iterator_start (enum GNUNET_SCHEDULER_Priority prio, | |||
550 | * @returns GNUNET_OK on success, GNUNET_SYSERR on failure, | 562 | * @returns GNUNET_OK on success, GNUNET_SYSERR on failure, |
551 | * GNUNET_NO if directory exists but is not writeable | 563 | * GNUNET_NO if directory exists but is not writeable |
552 | */ | 564 | */ |
553 | int GNUNET_DISK_directory_create_for_file (const char *filename); | 565 | int |
566 | GNUNET_DISK_directory_create_for_file (const char *filename); | ||
554 | 567 | ||
555 | 568 | ||
556 | /** | 569 | /** |
@@ -563,7 +576,8 @@ int GNUNET_DISK_directory_create_for_file (const char *filename); | |||
563 | * @return GNUNET_YES if yes, GNUNET_NO if does not exist, GNUNET_SYSERR | 576 | * @return GNUNET_YES if yes, GNUNET_NO if does not exist, GNUNET_SYSERR |
564 | * on any error and if exists but not directory | 577 | * on any error and if exists but not directory |
565 | */ | 578 | */ |
566 | int GNUNET_DISK_directory_test (const char *fil); | 579 | int |
580 | GNUNET_DISK_directory_test (const char *fil); | ||
567 | 581 | ||
568 | 582 | ||
569 | /** | 583 | /** |
@@ -573,7 +587,8 @@ int GNUNET_DISK_directory_test (const char *fil); | |||
573 | * @param fileName the file to remove | 587 | * @param fileName the file to remove |
574 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 588 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
575 | */ | 589 | */ |
576 | int GNUNET_DISK_directory_remove (const char *fileName); | 590 | int |
591 | GNUNET_DISK_directory_remove (const char *fileName); | ||
577 | 592 | ||
578 | 593 | ||
579 | /** | 594 | /** |
@@ -582,7 +597,8 @@ int GNUNET_DISK_directory_remove (const char *fileName); | |||
582 | * @param dir the directory to create | 597 | * @param dir the directory to create |
583 | * @returns GNUNET_SYSERR on failure, GNUNET_OK otherwise | 598 | * @returns GNUNET_SYSERR on failure, GNUNET_OK otherwise |
584 | */ | 599 | */ |
585 | int GNUNET_DISK_directory_create (const char *dir); | 600 | int |
601 | GNUNET_DISK_directory_create (const char *dir); | ||
586 | 602 | ||
587 | 603 | ||
588 | /** | 604 | /** |
@@ -594,8 +610,9 @@ int GNUNET_DISK_directory_create (const char *dir); | |||
594 | * @param excl GNUNET_YES for an exclusive lock | 610 | * @param excl GNUNET_YES for an exclusive lock |
595 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 611 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
596 | */ | 612 | */ |
597 | int GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, | 613 | int |
598 | off_t lockEnd, int excl); | 614 | GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, |
615 | off_t lockEnd, int excl); | ||
599 | 616 | ||
600 | 617 | ||
601 | /** | 618 | /** |
@@ -605,15 +622,17 @@ int GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, | |||
605 | * @param unlockEnd absolute position until where to unlock | 622 | * @param unlockEnd absolute position until where to unlock |
606 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 623 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
607 | */ | 624 | */ |
608 | int GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, | 625 | int |
609 | off_t unlockStart, off_t unlockEnd); | 626 | GNUNET_DISK_file_unlock (struct GNUNET_DISK_FileHandle *fh, off_t unlockStart, |
627 | off_t unlockEnd); | ||
610 | 628 | ||
611 | 629 | ||
612 | /** | 630 | /** |
613 | * @brief Removes special characters as ':' from a filename. | 631 | * @brief Removes special characters as ':' from a filename. |
614 | * @param fn the filename to canonicalize | 632 | * @param fn the filename to canonicalize |
615 | */ | 633 | */ |
616 | void GNUNET_DISK_filename_canonicalize (char *fn); | 634 | void |
635 | GNUNET_DISK_filename_canonicalize (char *fn); | ||
617 | 636 | ||
618 | 637 | ||
619 | /** | 638 | /** |
@@ -622,7 +641,8 @@ void GNUNET_DISK_filename_canonicalize (char *fn); | |||
622 | * @param user new owner of the file | 641 | * @param user new owner of the file |
623 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure | 642 | * @return GNUNET_OK on success, GNUNET_SYSERR on failure |
624 | */ | 643 | */ |
625 | int GNUNET_DISK_file_change_owner (const char *filename, const char *user); | 644 | int |
645 | GNUNET_DISK_file_change_owner (const char *filename, const char *user); | ||
626 | 646 | ||
627 | 647 | ||
628 | /** | 648 | /** |
@@ -639,8 +659,9 @@ int GNUNET_DISK_file_change_owner (const char *filename, const char *user); | |||
639 | * private directory name. | 659 | * private directory name. |
640 | * @return the constructed filename | 660 | * @return the constructed filename |
641 | */ | 661 | */ |
642 | char *GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle | 662 | char * |
643 | *cfg, const char *serviceName, ...); | 663 | GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, |
664 | const char *serviceName, ...); | ||
644 | 665 | ||
645 | 666 | ||
646 | /** | 667 | /** |
@@ -656,9 +677,10 @@ struct GNUNET_DISK_MapHandle; | |||
656 | * @param len size of the mapping | 677 | * @param len size of the mapping |
657 | * @return pointer to the mapped memory region, NULL on failure | 678 | * @return pointer to the mapped memory region, NULL on failure |
658 | */ | 679 | */ |
659 | void *GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, | 680 | void * |
660 | struct GNUNET_DISK_MapHandle **m, | 681 | GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, |
661 | enum GNUNET_DISK_MapType access, size_t len); | 682 | struct GNUNET_DISK_MapHandle **m, |
683 | enum GNUNET_DISK_MapType access, size_t len); | ||
662 | 684 | ||
663 | /** | 685 | /** |
664 | * Unmap a file | 686 | * Unmap a file |
@@ -666,14 +688,16 @@ void *GNUNET_DISK_file_map (const struct GNUNET_DISK_FileHandle *h, | |||
666 | * @param h mapping handle | 688 | * @param h mapping handle |
667 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 689 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
668 | */ | 690 | */ |
669 | int GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); | 691 | int |
692 | GNUNET_DISK_file_unmap (struct GNUNET_DISK_MapHandle *h); | ||
670 | 693 | ||
671 | /** | 694 | /** |
672 | * Write file changes to disk | 695 | * Write file changes to disk |
673 | * @param h handle to an open file | 696 | * @param h handle to an open file |
674 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 697 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
675 | */ | 698 | */ |
676 | int GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); | 699 | int |
700 | GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); | ||
677 | 701 | ||
678 | /** | 702 | /** |
679 | * Creates a named pipe/FIFO and opens it | 703 | * Creates a named pipe/FIFO and opens it |
@@ -682,13 +706,9 @@ int GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h); | |||
682 | * @param perm access permissions | 706 | * @param perm access permissions |
683 | * @return pipe handle on success, NULL on error | 707 | * @return pipe handle on success, NULL on error |
684 | */ | 708 | */ |
685 | struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_create (char **fn, | 709 | struct GNUNET_DISK_FileHandle * |
686 | enum | 710 | GNUNET_DISK_npipe_create (char **fn, enum GNUNET_DISK_OpenFlags flags, |
687 | GNUNET_DISK_OpenFlags | 711 | enum GNUNET_DISK_AccessPermissions perm); |
688 | flags, | ||
689 | enum | ||
690 | GNUNET_DISK_AccessPermissions | ||
691 | perm); | ||
692 | 712 | ||
693 | /** | 713 | /** |
694 | * Opens already existing named pipe/FIFO | 714 | * Opens already existing named pipe/FIFO |
@@ -698,20 +718,17 @@ struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_create (char **fn, | |||
698 | * @param perm access permissions | 718 | * @param perm access permissions |
699 | * @return pipe handle on success, NULL on error | 719 | * @return pipe handle on success, NULL on error |
700 | */ | 720 | */ |
701 | struct GNUNET_DISK_FileHandle *GNUNET_DISK_npipe_open (const char *fn, | 721 | struct GNUNET_DISK_FileHandle * |
702 | enum | 722 | GNUNET_DISK_npipe_open (const char *fn, enum GNUNET_DISK_OpenFlags flags, |
703 | GNUNET_DISK_OpenFlags | 723 | enum GNUNET_DISK_AccessPermissions perm); |
704 | flags, | ||
705 | enum | ||
706 | GNUNET_DISK_AccessPermissions | ||
707 | perm); | ||
708 | 724 | ||
709 | /** | 725 | /** |
710 | * Closes a named pipe/FIFO | 726 | * Closes a named pipe/FIFO |
711 | * @param pipe named pipe | 727 | * @param pipe named pipe |
712 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 728 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
713 | */ | 729 | */ |
714 | int GNUNET_DISK_npipe_close (struct GNUNET_DISK_FileHandle *pipe); | 730 | int |
731 | GNUNET_DISK_npipe_close (struct GNUNET_DISK_FileHandle *pipe); | ||
715 | 732 | ||
716 | #if 0 /* keep Emacsens' auto-indent happy */ | 733 | #if 0 /* keep Emacsens' auto-indent happy */ |
717 | { | 734 | { |
diff --git a/src/include/gnunet_dv_service.h b/src/include/gnunet_dv_service.h index 2bb2319b9..3454ebc24 100644 --- a/src/include/gnunet_dv_service.h +++ b/src/include/gnunet_dv_service.h | |||
@@ -68,12 +68,13 @@ struct GNUNET_DV_Handle; | |||
68 | * @param cont_cls closure for continuation | 68 | * @param cont_cls closure for continuation |
69 | * | 69 | * |
70 | */ | 70 | */ |
71 | int GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, | 71 | int |
72 | const struct GNUNET_PeerIdentity *target, | 72 | GNUNET_DV_send (struct GNUNET_DV_Handle *dv_handle, |
73 | const char *msgbuf, size_t msgbuf_size, | 73 | const struct GNUNET_PeerIdentity *target, const char *msgbuf, |
74 | unsigned int priority, struct GNUNET_TIME_Relative timeout, | 74 | size_t msgbuf_size, unsigned int priority, |
75 | const void *addr, size_t addrlen, | 75 | struct GNUNET_TIME_Relative timeout, const void *addr, |
76 | GNUNET_TRANSPORT_TransmitContinuation cont, void *cont_cls); | 76 | size_t addrlen, GNUNET_TRANSPORT_TransmitContinuation cont, |
77 | void *cont_cls); | ||
77 | 78 | ||
78 | 79 | ||
79 | 80 | ||
diff --git a/src/include/gnunet_fragmentation_lib.h b/src/include/gnunet_fragmentation_lib.h index 1f1f85321..06022e093 100644 --- a/src/include/gnunet_fragmentation_lib.h +++ b/src/include/gnunet_fragmentation_lib.h | |||
@@ -80,22 +80,14 @@ typedef void (*GNUNET_FRAGMENT_MessageProcessor) (void *cls, | |||
80 | * @param proc_cls closure for proc | 80 | * @param proc_cls closure for proc |
81 | * @return the fragmentation context | 81 | * @return the fragmentation context |
82 | */ | 82 | */ |
83 | struct GNUNET_FRAGMENT_Context *GNUNET_FRAGMENT_context_create (struct | 83 | struct GNUNET_FRAGMENT_Context * |
84 | GNUNET_STATISTICS_Handle | 84 | GNUNET_FRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, |
85 | *stats, | 85 | uint16_t mtu, |
86 | uint16_t mtu, | 86 | struct GNUNET_BANDWIDTH_Tracker *tracker, |
87 | struct | 87 | struct GNUNET_TIME_Relative delay, |
88 | GNUNET_BANDWIDTH_Tracker | 88 | const struct GNUNET_MessageHeader *msg, |
89 | *tracker, | 89 | GNUNET_FRAGMENT_MessageProcessor proc, |
90 | struct | 90 | void *proc_cls); |
91 | GNUNET_TIME_Relative | ||
92 | delay, | ||
93 | const struct | ||
94 | GNUNET_MessageHeader | ||
95 | *msg, | ||
96 | GNUNET_FRAGMENT_MessageProcessor | ||
97 | proc, | ||
98 | void *proc_cls); | ||
99 | 91 | ||
100 | 92 | ||
101 | /** | 93 | /** |
@@ -105,8 +97,8 @@ struct GNUNET_FRAGMENT_Context *GNUNET_FRAGMENT_context_create (struct | |||
105 | * | 97 | * |
106 | * @param fc fragmentation context | 98 | * @param fc fragmentation context |
107 | */ | 99 | */ |
108 | void GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context | 100 | void |
109 | *fc); | 101 | GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context *fc); |
110 | 102 | ||
111 | 103 | ||
112 | /** | 104 | /** |
@@ -120,8 +112,9 @@ void GNUNET_FRAGMENT_context_transmission_done (struct GNUNET_FRAGMENT_Context | |||
120 | * GNUNET_NO if more messages are pending | 112 | * GNUNET_NO if more messages are pending |
121 | * GNUNET_SYSERR if this ack is not valid for this fc | 113 | * GNUNET_SYSERR if this ack is not valid for this fc |
122 | */ | 114 | */ |
123 | int GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | 115 | int |
124 | const struct GNUNET_MessageHeader *msg); | 116 | GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, |
117 | const struct GNUNET_MessageHeader *msg); | ||
125 | 118 | ||
126 | 119 | ||
127 | /** | 120 | /** |
@@ -132,9 +125,8 @@ int GNUNET_FRAGMENT_process_ack (struct GNUNET_FRAGMENT_Context *fc, | |||
132 | * @return average delay between transmission and ACK for the | 125 | * @return average delay between transmission and ACK for the |
133 | * last message, FOREVER if the message was not fully transmitted | 126 | * last message, FOREVER if the message was not fully transmitted |
134 | */ | 127 | */ |
135 | struct GNUNET_TIME_Relative GNUNET_FRAGMENT_context_destroy (struct | 128 | struct GNUNET_TIME_Relative |
136 | GNUNET_FRAGMENT_Context | 129 | GNUNET_FRAGMENT_context_destroy (struct GNUNET_FRAGMENT_Context *fc); |
137 | *fc); | ||
138 | 130 | ||
139 | 131 | ||
140 | /** | 132 | /** |
@@ -171,18 +163,12 @@ typedef void (*GNUNET_DEFRAGMENT_AckProcessor) (void *cls, uint32_t id, | |||
171 | * back to the other side) | 163 | * back to the other side) |
172 | * @return the defragmentation context | 164 | * @return the defragmentation context |
173 | */ | 165 | */ |
174 | struct GNUNET_DEFRAGMENT_Context *GNUNET_DEFRAGMENT_context_create (struct | 166 | struct GNUNET_DEFRAGMENT_Context * |
175 | GNUNET_STATISTICS_Handle | 167 | GNUNET_DEFRAGMENT_context_create (struct GNUNET_STATISTICS_Handle *stats, |
176 | *stats, | 168 | uint16_t mtu, unsigned int num_msgs, |
177 | uint16_t | 169 | void *cls, |
178 | mtu, | 170 | GNUNET_FRAGMENT_MessageProcessor proc, |
179 | unsigned int | 171 | GNUNET_DEFRAGMENT_AckProcessor ackp); |
180 | num_msgs, | ||
181 | void *cls, | ||
182 | GNUNET_FRAGMENT_MessageProcessor | ||
183 | proc, | ||
184 | GNUNET_DEFRAGMENT_AckProcessor | ||
185 | ackp); | ||
186 | 172 | ||
187 | 173 | ||
188 | /** | 174 | /** |
@@ -190,7 +176,8 @@ struct GNUNET_DEFRAGMENT_Context *GNUNET_DEFRAGMENT_context_create (struct | |||
190 | * | 176 | * |
191 | * @param dc defragmentation context | 177 | * @param dc defragmentation context |
192 | */ | 178 | */ |
193 | void GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); | 179 | void |
180 | GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); | ||
194 | 181 | ||
195 | 182 | ||
196 | /** | 183 | /** |
@@ -200,8 +187,9 @@ void GNUNET_DEFRAGMENT_context_destroy (struct GNUNET_DEFRAGMENT_Context *dc); | |||
200 | * @param msg the message that was received | 187 | * @param msg the message that was received |
201 | * @return GNUNET_OK on success, GNUNET_NO if this was a duplicate, GNUNET_SYSERR on error | 188 | * @return GNUNET_OK on success, GNUNET_NO if this was a duplicate, GNUNET_SYSERR on error |
202 | */ | 189 | */ |
203 | int GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, | 190 | int |
204 | const struct GNUNET_MessageHeader *msg); | 191 | GNUNET_DEFRAGMENT_process_fragment (struct GNUNET_DEFRAGMENT_Context *dc, |
192 | const struct GNUNET_MessageHeader *msg); | ||
205 | 193 | ||
206 | 194 | ||
207 | #if 0 /* keep Emacsens' auto-indent happy */ | 195 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 2962a9cf2..e8026a66f 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -89,8 +89,8 @@ typedef int (*GNUNET_FS_KeywordIterator) (void *cls, const char *keyword, | |||
89 | * @param uri uri to convert to a unique key | 89 | * @param uri uri to convert to a unique key |
90 | * @param key wherer to store the unique key | 90 | * @param key wherer to store the unique key |
91 | */ | 91 | */ |
92 | void GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, | 92 | void |
93 | GNUNET_HashCode * key); | 93 | GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, GNUNET_HashCode * key); |
94 | 94 | ||
95 | /** | 95 | /** |
96 | * Convert a URI to a UTF-8 String. | 96 | * Convert a URI to a UTF-8 String. |
@@ -98,7 +98,8 @@ void GNUNET_FS_uri_to_key (const struct GNUNET_FS_Uri *uri, | |||
98 | * @param uri uri to convert to a string | 98 | * @param uri uri to convert to a string |
99 | * @return the UTF-8 string | 99 | * @return the UTF-8 string |
100 | */ | 100 | */ |
101 | char *GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); | 101 | char * |
102 | GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); | ||
102 | 103 | ||
103 | /** | 104 | /** |
104 | * Convert keyword URI to a human readable format | 105 | * Convert keyword URI to a human readable format |
@@ -107,7 +108,8 @@ char *GNUNET_FS_uri_to_string (const struct GNUNET_FS_Uri *uri); | |||
107 | * @param uri ksk uri to convert to a string | 108 | * @param uri ksk uri to convert to a string |
108 | * @return string with the keywords | 109 | * @return string with the keywords |
109 | */ | 110 | */ |
110 | char *GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | 111 | char * |
112 | GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | ||
111 | 113 | ||
112 | 114 | ||
113 | /** | 115 | /** |
@@ -118,8 +120,9 @@ char *GNUNET_FS_uri_ksk_to_string_fancy (const struct GNUNET_FS_Uri *uri); | |||
118 | * @param keyword keyword to add | 120 | * @param keyword keyword to add |
119 | * @param is_mandatory is this keyword mandatory? | 121 | * @param is_mandatory is this keyword mandatory? |
120 | */ | 122 | */ |
121 | void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | 123 | void |
122 | const char *keyword, int is_mandatory); | 124 | GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, const char *keyword, |
125 | int is_mandatory); | ||
123 | 126 | ||
124 | 127 | ||
125 | /** | 128 | /** |
@@ -129,8 +132,9 @@ void GNUNET_FS_uri_ksk_add_keyword (struct GNUNET_FS_Uri *uri, | |||
129 | * @param uri ksk uri to modify | 132 | * @param uri ksk uri to modify |
130 | * @param keyword keyword to add | 133 | * @param keyword keyword to add |
131 | */ | 134 | */ |
132 | void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, | 135 | void |
133 | const char *keyword); | 136 | GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, |
137 | const char *keyword); | ||
134 | 138 | ||
135 | 139 | ||
136 | /** | 140 | /** |
@@ -140,14 +144,16 @@ void GNUNET_FS_uri_ksk_remove_keyword (struct GNUNET_FS_Uri *uri, | |||
140 | * @param emsg where to store the parser error message (if any) | 144 | * @param emsg where to store the parser error message (if any) |
141 | * @return NULL on error | 145 | * @return NULL on error |
142 | */ | 146 | */ |
143 | struct GNUNET_FS_Uri *GNUNET_FS_uri_parse (const char *uri, char **emsg); | 147 | struct GNUNET_FS_Uri * |
148 | GNUNET_FS_uri_parse (const char *uri, char **emsg); | ||
144 | 149 | ||
145 | /** | 150 | /** |
146 | * Free URI. | 151 | * Free URI. |
147 | * | 152 | * |
148 | * @param uri uri to free | 153 | * @param uri uri to free |
149 | */ | 154 | */ |
150 | void GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | 155 | void |
156 | GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | ||
151 | 157 | ||
152 | 158 | ||
153 | /** | 159 | /** |
@@ -156,8 +162,8 @@ void GNUNET_FS_uri_destroy (struct GNUNET_FS_Uri *uri); | |||
156 | * @param uri ksk uri to get the number of keywords from | 162 | * @param uri ksk uri to get the number of keywords from |
157 | * @return 0 if this is not a keyword URI | 163 | * @return 0 if this is not a keyword URI |
158 | */ | 164 | */ |
159 | unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri | 165 | unsigned int |
160 | *uri); | 166 | GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri *uri); |
161 | 167 | ||
162 | 168 | ||
163 | /** | 169 | /** |
@@ -169,9 +175,10 @@ unsigned int GNUNET_FS_uri_ksk_get_keyword_count (const struct GNUNET_FS_Uri | |||
169 | * @return -1 if this is not a keyword URI, otherwise number of | 175 | * @return -1 if this is not a keyword URI, otherwise number of |
170 | * keywords iterated over until iterator aborted | 176 | * keywords iterated over until iterator aborted |
171 | */ | 177 | */ |
172 | int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | 178 | int |
173 | GNUNET_FS_KeywordIterator iterator, | 179 | GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, |
174 | void *iterator_cls); | 180 | GNUNET_FS_KeywordIterator iterator, |
181 | void *iterator_cls); | ||
175 | 182 | ||
176 | 183 | ||
177 | /** | 184 | /** |
@@ -181,8 +188,9 @@ int GNUNET_FS_uri_ksk_get_keywords (const struct GNUNET_FS_Uri *uri, | |||
181 | * @param peer where to store the identify of the peer (presumably) offering the content | 188 | * @param peer where to store the identify of the peer (presumably) offering the content |
182 | * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK | 189 | * @return GNUNET_SYSERR if this is not a location URI, otherwise GNUNET_OK |
183 | */ | 190 | */ |
184 | int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | 191 | int |
185 | struct GNUNET_PeerIdentity *peer); | 192 | GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, |
193 | struct GNUNET_PeerIdentity *peer); | ||
186 | 194 | ||
187 | 195 | ||
188 | /** | 196 | /** |
@@ -191,8 +199,8 @@ int GNUNET_FS_uri_loc_get_peer_identity (const struct GNUNET_FS_Uri *uri, | |||
191 | * @param uri location URI to get the content URI from | 199 | * @param uri location URI to get the content URI from |
192 | * @return NULL if argument is not a location URI | 200 | * @return NULL if argument is not a location URI |
193 | */ | 201 | */ |
194 | struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri | 202 | struct GNUNET_FS_Uri * |
195 | *uri); | 203 | GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri *uri); |
196 | 204 | ||
197 | 205 | ||
198 | /** | 206 | /** |
@@ -201,9 +209,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_get_uri (const struct GNUNET_FS_Uri | |||
201 | * @param uri location URI to get the expiration from | 209 | * @param uri location URI to get the expiration from |
202 | * @return expiration time of the URI | 210 | * @return expiration time of the URI |
203 | */ | 211 | */ |
204 | struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration (const struct | 212 | struct GNUNET_TIME_Absolute |
205 | GNUNET_FS_Uri | 213 | GNUNET_FS_uri_loc_get_expiration (const struct GNUNET_FS_Uri *uri); |
206 | *uri); | ||
207 | 214 | ||
208 | 215 | ||
209 | /** | 216 | /** |
@@ -214,13 +221,10 @@ struct GNUNET_TIME_Absolute GNUNET_FS_uri_loc_get_expiration (const struct | |||
214 | * @param expiration_time how long will the content be offered? | 221 | * @param expiration_time how long will the content be offered? |
215 | * @return the location URI, NULL on error | 222 | * @return the location URI, NULL on error |
216 | */ | 223 | */ |
217 | struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri | 224 | struct GNUNET_FS_Uri * |
218 | *baseUri, | 225 | GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri *baseUri, |
219 | const struct | 226 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
220 | GNUNET_CONFIGURATION_Handle | 227 | struct GNUNET_TIME_Absolute expiration_time); |
221 | *cfg, | ||
222 | struct GNUNET_TIME_Absolute | ||
223 | expiration_time); | ||
224 | 228 | ||
225 | 229 | ||
226 | /** | 230 | /** |
@@ -231,8 +235,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_loc_create (const struct GNUNET_FS_Uri | |||
231 | * @param uri the URI to canonicalize | 235 | * @param uri the URI to canonicalize |
232 | * @return canonicalized version of the URI, NULL on error | 236 | * @return canonicalized version of the URI, NULL on error |
233 | */ | 237 | */ |
234 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri | 238 | struct GNUNET_FS_Uri * |
235 | *uri); | 239 | GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri *uri); |
236 | 240 | ||
237 | 241 | ||
238 | /** | 242 | /** |
@@ -244,8 +248,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_canonicalize (const struct GNUNET_FS_Uri | |||
244 | * @param u2 second uri | 248 | * @param u2 second uri |
245 | * @return merged URI, NULL on error | 249 | * @return merged URI, NULL on error |
246 | */ | 250 | */ |
247 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, | 251 | struct GNUNET_FS_Uri * |
248 | const struct GNUNET_FS_Uri *u2); | 252 | GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, |
253 | const struct GNUNET_FS_Uri *u2); | ||
249 | 254 | ||
250 | 255 | ||
251 | /** | 256 | /** |
@@ -254,7 +259,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_merge (const struct GNUNET_FS_Uri *u1, | |||
254 | * @param uri the URI to duplicate | 259 | * @param uri the URI to duplicate |
255 | * @return copy of the URI | 260 | * @return copy of the URI |
256 | */ | 261 | */ |
257 | struct GNUNET_FS_Uri *GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); | 262 | struct GNUNET_FS_Uri * |
263 | GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); | ||
258 | 264 | ||
259 | 265 | ||
260 | /** | 266 | /** |
@@ -274,8 +280,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_dup (const struct GNUNET_FS_Uri *uri); | |||
274 | * @return an FS URI for the given keywords, NULL | 280 | * @return an FS URI for the given keywords, NULL |
275 | * if keywords is not legal (i.e. empty). | 281 | * if keywords is not legal (i.e. empty). |
276 | */ | 282 | */ |
277 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create (const char *keywords, | 283 | struct GNUNET_FS_Uri * |
278 | char **emsg); | 284 | GNUNET_FS_uri_ksk_create (const char *keywords, char **emsg); |
279 | 285 | ||
280 | 286 | ||
281 | /** | 287 | /** |
@@ -295,8 +301,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create (const char *keywords, | |||
295 | * @return an FS URI for the given keywords, NULL | 301 | * @return an FS URI for the given keywords, NULL |
296 | * if keywords is not legal (i.e. empty). | 302 | * if keywords is not legal (i.e. empty). |
297 | */ | 303 | */ |
298 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, | 304 | struct GNUNET_FS_Uri * |
299 | const char **argv); | 305 | GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, const char **argv); |
300 | 306 | ||
301 | 307 | ||
302 | /** | 308 | /** |
@@ -306,8 +312,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_args (unsigned int argc, | |||
306 | * @param u2 the other URI | 312 | * @param u2 the other URI |
307 | * @return GNUNET_YES if the URIs are equal | 313 | * @return GNUNET_YES if the URIs are equal |
308 | */ | 314 | */ |
309 | int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | 315 | int |
310 | const struct GNUNET_FS_Uri *u2); | 316 | GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, |
317 | const struct GNUNET_FS_Uri *u2); | ||
311 | 318 | ||
312 | 319 | ||
313 | /** | 320 | /** |
@@ -316,7 +323,8 @@ int GNUNET_FS_uri_test_equal (const struct GNUNET_FS_Uri *u1, | |||
316 | * @param uri the uri to check | 323 | * @param uri the uri to check |
317 | * @return GNUNET_YES if this is an SKS uri | 324 | * @return GNUNET_YES if this is an SKS uri |
318 | */ | 325 | */ |
319 | int GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); | 326 | int |
327 | GNUNET_FS_uri_test_sks (const struct GNUNET_FS_Uri *uri); | ||
320 | 328 | ||
321 | 329 | ||
322 | /** | 330 | /** |
@@ -333,8 +341,9 @@ struct GNUNET_FS_Namespace; | |||
333 | * @param emsg where to store an error message | 341 | * @param emsg where to store an error message |
334 | * @return an FS URI for the given namespace and identifier | 342 | * @return an FS URI for the given namespace and identifier |
335 | */ | 343 | */ |
336 | struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, | 344 | struct GNUNET_FS_Uri * |
337 | const char *id, char **emsg); | 345 | GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, const char *id, |
346 | char **emsg); | ||
338 | 347 | ||
339 | 348 | ||
340 | /** | 349 | /** |
@@ -344,8 +353,8 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create (struct GNUNET_FS_Namespace *ns, | |||
344 | * @param id identifier | 353 | * @param id identifier |
345 | * @return an FS URI for the given namespace and identifier | 354 | * @return an FS URI for the given namespace and identifier |
346 | */ | 355 | */ |
347 | struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * | 356 | struct GNUNET_FS_Uri * |
348 | nsid, const char *id); | 357 | GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * nsid, const char *id); |
349 | 358 | ||
350 | 359 | ||
351 | /** | 360 | /** |
@@ -356,8 +365,9 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_sks_create_from_nsid (GNUNET_HashCode * | |||
356 | * @param nsid where to store the ID of the namespace | 365 | * @param nsid where to store the ID of the namespace |
357 | * @return GNUNET_OK on success | 366 | * @return GNUNET_OK on success |
358 | */ | 367 | */ |
359 | int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | 368 | int |
360 | GNUNET_HashCode * nsid); | 369 | GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, |
370 | GNUNET_HashCode * nsid); | ||
361 | 371 | ||
362 | 372 | ||
363 | /** | 373 | /** |
@@ -366,7 +376,8 @@ int GNUNET_FS_uri_sks_get_namespace (const struct GNUNET_FS_Uri *uri, | |||
366 | * @param uri the sks uri | 376 | * @param uri the sks uri |
367 | * @return NULL on error (not a valid SKS URI) | 377 | * @return NULL on error (not a valid SKS URI) |
368 | */ | 378 | */ |
369 | char *GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); | 379 | char * |
380 | GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); | ||
370 | 381 | ||
371 | 382 | ||
372 | /** | 383 | /** |
@@ -377,8 +388,9 @@ char *GNUNET_FS_uri_sks_get_content_id (const struct GNUNET_FS_Uri *uri); | |||
377 | * @param uri SKS uri to convert | 388 | * @param uri SKS uri to convert |
378 | * @return NULL on error (not an SKS URI) | 389 | * @return NULL on error (not an SKS URI) |
379 | */ | 390 | */ |
380 | char *GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle | 391 | char * |
381 | *cfg, const struct GNUNET_FS_Uri *uri); | 392 | GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle *cfg, |
393 | const struct GNUNET_FS_Uri *uri); | ||
382 | 394 | ||
383 | 395 | ||
384 | /** | 396 | /** |
@@ -387,7 +399,8 @@ char *GNUNET_FS_uri_sks_to_string_fancy (struct GNUNET_CONFIGURATION_Handle | |||
387 | * @param uri the uri | 399 | * @param uri the uri |
388 | * @return GNUNET_YES if this is a KSK uri | 400 | * @return GNUNET_YES if this is a KSK uri |
389 | */ | 401 | */ |
390 | int GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); | 402 | int |
403 | GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); | ||
391 | 404 | ||
392 | 405 | ||
393 | /** | 406 | /** |
@@ -396,7 +409,8 @@ int GNUNET_FS_uri_test_ksk (const struct GNUNET_FS_Uri *uri); | |||
396 | * @param uri the uri to check | 409 | * @param uri the uri to check |
397 | * @return GNUNET_YES if this is a CHK uri | 410 | * @return GNUNET_YES if this is a CHK uri |
398 | */ | 411 | */ |
399 | int GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); | 412 | int |
413 | GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); | ||
400 | 414 | ||
401 | 415 | ||
402 | /** | 416 | /** |
@@ -406,7 +420,8 @@ int GNUNET_FS_uri_test_chk (const struct GNUNET_FS_Uri *uri); | |||
406 | * @param uri the CHK (or LOC) URI to inspect | 420 | * @param uri the CHK (or LOC) URI to inspect |
407 | * @return size of the file as specified in the CHK URI | 421 | * @return size of the file as specified in the CHK URI |
408 | */ | 422 | */ |
409 | uint64_t GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); | 423 | uint64_t |
424 | GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); | ||
410 | 425 | ||
411 | 426 | ||
412 | /** | 427 | /** |
@@ -415,7 +430,8 @@ uint64_t GNUNET_FS_uri_chk_get_file_size (const struct GNUNET_FS_Uri *uri); | |||
415 | * @param uri the uri to check | 430 | * @param uri the uri to check |
416 | * @return GNUNET_YES if this is a LOC uri | 431 | * @return GNUNET_YES if this is a LOC uri |
417 | */ | 432 | */ |
418 | int GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); | 433 | int |
434 | GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); | ||
419 | 435 | ||
420 | 436 | ||
421 | /** | 437 | /** |
@@ -426,9 +442,9 @@ int GNUNET_FS_uri_test_loc (const struct GNUNET_FS_Uri *uri); | |||
426 | * @param md metadata to use | 442 | * @param md metadata to use |
427 | * @return NULL on error, otherwise a KSK URI | 443 | * @return NULL on error, otherwise a KSK URI |
428 | */ | 444 | */ |
429 | struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_meta_data (const struct | 445 | struct GNUNET_FS_Uri * |
430 | GNUNET_CONTAINER_MetaData | 446 | GNUNET_FS_uri_ksk_create_from_meta_data (const struct GNUNET_CONTAINER_MetaData |
431 | *md); | 447 | *md); |
432 | 448 | ||
433 | 449 | ||
434 | /* ******************** command-line option parsing API *********************** */ | 450 | /* ******************** command-line option parsing API *********************** */ |
@@ -445,10 +461,10 @@ struct GNUNET_FS_Uri *GNUNET_FS_uri_ksk_create_from_meta_data (const struct | |||
445 | * @param value command line argument given | 461 | * @param value command line argument given |
446 | * @return GNUNET_OK on success | 462 | * @return GNUNET_OK on success |
447 | */ | 463 | */ |
448 | int GNUNET_FS_getopt_set_keywords (struct | 464 | int |
449 | GNUNET_GETOPT_CommandLineProcessorContext | 465 | GNUNET_FS_getopt_set_keywords (struct GNUNET_GETOPT_CommandLineProcessorContext |
450 | *ctx, void *scls, const char *option, | 466 | *ctx, void *scls, const char *option, |
451 | const char *value); | 467 | const char *value); |
452 | 468 | ||
453 | 469 | ||
454 | /** | 470 | /** |
@@ -463,10 +479,10 @@ int GNUNET_FS_getopt_set_keywords (struct | |||
463 | * @param value command line argument given | 479 | * @param value command line argument given |
464 | * @return GNUNET_OK on success | 480 | * @return GNUNET_OK on success |
465 | */ | 481 | */ |
466 | int GNUNET_FS_getopt_set_metadata (struct | 482 | int |
467 | GNUNET_GETOPT_CommandLineProcessorContext | 483 | GNUNET_FS_getopt_set_metadata (struct GNUNET_GETOPT_CommandLineProcessorContext |
468 | *ctx, void *scls, const char *option, | 484 | *ctx, void *scls, const char *option, |
469 | const char *value); | 485 | const char *value); |
470 | 486 | ||
471 | 487 | ||
472 | 488 | ||
@@ -1621,7 +1637,8 @@ struct GNUNET_FS_BlockOptions | |||
1621 | /** | 1637 | /** |
1622 | * Return the current year (i.e. '2011'). | 1638 | * Return the current year (i.e. '2011'). |
1623 | */ | 1639 | */ |
1624 | unsigned int GNUNET_FS_get_current_year (void); | 1640 | unsigned int |
1641 | GNUNET_FS_get_current_year (void); | ||
1625 | 1642 | ||
1626 | 1643 | ||
1627 | /** | 1644 | /** |
@@ -1630,7 +1647,8 @@ unsigned int GNUNET_FS_get_current_year (void); | |||
1630 | * @param year a year (after 1970, please ;-)). | 1647 | * @param year a year (after 1970, please ;-)). |
1631 | * @return absolute time for January 1st of that year. | 1648 | * @return absolute time for January 1st of that year. |
1632 | */ | 1649 | */ |
1633 | struct GNUNET_TIME_Absolute GNUNET_FS_year_to_time (unsigned int year); | 1650 | struct GNUNET_TIME_Absolute |
1651 | GNUNET_FS_year_to_time (unsigned int year); | ||
1634 | 1652 | ||
1635 | 1653 | ||
1636 | /** | 1654 | /** |
@@ -1650,12 +1668,10 @@ struct GNUNET_FS_Handle; | |||
1650 | * @param ... list of optional options, terminated with GNUNET_FS_OPTIONS_END | 1668 | * @param ... list of optional options, terminated with GNUNET_FS_OPTIONS_END |
1651 | * @return NULL on error | 1669 | * @return NULL on error |
1652 | */ | 1670 | */ |
1653 | struct GNUNET_FS_Handle *GNUNET_FS_start (const struct | 1671 | struct GNUNET_FS_Handle * |
1654 | GNUNET_CONFIGURATION_Handle *cfg, | 1672 | GNUNET_FS_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
1655 | const char *client_name, | 1673 | const char *client_name, GNUNET_FS_ProgressCallback upcb, |
1656 | GNUNET_FS_ProgressCallback upcb, | 1674 | void *upcb_cls, enum GNUNET_FS_Flags flags, ...); |
1657 | void *upcb_cls, | ||
1658 | enum GNUNET_FS_Flags flags, ...); | ||
1659 | 1675 | ||
1660 | 1676 | ||
1661 | /** | 1677 | /** |
@@ -1665,7 +1681,8 @@ struct GNUNET_FS_Handle *GNUNET_FS_start (const struct | |||
1665 | * | 1681 | * |
1666 | * @param h handle that was returned from GNUNET_FS_start | 1682 | * @param h handle that was returned from GNUNET_FS_start |
1667 | */ | 1683 | */ |
1668 | void GNUNET_FS_stop (struct GNUNET_FS_Handle *h); | 1684 | void |
1685 | GNUNET_FS_stop (struct GNUNET_FS_Handle *h); | ||
1669 | 1686 | ||
1670 | 1687 | ||
1671 | /** | 1688 | /** |
@@ -1677,10 +1694,10 @@ void GNUNET_FS_stop (struct GNUNET_FS_Handle *h); | |||
1677 | * @return GNUNET_SYSERR on error, otherwise the number | 1694 | * @return GNUNET_SYSERR on error, otherwise the number |
1678 | * of meta-data items obtained | 1695 | * of meta-data items obtained |
1679 | */ | 1696 | */ |
1680 | int GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md, | 1697 | int |
1681 | const char *filename, | 1698 | GNUNET_FS_meta_data_extract_from_file (struct GNUNET_CONTAINER_MetaData *md, |
1682 | struct EXTRACTOR_PluginList | 1699 | const char *filename, |
1683 | *extractors); | 1700 | struct EXTRACTOR_PluginList *extractors); |
1684 | 1701 | ||
1685 | 1702 | ||
1686 | /** | 1703 | /** |
@@ -1721,8 +1738,8 @@ typedef int (*GNUNET_FS_FileInformationProcessor) (void *cls, | |||
1721 | * can be passed to "GNUNET_FS_file_information_recover" | 1738 | * can be passed to "GNUNET_FS_file_information_recover" |
1722 | * to read this fi-struct from disk. | 1739 | * to read this fi-struct from disk. |
1723 | */ | 1740 | */ |
1724 | const char *GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation | 1741 | const char * |
1725 | *s); | 1742 | GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation *s); |
1726 | 1743 | ||
1727 | 1744 | ||
1728 | 1745 | ||
@@ -1740,17 +1757,17 @@ const char *GNUNET_FS_file_information_get_id (struct GNUNET_FS_FileInformation | |||
1740 | * @param bo block options | 1757 | * @param bo block options |
1741 | * @return publish structure entry for the file | 1758 | * @return publish structure entry for the file |
1742 | */ | 1759 | */ |
1743 | struct GNUNET_FS_FileInformation | 1760 | struct GNUNET_FS_FileInformation * |
1744 | *GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, | 1761 | GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h, |
1745 | void *client_info, | 1762 | void *client_info, |
1746 | const char *filename, | 1763 | const char *filename, |
1747 | const struct GNUNET_FS_Uri | 1764 | const struct GNUNET_FS_Uri |
1748 | *keywords, | 1765 | *keywords, |
1749 | const struct | 1766 | const struct |
1750 | GNUNET_CONTAINER_MetaData | 1767 | GNUNET_CONTAINER_MetaData *meta, |
1751 | *meta, int do_index, | 1768 | int do_index, |
1752 | const struct | 1769 | const struct GNUNET_FS_BlockOptions |
1753 | GNUNET_FS_BlockOptions *bo); | 1770 | *bo); |
1754 | 1771 | ||
1755 | 1772 | ||
1756 | /** | 1773 | /** |
@@ -1769,17 +1786,17 @@ struct GNUNET_FS_FileInformation | |||
1769 | * @param bo block options | 1786 | * @param bo block options |
1770 | * @return publish structure entry for the file | 1787 | * @return publish structure entry for the file |
1771 | */ | 1788 | */ |
1772 | struct GNUNET_FS_FileInformation | 1789 | struct GNUNET_FS_FileInformation * |
1773 | *GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, | 1790 | GNUNET_FS_file_information_create_from_data (struct GNUNET_FS_Handle *h, |
1774 | void *client_info, | 1791 | void *client_info, uint64_t length, |
1775 | uint64_t length, void *data, | 1792 | void *data, |
1776 | const struct GNUNET_FS_Uri | 1793 | const struct GNUNET_FS_Uri |
1777 | *keywords, | 1794 | *keywords, |
1778 | const struct | 1795 | const struct |
1779 | GNUNET_CONTAINER_MetaData | 1796 | GNUNET_CONTAINER_MetaData *meta, |
1780 | *meta, int do_index, | 1797 | int do_index, |
1781 | const struct | 1798 | const struct GNUNET_FS_BlockOptions |
1782 | GNUNET_FS_BlockOptions *bo); | 1799 | *bo); |
1783 | 1800 | ||
1784 | 1801 | ||
1785 | /** | 1802 | /** |
@@ -1818,19 +1835,19 @@ typedef size_t (*GNUNET_FS_DataReader) (void *cls, uint64_t offset, size_t max, | |||
1818 | * @param bo block options | 1835 | * @param bo block options |
1819 | * @return publish structure entry for the file | 1836 | * @return publish structure entry for the file |
1820 | */ | 1837 | */ |
1821 | struct GNUNET_FS_FileInformation | 1838 | struct GNUNET_FS_FileInformation * |
1822 | *GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, | 1839 | GNUNET_FS_file_information_create_from_reader (struct GNUNET_FS_Handle *h, |
1823 | void *client_info, | 1840 | void *client_info, |
1824 | uint64_t length, | 1841 | uint64_t length, |
1825 | GNUNET_FS_DataReader reader, | 1842 | GNUNET_FS_DataReader reader, |
1826 | void *reader_cls, | 1843 | void *reader_cls, |
1827 | const struct GNUNET_FS_Uri | 1844 | const struct GNUNET_FS_Uri |
1828 | *keywords, | 1845 | *keywords, |
1829 | const struct | 1846 | const struct |
1830 | GNUNET_CONTAINER_MetaData | 1847 | GNUNET_CONTAINER_MetaData *meta, |
1831 | *meta, int do_index, | 1848 | int do_index, |
1832 | const struct | 1849 | const struct |
1833 | GNUNET_FS_BlockOptions *bo); | 1850 | GNUNET_FS_BlockOptions *bo); |
1834 | 1851 | ||
1835 | 1852 | ||
1836 | /** | 1853 | /** |
@@ -1890,11 +1907,12 @@ typedef int (*GNUNET_FS_DirectoryScanner) (void *cls, | |||
1890 | * @param emsg where to store an error message (on errors) | 1907 | * @param emsg where to store an error message (on errors) |
1891 | * @return GNUNET_OK on success | 1908 | * @return GNUNET_OK on success |
1892 | */ | 1909 | */ |
1893 | int GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, | 1910 | int |
1894 | const char *dirname, int do_index, | 1911 | GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, |
1895 | const struct GNUNET_FS_BlockOptions | 1912 | const char *dirname, int do_index, |
1896 | *bo, GNUNET_FS_FileProcessor proc, | 1913 | const struct GNUNET_FS_BlockOptions *bo, |
1897 | void *proc_cls, char **emsg); | 1914 | GNUNET_FS_FileProcessor proc, |
1915 | void *proc_cls, char **emsg); | ||
1898 | 1916 | ||
1899 | 1917 | ||
1900 | /** | 1918 | /** |
@@ -1917,17 +1935,16 @@ int GNUNET_FS_directory_scanner_default (void *cls, struct GNUNET_FS_Handle *h, | |||
1917 | * @param emsg where to store an error message | 1935 | * @param emsg where to store an error message |
1918 | * @return publish structure entry for the directory, NULL on error | 1936 | * @return publish structure entry for the directory, NULL on error |
1919 | */ | 1937 | */ |
1920 | struct GNUNET_FS_FileInformation | 1938 | struct GNUNET_FS_FileInformation * |
1921 | *GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle | 1939 | GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h, |
1922 | *h, void *client_info, | 1940 | void *client_info, |
1923 | const char *filename, | 1941 | const char *filename, |
1924 | GNUNET_FS_DirectoryScanner | 1942 | GNUNET_FS_DirectoryScanner |
1925 | scanner, | 1943 | scanner, void *scanner_cls, |
1926 | void *scanner_cls, | 1944 | int do_index, |
1927 | int do_index, | 1945 | const struct |
1928 | const struct | 1946 | GNUNET_FS_BlockOptions *bo, |
1929 | GNUNET_FS_BlockOptions | 1947 | char **emsg); |
1930 | *bo, char **emsg); | ||
1931 | 1948 | ||
1932 | 1949 | ||
1933 | /** | 1950 | /** |
@@ -1944,17 +1961,16 @@ struct GNUNET_FS_FileInformation | |||
1944 | * @param bo block options | 1961 | * @param bo block options |
1945 | * @return publish structure entry for the directory , NULL on error | 1962 | * @return publish structure entry for the directory , NULL on error |
1946 | */ | 1963 | */ |
1947 | struct GNUNET_FS_FileInformation | 1964 | struct GNUNET_FS_FileInformation * |
1948 | *GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle | 1965 | GNUNET_FS_file_information_create_empty_directory (struct GNUNET_FS_Handle *h, |
1949 | *h, void *client_info, | 1966 | void *client_info, |
1950 | const struct | 1967 | const struct GNUNET_FS_Uri |
1951 | GNUNET_FS_Uri *keywords, | 1968 | *keywords, |
1952 | const struct | 1969 | const struct |
1953 | GNUNET_CONTAINER_MetaData | 1970 | GNUNET_CONTAINER_MetaData |
1954 | *meta, | 1971 | *meta, |
1955 | const struct | 1972 | const struct |
1956 | GNUNET_FS_BlockOptions | 1973 | GNUNET_FS_BlockOptions *bo); |
1957 | *bo); | ||
1958 | 1974 | ||
1959 | 1975 | ||
1960 | /** | 1976 | /** |
@@ -1963,8 +1979,9 @@ struct GNUNET_FS_FileInformation | |||
1963 | * @param ent check if this FI represents a directory | 1979 | * @param ent check if this FI represents a directory |
1964 | * @return GNUNET_YES if so, GNUNET_NO if not | 1980 | * @return GNUNET_YES if so, GNUNET_NO if not |
1965 | */ | 1981 | */ |
1966 | int GNUNET_FS_file_information_is_directory (const struct | 1982 | int |
1967 | GNUNET_FS_FileInformation *ent); | 1983 | GNUNET_FS_file_information_is_directory (const struct GNUNET_FS_FileInformation |
1984 | *ent); | ||
1968 | 1985 | ||
1969 | 1986 | ||
1970 | /** | 1987 | /** |
@@ -1978,8 +1995,9 @@ int GNUNET_FS_file_information_is_directory (const struct | |||
1978 | * must not include "dir" in its structure | 1995 | * must not include "dir" in its structure |
1979 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 1996 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
1980 | */ | 1997 | */ |
1981 | int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | 1998 | int |
1982 | struct GNUNET_FS_FileInformation *ent); | 1999 | GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, |
2000 | struct GNUNET_FS_FileInformation *ent); | ||
1983 | 2001 | ||
1984 | 2002 | ||
1985 | /** | 2003 | /** |
@@ -1996,9 +2014,10 @@ int GNUNET_FS_file_information_add (struct GNUNET_FS_FileInformation *dir, | |||
1996 | * @param proc function to call on each entry | 2014 | * @param proc function to call on each entry |
1997 | * @param proc_cls closure for proc | 2015 | * @param proc_cls closure for proc |
1998 | */ | 2016 | */ |
1999 | void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | 2017 | void |
2000 | GNUNET_FS_FileInformationProcessor | 2018 | GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, |
2001 | proc, void *proc_cls); | 2019 | GNUNET_FS_FileInformationProcessor proc, |
2020 | void *proc_cls); | ||
2002 | 2021 | ||
2003 | 2022 | ||
2004 | /** | 2023 | /** |
@@ -2011,9 +2030,10 @@ void GNUNET_FS_file_information_inspect (struct GNUNET_FS_FileInformation *dir, | |||
2011 | * values are ignored | 2030 | * values are ignored |
2012 | * @param cleaner_cls closure for cleaner | 2031 | * @param cleaner_cls closure for cleaner |
2013 | */ | 2032 | */ |
2014 | void GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, | 2033 | void |
2015 | GNUNET_FS_FileInformationProcessor | 2034 | GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, |
2016 | cleaner, void *cleaner_cls); | 2035 | GNUNET_FS_FileInformationProcessor cleaner, |
2036 | void *cleaner_cls); | ||
2017 | 2037 | ||
2018 | 2038 | ||
2019 | /** | 2039 | /** |
@@ -2047,19 +2067,12 @@ enum GNUNET_FS_PublishOptions | |||
2047 | * @param options options for the publication | 2067 | * @param options options for the publication |
2048 | * @return context that can be used to control the publish operation | 2068 | * @return context that can be used to control the publish operation |
2049 | */ | 2069 | */ |
2050 | struct GNUNET_FS_PublishContext *GNUNET_FS_publish_start (struct | 2070 | struct GNUNET_FS_PublishContext * |
2051 | GNUNET_FS_Handle *h, | 2071 | GNUNET_FS_publish_start (struct GNUNET_FS_Handle *h, |
2052 | struct | 2072 | struct GNUNET_FS_FileInformation *fi, |
2053 | GNUNET_FS_FileInformation | 2073 | struct GNUNET_FS_Namespace *namespace, const char *nid, |
2054 | *fi, | 2074 | const char *nuid, |
2055 | struct | 2075 | enum GNUNET_FS_PublishOptions options); |
2056 | GNUNET_FS_Namespace | ||
2057 | *namespace, | ||
2058 | const char *nid, | ||
2059 | const char *nuid, | ||
2060 | enum | ||
2061 | GNUNET_FS_PublishOptions | ||
2062 | options); | ||
2063 | 2076 | ||
2064 | 2077 | ||
2065 | /** | 2078 | /** |
@@ -2070,7 +2083,8 @@ struct GNUNET_FS_PublishContext *GNUNET_FS_publish_start (struct | |||
2070 | * | 2083 | * |
2071 | * @param pc context for the publication to stop | 2084 | * @param pc context for the publication to stop |
2072 | */ | 2085 | */ |
2073 | void GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc); | 2086 | void |
2087 | GNUNET_FS_publish_stop (struct GNUNET_FS_PublishContext *pc); | ||
2074 | 2088 | ||
2075 | 2089 | ||
2076 | /** | 2090 | /** |
@@ -2098,13 +2112,14 @@ typedef void (*GNUNET_FS_PublishContinuation) (void *cls, | |||
2098 | * @param cont continuation | 2112 | * @param cont continuation |
2099 | * @param cont_cls closure for cont | 2113 | * @param cont_cls closure for cont |
2100 | */ | 2114 | */ |
2101 | void GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | 2115 | void |
2102 | const struct GNUNET_FS_Uri *ksk_uri, | 2116 | GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, |
2103 | const struct GNUNET_CONTAINER_MetaData *meta, | 2117 | const struct GNUNET_FS_Uri *ksk_uri, |
2104 | const struct GNUNET_FS_Uri *uri, | 2118 | const struct GNUNET_CONTAINER_MetaData *meta, |
2105 | const struct GNUNET_FS_BlockOptions *bo, | 2119 | const struct GNUNET_FS_Uri *uri, |
2106 | enum GNUNET_FS_PublishOptions options, | 2120 | const struct GNUNET_FS_BlockOptions *bo, |
2107 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | 2121 | enum GNUNET_FS_PublishOptions options, |
2122 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | ||
2108 | 2123 | ||
2109 | 2124 | ||
2110 | /** | 2125 | /** |
@@ -2121,14 +2136,15 @@ void GNUNET_FS_publish_ksk (struct GNUNET_FS_Handle *h, | |||
2121 | * @param cont continuation | 2136 | * @param cont continuation |
2122 | * @param cont_cls closure for cont | 2137 | * @param cont_cls closure for cont |
2123 | */ | 2138 | */ |
2124 | void GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, | 2139 | void |
2125 | struct GNUNET_FS_Namespace *namespace, | 2140 | GNUNET_FS_publish_sks (struct GNUNET_FS_Handle *h, |
2126 | const char *identifier, const char *update, | 2141 | struct GNUNET_FS_Namespace *namespace, |
2127 | const struct GNUNET_CONTAINER_MetaData *meta, | 2142 | const char *identifier, const char *update, |
2128 | const struct GNUNET_FS_Uri *uri, | 2143 | const struct GNUNET_CONTAINER_MetaData *meta, |
2129 | const struct GNUNET_FS_BlockOptions *bo, | 2144 | const struct GNUNET_FS_Uri *uri, |
2130 | enum GNUNET_FS_PublishOptions options, | 2145 | const struct GNUNET_FS_BlockOptions *bo, |
2131 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | 2146 | enum GNUNET_FS_PublishOptions options, |
2147 | GNUNET_FS_PublishContinuation cont, void *cont_cls); | ||
2132 | 2148 | ||
2133 | 2149 | ||
2134 | /** | 2150 | /** |
@@ -2154,10 +2170,11 @@ typedef int (*GNUNET_FS_IndexedFileProcessor) (void *cls, const char *filename, | |||
2154 | * error) or "PREREQ_DONE" (on success) | 2170 | * error) or "PREREQ_DONE" (on success) |
2155 | * @param cont_cls closure for cont | 2171 | * @param cont_cls closure for cont |
2156 | */ | 2172 | */ |
2157 | void GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | 2173 | void |
2158 | GNUNET_FS_IndexedFileProcessor iterator, | 2174 | GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, |
2159 | void *iterator_cls, | 2175 | GNUNET_FS_IndexedFileProcessor iterator, |
2160 | GNUNET_SCHEDULER_Task cont, void *cont_cls); | 2176 | void *iterator_cls, GNUNET_SCHEDULER_Task cont, |
2177 | void *cont_cls); | ||
2161 | 2178 | ||
2162 | 2179 | ||
2163 | /** | 2180 | /** |
@@ -2168,10 +2185,9 @@ void GNUNET_FS_get_indexed_files (struct GNUNET_FS_Handle *h, | |||
2168 | * @param cctx initial value for the client context | 2185 | * @param cctx initial value for the client context |
2169 | * @return NULL on error, otherwise handle | 2186 | * @return NULL on error, otherwise handle |
2170 | */ | 2187 | */ |
2171 | struct GNUNET_FS_UnindexContext *GNUNET_FS_unindex_start (struct | 2188 | struct GNUNET_FS_UnindexContext * |
2172 | GNUNET_FS_Handle *h, | 2189 | GNUNET_FS_unindex_start (struct GNUNET_FS_Handle *h, const char *filename, |
2173 | const char *filename, | 2190 | void *cctx); |
2174 | void *cctx); | ||
2175 | 2191 | ||
2176 | 2192 | ||
2177 | /** | 2193 | /** |
@@ -2179,7 +2195,8 @@ struct GNUNET_FS_UnindexContext *GNUNET_FS_unindex_start (struct | |||
2179 | * | 2195 | * |
2180 | * @param uc handle | 2196 | * @param uc handle |
2181 | */ | 2197 | */ |
2182 | void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | 2198 | void |
2199 | GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | ||
2183 | 2200 | ||
2184 | 2201 | ||
2185 | /** | 2202 | /** |
@@ -2194,15 +2211,15 @@ void GNUNET_FS_unindex_stop (struct GNUNET_FS_UnindexContext *uc); | |||
2194 | * @param cont continuation | 2211 | * @param cont continuation |
2195 | * @param cont_cls closure for cont | 2212 | * @param cont_cls closure for cont |
2196 | */ | 2213 | */ |
2197 | void GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, | 2214 | void |
2198 | struct GNUNET_FS_Uri *ksk_uri, | 2215 | GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, |
2199 | struct GNUNET_FS_Namespace *namespace, | 2216 | struct GNUNET_FS_Uri *ksk_uri, |
2200 | const struct GNUNET_CONTAINER_MetaData | 2217 | struct GNUNET_FS_Namespace *namespace, |
2201 | *meta, | 2218 | const struct GNUNET_CONTAINER_MetaData *meta, |
2202 | const struct GNUNET_FS_BlockOptions *bo, | 2219 | const struct GNUNET_FS_BlockOptions *bo, |
2203 | const char *rootEntry, | 2220 | const char *rootEntry, |
2204 | GNUNET_FS_PublishContinuation cont, | 2221 | GNUNET_FS_PublishContinuation cont, |
2205 | void *cont_cls); | 2222 | void *cont_cls); |
2206 | 2223 | ||
2207 | 2224 | ||
2208 | /** | 2225 | /** |
@@ -2213,8 +2230,8 @@ void GNUNET_FS_namespace_advertise (struct GNUNET_FS_Handle *h, | |||
2213 | * @param name name to use for the namespace | 2230 | * @param name name to use for the namespace |
2214 | * @return handle to the namespace, NULL on error | 2231 | * @return handle to the namespace, NULL on error |
2215 | */ | 2232 | */ |
2216 | struct GNUNET_FS_Namespace *GNUNET_FS_namespace_create (struct GNUNET_FS_Handle | 2233 | struct GNUNET_FS_Namespace * |
2217 | *h, const char *name); | 2234 | GNUNET_FS_namespace_create (struct GNUNET_FS_Handle *h, const char *name); |
2218 | 2235 | ||
2219 | 2236 | ||
2220 | /** | 2237 | /** |
@@ -2228,8 +2245,8 @@ struct GNUNET_FS_Namespace *GNUNET_FS_namespace_create (struct GNUNET_FS_Handle | |||
2228 | * | 2245 | * |
2229 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 2246 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
2230 | */ | 2247 | */ |
2231 | int GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, | 2248 | int |
2232 | int freeze); | 2249 | GNUNET_FS_namespace_delete (struct GNUNET_FS_Namespace *namespace, int freeze); |
2233 | 2250 | ||
2234 | 2251 | ||
2235 | /** | 2252 | /** |
@@ -2254,9 +2271,9 @@ typedef void (*GNUNET_FS_NamespaceInfoProcessor) (void *cls, const char *name, | |||
2254 | * @param cb function to call on each known namespace | 2271 | * @param cb function to call on each known namespace |
2255 | * @param cb_cls closure for cb | 2272 | * @param cb_cls closure for cb |
2256 | */ | 2273 | */ |
2257 | void GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, | 2274 | void |
2258 | GNUNET_FS_NamespaceInfoProcessor cb, | 2275 | GNUNET_FS_namespace_list (struct GNUNET_FS_Handle *h, |
2259 | void *cb_cls); | 2276 | GNUNET_FS_NamespaceInfoProcessor cb, void *cb_cls); |
2260 | 2277 | ||
2261 | 2278 | ||
2262 | /** | 2279 | /** |
@@ -2296,10 +2313,11 @@ typedef void (*GNUNET_FS_IdentifierProcessor) (void *cls, const char *last_id, | |||
2296 | * @param ip function to call on each updateable identifier | 2313 | * @param ip function to call on each updateable identifier |
2297 | * @param ip_cls closure for ip | 2314 | * @param ip_cls closure for ip |
2298 | */ | 2315 | */ |
2299 | void GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, | 2316 | void |
2300 | const char *next_id, | 2317 | GNUNET_FS_namespace_list_updateable (struct GNUNET_FS_Namespace *namespace, |
2301 | GNUNET_FS_IdentifierProcessor ip, | 2318 | const char *next_id, |
2302 | void *ip_cls); | 2319 | GNUNET_FS_IdentifierProcessor ip, |
2320 | void *ip_cls); | ||
2303 | 2321 | ||
2304 | 2322 | ||
2305 | /** | 2323 | /** |
@@ -2331,14 +2349,10 @@ enum GNUNET_FS_SearchOptions | |||
2331 | * @param cctx initial value for the client context | 2349 | * @param cctx initial value for the client context |
2332 | * @return context that can be used to control the search | 2350 | * @return context that can be used to control the search |
2333 | */ | 2351 | */ |
2334 | struct GNUNET_FS_SearchContext *GNUNET_FS_search_start (struct GNUNET_FS_Handle | 2352 | struct GNUNET_FS_SearchContext * |
2335 | *h, | 2353 | GNUNET_FS_search_start (struct GNUNET_FS_Handle *h, |
2336 | const struct | 2354 | const struct GNUNET_FS_Uri *uri, uint32_t anonymity, |
2337 | GNUNET_FS_Uri *uri, | 2355 | enum GNUNET_FS_SearchOptions options, void *cctx); |
2338 | uint32_t anonymity, | ||
2339 | enum | ||
2340 | GNUNET_FS_SearchOptions | ||
2341 | options, void *cctx); | ||
2342 | 2356 | ||
2343 | 2357 | ||
2344 | /** | 2358 | /** |
@@ -2346,7 +2360,8 @@ struct GNUNET_FS_SearchContext *GNUNET_FS_search_start (struct GNUNET_FS_Handle | |||
2346 | * | 2360 | * |
2347 | * @param sc context for the search that should be paused | 2361 | * @param sc context for the search that should be paused |
2348 | */ | 2362 | */ |
2349 | void GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); | 2363 | void |
2364 | GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); | ||
2350 | 2365 | ||
2351 | 2366 | ||
2352 | /** | 2367 | /** |
@@ -2354,7 +2369,8 @@ void GNUNET_FS_search_pause (struct GNUNET_FS_SearchContext *sc); | |||
2354 | * | 2369 | * |
2355 | * @param sc context for the search that should be resumed | 2370 | * @param sc context for the search that should be resumed |
2356 | */ | 2371 | */ |
2357 | void GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); | 2372 | void |
2373 | GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); | ||
2358 | 2374 | ||
2359 | 2375 | ||
2360 | /** | 2376 | /** |
@@ -2362,7 +2378,8 @@ void GNUNET_FS_search_continue (struct GNUNET_FS_SearchContext *sc); | |||
2362 | * | 2378 | * |
2363 | * @param sc context for the search that should be stopped | 2379 | * @param sc context for the search that should be stopped |
2364 | */ | 2380 | */ |
2365 | void GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); | 2381 | void |
2382 | GNUNET_FS_search_stop (struct GNUNET_FS_SearchContext *sc); | ||
2366 | 2383 | ||
2367 | 2384 | ||
2368 | 2385 | ||
@@ -2437,26 +2454,14 @@ enum GNUNET_FS_DownloadOptions | |||
2437 | * for top-level downloads; useful for manually-triggered recursive downloads) | 2454 | * for top-level downloads; useful for manually-triggered recursive downloads) |
2438 | * @return context that can be used to control this download | 2455 | * @return context that can be used to control this download |
2439 | */ | 2456 | */ |
2440 | struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start (struct | 2457 | struct GNUNET_FS_DownloadContext * |
2441 | GNUNET_FS_Handle *h, | 2458 | GNUNET_FS_download_start (struct GNUNET_FS_Handle *h, |
2442 | const struct | 2459 | const struct GNUNET_FS_Uri *uri, |
2443 | GNUNET_FS_Uri *uri, | 2460 | const struct GNUNET_CONTAINER_MetaData *meta, |
2444 | const struct | 2461 | const char *filename, const char *tempname, |
2445 | GNUNET_CONTAINER_MetaData | 2462 | uint64_t offset, uint64_t length, uint32_t anonymity, |
2446 | *meta, | 2463 | enum GNUNET_FS_DownloadOptions options, void *cctx, |
2447 | const char | 2464 | struct GNUNET_FS_DownloadContext *parent); |
2448 | *filename, | ||
2449 | const char | ||
2450 | *tempname, | ||
2451 | uint64_t offset, | ||
2452 | uint64_t length, | ||
2453 | uint32_t anonymity, | ||
2454 | enum | ||
2455 | GNUNET_FS_DownloadOptions | ||
2456 | options, void *cctx, | ||
2457 | struct | ||
2458 | GNUNET_FS_DownloadContext | ||
2459 | *parent); | ||
2460 | 2465 | ||
2461 | 2466 | ||
2462 | /** | 2467 | /** |
@@ -2493,29 +2498,14 @@ struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start (struct | |||
2493 | * @param cctx initial value for the client context for this download | 2498 | * @param cctx initial value for the client context for this download |
2494 | * @return context that can be used to control this download | 2499 | * @return context that can be used to control this download |
2495 | */ | 2500 | */ |
2496 | struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start_from_search (struct | 2501 | struct GNUNET_FS_DownloadContext * |
2497 | GNUNET_FS_Handle | 2502 | GNUNET_FS_download_start_from_search (struct GNUNET_FS_Handle *h, |
2498 | *h, | 2503 | struct GNUNET_FS_SearchResult *sr, |
2499 | struct | 2504 | const char *filename, |
2500 | GNUNET_FS_SearchResult | 2505 | const char *tempname, uint64_t offset, |
2501 | *sr, | 2506 | uint64_t length, uint32_t anonymity, |
2502 | const | 2507 | enum GNUNET_FS_DownloadOptions options, |
2503 | char | 2508 | void *cctx); |
2504 | *filename, | ||
2505 | const | ||
2506 | char | ||
2507 | *tempname, | ||
2508 | uint64_t | ||
2509 | offset, | ||
2510 | uint64_t | ||
2511 | length, | ||
2512 | uint32_t | ||
2513 | anonymity, | ||
2514 | enum | ||
2515 | GNUNET_FS_DownloadOptions | ||
2516 | options, | ||
2517 | void | ||
2518 | *cctx); | ||
2519 | 2509 | ||
2520 | 2510 | ||
2521 | /** | 2511 | /** |
@@ -2524,8 +2514,8 @@ struct GNUNET_FS_DownloadContext *GNUNET_FS_download_start_from_search (struct | |||
2524 | * @param dc handle for the download | 2514 | * @param dc handle for the download |
2525 | * @param do_delete delete files of incomplete downloads | 2515 | * @param do_delete delete files of incomplete downloads |
2526 | */ | 2516 | */ |
2527 | void GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, | 2517 | void |
2528 | int do_delete); | 2518 | GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, int do_delete); |
2529 | 2519 | ||
2530 | 2520 | ||
2531 | 2521 | ||
@@ -2543,8 +2533,9 @@ void GNUNET_FS_download_stop (struct GNUNET_FS_DownloadContext *dc, | |||
2543 | * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if | 2533 | * @return GNUNET_YES if it is, GNUNET_NO if it is not, GNUNET_SYSERR if |
2544 | * we have no mime-type information (treat as 'GNUNET_NO') | 2534 | * we have no mime-type information (treat as 'GNUNET_NO') |
2545 | */ | 2535 | */ |
2546 | int GNUNET_FS_meta_data_test_for_directory (const struct | 2536 | int |
2547 | GNUNET_CONTAINER_MetaData *md); | 2537 | GNUNET_FS_meta_data_test_for_directory (const struct GNUNET_CONTAINER_MetaData |
2538 | *md); | ||
2548 | 2539 | ||
2549 | 2540 | ||
2550 | /** | 2541 | /** |
@@ -2553,7 +2544,8 @@ int GNUNET_FS_meta_data_test_for_directory (const struct | |||
2553 | * | 2544 | * |
2554 | * @param md metadata to add mimetype to | 2545 | * @param md metadata to add mimetype to |
2555 | */ | 2546 | */ |
2556 | void GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); | 2547 | void |
2548 | GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); | ||
2557 | 2549 | ||
2558 | 2550 | ||
2559 | /** | 2551 | /** |
@@ -2562,8 +2554,9 @@ void GNUNET_FS_meta_data_make_directory (struct GNUNET_CONTAINER_MetaData *md); | |||
2562 | * @param md given meta data | 2554 | * @param md given meta data |
2563 | * @return NULL if meta data is useless for suggesting a filename | 2555 | * @return NULL if meta data is useless for suggesting a filename |
2564 | */ | 2556 | */ |
2565 | char *GNUNET_FS_meta_data_suggest_filename (const struct | 2557 | char * |
2566 | GNUNET_CONTAINER_MetaData *md); | 2558 | GNUNET_FS_meta_data_suggest_filename (const struct GNUNET_CONTAINER_MetaData |
2559 | *md); | ||
2567 | 2560 | ||
2568 | 2561 | ||
2569 | /** | 2562 | /** |
@@ -2610,10 +2603,11 @@ typedef void (*GNUNET_FS_DirectoryEntryProcessor) (void *cls, | |||
2610 | * GNUNET_NO if this could be part of a directory (but not 100% OK) | 2603 | * GNUNET_NO if this could be part of a directory (but not 100% OK) |
2611 | * GNUNET_SYSERR if 'data' does not represent a directory | 2604 | * GNUNET_SYSERR if 'data' does not represent a directory |
2612 | */ | 2605 | */ |
2613 | int GNUNET_FS_directory_list_contents (size_t size, const void *data, | 2606 | int |
2614 | uint64_t offset, | 2607 | GNUNET_FS_directory_list_contents (size_t size, const void *data, |
2615 | GNUNET_FS_DirectoryEntryProcessor dep, | 2608 | uint64_t offset, |
2616 | void *dep_cls); | 2609 | GNUNET_FS_DirectoryEntryProcessor dep, |
2610 | void *dep_cls); | ||
2617 | 2611 | ||
2618 | 2612 | ||
2619 | /** | 2613 | /** |
@@ -2626,10 +2620,9 @@ struct GNUNET_FS_DirectoryBuilder; | |||
2626 | * | 2620 | * |
2627 | * @param mdir metadata for the directory | 2621 | * @param mdir metadata for the directory |
2628 | */ | 2622 | */ |
2629 | struct GNUNET_FS_DirectoryBuilder *GNUNET_FS_directory_builder_create (const | 2623 | struct GNUNET_FS_DirectoryBuilder * |
2630 | struct | 2624 | GNUNET_FS_directory_builder_create (const struct GNUNET_CONTAINER_MetaData |
2631 | GNUNET_CONTAINER_MetaData | 2625 | *mdir); |
2632 | *mdir); | ||
2633 | 2626 | ||
2634 | 2627 | ||
2635 | /** | 2628 | /** |
@@ -2642,10 +2635,11 @@ struct GNUNET_FS_DirectoryBuilder *GNUNET_FS_directory_builder_create (const | |||
2642 | * data must point to exactly the number of bytes specified | 2635 | * data must point to exactly the number of bytes specified |
2643 | * by the uri | 2636 | * by the uri |
2644 | */ | 2637 | */ |
2645 | void GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | 2638 | void |
2646 | const struct GNUNET_FS_Uri *uri, | 2639 | GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, |
2647 | const struct GNUNET_CONTAINER_MetaData | 2640 | const struct GNUNET_FS_Uri *uri, |
2648 | *md, const void *data); | 2641 | const struct GNUNET_CONTAINER_MetaData *md, |
2642 | const void *data); | ||
2649 | 2643 | ||
2650 | 2644 | ||
2651 | /** | 2645 | /** |
@@ -2658,8 +2652,9 @@ void GNUNET_FS_directory_builder_add (struct GNUNET_FS_DirectoryBuilder *bld, | |||
2658 | * @param rdata set to the encoded directory | 2652 | * @param rdata set to the encoded directory |
2659 | * @return GNUNET_OK on success | 2653 | * @return GNUNET_OK on success |
2660 | */ | 2654 | */ |
2661 | int GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, | 2655 | int |
2662 | size_t * rsize, void **rdata); | 2656 | GNUNET_FS_directory_builder_finish (struct GNUNET_FS_DirectoryBuilder *bld, |
2657 | size_t * rsize, void **rdata); | ||
2663 | 2658 | ||
2664 | 2659 | ||
2665 | #if 0 /* keep Emacsens' auto-indent happy */ | 2660 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h index 0fb7ec84e..e6afa2b3c 100644 --- a/src/include/gnunet_getopt_lib.h +++ b/src/include/gnunet_getopt_lib.h | |||
@@ -207,9 +207,10 @@ struct GNUNET_GETOPT_CommandLineOption | |||
207 | * @return index into argv with first non-option | 207 | * @return index into argv with first non-option |
208 | * argument, or GNUNET_SYSERR on error | 208 | * argument, or GNUNET_SYSERR on error |
209 | */ | 209 | */ |
210 | int GNUNET_GETOPT_run (const char *binaryOptions, | 210 | int |
211 | const struct GNUNET_GETOPT_CommandLineOption *allOptions, | 211 | GNUNET_GETOPT_run (const char *binaryOptions, |
212 | unsigned int argc, char *const *argv); | 212 | const struct GNUNET_GETOPT_CommandLineOption *allOptions, |
213 | unsigned int argc, char *const *argv); | ||
213 | 214 | ||
214 | 215 | ||
215 | /** | 216 | /** |
@@ -225,9 +226,9 @@ int GNUNET_GETOPT_run (const char *binaryOptions, | |||
225 | * @param value actual value of the option as a string. | 226 | * @param value actual value of the option as a string. |
226 | * @return GNUNET_OK if parsing the value worked | 227 | * @return GNUNET_OK if parsing the value worked |
227 | */ | 228 | */ |
228 | int GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext | 229 | int |
229 | *ctx, void *scls, const char *option, | 230 | GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
230 | const char *value); | 231 | void *scls, const char *option, const char *value); |
231 | 232 | ||
232 | 233 | ||
233 | /** | 234 | /** |
@@ -243,9 +244,9 @@ int GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
243 | * @param value actual value of the option as a string. | 244 | * @param value actual value of the option as a string. |
244 | * @return GNUNET_OK if parsing the value worked | 245 | * @return GNUNET_OK if parsing the value worked |
245 | */ | 246 | */ |
246 | int GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext | 247 | int |
247 | *ctx, void *scls, const char *option, | 248 | GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
248 | const char *value); | 249 | void *scls, const char *option, const char *value); |
249 | 250 | ||
250 | 251 | ||
251 | /** | 252 | /** |
@@ -262,9 +263,9 @@ int GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
262 | * @param value not used (NULL) | 263 | * @param value not used (NULL) |
263 | * @return GNUNET_OK | 264 | * @return GNUNET_OK |
264 | */ | 265 | */ |
265 | int GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext | 266 | int |
266 | *ctx, void *scls, const char *option, | 267 | GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
267 | const char *value); | 268 | void *scls, const char *option, const char *value); |
268 | 269 | ||
269 | 270 | ||
270 | /** | 271 | /** |
@@ -281,9 +282,9 @@ int GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
281 | * @param value actual value of the option (a string) | 282 | * @param value actual value of the option (a string) |
282 | * @return GNUNET_OK | 283 | * @return GNUNET_OK |
283 | */ | 284 | */ |
284 | int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext | 285 | int |
285 | *ctx, void *scls, const char *option, | 286 | GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, |
286 | const char *value); | 287 | void *scls, const char *option, const char *value); |
287 | 288 | ||
288 | /** | 289 | /** |
289 | * Set an option of type 'unsigned int' from the command line. Each | 290 | * Set an option of type 'unsigned int' from the command line. Each |
@@ -299,10 +300,10 @@ int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
299 | * @param value not used (NULL) | 300 | * @param value not used (NULL) |
300 | * @return GNUNET_OK | 301 | * @return GNUNET_OK |
301 | */ | 302 | */ |
302 | int GNUNET_GETOPT_increment_value (struct | 303 | int |
303 | GNUNET_GETOPT_CommandLineProcessorContext | 304 | GNUNET_GETOPT_increment_value (struct GNUNET_GETOPT_CommandLineProcessorContext |
304 | *ctx, void *scls, const char *option, | 305 | *ctx, void *scls, const char *option, |
305 | const char *value); | 306 | const char *value); |
306 | 307 | ||
307 | 308 | ||
308 | /* *************** internal prototypes - use macros above! ************* */ | 309 | /* *************** internal prototypes - use macros above! ************* */ |
@@ -316,9 +317,10 @@ int GNUNET_GETOPT_increment_value (struct | |||
316 | * @param value not used (NULL) | 317 | * @param value not used (NULL) |
317 | * @return GNUNET_SYSERR (do not continue) | 318 | * @return GNUNET_SYSERR (do not continue) |
318 | */ | 319 | */ |
319 | int GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext | 320 | int |
320 | *ctx, void *scls, const char *option, | 321 | GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext |
321 | const char *value); | 322 | *ctx, void *scls, const char *option, |
323 | const char *value); | ||
322 | 324 | ||
323 | /** | 325 | /** |
324 | * Print out program version (implements --version). | 326 | * Print out program version (implements --version). |
@@ -329,10 +331,10 @@ int GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext | |||
329 | * @param value not used (NULL) | 331 | * @param value not used (NULL) |
330 | * @return GNUNET_SYSERR (do not continue) | 332 | * @return GNUNET_SYSERR (do not continue) |
331 | */ | 333 | */ |
332 | int GNUNET_GETOPT_print_version_ (struct | 334 | int |
333 | GNUNET_GETOPT_CommandLineProcessorContext | 335 | GNUNET_GETOPT_print_version_ (struct GNUNET_GETOPT_CommandLineProcessorContext |
334 | *ctx, void *scls, const char *option, | 336 | *ctx, void *scls, const char *option, |
335 | const char *value); | 337 | const char *value); |
336 | 338 | ||
337 | #if 0 /* keep Emacsens' auto-indent happy */ | 339 | #if 0 /* keep Emacsens' auto-indent happy */ |
338 | { | 340 | { |
diff --git a/src/include/gnunet_hello_lib.h b/src/include/gnunet_hello_lib.h index 3c44b5048..556b41d3c 100644 --- a/src/include/gnunet_hello_lib.h +++ b/src/include/gnunet_hello_lib.h | |||
@@ -60,11 +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 GNUNET_HELLO_add_address (const char *tname, | 63 | size_t |
64 | struct GNUNET_TIME_Absolute | 64 | GNUNET_HELLO_add_address (const char *tname, |
65 | expiration, const void *addr, | 65 | struct GNUNET_TIME_Absolute expiration, |
66 | uint16_t addr_len, char *target, | 66 | const void *addr, uint16_t addr_len, char *target, |
67 | size_t max); | 67 | size_t max); |
68 | 68 | ||
69 | 69 | ||
70 | /** | 70 | /** |
@@ -90,11 +90,11 @@ typedef size_t (*GNUNET_HELLO_GenerateAddressListCallback) (void *cls, | |||
90 | * | 90 | * |
91 | * @return the hello message | 91 | * @return the hello message |
92 | */ | 92 | */ |
93 | struct GNUNET_HELLO_Message *GNUNET_HELLO_create (const struct | 93 | struct GNUNET_HELLO_Message * |
94 | GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 94 | GNUNET_HELLO_create (const struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
95 | *publicKey, | 95 | *publicKey, |
96 | GNUNET_HELLO_GenerateAddressListCallback | 96 | GNUNET_HELLO_GenerateAddressListCallback addrgen, |
97 | addrgen, void *addrgen_cls); | 97 | void *addrgen_cls); |
98 | 98 | ||
99 | 99 | ||
100 | /** | 100 | /** |
@@ -102,7 +102,8 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_create (const struct | |||
102 | * @param hello to inspect | 102 | * @param hello to inspect |
103 | * @return the size, 0 if HELLO is invalid | 103 | * @return the size, 0 if HELLO is invalid |
104 | */ | 104 | */ |
105 | uint16_t GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); | 105 | uint16_t |
106 | GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); | ||
106 | 107 | ||
107 | 108 | ||
108 | /** | 109 | /** |
@@ -114,10 +115,9 @@ uint16_t GNUNET_HELLO_size (const struct GNUNET_HELLO_Message *hello); | |||
114 | * @param h2 the second HELLO message | 115 | * @param h2 the second HELLO message |
115 | * @return the combined hello message | 116 | * @return the combined hello message |
116 | */ | 117 | */ |
117 | struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct | 118 | struct GNUNET_HELLO_Message * |
118 | GNUNET_HELLO_Message *h1, | 119 | GNUNET_HELLO_merge (const struct GNUNET_HELLO_Message *h1, |
119 | const struct | 120 | const struct GNUNET_HELLO_Message *h2); |
120 | GNUNET_HELLO_Message *h2); | ||
121 | 121 | ||
122 | 122 | ||
123 | /** | 123 | /** |
@@ -136,12 +136,10 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_merge (const struct | |||
136 | * zero if the some addresses with expirations >= now | 136 | * zero if the some addresses with expirations >= now |
137 | * do not match at all | 137 | * do not match at all |
138 | */ | 138 | */ |
139 | struct GNUNET_TIME_Absolute GNUNET_HELLO_equals (const struct | 139 | struct GNUNET_TIME_Absolute |
140 | GNUNET_HELLO_Message *h1, | 140 | GNUNET_HELLO_equals (const struct GNUNET_HELLO_Message *h1, |
141 | const struct | 141 | const struct GNUNET_HELLO_Message *h2, |
142 | GNUNET_HELLO_Message *h2, | 142 | struct GNUNET_TIME_Absolute now); |
143 | struct GNUNET_TIME_Absolute | ||
144 | now); | ||
145 | 143 | ||
146 | 144 | ||
147 | /** | 145 | /** |
@@ -174,13 +172,10 @@ typedef int (*GNUNET_HELLO_AddressIterator) (void *cls, const char *tname, | |||
174 | * @param it_cls closure for it | 172 | * @param it_cls closure for it |
175 | * @return the modified HELLO or NULL | 173 | * @return the modified HELLO or NULL |
176 | */ | 174 | */ |
177 | struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct | 175 | struct GNUNET_HELLO_Message * |
178 | GNUNET_HELLO_Message | 176 | GNUNET_HELLO_iterate_addresses (const struct GNUNET_HELLO_Message *msg, |
179 | *msg, | 177 | int return_modified, |
180 | int | 178 | GNUNET_HELLO_AddressIterator it, void *it_cls); |
181 | return_modified, | ||
182 | GNUNET_HELLO_AddressIterator | ||
183 | it, void *it_cls); | ||
184 | 179 | ||
185 | 180 | ||
186 | /** | 181 | /** |
@@ -194,14 +189,15 @@ struct GNUNET_HELLO_Message *GNUNET_HELLO_iterate_addresses (const struct | |||
194 | * @param it iterator to call on each address | 189 | * @param it iterator to call on each address |
195 | * @param it_cls closure for it | 190 | * @param it_cls closure for it |
196 | */ | 191 | */ |
197 | void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | 192 | void |
198 | *new_hello, | 193 | GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message |
199 | const struct GNUNET_HELLO_Message | 194 | *new_hello, |
200 | *old_hello, | 195 | const struct GNUNET_HELLO_Message |
201 | struct GNUNET_TIME_Absolute | 196 | *old_hello, |
202 | expiration_limit, | 197 | struct GNUNET_TIME_Absolute |
203 | GNUNET_HELLO_AddressIterator it, | 198 | expiration_limit, |
204 | void *it_cls); | 199 | GNUNET_HELLO_AddressIterator it, |
200 | void *it_cls); | ||
205 | 201 | ||
206 | 202 | ||
207 | /** | 203 | /** |
@@ -211,9 +207,10 @@ void GNUNET_HELLO_iterate_new_addresses (const struct GNUNET_HELLO_Message | |||
211 | * @param publicKey where to copy the public key information, can be NULL | 207 | * @param publicKey where to copy the public key information, can be NULL |
212 | * @return GNUNET_SYSERR if the HELLO was malformed | 208 | * @return GNUNET_SYSERR if the HELLO was malformed |
213 | */ | 209 | */ |
214 | int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | 210 | int |
215 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded | 211 | GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, |
216 | *publicKey); | 212 | struct GNUNET_CRYPTO_RsaPublicKeyBinaryEncoded |
213 | *publicKey); | ||
217 | 214 | ||
218 | 215 | ||
219 | /** | 216 | /** |
@@ -223,8 +220,9 @@ int GNUNET_HELLO_get_key (const struct GNUNET_HELLO_Message *hello, | |||
223 | * @param peer where to store the peer's identity | 220 | * @param peer where to store the peer's identity |
224 | * @return GNUNET_SYSERR if the HELLO was malformed | 221 | * @return GNUNET_SYSERR if the HELLO was malformed |
225 | */ | 222 | */ |
226 | int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | 223 | int |
227 | struct GNUNET_PeerIdentity *peer); | 224 | GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, |
225 | struct GNUNET_PeerIdentity *peer); | ||
228 | 226 | ||
229 | 227 | ||
230 | /** | 228 | /** |
@@ -235,9 +233,8 @@ int GNUNET_HELLO_get_id (const struct GNUNET_HELLO_Message *hello, | |||
235 | * | 233 | * |
236 | * @return header or NULL if the HELLO was malformed | 234 | * @return header or NULL if the HELLO was malformed |
237 | */ | 235 | */ |
238 | struct GNUNET_MessageHeader *GNUNET_HELLO_get_header (struct | 236 | struct GNUNET_MessageHeader * |
239 | GNUNET_HELLO_Message | 237 | GNUNET_HELLO_get_header (struct GNUNET_HELLO_Message *hello); |
240 | *hello); | ||
241 | 238 | ||
242 | /* ifndef GNUNET_HELLO_LIB_H */ | 239 | /* ifndef GNUNET_HELLO_LIB_H */ |
243 | #endif | 240 | #endif |
diff --git a/src/include/gnunet_load_lib.h b/src/include/gnunet_load_lib.h index d56522d40..6dfe80cb2 100644 --- a/src/include/gnunet_load_lib.h +++ b/src/include/gnunet_load_lib.h | |||
@@ -51,8 +51,8 @@ struct GNUNET_LOAD_Value; | |||
51 | * frequency, 0-load values will be added to the load | 51 | * frequency, 0-load values will be added to the load |
52 | * @return the new load value | 52 | * @return the new load value |
53 | */ | 53 | */ |
54 | struct GNUNET_LOAD_Value *GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative | 54 | struct GNUNET_LOAD_Value * |
55 | autodecline); | 55 | GNUNET_LOAD_value_init (struct GNUNET_TIME_Relative autodecline); |
56 | 56 | ||
57 | 57 | ||
58 | /** | 58 | /** |
@@ -61,8 +61,9 @@ 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 GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, | 64 | void |
65 | struct GNUNET_TIME_Relative autodecline); | 65 | GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, |
66 | struct GNUNET_TIME_Relative autodecline); | ||
66 | 67 | ||
67 | 68 | ||
68 | /** | 69 | /** |
@@ -82,7 +83,8 @@ void GNUNET_LOAD_value_set_decline (struct GNUNET_LOAD_Value *load, | |||
82 | * 100 if the latest updates were so large | 83 | * 100 if the latest updates were so large |
83 | * that we could not do proper calculations | 84 | * that we could not do proper calculations |
84 | */ | 85 | */ |
85 | double GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); | 86 | double |
87 | GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); | ||
86 | 88 | ||
87 | 89 | ||
88 | /** | 90 | /** |
@@ -91,7 +93,8 @@ double GNUNET_LOAD_get_load (struct GNUNET_LOAD_Value *load); | |||
91 | * @param load load handle | 93 | * @param load load handle |
92 | * @return zero if update was never called | 94 | * @return zero if update was never called |
93 | */ | 95 | */ |
94 | double GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); | 96 | double |
97 | GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); | ||
95 | 98 | ||
96 | 99 | ||
97 | /** | 100 | /** |
@@ -100,7 +103,8 @@ double GNUNET_LOAD_get_average (struct GNUNET_LOAD_Value *load); | |||
100 | * @param load to update | 103 | * @param load to update |
101 | * @param data latest measurement value (for example, delay) | 104 | * @param data latest measurement value (for example, delay) |
102 | */ | 105 | */ |
103 | void GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data); | 106 | void |
107 | GNUNET_LOAD_update (struct GNUNET_LOAD_Value *load, uint64_t data); | ||
104 | 108 | ||
105 | 109 | ||
106 | #if 0 /* keep Emacsens' auto-indent happy */ | 110 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_mesh_service.h b/src/include/gnunet_mesh_service.h index 507b766d1..bea706478 100644 --- a/src/include/gnunet_mesh_service.h +++ b/src/include/gnunet_mesh_service.h | |||
@@ -138,17 +138,11 @@ typedef uint32_t GNUNET_MESH_ApplicationType; | |||
138 | * @return handle to the mesh service | 138 | * @return handle to the mesh service |
139 | * NULL on error (in this case, init is never called) | 139 | * NULL on error (in this case, init is never called) |
140 | */ | 140 | */ |
141 | struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | 141 | struct GNUNET_MESH_Handle * |
142 | GNUNET_CONFIGURATION_Handle | 142 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, |
143 | *cfg, void *cls, | 143 | GNUNET_MESH_TunnelEndHandler cleaner, |
144 | GNUNET_MESH_TunnelEndHandler | 144 | const struct GNUNET_MESH_MessageHandler *handlers, |
145 | cleaner, | 145 | const GNUNET_MESH_ApplicationType *stypes); |
146 | const struct | ||
147 | GNUNET_MESH_MessageHandler | ||
148 | *handlers, | ||
149 | const | ||
150 | GNUNET_MESH_ApplicationType | ||
151 | *stypes); | ||
152 | 146 | ||
153 | /** | 147 | /** |
154 | * Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise | 148 | * Get the peer on the other side of this tunnel if it is just one. Return NULL otherwise |
@@ -156,9 +150,8 @@ struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | |||
156 | * @param tunnel the tunnel | 150 | * @param tunnel the tunnel |
157 | * @return the peer or NULL | 151 | * @return the peer or NULL |
158 | */ | 152 | */ |
159 | const struct GNUNET_PeerIdentity *GNUNET_MESH_get_peer (const struct | 153 | const struct GNUNET_PeerIdentity * |
160 | GNUNET_MESH_Tunnel | 154 | GNUNET_MESH_get_peer (const struct GNUNET_MESH_Tunnel *tunnel); |
161 | *tunnel); | ||
162 | 155 | ||
163 | 156 | ||
164 | /** | 157 | /** |
@@ -166,7 +159,8 @@ const struct GNUNET_PeerIdentity *GNUNET_MESH_get_peer (const struct | |||
166 | * | 159 | * |
167 | * @param handle connection to mesh to disconnect | 160 | * @param handle connection to mesh to disconnect |
168 | */ | 161 | */ |
169 | void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | 162 | void |
163 | GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | ||
170 | 164 | ||
171 | 165 | ||
172 | 166 | ||
@@ -220,23 +214,15 @@ struct GNUNET_MESH_PeerRequestHandle; | |||
220 | * @param handler_cls closure for handler | 214 | * @param handler_cls closure for handler |
221 | * @return NULL on error (handler will not be called), otherwise handle for cancellation | 215 | * @return NULL on error (handler will not be called), otherwise handle for cancellation |
222 | */ | 216 | */ |
223 | struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_any (struct | 217 | struct GNUNET_MESH_Tunnel * |
224 | GNUNET_MESH_Handle | 218 | GNUNET_MESH_peer_request_connect_any (struct GNUNET_MESH_Handle *h, |
225 | *h, | 219 | struct GNUNET_TIME_Relative timeout, |
226 | struct | 220 | unsigned int num_peers, |
227 | GNUNET_TIME_Relative | 221 | const struct GNUNET_PeerIdentity *peers, |
228 | timeout, | 222 | GNUNET_MESH_TunnelConnectHandler |
229 | unsigned int | 223 | connect_handler, |
230 | num_peers, | 224 | GNUNET_MESH_TunnelDisconnectHandler |
231 | const struct | 225 | disconnect_handler, void *handler_cls); |
232 | GNUNET_PeerIdentity | ||
233 | *peers, | ||
234 | GNUNET_MESH_TunnelConnectHandler | ||
235 | connect_handler, | ||
236 | GNUNET_MESH_TunnelDisconnectHandler | ||
237 | disconnect_handler, | ||
238 | void | ||
239 | *handler_cls); | ||
240 | 226 | ||
241 | 227 | ||
242 | /** | 228 | /** |
@@ -256,23 +242,15 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_any (struct | |||
256 | * @param handler_cls closure for handler | 242 | * @param handler_cls closure for handler |
257 | * @return NULL on error (handler will not be called), otherwise handle for cancellation | 243 | * @return NULL on error (handler will not be called), otherwise handle for cancellation |
258 | */ | 244 | */ |
259 | struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_all (struct | 245 | struct GNUNET_MESH_Tunnel * |
260 | GNUNET_MESH_Handle | 246 | GNUNET_MESH_peer_request_connect_all (struct GNUNET_MESH_Handle *h, |
261 | *h, | 247 | struct GNUNET_TIME_Relative timeout, |
262 | struct | 248 | unsigned int num_peers, |
263 | GNUNET_TIME_Relative | 249 | const struct GNUNET_PeerIdentity *peers, |
264 | timeout, | 250 | GNUNET_MESH_TunnelConnectHandler |
265 | unsigned int | 251 | connect_handler, |
266 | num_peers, | 252 | GNUNET_MESH_TunnelDisconnectHandler |
267 | const struct | 253 | disconnect_handler, void *handler_cls); |
268 | GNUNET_PeerIdentity | ||
269 | *peers, | ||
270 | GNUNET_MESH_TunnelConnectHandler | ||
271 | connect_handler, | ||
272 | GNUNET_MESH_TunnelDisconnectHandler | ||
273 | disconnect_handler, | ||
274 | void | ||
275 | *handler_cls); | ||
276 | 254 | ||
277 | 255 | ||
278 | /** | 256 | /** |
@@ -283,10 +261,10 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_all (struct | |||
283 | * @param timeout how long to try to establish a connection | 261 | * @param timeout how long to try to establish a connection |
284 | * @param peer peer to add | 262 | * @param peer peer to add |
285 | */ | 263 | */ |
286 | void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | 264 | void |
287 | struct GNUNET_TIME_Relative timeout, | 265 | GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, |
288 | const struct GNUNET_PeerIdentity | 266 | struct GNUNET_TIME_Relative timeout, |
289 | *peer); | 267 | const struct GNUNET_PeerIdentity *peer); |
290 | 268 | ||
291 | 269 | ||
292 | /** | 270 | /** |
@@ -296,9 +274,9 @@ void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | |||
296 | * @param tunnel handle to existing tunnel | 274 | * @param tunnel handle to existing tunnel |
297 | * @param peer peer to remove | 275 | * @param peer peer to remove |
298 | */ | 276 | */ |
299 | void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | 277 | void |
300 | const struct GNUNET_PeerIdentity | 278 | GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, |
301 | *peer); | 279 | const struct GNUNET_PeerIdentity *peer); |
302 | 280 | ||
303 | 281 | ||
304 | /** | 282 | /** |
@@ -318,20 +296,15 @@ void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | |||
318 | * @param handler_cls closure for handler | 296 | * @param handler_cls closure for handler |
319 | * @return NULL on error (handler will not be called), otherwise handle for cancellation | 297 | * @return NULL on error (handler will not be called), otherwise handle for cancellation |
320 | */ | 298 | */ |
321 | struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_by_type (struct | 299 | struct GNUNET_MESH_Tunnel * |
322 | GNUNET_MESH_Handle | 300 | GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Handle *h, |
323 | *h, | 301 | struct GNUNET_TIME_Relative timeout, |
324 | struct | 302 | GNUNET_MESH_ApplicationType app_type, |
325 | GNUNET_TIME_Relative | 303 | GNUNET_MESH_TunnelConnectHandler |
326 | timeout, | 304 | connect_handler, |
327 | GNUNET_MESH_ApplicationType | 305 | GNUNET_MESH_TunnelDisconnectHandler |
328 | app_type, | 306 | disconnect_handler, |
329 | GNUNET_MESH_TunnelConnectHandler | 307 | void *handler_cls); |
330 | connect_handler, | ||
331 | GNUNET_MESH_TunnelDisconnectHandler | ||
332 | disconnect_handler, | ||
333 | void | ||
334 | *handler_cls); | ||
335 | 308 | ||
336 | 309 | ||
337 | /** | 310 | /** |
@@ -340,7 +313,8 @@ struct GNUNET_MESH_Tunnel *GNUNET_MESH_peer_request_connect_by_type (struct | |||
340 | * | 313 | * |
341 | * @param req request handle that was returned for the original request | 314 | * @param req request handle that was returned for the original request |
342 | */ | 315 | */ |
343 | void GNUNET_MESH_peer_request_connect_cancel (struct GNUNET_MESH_Tunnel *req); | 316 | void |
317 | GNUNET_MESH_peer_request_connect_cancel (struct GNUNET_MESH_Tunnel *req); | ||
344 | 318 | ||
345 | 319 | ||
346 | /** | 320 | /** |
@@ -370,25 +344,14 @@ struct GNUNET_MESH_TransmitHandle; | |||
370 | * NULL if we can not even queue the request (insufficient | 344 | * NULL if we can not even queue the request (insufficient |
371 | * memory); if NULL is returned, "notify" will NOT be called. | 345 | * memory); if NULL is returned, "notify" will NOT be called. |
372 | */ | 346 | */ |
373 | struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | 347 | struct GNUNET_MESH_TransmitHandle * |
374 | GNUNET_MESH_Tunnel | 348 | GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork, |
375 | *tunnel, | 349 | uint32_t priority, |
376 | int cork, | 350 | struct GNUNET_TIME_Relative maxdelay, |
377 | uint32_t | 351 | const struct GNUNET_PeerIdentity *target, |
378 | priority, | 352 | size_t notify_size, |
379 | struct | 353 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
380 | GNUNET_TIME_Relative | 354 | void *notify_cls); |
381 | maxdelay, | ||
382 | const | ||
383 | struct | ||
384 | GNUNET_PeerIdentity | ||
385 | *target, | ||
386 | size_t | ||
387 | notify_size, | ||
388 | GNUNET_CONNECTION_TransmitReadyNotify | ||
389 | notify, | ||
390 | void | ||
391 | *notify_cls); | ||
392 | 355 | ||
393 | 356 | ||
394 | /** | 357 | /** |
@@ -396,19 +359,23 @@ struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | |||
396 | * | 359 | * |
397 | * @param th handle that was returned by "notify_transmit_ready". | 360 | * @param th handle that was returned by "notify_transmit_ready". |
398 | */ | 361 | */ |
399 | void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | 362 | void |
400 | *th); | 363 | GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle |
401 | 364 | *th); | |
402 | void GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, | 365 | |
403 | void *head); | 366 | void |
404 | void GNUNET_MESH_tunnel_set_tail (struct GNUNET_MESH_Tunnel *tunnel, | 367 | GNUNET_MESH_tunnel_set_head (struct GNUNET_MESH_Tunnel *tunnel, void *head); |
405 | void *tail); | 368 | void |
406 | void *GNUNET_MESH_tunnel_get_head (struct GNUNET_MESH_Tunnel *tunnel); | 369 | GNUNET_MESH_tunnel_set_tail (struct GNUNET_MESH_Tunnel *tunnel, void *tail); |
407 | void *GNUNET_MESH_tunnel_get_tail (struct GNUNET_MESH_Tunnel *tunnel); | 370 | void * |
408 | 371 | GNUNET_MESH_tunnel_get_head (struct GNUNET_MESH_Tunnel *tunnel); | |
409 | void GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, | 372 | void * |
410 | void *data); | 373 | GNUNET_MESH_tunnel_get_tail (struct GNUNET_MESH_Tunnel *tunnel); |
411 | void *GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel); | 374 | |
375 | void | ||
376 | GNUNET_MESH_tunnel_set_data (struct GNUNET_MESH_Tunnel *tunnel, void *data); | ||
377 | void * | ||
378 | GNUNET_MESH_tunnel_get_data (struct GNUNET_MESH_Tunnel *tunnel); | ||
412 | 379 | ||
413 | #if 0 /* keep Emacsens' auto-indent happy */ | 380 | #if 0 /* keep Emacsens' auto-indent happy */ |
414 | { | 381 | { |
diff --git a/src/include/gnunet_mesh_service_new.h b/src/include/gnunet_mesh_service_new.h index 89b1c881e..83addfce5 100644 --- a/src/include/gnunet_mesh_service_new.h +++ b/src/include/gnunet_mesh_service_new.h | |||
@@ -140,17 +140,11 @@ typedef uint32_t GNUNET_MESH_ApplicationType; | |||
140 | * @return handle to the mesh service NULL on error | 140 | * @return handle to the mesh service NULL on error |
141 | * (in this case, init is never called) | 141 | * (in this case, init is never called) |
142 | */ | 142 | */ |
143 | struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | 143 | struct GNUNET_MESH_Handle * |
144 | GNUNET_CONFIGURATION_Handle | 144 | GNUNET_MESH_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, void *cls, |
145 | *cfg, void *cls, | 145 | GNUNET_MESH_TunnelEndHandler cleaner, |
146 | GNUNET_MESH_TunnelEndHandler | 146 | const struct GNUNET_MESH_MessageHandler *handlers, |
147 | cleaner, | 147 | const GNUNET_MESH_ApplicationType *stypes); |
148 | const struct | ||
149 | GNUNET_MESH_MessageHandler | ||
150 | *handlers, | ||
151 | const | ||
152 | GNUNET_MESH_ApplicationType | ||
153 | *stypes); | ||
154 | 148 | ||
155 | 149 | ||
156 | /** | 150 | /** |
@@ -158,7 +152,8 @@ struct GNUNET_MESH_Handle *GNUNET_MESH_connect (const struct | |||
158 | * | 152 | * |
159 | * @param handle connection to mesh to disconnect | 153 | * @param handle connection to mesh to disconnect |
160 | */ | 154 | */ |
161 | void GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | 155 | void |
156 | GNUNET_MESH_disconnect (struct GNUNET_MESH_Handle *handle); | ||
162 | 157 | ||
163 | 158 | ||
164 | /** | 159 | /** |
@@ -198,20 +193,19 @@ typedef void (*GNUNET_MESH_TunnelConnectHandler) (void *cls, | |||
198 | * @param disconnect_handler function to call when peers are disconnected | 193 | * @param disconnect_handler function to call when peers are disconnected |
199 | * @param handler_cls closure for connect/disconnect handlers | 194 | * @param handler_cls closure for connect/disconnect handlers |
200 | */ | 195 | */ |
201 | struct GNUNET_MESH_Tunnel *GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle | 196 | struct GNUNET_MESH_Tunnel * |
202 | *h, | 197 | GNUNET_MESH_tunnel_create (struct GNUNET_MESH_Handle *h, |
203 | GNUNET_MESH_TunnelConnectHandler | 198 | GNUNET_MESH_TunnelConnectHandler connect_handler, |
204 | connect_handler, | 199 | GNUNET_MESH_TunnelDisconnectHandler |
205 | GNUNET_MESH_TunnelDisconnectHandler | 200 | disconnect_handler, void *handler_cls); |
206 | disconnect_handler, | ||
207 | void *handler_cls); | ||
208 | 201 | ||
209 | /** | 202 | /** |
210 | * Destroy an existing tunnel. | 203 | * Destroy an existing tunnel. |
211 | * | 204 | * |
212 | * @param tun tunnel handle | 205 | * @param tun tunnel handle |
213 | */ | 206 | */ |
214 | void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | 207 | void |
208 | GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | ||
215 | 209 | ||
216 | 210 | ||
217 | /** | 211 | /** |
@@ -222,10 +216,10 @@ void GNUNET_MESH_tunnel_destroy (struct GNUNET_MESH_Tunnel *tun); | |||
222 | * @param timeout how long to try to establish a connection | 216 | * @param timeout how long to try to establish a connection |
223 | * @param peer peer to add | 217 | * @param peer peer to add |
224 | */ | 218 | */ |
225 | void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | 219 | void |
226 | struct GNUNET_TIME_Relative timeout, | 220 | GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, |
227 | const struct GNUNET_PeerIdentity | 221 | struct GNUNET_TIME_Relative timeout, |
228 | *peer); | 222 | const struct GNUNET_PeerIdentity *peer); |
229 | 223 | ||
230 | 224 | ||
231 | /** | 225 | /** |
@@ -235,9 +229,9 @@ void GNUNET_MESH_peer_request_connect_add (struct GNUNET_MESH_Tunnel *tunnel, | |||
235 | * @param tunnel handle to existing tunnel | 229 | * @param tunnel handle to existing tunnel |
236 | * @param peer peer to remove | 230 | * @param peer peer to remove |
237 | */ | 231 | */ |
238 | void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | 232 | void |
239 | const struct GNUNET_PeerIdentity | 233 | GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, |
240 | *peer); | 234 | const struct GNUNET_PeerIdentity *peer); |
241 | 235 | ||
242 | 236 | ||
243 | /** | 237 | /** |
@@ -249,12 +243,10 @@ void GNUNET_MESH_peer_request_connect_del (struct GNUNET_MESH_Tunnel *tunnel, | |||
249 | * @param app_type application type that must be supported by the peer | 243 | * @param app_type application type that must be supported by the peer |
250 | * (MESH should discover peer in proximity handling this type) | 244 | * (MESH should discover peer in proximity handling this type) |
251 | */ | 245 | */ |
252 | void GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel | 246 | void |
253 | *tunnel, | 247 | GNUNET_MESH_peer_request_connect_by_type (struct GNUNET_MESH_Tunnel *tunnel, |
254 | struct GNUNET_TIME_Relative | 248 | struct GNUNET_TIME_Relative timeout, |
255 | timeout, | 249 | GNUNET_MESH_ApplicationType app_type); |
256 | GNUNET_MESH_ApplicationType | ||
257 | app_type); | ||
258 | 250 | ||
259 | 251 | ||
260 | /** | 252 | /** |
@@ -283,25 +275,14 @@ struct GNUNET_MESH_TransmitHandle; | |||
283 | * NULL if we can not even queue the request (insufficient | 275 | * NULL if we can not even queue the request (insufficient |
284 | * memory); if NULL is returned, "notify" will NOT be called. | 276 | * memory); if NULL is returned, "notify" will NOT be called. |
285 | */ | 277 | */ |
286 | struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | 278 | struct GNUNET_MESH_TransmitHandle * |
287 | GNUNET_MESH_Tunnel | 279 | GNUNET_MESH_notify_transmit_ready (struct GNUNET_MESH_Tunnel *tunnel, int cork, |
288 | *tunnel, | 280 | uint32_t priority, |
289 | int cork, | 281 | struct GNUNET_TIME_Relative maxdelay, |
290 | uint32_t | 282 | const struct GNUNET_PeerIdentity *target, |
291 | priority, | 283 | size_t notify_size, |
292 | struct | 284 | GNUNET_CONNECTION_TransmitReadyNotify notify, |
293 | GNUNET_TIME_Relative | 285 | void *notify_cls); |
294 | maxdelay, | ||
295 | const | ||
296 | struct | ||
297 | GNUNET_PeerIdentity | ||
298 | *target, | ||
299 | size_t | ||
300 | notify_size, | ||
301 | GNUNET_CONNECTION_TransmitReadyNotify | ||
302 | notify, | ||
303 | void | ||
304 | *notify_cls); | ||
305 | 286 | ||
306 | 287 | ||
307 | /** | 288 | /** |
@@ -309,8 +290,9 @@ struct GNUNET_MESH_TransmitHandle *GNUNET_MESH_notify_transmit_ready (struct | |||
309 | * | 290 | * |
310 | * @param th handle that was returned by "notify_transmit_ready". | 291 | * @param th handle that was returned by "notify_transmit_ready". |
311 | */ | 292 | */ |
312 | void GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle | 293 | void |
313 | *th); | 294 | GNUNET_MESH_notify_transmit_ready_cancel (struct GNUNET_MESH_TransmitHandle |
295 | *th); | ||
314 | 296 | ||
315 | 297 | ||
316 | #if 0 /* keep Emacsens' auto-indent happy */ | 298 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_nat_lib.h b/src/include/gnunet_nat_lib.h index 30eb50dd8..c521a560c 100644 --- a/src/include/gnunet_nat_lib.h +++ b/src/include/gnunet_nat_lib.h | |||
@@ -86,17 +86,13 @@ struct GNUNET_NAT_Handle; | |||
86 | * @param callback_cls closure for callback | 86 | * @param callback_cls closure for callback |
87 | * @return NULL on error, otherwise handle that can be used to unregister | 87 | * @return NULL on error, otherwise handle that can be used to unregister |
88 | */ | 88 | */ |
89 | struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct | 89 | struct GNUNET_NAT_Handle * |
90 | GNUNET_CONFIGURATION_Handle *cfg, | 90 | GNUNET_NAT_register (const struct GNUNET_CONFIGURATION_Handle *cfg, int is_tcp, |
91 | int is_tcp, uint16_t adv_port, | 91 | uint16_t adv_port, unsigned int num_addrs, |
92 | unsigned int num_addrs, | 92 | const struct sockaddr **addrs, const socklen_t * addrlens, |
93 | const struct sockaddr **addrs, | 93 | GNUNET_NAT_AddressCallback address_callback, |
94 | const socklen_t * addrlens, | 94 | GNUNET_NAT_ReversalCallback reversal_callback, |
95 | GNUNET_NAT_AddressCallback | 95 | void *callback_cls); |
96 | address_callback, | ||
97 | GNUNET_NAT_ReversalCallback | ||
98 | reversal_callback, | ||
99 | void *callback_cls); | ||
100 | 96 | ||
101 | 97 | ||
102 | /** | 98 | /** |
@@ -109,8 +105,9 @@ struct GNUNET_NAT_Handle *GNUNET_NAT_register (const struct | |||
109 | * GNUNET_NO if the address is not plausible, | 105 | * GNUNET_NO if the address is not plausible, |
110 | * GNUNET_SYSERR if the address is malformed | 106 | * GNUNET_SYSERR if the address is malformed |
111 | */ | 107 | */ |
112 | int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, | 108 | int |
113 | socklen_t addrlen); | 109 | GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, |
110 | socklen_t addrlen); | ||
114 | 111 | ||
115 | 112 | ||
116 | /** | 113 | /** |
@@ -121,8 +118,9 @@ int GNUNET_NAT_test_address (struct GNUNET_NAT_Handle *h, const void *addr, | |||
121 | * @param h handle (used for configuration) | 118 | * @param h handle (used for configuration) |
122 | * @param sa the address of the peer (IPv4-only) | 119 | * @param sa the address of the peer (IPv4-only) |
123 | */ | 120 | */ |
124 | void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, | 121 | void |
125 | const struct sockaddr_in *sa); | 122 | GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, |
123 | const struct sockaddr_in *sa); | ||
126 | 124 | ||
127 | 125 | ||
128 | 126 | ||
@@ -132,7 +130,8 @@ void GNUNET_NAT_run_client (struct GNUNET_NAT_Handle *h, | |||
132 | * | 130 | * |
133 | * @param h the handle to stop | 131 | * @param h the handle to stop |
134 | */ | 132 | */ |
135 | void GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h); | 133 | void |
134 | GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *h); | ||
136 | 135 | ||
137 | 136 | ||
138 | /** | 137 | /** |
@@ -163,12 +162,10 @@ typedef void (*GNUNET_NAT_TestCallback) (void *cls, int success); | |||
163 | * @param report_cls closure for report | 162 | * @param report_cls closure for report |
164 | * @return handle to cancel NAT test | 163 | * @return handle to cancel NAT test |
165 | */ | 164 | */ |
166 | struct GNUNET_NAT_Test *GNUNET_NAT_test_start (const struct | 165 | struct GNUNET_NAT_Test * |
167 | GNUNET_CONFIGURATION_Handle *cfg, | 166 | GNUNET_NAT_test_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
168 | int is_tcp, uint16_t bnd_port, | 167 | int is_tcp, uint16_t bnd_port, uint16_t adv_port, |
169 | uint16_t adv_port, | 168 | GNUNET_NAT_TestCallback report, void *report_cls); |
170 | GNUNET_NAT_TestCallback report, | ||
171 | void *report_cls); | ||
172 | 169 | ||
173 | 170 | ||
174 | /** | 171 | /** |
@@ -176,7 +173,8 @@ struct GNUNET_NAT_Test *GNUNET_NAT_test_start (const struct | |||
176 | * | 173 | * |
177 | * @param tst test to stop. | 174 | * @param tst test to stop. |
178 | */ | 175 | */ |
179 | void GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); | 176 | void |
177 | GNUNET_NAT_test_stop (struct GNUNET_NAT_Test *tst); | ||
180 | 178 | ||
181 | 179 | ||
182 | /** | 180 | /** |
@@ -203,13 +201,9 @@ struct GNUNET_NAT_ExternalHandle; | |||
203 | * @param cb_cls closure for 'cb' | 201 | * @param cb_cls closure for 'cb' |
204 | * @return handle for cancellation (can only be used until 'cb' is called), NULL on error | 202 | * @return handle for cancellation (can only be used until 'cb' is called), NULL on error |
205 | */ | 203 | */ |
206 | struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct | 204 | struct GNUNET_NAT_ExternalHandle * |
207 | GNUNET_TIME_Relative | 205 | GNUNET_NAT_mini_get_external_ipv4 (struct GNUNET_TIME_Relative timeout, |
208 | timeout, | 206 | GNUNET_NAT_IPCallback cb, void *cb_cls); |
209 | GNUNET_NAT_IPCallback | ||
210 | cb, | ||
211 | void | ||
212 | *cb_cls); | ||
213 | 207 | ||
214 | 208 | ||
215 | /** | 209 | /** |
@@ -217,8 +211,8 @@ struct GNUNET_NAT_ExternalHandle *GNUNET_NAT_mini_get_external_ipv4 (struct | |||
217 | * | 211 | * |
218 | * @param eh operation to cancel | 212 | * @param eh operation to cancel |
219 | */ | 213 | */ |
220 | void GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle | 214 | void |
221 | *eh); | 215 | GNUNET_NAT_mini_get_external_ipv4_cancel (struct GNUNET_NAT_ExternalHandle *eh); |
222 | 216 | ||
223 | 217 | ||
224 | /** | 218 | /** |
@@ -240,10 +234,9 @@ struct GNUNET_NAT_MiniHandle; | |||
240 | * @param ac_cls closure for 'ac' | 234 | * @param ac_cls closure for 'ac' |
241 | * @return NULL on error | 235 | * @return NULL on error |
242 | */ | 236 | */ |
243 | struct GNUNET_NAT_MiniHandle *GNUNET_NAT_mini_map_start (uint16_t port, | 237 | struct GNUNET_NAT_MiniHandle * |
244 | int is_tcp, | 238 | GNUNET_NAT_mini_map_start (uint16_t port, int is_tcp, |
245 | GNUNET_NAT_AddressCallback | 239 | GNUNET_NAT_AddressCallback ac, void *ac_cls); |
246 | ac, void *ac_cls); | ||
247 | 240 | ||
248 | 241 | ||
249 | /** | 242 | /** |
@@ -254,7 +247,8 @@ struct GNUNET_NAT_MiniHandle *GNUNET_NAT_mini_map_start (uint16_t port, | |||
254 | * | 247 | * |
255 | * @param mini the handle | 248 | * @param mini the handle |
256 | */ | 249 | */ |
257 | void GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); | 250 | void |
251 | GNUNET_NAT_mini_map_stop (struct GNUNET_NAT_MiniHandle *mini); | ||
258 | 252 | ||
259 | 253 | ||
260 | #endif | 254 | #endif |
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 0f38b855f..65b2042d5 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h | |||
@@ -83,13 +83,10 @@ struct GNUNET_NETWORK_FDSet | |||
83 | * @param address_len length of address | 83 | * @param address_len length of address |
84 | * @return client socket | 84 | * @return client socket |
85 | */ | 85 | */ |
86 | struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_accept (const struct | 86 | struct GNUNET_NETWORK_Handle * |
87 | GNUNET_NETWORK_Handle | 87 | GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, |
88 | *desc, | 88 | struct sockaddr *address, |
89 | struct sockaddr | 89 | socklen_t * address_len); |
90 | *address, | ||
91 | socklen_t * | ||
92 | address_len); | ||
93 | 90 | ||
94 | 91 | ||
95 | /** | 92 | /** |
@@ -98,7 +95,8 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_accept (const struct | |||
98 | * @param fd socket to box | 95 | * @param fd socket to box |
99 | * @return NULL on error (including not supported on target platform) | 96 | * @return NULL on error (including not supported on target platform) |
100 | */ | 97 | */ |
101 | struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_box_native (int fd); | 98 | struct GNUNET_NETWORK_Handle * |
99 | GNUNET_NETWORK_socket_box_native (int fd); | ||
102 | 100 | ||
103 | 101 | ||
104 | /** | 102 | /** |
@@ -109,9 +107,10 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_box_native (int fd); | |||
109 | * @param address_len length of address | 107 | * @param address_len length of address |
110 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 108 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
111 | */ | 109 | */ |
112 | int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | 110 | int |
113 | const struct sockaddr *address, | 111 | GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, |
114 | socklen_t address_len); | 112 | const struct sockaddr *address, |
113 | socklen_t address_len); | ||
115 | 114 | ||
116 | /** | 115 | /** |
117 | * Close a socket. | 116 | * Close a socket. |
@@ -119,7 +118,8 @@ int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | |||
119 | * @param desc socket to close | 118 | * @param desc socket to close |
120 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 119 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
121 | */ | 120 | */ |
122 | int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | 121 | int |
122 | GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | ||
123 | 123 | ||
124 | 124 | ||
125 | /** | 125 | /** |
@@ -130,9 +130,10 @@ int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | |||
130 | * @param address_len of address | 130 | * @param address_len of address |
131 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 131 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
132 | */ | 132 | */ |
133 | int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | 133 | int |
134 | const struct sockaddr *address, | 134 | GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, |
135 | socklen_t address_len); | 135 | const struct sockaddr *address, |
136 | socklen_t address_len); | ||
136 | 137 | ||
137 | 138 | ||
138 | /** | 139 | /** |
@@ -145,9 +146,10 @@ int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | |||
145 | * @param optlen length of optval | 146 | * @param optlen length of optval |
146 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 147 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
147 | */ | 148 | */ |
148 | int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | 149 | int |
149 | int level, int optname, void *optval, | 150 | GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, |
150 | socklen_t * optlen); | 151 | int level, int optname, void *optval, |
152 | socklen_t * optlen); | ||
151 | 153 | ||
152 | 154 | ||
153 | /** | 155 | /** |
@@ -157,16 +159,18 @@ int GNUNET_NETWORK_socket_getsockopt (const struct GNUNET_NETWORK_Handle *desc, | |||
157 | * @param backlog length of the listen queue | 159 | * @param backlog length of the listen queue |
158 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 160 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
159 | */ | 161 | */ |
160 | int GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, | 162 | int |
161 | int backlog); | 163 | GNUNET_NETWORK_socket_listen (const struct GNUNET_NETWORK_Handle *desc, |
164 | int backlog); | ||
162 | 165 | ||
163 | 166 | ||
164 | /** | 167 | /** |
165 | * How much data is available to be read on this descriptor? | 168 | * How much data is available to be read on this descriptor? |
166 | * @param desc socket | 169 | * @param desc socket |
167 | */ | 170 | */ |
168 | ssize_t GNUNET_NETWORK_socket_recvfrom_amount (const struct | 171 | ssize_t |
169 | GNUNET_NETWORK_Handle *desc); | 172 | GNUNET_NETWORK_socket_recvfrom_amount (const struct GNUNET_NETWORK_Handle |
173 | *desc); | ||
170 | 174 | ||
171 | 175 | ||
172 | /** | 176 | /** |
@@ -178,12 +182,10 @@ ssize_t GNUNET_NETWORK_socket_recvfrom_amount (const struct | |||
178 | * to be filled in by recvfrom | 182 | * to be filled in by recvfrom |
179 | * @param addrlen length of the addr | 183 | * @param addrlen length of the addr |
180 | */ | 184 | */ |
181 | ssize_t GNUNET_NETWORK_socket_recvfrom (const struct | 185 | ssize_t |
182 | GNUNET_NETWORK_Handle | 186 | GNUNET_NETWORK_socket_recvfrom (const struct GNUNET_NETWORK_Handle *desc, |
183 | *desc, void *buffer, | 187 | void *buffer, size_t length, |
184 | size_t length, | 188 | struct sockaddr *src_addr, socklen_t * addrlen); |
185 | struct sockaddr *src_addr, | ||
186 | socklen_t * addrlen); | ||
187 | 189 | ||
188 | 190 | ||
189 | /** | 191 | /** |
@@ -194,8 +196,9 @@ ssize_t GNUNET_NETWORK_socket_recvfrom (const struct | |||
194 | * @param length length of buffer | 196 | * @param length length of buffer |
195 | * @return number of bytes read | 197 | * @return number of bytes read |
196 | */ | 198 | */ |
197 | ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | 199 | ssize_t |
198 | void *buffer, size_t length); | 200 | GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, |
201 | void *buffer, size_t length); | ||
199 | 202 | ||
200 | 203 | ||
201 | /** | 204 | /** |
@@ -206,10 +209,11 @@ ssize_t GNUNET_NETWORK_socket_recv (const struct GNUNET_NETWORK_Handle *desc, | |||
206 | * @param timeout relative value when to return | 209 | * @param timeout relative value when to return |
207 | * @return number of selected sockets, GNUNET_SYSERR on error | 210 | * @return number of selected sockets, GNUNET_SYSERR on error |
208 | */ | 211 | */ |
209 | int GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | 212 | int |
210 | struct GNUNET_NETWORK_FDSet *wfds, | 213 | GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, |
211 | struct GNUNET_NETWORK_FDSet *efds, | 214 | struct GNUNET_NETWORK_FDSet *wfds, |
212 | struct GNUNET_TIME_Relative timeout); | 215 | struct GNUNET_NETWORK_FDSet *efds, |
216 | struct GNUNET_TIME_Relative timeout); | ||
213 | 217 | ||
214 | 218 | ||
215 | /** | 219 | /** |
@@ -220,8 +224,9 @@ int GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
220 | * @param length size of the buffer | 224 | * @param length size of the buffer |
221 | * @return number of bytes sent, GNUNET_SYSERR on error | 225 | * @return number of bytes sent, GNUNET_SYSERR on error |
222 | */ | 226 | */ |
223 | ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | 227 | ssize_t |
224 | const void *buffer, size_t length); | 228 | GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, |
229 | const void *buffer, size_t length); | ||
225 | 230 | ||
226 | 231 | ||
227 | /** | 232 | /** |
@@ -235,10 +240,11 @@ ssize_t GNUNET_NETWORK_socket_send (const struct GNUNET_NETWORK_Handle *desc, | |||
235 | * @param dest_len length of address | 240 | * @param dest_len length of address |
236 | * @return number of bytes sent, GNUNET_SYSERR on error | 241 | * @return number of bytes sent, GNUNET_SYSERR on error |
237 | */ | 242 | */ |
238 | ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, | 243 | ssize_t |
239 | const void *message, size_t length, | 244 | GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, |
240 | const struct sockaddr *dest_addr, | 245 | const void *message, size_t length, |
241 | socklen_t dest_len); | 246 | const struct sockaddr *dest_addr, |
247 | socklen_t dest_len); | ||
242 | 248 | ||
243 | 249 | ||
244 | /** | 250 | /** |
@@ -251,10 +257,10 @@ ssize_t GNUNET_NETWORK_socket_sendto (const struct GNUNET_NETWORK_Handle *desc, | |||
251 | * @param option_len size of option_value | 257 | * @param option_len size of option_value |
252 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 258 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
253 | */ | 259 | */ |
254 | int GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | 260 | int |
255 | int level, int option_name, | 261 | GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, int level, |
256 | const void *option_value, | 262 | int option_name, const void *option_value, |
257 | socklen_t option_len); | 263 | socklen_t option_len); |
258 | 264 | ||
259 | 265 | ||
260 | /** | 266 | /** |
@@ -264,8 +270,8 @@ int GNUNET_NETWORK_socket_setsockopt (struct GNUNET_NETWORK_Handle *fd, | |||
264 | * @param how type of shutdown | 270 | * @param how type of shutdown |
265 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 271 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
266 | */ | 272 | */ |
267 | int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | 273 | int |
268 | int how); | 274 | GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, int how); |
269 | 275 | ||
270 | 276 | ||
271 | /** | 277 | /** |
@@ -277,7 +283,8 @@ int GNUNET_NETWORK_socket_shutdown (struct GNUNET_NETWORK_Handle *desc, | |||
277 | * @param desc socket | 283 | * @param desc socket |
278 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 284 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
279 | */ | 285 | */ |
280 | int GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | 286 | int |
287 | GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | ||
281 | 288 | ||
282 | 289 | ||
283 | /** | 290 | /** |
@@ -290,9 +297,8 @@ int GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc); | |||
290 | * @param protocol network protocol | 297 | * @param protocol network protocol |
291 | * @return new socket, NULL on error | 298 | * @return new socket, NULL on error |
292 | */ | 299 | */ |
293 | struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain, | 300 | struct GNUNET_NETWORK_Handle * |
294 | int type, | 301 | GNUNET_NETWORK_socket_create (int domain, int type, int protocol); |
295 | int protocol); | ||
296 | 302 | ||
297 | 303 | ||
298 | /** | 304 | /** |
@@ -300,7 +306,8 @@ struct GNUNET_NETWORK_Handle *GNUNET_NETWORK_socket_create (int domain, | |||
300 | * | 306 | * |
301 | * @param fds fd set to clear | 307 | * @param fds fd set to clear |
302 | */ | 308 | */ |
303 | void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | 309 | void |
310 | GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | ||
304 | 311 | ||
305 | 312 | ||
306 | /** | 313 | /** |
@@ -308,8 +315,9 @@ void GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds); | |||
308 | * @param fds fd set | 315 | * @param fds fd set |
309 | * @param desc socket to add | 316 | * @param desc socket to add |
310 | */ | 317 | */ |
311 | void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | 318 | void |
312 | const struct GNUNET_NETWORK_Handle *desc); | 319 | GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, |
320 | const struct GNUNET_NETWORK_Handle *desc); | ||
313 | 321 | ||
314 | 322 | ||
315 | #ifdef __MINGW32__ | 323 | #ifdef __MINGW32__ |
@@ -319,9 +327,9 @@ void GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | |||
319 | * @param fds fd set | 327 | * @param fds fd set |
320 | * @param h the file handle to add | 328 | * @param h the file handle to add |
321 | */ | 329 | */ |
322 | void GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct | 330 | void |
323 | GNUNET_NETWORK_FDSet | 331 | GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct GNUNET_NETWORK_FDSet |
324 | *fds, HANDLE h); | 332 | *fds, HANDLE h); |
325 | #endif | 333 | #endif |
326 | 334 | ||
327 | 335 | ||
@@ -331,8 +339,9 @@ void GNUNET_NETWORK_fdset_handle_set_native_w32_handle (struct | |||
331 | * @param desc socket | 339 | * @param desc socket |
332 | * @return GNUNET_YES if the socket is in the set | 340 | * @return GNUNET_YES if the socket is in the set |
333 | */ | 341 | */ |
334 | int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | 342 | int |
335 | const struct GNUNET_NETWORK_Handle *desc); | 343 | GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, |
344 | const struct GNUNET_NETWORK_Handle *desc); | ||
336 | 345 | ||
337 | 346 | ||
338 | /** | 347 | /** |
@@ -340,8 +349,9 @@ int GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
340 | * @param dst the fd set to add to | 349 | * @param dst the fd set to add to |
341 | * @param src the fd set to add from | 350 | * @param src the fd set to add from |
342 | */ | 351 | */ |
343 | void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | 352 | void |
344 | const struct GNUNET_NETWORK_FDSet *src); | 353 | GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, |
354 | const struct GNUNET_NETWORK_FDSet *src); | ||
345 | 355 | ||
346 | 356 | ||
347 | /** | 357 | /** |
@@ -349,8 +359,9 @@ void GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | |||
349 | * @param to destination | 359 | * @param to destination |
350 | * @param from source | 360 | * @param from source |
351 | */ | 361 | */ |
352 | void GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | 362 | void |
353 | const struct GNUNET_NETWORK_FDSet *from); | 363 | GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, |
364 | const struct GNUNET_NETWORK_FDSet *from); | ||
354 | 365 | ||
355 | 366 | ||
356 | /** | 367 | /** |
@@ -359,7 +370,8 @@ void GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | |||
359 | * @param desc wrapper to process | 370 | * @param desc wrapper to process |
360 | * @return POSIX file descriptor | 371 | * @return POSIX file descriptor |
361 | */ | 372 | */ |
362 | int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); | 373 | int |
374 | GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); | ||
363 | 375 | ||
364 | 376 | ||
365 | /** | 377 | /** |
@@ -368,8 +380,9 @@ int GNUNET_NETWORK_get_fd (struct GNUNET_NETWORK_Handle *desc); | |||
368 | * @param from native source set | 380 | * @param from native source set |
369 | * @param nfds the biggest socket number in from + 1 | 381 | * @param nfds the biggest socket number in from + 1 |
370 | */ | 382 | */ |
371 | void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | 383 | void |
372 | const fd_set * from, int nfds); | 384 | GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, |
385 | const fd_set * from, int nfds); | ||
373 | 386 | ||
374 | 387 | ||
375 | /** | 388 | /** |
@@ -378,7 +391,8 @@ void GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | |||
378 | * @param to destination | 391 | * @param to destination |
379 | * @param nfd native FD to set | 392 | * @param nfd native FD to set |
380 | */ | 393 | */ |
381 | void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); | 394 | void |
395 | GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); | ||
382 | 396 | ||
383 | 397 | ||
384 | /** | 398 | /** |
@@ -388,8 +402,9 @@ void GNUNET_NETWORK_fdset_set_native (struct GNUNET_NETWORK_FDSet *to, int nfd); | |||
388 | * @param nfd native FD to test, -1 for none | 402 | * @param nfd native FD to test, -1 for none |
389 | * @return GNUNET_YES if to contains nfd | 403 | * @return GNUNET_YES if to contains nfd |
390 | */ | 404 | */ |
391 | int GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | 405 | int |
392 | int nfd); | 406 | GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, |
407 | int nfd); | ||
393 | 408 | ||
394 | 409 | ||
395 | /** | 410 | /** |
@@ -397,8 +412,9 @@ int GNUNET_NETWORK_fdset_test_native (const struct GNUNET_NETWORK_FDSet *to, | |||
397 | * @param fds fd set | 412 | * @param fds fd set |
398 | * @param h the file handle to add | 413 | * @param h the file handle to add |
399 | */ | 414 | */ |
400 | void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | 415 | void |
401 | const struct GNUNET_DISK_FileHandle *h); | 416 | GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, |
417 | const struct GNUNET_DISK_FileHandle *h); | ||
402 | 418 | ||
403 | 419 | ||
404 | /** | 420 | /** |
@@ -407,8 +423,9 @@ void GNUNET_NETWORK_fdset_handle_set (struct GNUNET_NETWORK_FDSet *fds, | |||
407 | * @param h file handle | 423 | * @param h file handle |
408 | * @return GNUNET_YES if the file handle is part of the set | 424 | * @return GNUNET_YES if the file handle is part of the set |
409 | */ | 425 | */ |
410 | int GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | 426 | int |
411 | const struct GNUNET_DISK_FileHandle *h); | 427 | GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, |
428 | const struct GNUNET_DISK_FileHandle *h); | ||
412 | 429 | ||
413 | 430 | ||
414 | /** | 431 | /** |
@@ -417,22 +434,25 @@ int GNUNET_NETWORK_fdset_handle_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
417 | * @param fds2 second fd set | 434 | * @param fds2 second fd set |
418 | * @return GNUNET_YES if they do overlap, GNUNET_NO otherwise | 435 | * @return GNUNET_YES if they do overlap, GNUNET_NO otherwise |
419 | */ | 436 | */ |
420 | int GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, | 437 | int |
421 | const struct GNUNET_NETWORK_FDSet *fds2); | 438 | GNUNET_NETWORK_fdset_overlap (const struct GNUNET_NETWORK_FDSet *fds1, |
439 | const struct GNUNET_NETWORK_FDSet *fds2); | ||
422 | 440 | ||
423 | 441 | ||
424 | /** | 442 | /** |
425 | * Creates an fd set | 443 | * Creates an fd set |
426 | * @return a new fd set | 444 | * @return a new fd set |
427 | */ | 445 | */ |
428 | struct GNUNET_NETWORK_FDSet *GNUNET_NETWORK_fdset_create (void); | 446 | struct GNUNET_NETWORK_FDSet * |
447 | GNUNET_NETWORK_fdset_create (void); | ||
429 | 448 | ||
430 | 449 | ||
431 | /** | 450 | /** |
432 | * Releases the associated memory of an fd set | 451 | * Releases the associated memory of an fd set |
433 | * @param fds fd set | 452 | * @param fds fd set |
434 | */ | 453 | */ |
435 | void GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); | 454 | void |
455 | GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds); | ||
436 | 456 | ||
437 | 457 | ||
438 | #if 0 /* keep Emacsens' auto-indent happy */ | 458 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_nse_service.h b/src/include/gnunet_nse_service.h index 91711ef5b..451f2a2dc 100644 --- a/src/include/gnunet_nse_service.h +++ b/src/include/gnunet_nse_service.h | |||
@@ -84,10 +84,9 @@ typedef void (*GNUNET_NSE_Callback) (void *cls, | |||
84 | * | 84 | * |
85 | * @return handle to use | 85 | * @return handle to use |
86 | */ | 86 | */ |
87 | struct GNUNET_NSE_Handle *GNUNET_NSE_connect (const struct | 87 | struct GNUNET_NSE_Handle * |
88 | GNUNET_CONFIGURATION_Handle *cfg, | 88 | GNUNET_NSE_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
89 | GNUNET_NSE_Callback func, | 89 | GNUNET_NSE_Callback func, void *func_cls); |
90 | void *func_cls); | ||
91 | 90 | ||
92 | 91 | ||
93 | /** | 92 | /** |
@@ -96,7 +95,8 @@ struct GNUNET_NSE_Handle *GNUNET_NSE_connect (const struct | |||
96 | * @param h handle to destroy | 95 | * @param h handle to destroy |
97 | * | 96 | * |
98 | */ | 97 | */ |
99 | void GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h); | 98 | void |
99 | GNUNET_NSE_disconnect (struct GNUNET_NSE_Handle *h); | ||
100 | 100 | ||
101 | 101 | ||
102 | #if 0 /* keep Emacsens' auto-indent happy */ | 102 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index d2474d2d8..9d611af9b 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h | |||
@@ -135,8 +135,8 @@ enum GNUNET_OS_ProcessStatusType | |||
135 | * @param dirkind what kind of directory is desired? | 135 | * @param dirkind what kind of directory is desired? |
136 | * @return a pointer to the dir path (to be freed by the caller) | 136 | * @return a pointer to the dir path (to be freed by the caller) |
137 | */ | 137 | */ |
138 | char *GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind | 138 | char * |
139 | dirkind); | 139 | GNUNET_OS_installation_get_path (enum GNUNET_OS_InstallationPathKind dirkind); |
140 | 140 | ||
141 | 141 | ||
142 | /** | 142 | /** |
@@ -160,8 +160,9 @@ typedef int (*GNUNET_OS_NetworkInterfaceProcessor) (void *cls, const char *name, | |||
160 | * @param proc the callback function | 160 | * @param proc the callback function |
161 | * @param proc_cls closure for proc | 161 | * @param proc_cls closure for proc |
162 | */ | 162 | */ |
163 | void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor | 163 | void |
164 | proc, void *proc_cls); | 164 | GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, |
165 | void *proc_cls); | ||
165 | 166 | ||
166 | /** | 167 | /** |
167 | * @brief Get maximum string length returned by gethostname() | 168 | * @brief Get maximum string length returned by gethostname() |
@@ -183,7 +184,8 @@ void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor | |||
183 | * | 184 | * |
184 | * @return pointer to the process sturcutre for this process | 185 | * @return pointer to the process sturcutre for this process |
185 | */ | 186 | */ |
186 | struct GNUNET_OS_Process *GNUNET_OS_process_current (void); | 187 | struct GNUNET_OS_Process * |
188 | GNUNET_OS_process_current (void); | ||
187 | 189 | ||
188 | 190 | ||
189 | /** | 191 | /** |
@@ -193,7 +195,8 @@ struct GNUNET_OS_Process *GNUNET_OS_process_current (void); | |||
193 | * @param sig signal | 195 | * @param sig signal |
194 | * @return 0 on success, -1 on error | 196 | * @return 0 on success, -1 on error |
195 | */ | 197 | */ |
196 | int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); | 198 | int |
199 | GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); | ||
197 | 200 | ||
198 | 201 | ||
199 | /** | 202 | /** |
@@ -201,7 +204,8 @@ int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig); | |||
201 | * | 204 | * |
202 | * @param proc pointer to process structure | 205 | * @param proc pointer to process structure |
203 | */ | 206 | */ |
204 | void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); | 207 | void |
208 | GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); | ||
205 | 209 | ||
206 | /** | 210 | /** |
207 | * Get the pid of the process in question | 211 | * Get the pid of the process in question |
@@ -210,7 +214,8 @@ void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc); | |||
210 | * | 214 | * |
211 | * @return the current process id | 215 | * @return the current process id |
212 | */ | 216 | */ |
213 | pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | 217 | pid_t |
218 | GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | ||
214 | 219 | ||
215 | /** | 220 | /** |
216 | * Set process priority | 221 | * Set process priority |
@@ -219,8 +224,9 @@ pid_t GNUNET_OS_process_get_pid (struct GNUNET_OS_Process *proc); | |||
219 | * @param prio priority value | 224 | * @param prio priority value |
220 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 225 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
221 | */ | 226 | */ |
222 | int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, | 227 | int |
223 | enum GNUNET_SCHEDULER_Priority prio); | 228 | GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, |
229 | enum GNUNET_SCHEDULER_Priority prio); | ||
224 | 230 | ||
225 | 231 | ||
226 | /** | 232 | /** |
@@ -232,11 +238,10 @@ int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc, | |||
232 | * @param ... NULL-terminated list of arguments to the process | 238 | * @param ... NULL-terminated list of arguments to the process |
233 | * @return pointer to process structure of the new process, NULL on error | 239 | * @return pointer to process structure of the new process, NULL on error |
234 | */ | 240 | */ |
235 | struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle | 241 | struct GNUNET_OS_Process * |
236 | *pipe_stdin, | 242 | GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin, |
237 | struct GNUNET_DISK_PipeHandle | 243 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
238 | *pipe_stdout, | 244 | const char *filename, ...); |
239 | const char *filename, ...); | ||
240 | 245 | ||
241 | 246 | ||
242 | /** | 247 | /** |
@@ -248,14 +253,10 @@ struct GNUNET_OS_Process *GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle | |||
248 | * @param va NULL-terminated list of arguments to the process | 253 | * @param va NULL-terminated list of arguments to the process |
249 | * @return pointer to process structure of the new process, NULL on error | 254 | * @return pointer to process structure of the new process, NULL on error |
250 | */ | 255 | */ |
251 | struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct | 256 | struct GNUNET_OS_Process * |
252 | GNUNET_DISK_PipeHandle | 257 | GNUNET_OS_start_process_va (struct GNUNET_DISK_PipeHandle *pipe_stdin, |
253 | *pipe_stdin, | 258 | struct GNUNET_DISK_PipeHandle *pipe_stdout, |
254 | struct | 259 | const char *filename, va_list va); |
255 | GNUNET_DISK_PipeHandle | ||
256 | *pipe_stdout, | ||
257 | const char *filename, | ||
258 | va_list va); | ||
259 | 260 | ||
260 | /** | 261 | /** |
261 | * Start a process. | 262 | * Start a process. |
@@ -267,9 +268,9 @@ struct GNUNET_OS_Process *GNUNET_OS_start_process_va (struct | |||
267 | * including the process name as the first argument | 268 | * including the process name as the first argument |
268 | * @return pointer to process structure of the new process, NULL on error | 269 | * @return pointer to process structure of the new process, NULL on error |
269 | */ | 270 | */ |
270 | struct GNUNET_OS_Process *GNUNET_OS_start_process_v (const int *lsocks, | 271 | struct GNUNET_OS_Process * |
271 | const char *filename, | 272 | GNUNET_OS_start_process_v (const int *lsocks, const char *filename, |
272 | char *const argv[]); | 273 | char *const argv[]); |
273 | 274 | ||
274 | 275 | ||
275 | /** | 276 | /** |
@@ -290,7 +291,8 @@ typedef void (*GNUNET_OS_LineProcessor) (void *cls, const char *line); | |||
290 | * | 291 | * |
291 | * @param cmd handle to the process | 292 | * @param cmd handle to the process |
292 | */ | 293 | */ |
293 | void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | 294 | void |
295 | GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | ||
294 | 296 | ||
295 | 297 | ||
296 | /** | 298 | /** |
@@ -304,12 +306,10 @@ void GNUNET_OS_command_stop (struct GNUNET_OS_CommandHandle *cmd); | |||
304 | * @param ... arguments to command | 306 | * @param ... arguments to command |
305 | * @return NULL on error | 307 | * @return NULL on error |
306 | */ | 308 | */ |
307 | struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor | 309 | struct GNUNET_OS_CommandHandle * |
308 | proc, void *proc_cls, | 310 | GNUNET_OS_command_run (GNUNET_OS_LineProcessor proc, void *proc_cls, |
309 | struct | 311 | struct GNUNET_TIME_Relative timeout, const char *binary, |
310 | GNUNET_TIME_Relative | 312 | ...); |
311 | timeout, | ||
312 | const char *binary, ...); | ||
313 | 313 | ||
314 | 314 | ||
315 | /** | 315 | /** |
@@ -320,9 +320,10 @@ struct GNUNET_OS_CommandHandle *GNUNET_OS_command_run (GNUNET_OS_LineProcessor | |||
320 | * @param code return code/signal number | 320 | * @param code return code/signal number |
321 | * @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise | 321 | * @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise |
322 | */ | 322 | */ |
323 | int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, | 323 | int |
324 | enum GNUNET_OS_ProcessStatusType *type, | 324 | GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, |
325 | unsigned long *code); | 325 | enum GNUNET_OS_ProcessStatusType *type, |
326 | unsigned long *code); | ||
326 | 327 | ||
327 | 328 | ||
328 | /** | 329 | /** |
@@ -335,16 +336,17 @@ int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc, | |||
335 | * @param proc pointer to process structure of the process to wait for | 336 | * @param proc pointer to process structure of the process to wait for |
336 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 337 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
337 | */ | 338 | */ |
338 | int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | 339 | int |
340 | GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc); | ||
339 | 341 | ||
340 | 342 | ||
341 | /** | 343 | /** |
342 | * Connects this process to its parent via pipe | 344 | * Connects this process to its parent via pipe |
343 | */ | 345 | */ |
344 | void GNUNET_OS_install_parent_control_handler (void *cls, | 346 | void |
345 | const struct | 347 | GNUNET_OS_install_parent_control_handler (void *cls, |
346 | GNUNET_SCHEDULER_TaskContext | 348 | const struct |
347 | *tc); | 349 | GNUNET_SCHEDULER_TaskContext *tc); |
348 | 350 | ||
349 | 351 | ||
350 | /** | 352 | /** |
@@ -358,7 +360,8 @@ void GNUNET_OS_install_parent_control_handler (void *cls, | |||
358 | * GNUNET_NO if not SUID (but binary exists) | 360 | * GNUNET_NO if not SUID (but binary exists) |
359 | * GNUNET_SYSERR on error (no such binary or not executable) | 361 | * GNUNET_SYSERR on error (no such binary or not executable) |
360 | */ | 362 | */ |
361 | int GNUNET_OS_check_helper_binary (const char *binary); | 363 | int |
364 | GNUNET_OS_check_helper_binary (const char *binary); | ||
362 | 365 | ||
363 | 366 | ||
364 | #if 0 /* keep Emacsens' auto-indent happy */ | 367 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_peer_lib.h b/src/include/gnunet_peer_lib.h index da364dd44..89413aa59 100644 --- a/src/include/gnunet_peer_lib.h +++ b/src/include/gnunet_peer_lib.h | |||
@@ -53,7 +53,8 @@ typedef unsigned int GNUNET_PEER_Id; | |||
53 | * @param pid identity to find | 53 | * @param pid identity to find |
54 | * @return the interned identity or 0. | 54 | * @return the interned identity or 0. |
55 | */ | 55 | */ |
56 | GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); | 56 | GNUNET_PEER_Id |
57 | GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); | ||
57 | 58 | ||
58 | 59 | ||
59 | /** | 60 | /** |
@@ -63,7 +64,8 @@ GNUNET_PEER_Id GNUNET_PEER_search (const struct GNUNET_PeerIdentity *pid); | |||
63 | * @param pid identity to intern | 64 | * @param pid identity to intern |
64 | * @return the interned identity. | 65 | * @return the interned identity. |
65 | */ | 66 | */ |
66 | GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); | 67 | GNUNET_PEER_Id |
68 | GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); | ||
67 | 69 | ||
68 | 70 | ||
69 | /** | 71 | /** |
@@ -72,7 +74,8 @@ GNUNET_PEER_Id GNUNET_PEER_intern (const struct GNUNET_PeerIdentity *pid); | |||
72 | * @param id identity to change the RC of | 74 | * @param id identity to change the RC of |
73 | * @param delta how much to change the RC | 75 | * @param delta how much to change the RC |
74 | */ | 76 | */ |
75 | void GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); | 77 | void |
78 | GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); | ||
76 | 79 | ||
77 | 80 | ||
78 | /** | 81 | /** |
@@ -81,7 +84,8 @@ void GNUNET_PEER_change_rc (GNUNET_PEER_Id id, int delta); | |||
81 | * @param ids array of PIDs to decrement the RCs of | 84 | * @param ids array of PIDs to decrement the RCs of |
82 | * @param count size of the ids array | 85 | * @param count size of the ids array |
83 | */ | 86 | */ |
84 | void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count); | 87 | void |
88 | GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count); | ||
85 | 89 | ||
86 | 90 | ||
87 | /** | 91 | /** |
@@ -90,7 +94,8 @@ void GNUNET_PEER_decrement_rcs (const GNUNET_PEER_Id *ids, unsigned int count); | |||
90 | * @param id interned PID to convert | 94 | * @param id interned PID to convert |
91 | * @param pid where to write the normal peer identity | 95 | * @param pid where to write the normal peer identity |
92 | */ | 96 | */ |
93 | void GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid); | 97 | void |
98 | GNUNET_PEER_resolve (GNUNET_PEER_Id id, struct GNUNET_PeerIdentity *pid); | ||
94 | 99 | ||
95 | 100 | ||
96 | /* ifndef GNUNET_PEER_LIB_H */ | 101 | /* ifndef GNUNET_PEER_LIB_H */ |
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h index 2013eb60f..50bbc458a 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h | |||
@@ -54,9 +54,8 @@ struct GNUNET_PEERINFO_Handle; | |||
54 | * @return NULL on error (configuration related, actual connection | 54 | * @return NULL on error (configuration related, actual connection |
55 | * etablishment may happen asynchronously). | 55 | * etablishment may happen asynchronously). |
56 | */ | 56 | */ |
57 | struct GNUNET_PEERINFO_Handle *GNUNET_PEERINFO_connect (const struct | 57 | struct GNUNET_PEERINFO_Handle * |
58 | GNUNET_CONFIGURATION_Handle | 58 | GNUNET_PEERINFO_connect (const struct GNUNET_CONFIGURATION_Handle *cfg); |
59 | *cfg); | ||
60 | 59 | ||
61 | 60 | ||
62 | 61 | ||
@@ -69,7 +68,8 @@ struct GNUNET_PEERINFO_Handle *GNUNET_PEERINFO_connect (const struct | |||
69 | * | 68 | * |
70 | * @param h handle to disconnect | 69 | * @param h handle to disconnect |
71 | */ | 70 | */ |
72 | void GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | 71 | void |
72 | GNUNET_PEERINFO_disconnect (struct GNUNET_PEERINFO_Handle *h); | ||
73 | 73 | ||
74 | 74 | ||
75 | /** | 75 | /** |
@@ -83,8 +83,9 @@ 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 GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, | 86 | void |
87 | const struct GNUNET_HELLO_Message *hello); | 87 | GNUNET_PEERINFO_add_peer (struct GNUNET_PEERINFO_Handle *h, |
88 | const struct GNUNET_HELLO_Message *hello); | ||
88 | 89 | ||
89 | 90 | ||
90 | /** | 91 | /** |
@@ -126,19 +127,12 @@ struct GNUNET_PEERINFO_IteratorContext; | |||
126 | * @return NULL on error (in this case, 'callback' is never called!), | 127 | * @return NULL on error (in this case, 'callback' is never called!), |
127 | * otherwise an iterator context | 128 | * otherwise an iterator context |
128 | */ | 129 | */ |
129 | struct GNUNET_PEERINFO_IteratorContext *GNUNET_PEERINFO_iterate (struct | 130 | struct GNUNET_PEERINFO_IteratorContext * |
130 | GNUNET_PEERINFO_Handle | 131 | GNUNET_PEERINFO_iterate (struct GNUNET_PEERINFO_Handle *h, |
131 | *h, | 132 | const struct GNUNET_PeerIdentity *peer, |
132 | const struct | 133 | struct GNUNET_TIME_Relative timeout, |
133 | GNUNET_PeerIdentity | 134 | GNUNET_PEERINFO_Processor callback, |
134 | *peer, | 135 | void *callback_cls); |
135 | struct | ||
136 | GNUNET_TIME_Relative | ||
137 | timeout, | ||
138 | GNUNET_PEERINFO_Processor | ||
139 | callback, | ||
140 | void | ||
141 | *callback_cls); | ||
142 | 136 | ||
143 | 137 | ||
144 | 138 | ||
@@ -147,8 +141,8 @@ struct GNUNET_PEERINFO_IteratorContext *GNUNET_PEERINFO_iterate (struct | |||
147 | * | 141 | * |
148 | * @param ic context of the iterator to cancel | 142 | * @param ic context of the iterator to cancel |
149 | */ | 143 | */ |
150 | void GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext | 144 | void |
151 | *ic); | 145 | GNUNET_PEERINFO_iterate_cancel (struct GNUNET_PEERINFO_IteratorContext *ic); |
152 | 146 | ||
153 | 147 | ||
154 | 148 | ||
@@ -170,13 +164,9 @@ struct GNUNET_PEERINFO_NotifyContext; | |||
170 | * @param callback_cls closure for callback | 164 | * @param callback_cls closure for callback |
171 | * @return NULL on error | 165 | * @return NULL on error |
172 | */ | 166 | */ |
173 | struct GNUNET_PEERINFO_NotifyContext *GNUNET_PEERINFO_notify (const struct | 167 | struct GNUNET_PEERINFO_NotifyContext * |
174 | GNUNET_CONFIGURATION_Handle | 168 | GNUNET_PEERINFO_notify (const struct GNUNET_CONFIGURATION_Handle *cfg, |
175 | *cfg, | 169 | GNUNET_PEERINFO_Processor callback, void *callback_cls); |
176 | GNUNET_PEERINFO_Processor | ||
177 | callback, | ||
178 | void | ||
179 | *callback_cls); | ||
180 | 170 | ||
181 | 171 | ||
182 | /** | 172 | /** |
@@ -184,7 +174,8 @@ struct GNUNET_PEERINFO_NotifyContext *GNUNET_PEERINFO_notify (const struct | |||
184 | * | 174 | * |
185 | * @param nc context to stop notifying | 175 | * @param nc context to stop notifying |
186 | */ | 176 | */ |
187 | void GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc); | 177 | void |
178 | GNUNET_PEERINFO_notify_cancel (struct GNUNET_PEERINFO_NotifyContext *nc); | ||
188 | 179 | ||
189 | 180 | ||
190 | #if 0 /* keep Emacsens' auto-indent happy */ | 181 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_plugin_lib.h b/src/include/gnunet_plugin_lib.h index 9608abd4c..fbc7e2617 100644 --- a/src/include/gnunet_plugin_lib.h +++ b/src/include/gnunet_plugin_lib.h | |||
@@ -59,7 +59,8 @@ typedef void *(*GNUNET_PLUGIN_Callback) (void *arg); | |||
59 | * @param library_name name of the plugin to test if it is installed | 59 | * @param library_name name of the plugin to test if it is installed |
60 | * @return GNUNET_YES if the plugin exists, GNUNET_NO if not | 60 | * @return GNUNET_YES if the plugin exists, GNUNET_NO if not |
61 | */ | 61 | */ |
62 | int GNUNET_PLUGIN_test (const char *library_name); | 62 | int |
63 | GNUNET_PLUGIN_test (const char *library_name); | ||
63 | 64 | ||
64 | /** | 65 | /** |
65 | * Setup plugin (runs the "init" callback and returns whatever "init" | 66 | * Setup plugin (runs the "init" callback and returns whatever "init" |
@@ -73,7 +74,8 @@ int GNUNET_PLUGIN_test (const char *library_name); | |||
73 | * @param arg argument to the plugin initialization function | 74 | * @param arg argument to the plugin initialization function |
74 | * @return whatever the initialization function returned, NULL on error | 75 | * @return whatever the initialization function returned, NULL on error |
75 | */ | 76 | */ |
76 | void *GNUNET_PLUGIN_load (const char *library_name, void *arg); | 77 | void * |
78 | GNUNET_PLUGIN_load (const char *library_name, void *arg); | ||
77 | 79 | ||
78 | 80 | ||
79 | /** | 81 | /** |
@@ -85,7 +87,8 @@ void *GNUNET_PLUGIN_load (const char *library_name, void *arg); | |||
85 | * @return whatever the shutdown function returned, typically NULL | 87 | * @return whatever the shutdown function returned, typically NULL |
86 | * or a "char *" representing the error message | 88 | * or a "char *" representing the error message |
87 | */ | 89 | */ |
88 | void *GNUNET_PLUGIN_unload (const char *library_name, void *arg); | 90 | void * |
91 | GNUNET_PLUGIN_unload (const char *library_name, void *arg); | ||
89 | 92 | ||
90 | 93 | ||
91 | #if 0 /* keep Emacsens' auto-indent happy */ | 94 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_program_lib.h b/src/include/gnunet_program_lib.h index 8881bfa9d..48d5280ee 100644 --- a/src/include/gnunet_program_lib.h +++ b/src/include/gnunet_program_lib.h | |||
@@ -66,10 +66,11 @@ typedef void (*GNUNET_PROGRAM_Main) (void *cls, char *const *args, | |||
66 | * @param task_cls closure for task | 66 | * @param task_cls closure for task |
67 | * @return GNUNET_SYSERR on error, GNUNET_OK on success | 67 | * @return GNUNET_SYSERR on error, GNUNET_OK on success |
68 | */ | 68 | */ |
69 | int GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName, | 69 | int |
70 | const char *binaryHelp, | 70 | GNUNET_PROGRAM_run (int argc, char *const *argv, const char *binaryName, |
71 | const struct GNUNET_GETOPT_CommandLineOption *options, | 71 | const char *binaryHelp, |
72 | GNUNET_PROGRAM_Main task, void *task_cls); | 72 | const struct GNUNET_GETOPT_CommandLineOption *options, |
73 | GNUNET_PROGRAM_Main task, void *task_cls); | ||
73 | 74 | ||
74 | 75 | ||
75 | 76 | ||
diff --git a/src/include/gnunet_pseudonym_lib.h b/src/include/gnunet_pseudonym_lib.h index 7a9373cc4..138375fe1 100644 --- a/src/include/gnunet_pseudonym_lib.h +++ b/src/include/gnunet_pseudonym_lib.h | |||
@@ -61,8 +61,9 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls, | |||
61 | * @param delta by how much should the rating be changed? | 61 | * @param delta by how much should the rating be changed? |
62 | * @return new rating of the namespace | 62 | * @return new rating of the namespace |
63 | */ | 63 | */ |
64 | int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | 64 | int |
65 | const GNUNET_HashCode * nsid, int delta); | 65 | GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, |
66 | const GNUNET_HashCode * nsid, int delta); | ||
66 | 67 | ||
67 | /** | 68 | /** |
68 | * Add a pseudonym to the set of known pseudonyms. | 69 | * Add a pseudonym to the set of known pseudonyms. |
@@ -73,9 +74,10 @@ int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
73 | * @param id the pseudonym identifier | 74 | * @param id the pseudonym identifier |
74 | * @param meta metadata for the pseudonym | 75 | * @param meta metadata for the pseudonym |
75 | */ | 76 | */ |
76 | void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | 77 | void |
77 | const GNUNET_HashCode * id, | 78 | GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, |
78 | const struct GNUNET_CONTAINER_MetaData *meta); | 79 | const GNUNET_HashCode * id, |
80 | const struct GNUNET_CONTAINER_MetaData *meta); | ||
79 | 81 | ||
80 | 82 | ||
81 | /** | 83 | /** |
@@ -86,41 +88,44 @@ void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
86 | * @param closure closure for iterator | 88 | * @param closure closure for iterator |
87 | * @return number of pseudonyms found | 89 | * @return number of pseudonyms found |
88 | */ | 90 | */ |
89 | int GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, | 91 | int |
90 | GNUNET_PSEUDONYM_Iterator iterator, | 92 | GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, |
91 | void *closure); | 93 | GNUNET_PSEUDONYM_Iterator iterator, void *closure); |
92 | 94 | ||
93 | /** | 95 | /** |
94 | * Register callback to be invoked whenever we discover | 96 | * Register callback to be invoked whenever we discover |
95 | * a new pseudonym. | 97 | * a new pseudonym. |
96 | */ | 98 | */ |
97 | int GNUNET_PSEUDONYM_discovery_callback_register (const struct | 99 | int |
98 | GNUNET_CONFIGURATION_Handle | 100 | GNUNET_PSEUDONYM_discovery_callback_register (const struct |
99 | *cfg, | 101 | GNUNET_CONFIGURATION_Handle *cfg, |
100 | GNUNET_PSEUDONYM_Iterator | 102 | GNUNET_PSEUDONYM_Iterator |
101 | iterator, void *closure); | 103 | iterator, void *closure); |
102 | 104 | ||
103 | /** | 105 | /** |
104 | * Unregister namespace discovery callback. | 106 | * Unregister namespace discovery callback. |
105 | */ | 107 | */ |
106 | int GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator | 108 | int |
107 | iterator, void *closure); | 109 | GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator |
110 | iterator, void *closure); | ||
108 | 111 | ||
109 | /** | 112 | /** |
110 | * Return the unique, human readable name for the given pseudonym. | 113 | * Return the unique, human readable name for the given pseudonym. |
111 | * | 114 | * |
112 | * @return NULL on failure (should never happen) | 115 | * @return NULL on failure (should never happen) |
113 | */ | 116 | */ |
114 | char *GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle | 117 | char * |
115 | *cfg, const GNUNET_HashCode * pseudo); | 118 | GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg, |
119 | const GNUNET_HashCode * pseudo); | ||
116 | 120 | ||
117 | /** | 121 | /** |
118 | * Get the pseudonym ID belonging to the given human readable name. | 122 | * Get the pseudonym ID belonging to the given human readable name. |
119 | * | 123 | * |
120 | * @return GNUNET_OK on success | 124 | * @return GNUNET_OK on success |
121 | */ | 125 | */ |
122 | int GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, | 126 | int |
123 | const char *hname, GNUNET_HashCode * psid); | 127 | GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, |
128 | const char *hname, GNUNET_HashCode * psid); | ||
124 | 129 | ||
125 | 130 | ||
126 | #if 0 /* keep Emacsens' auto-indent happy */ | 131 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_resolver_service.h b/src/include/gnunet_resolver_service.h index f24bf5c5e..e55a014e6 100644 --- a/src/include/gnunet_resolver_service.h +++ b/src/include/gnunet_resolver_service.h | |||
@@ -63,13 +63,15 @@ struct GNUNET_RESOLVER_RequestHandle; | |||
63 | * | 63 | * |
64 | * @param cfg configuration to use | 64 | * @param cfg configuration to use |
65 | */ | 65 | */ |
66 | void GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c); | 66 | void |
67 | GNUNET_RESOLVER_connect (const struct GNUNET_CONFIGURATION_Handle *c); | ||
67 | 68 | ||
68 | 69 | ||
69 | /** | 70 | /** |
70 | * Destroy the connection to the resolver service. | 71 | * Destroy the connection to the resolver service. |
71 | */ | 72 | */ |
72 | void GNUNET_RESOLVER_disconnect (void); | 73 | void |
74 | GNUNET_RESOLVER_disconnect (void); | ||
73 | 75 | ||
74 | 76 | ||
75 | /** | 77 | /** |
@@ -82,16 +84,11 @@ void GNUNET_RESOLVER_disconnect (void); | |||
82 | * @param timeout how long to try resolving | 84 | * @param timeout how long to try resolving |
83 | * @return handle that can be used to cancel the request, NULL on error | 85 | * @return handle that can be used to cancel the request, NULL on error |
84 | */ | 86 | */ |
85 | struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_ip_get (const char | 87 | struct GNUNET_RESOLVER_RequestHandle * |
86 | *hostname, | 88 | GNUNET_RESOLVER_ip_get (const char *hostname, int domain, |
87 | int domain, | 89 | struct GNUNET_TIME_Relative timeout, |
88 | struct | 90 | GNUNET_RESOLVER_AddressCallback callback, |
89 | GNUNET_TIME_Relative | 91 | void *callback_cls); |
90 | timeout, | ||
91 | GNUNET_RESOLVER_AddressCallback | ||
92 | callback, | ||
93 | void | ||
94 | *callback_cls); | ||
95 | 92 | ||
96 | 93 | ||
97 | /** | 94 | /** |
@@ -104,15 +101,11 @@ struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_ip_get (const char | |||
104 | * @param timeout how long to try resolving | 101 | * @param timeout how long to try resolving |
105 | * @return handle that can be used to cancel the request, NULL on error | 102 | * @return handle that can be used to cancel the request, NULL on error |
106 | */ | 103 | */ |
107 | struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_resolve (int | 104 | struct GNUNET_RESOLVER_RequestHandle * |
108 | domain, | 105 | GNUNET_RESOLVER_hostname_resolve (int domain, |
109 | struct | 106 | struct GNUNET_TIME_Relative timeout, |
110 | GNUNET_TIME_Relative | 107 | GNUNET_RESOLVER_AddressCallback callback, |
111 | timeout, | 108 | void *cls); |
112 | GNUNET_RESOLVER_AddressCallback | ||
113 | callback, | ||
114 | void | ||
115 | *cls); | ||
116 | 109 | ||
117 | 110 | ||
118 | /** | 111 | /** |
@@ -130,7 +123,8 @@ typedef void (*GNUNET_RESOLVER_HostnameCallback) (void *cls, | |||
130 | * | 123 | * |
131 | * @return local hostname, caller must free | 124 | * @return local hostname, caller must free |
132 | */ | 125 | */ |
133 | char *GNUNET_RESOLVER_local_fqdn_get (void); | 126 | char * |
127 | GNUNET_RESOLVER_local_fqdn_get (void); | ||
134 | 128 | ||
135 | 129 | ||
136 | /** | 130 | /** |
@@ -145,19 +139,12 @@ char *GNUNET_RESOLVER_local_fqdn_get (void); | |||
145 | * @param cls closure for callback | 139 | * @param cls closure for callback |
146 | * @return handle that can be used to cancel the request, NULL on error | 140 | * @return handle that can be used to cancel the request, NULL on error |
147 | */ | 141 | */ |
148 | struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_get (const struct | 142 | struct GNUNET_RESOLVER_RequestHandle * |
149 | sockaddr | 143 | GNUNET_RESOLVER_hostname_get (const struct sockaddr *sa, socklen_t salen, |
150 | *sa, | 144 | int do_resolve, |
151 | socklen_t | 145 | struct GNUNET_TIME_Relative timeout, |
152 | salen, | 146 | GNUNET_RESOLVER_HostnameCallback callback, |
153 | int | 147 | void *cls); |
154 | do_resolve, | ||
155 | struct | ||
156 | GNUNET_TIME_Relative | ||
157 | timeout, | ||
158 | GNUNET_RESOLVER_HostnameCallback | ||
159 | callback, | ||
160 | void *cls); | ||
161 | 148 | ||
162 | 149 | ||
163 | /** | 150 | /** |
@@ -168,7 +155,8 @@ struct GNUNET_RESOLVER_RequestHandle *GNUNET_RESOLVER_hostname_get (const struct | |||
168 | * | 155 | * |
169 | * @param rh handle of request to cancel | 156 | * @param rh handle of request to cancel |
170 | */ | 157 | */ |
171 | void GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh); | 158 | void |
159 | GNUNET_RESOLVER_request_cancel (struct GNUNET_RESOLVER_RequestHandle *rh); | ||
172 | 160 | ||
173 | 161 | ||
174 | #if 0 /* keep Emacsens' auto-indent happy */ | 162 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_scheduler_lib.h b/src/include/gnunet_scheduler_lib.h index 9ab3a3a84..0f80b9cee 100644 --- a/src/include/gnunet_scheduler_lib.h +++ b/src/include/gnunet_scheduler_lib.h | |||
@@ -224,7 +224,8 @@ typedef int (*GNUNET_SCHEDULER_select) (void *cls, | |||
224 | * @param task task to run first (and immediately) | 224 | * @param task task to run first (and immediately) |
225 | * @param task_cls closure of task | 225 | * @param task_cls closure of task |
226 | */ | 226 | */ |
227 | void GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); | 227 | void |
228 | GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); | ||
228 | 229 | ||
229 | 230 | ||
230 | /** | 231 | /** |
@@ -234,7 +235,8 @@ void GNUNET_SCHEDULER_run (GNUNET_SCHEDULER_Task task, void *task_cls); | |||
234 | * priorities and prerequisite tasks). Note that tasks | 235 | * priorities and prerequisite tasks). Note that tasks |
235 | * scheduled AFTER this call may still be delayed arbitrarily. | 236 | * scheduled AFTER this call may still be delayed arbitrarily. |
236 | */ | 237 | */ |
237 | void GNUNET_SCHEDULER_shutdown (); | 238 | void |
239 | GNUNET_SCHEDULER_shutdown (); | ||
238 | 240 | ||
239 | 241 | ||
240 | /** | 242 | /** |
@@ -248,7 +250,8 @@ void GNUNET_SCHEDULER_shutdown (); | |||
248 | * all priority levels | 250 | * all priority levels |
249 | * @return number of tasks pending right now | 251 | * @return number of tasks pending right now |
250 | */ | 252 | */ |
251 | unsigned int GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | 253 | unsigned int |
254 | GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | ||
252 | 255 | ||
253 | 256 | ||
254 | /** | 257 | /** |
@@ -258,7 +261,8 @@ unsigned int GNUNET_SCHEDULER_get_load (enum GNUNET_SCHEDULER_Priority p); | |||
258 | * | 261 | * |
259 | * * @return reason(s) why the current task is run | 262 | * * @return reason(s) why the current task is run |
260 | */ | 263 | */ |
261 | enum GNUNET_SCHEDULER_Reason GNUNET_SCHEDULER_get_reason (); | 264 | enum GNUNET_SCHEDULER_Reason |
265 | GNUNET_SCHEDULER_get_reason (); | ||
262 | 266 | ||
263 | 267 | ||
264 | /** | 268 | /** |
@@ -268,7 +272,8 @@ enum GNUNET_SCHEDULER_Reason GNUNET_SCHEDULER_get_reason (); | |||
268 | * * @param task id of the task to cancel | 272 | * * @param task id of the task to cancel |
269 | * @return the closure of the callback of the cancelled task | 273 | * @return the closure of the callback of the cancelled task |
270 | */ | 274 | */ |
271 | void *GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); | 275 | void * |
276 | GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); | ||
272 | 277 | ||
273 | 278 | ||
274 | /** | 279 | /** |
@@ -280,9 +285,9 @@ void *GNUNET_SCHEDULER_cancel (GNUNET_SCHEDULER_TaskIdentifier task); | |||
280 | * @param task_cls closure of task | 285 | * @param task_cls closure of task |
281 | * @param reason reason for task invocation | 286 | * @param reason reason for task invocation |
282 | */ | 287 | */ |
283 | void GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, | 288 | void |
284 | void *task_cls, | 289 | GNUNET_SCHEDULER_add_continuation (GNUNET_SCHEDULER_Task task, void *task_cls, |
285 | enum GNUNET_SCHEDULER_Reason reason); | 290 | enum GNUNET_SCHEDULER_Reason reason); |
286 | 291 | ||
287 | 292 | ||
288 | /** | 293 | /** |
@@ -315,13 +320,9 @@ GNUNET_SCHEDULER_add_after (GNUNET_SCHEDULER_TaskIdentifier prerequisite_task, | |||
315 | * @return unique task identifier for the job | 320 | * @return unique task identifier for the job |
316 | * only valid until "task" is started! | 321 | * only valid until "task" is started! |
317 | */ | 322 | */ |
318 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_with_priority (enum | 323 | GNUNET_SCHEDULER_TaskIdentifier |
319 | GNUNET_SCHEDULER_Priority | 324 | GNUNET_SCHEDULER_add_with_priority (enum GNUNET_SCHEDULER_Priority prio, |
320 | prio, | 325 | GNUNET_SCHEDULER_Task task, void *task_cls); |
321 | GNUNET_SCHEDULER_Task | ||
322 | task, | ||
323 | void | ||
324 | *task_cls); | ||
325 | 326 | ||
326 | 327 | ||
327 | /** | 328 | /** |
@@ -333,8 +334,8 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_with_priority (enum | |||
333 | * @return unique task identifier for the job | 334 | * @return unique task identifier for the job |
334 | * only valid until "task" is started! | 335 | * only valid until "task" is started! |
335 | */ | 336 | */ |
336 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task | 337 | GNUNET_SCHEDULER_TaskIdentifier |
337 | task, void *task_cls); | 338 | GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task task, void *task_cls); |
338 | 339 | ||
339 | 340 | ||
340 | /** | 341 | /** |
@@ -351,12 +352,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now (GNUNET_SCHEDULER_Task | |||
351 | * @return unique task identifier for the job | 352 | * @return unique task identifier for the job |
352 | * only valid until "task" is started! | 353 | * only valid until "task" is started! |
353 | */ | 354 | */ |
354 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now_with_lifeness (int | 355 | GNUNET_SCHEDULER_TaskIdentifier |
355 | lifeness, | 356 | GNUNET_SCHEDULER_add_now_with_lifeness (int lifeness, |
356 | GNUNET_SCHEDULER_Task | 357 | GNUNET_SCHEDULER_Task task, |
357 | task, | 358 | void *task_cls); |
358 | void | ||
359 | *task_cls); | ||
360 | 359 | ||
361 | 360 | ||
362 | /** | 361 | /** |
@@ -371,12 +370,9 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_now_with_lifeness (int | |||
371 | * @return unique task identifier for the job | 370 | * @return unique task identifier for the job |
372 | * only valid until "task" is started! | 371 | * only valid until "task" is started! |
373 | */ | 372 | */ |
374 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_delayed (struct | 373 | GNUNET_SCHEDULER_TaskIdentifier |
375 | GNUNET_TIME_Relative | 374 | GNUNET_SCHEDULER_add_delayed (struct GNUNET_TIME_Relative delay, |
376 | delay, | 375 | GNUNET_SCHEDULER_Task task, void *task_cls); |
377 | GNUNET_SCHEDULER_Task | ||
378 | task, | ||
379 | void *task_cls); | ||
380 | 376 | ||
381 | 377 | ||
382 | /** | 378 | /** |
@@ -395,15 +391,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_delayed (struct | |||
395 | * @return unique task identifier for the job | 391 | * @return unique task identifier for the job |
396 | * only valid until "task" is started! | 392 | * only valid until "task" is started! |
397 | */ | 393 | */ |
398 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_net (struct | 394 | GNUNET_SCHEDULER_TaskIdentifier |
399 | GNUNET_TIME_Relative | 395 | GNUNET_SCHEDULER_add_read_net (struct GNUNET_TIME_Relative delay, |
400 | delay, | 396 | struct GNUNET_NETWORK_Handle *rfd, |
401 | struct | 397 | GNUNET_SCHEDULER_Task task, void *task_cls); |
402 | GNUNET_NETWORK_Handle | ||
403 | *rfd, | ||
404 | GNUNET_SCHEDULER_Task | ||
405 | task, | ||
406 | void *task_cls); | ||
407 | 398 | ||
408 | 399 | ||
409 | /** | 400 | /** |
@@ -422,15 +413,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_net (struct | |||
422 | * @return unique task identifier for the job | 413 | * @return unique task identifier for the job |
423 | * only valid until "task" is started! | 414 | * only valid until "task" is started! |
424 | */ | 415 | */ |
425 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_net (struct | 416 | GNUNET_SCHEDULER_TaskIdentifier |
426 | GNUNET_TIME_Relative | 417 | GNUNET_SCHEDULER_add_write_net (struct GNUNET_TIME_Relative delay, |
427 | delay, | 418 | struct GNUNET_NETWORK_Handle *wfd, |
428 | struct | 419 | GNUNET_SCHEDULER_Task task, void *task_cls); |
429 | GNUNET_NETWORK_Handle | ||
430 | *wfd, | ||
431 | GNUNET_SCHEDULER_Task | ||
432 | task, | ||
433 | void *task_cls); | ||
434 | 420 | ||
435 | 421 | ||
436 | /** | 422 | /** |
@@ -449,15 +435,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_net (struct | |||
449 | * @return unique task identifier for the job | 435 | * @return unique task identifier for the job |
450 | * only valid until "task" is started! | 436 | * only valid until "task" is started! |
451 | */ | 437 | */ |
452 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_file (struct | 438 | GNUNET_SCHEDULER_TaskIdentifier |
453 | GNUNET_TIME_Relative | 439 | GNUNET_SCHEDULER_add_read_file (struct GNUNET_TIME_Relative delay, |
454 | delay, | 440 | const struct GNUNET_DISK_FileHandle *rfd, |
455 | const struct | 441 | GNUNET_SCHEDULER_Task task, void *task_cls); |
456 | GNUNET_DISK_FileHandle | ||
457 | *rfd, | ||
458 | GNUNET_SCHEDULER_Task | ||
459 | task, | ||
460 | void *task_cls); | ||
461 | 442 | ||
462 | 443 | ||
463 | /** | 444 | /** |
@@ -476,16 +457,10 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_read_file (struct | |||
476 | * @return unique task identifier for the job | 457 | * @return unique task identifier for the job |
477 | * only valid until "task" is started! | 458 | * only valid until "task" is started! |
478 | */ | 459 | */ |
479 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_file (struct | 460 | GNUNET_SCHEDULER_TaskIdentifier |
480 | GNUNET_TIME_Relative | 461 | GNUNET_SCHEDULER_add_write_file (struct GNUNET_TIME_Relative delay, |
481 | delay, | 462 | const struct GNUNET_DISK_FileHandle *wfd, |
482 | const struct | 463 | GNUNET_SCHEDULER_Task task, void *task_cls); |
483 | GNUNET_DISK_FileHandle | ||
484 | *wfd, | ||
485 | GNUNET_SCHEDULER_Task | ||
486 | task, | ||
487 | void | ||
488 | *task_cls); | ||
489 | 464 | ||
490 | 465 | ||
491 | /** | 466 | /** |
@@ -520,23 +495,13 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_write_file (struct | |||
520 | * @return unique task identifier for the job | 495 | * @return unique task identifier for the job |
521 | * only valid until "task" is started! | 496 | * only valid until "task" is started! |
522 | */ | 497 | */ |
523 | GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_select (enum | 498 | GNUNET_SCHEDULER_TaskIdentifier |
524 | GNUNET_SCHEDULER_Priority | 499 | GNUNET_SCHEDULER_add_select (enum GNUNET_SCHEDULER_Priority prio, |
525 | prio, | 500 | GNUNET_SCHEDULER_TaskIdentifier prerequisite_task, |
526 | GNUNET_SCHEDULER_TaskIdentifier | 501 | struct GNUNET_TIME_Relative delay, |
527 | prerequisite_task, | 502 | const struct GNUNET_NETWORK_FDSet *rs, |
528 | struct | 503 | const struct GNUNET_NETWORK_FDSet *ws, |
529 | GNUNET_TIME_Relative | 504 | 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); | ||
540 | 505 | ||
541 | /** | 506 | /** |
542 | * Sets the select function to use in the scheduler (scheduler_select). | 507 | * Sets the select function to use in the scheduler (scheduler_select). |
@@ -544,8 +509,9 @@ GNUNET_SCHEDULER_TaskIdentifier GNUNET_SCHEDULER_add_select (enum | |||
544 | * @param new_select new select function to use (NULL to reset to default) | 509 | * @param new_select new select function to use (NULL to reset to default) |
545 | * @param new_select_cls closure for 'new_select' | 510 | * @param new_select_cls closure for 'new_select' |
546 | */ | 511 | */ |
547 | void GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, | 512 | void |
548 | void *new_select_cls); | 513 | GNUNET_SCHEDULER_set_select (GNUNET_SCHEDULER_select new_select, |
514 | void *new_select_cls); | ||
549 | 515 | ||
550 | 516 | ||
551 | #if 0 /* keep Emacsens' auto-indent happy */ | 517 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_server_lib.h b/src/include/gnunet_server_lib.h index d9663ac82..3d8130c60 100644 --- a/src/include/gnunet_server_lib.h +++ b/src/include/gnunet_server_lib.h | |||
@@ -122,12 +122,12 @@ struct GNUNET_SERVER_MessageHandler | |||
122 | * @return handle for the new server, NULL on error | 122 | * @return handle for the new server, NULL on error |
123 | * (typically, "port" already in use) | 123 | * (typically, "port" already in use) |
124 | */ | 124 | */ |
125 | struct GNUNET_SERVER_Handle | 125 | struct GNUNET_SERVER_Handle * |
126 | *GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, | 126 | GNUNET_SERVER_create_with_sockets (GNUNET_CONNECTION_AccessCheck access, |
127 | void *access_cls, | 127 | void *access_cls, |
128 | struct GNUNET_NETWORK_Handle **lsocks, | 128 | struct GNUNET_NETWORK_Handle **lsocks, |
129 | struct GNUNET_TIME_Relative | 129 | struct GNUNET_TIME_Relative idle_timeout, |
130 | idle_timeout, int require_found); | 130 | int require_found); |
131 | 131 | ||
132 | /** | 132 | /** |
133 | * Create a new server. | 133 | * Create a new server. |
@@ -142,14 +142,12 @@ struct GNUNET_SERVER_Handle | |||
142 | * @return handle for the new server, NULL on error | 142 | * @return handle for the new server, NULL on error |
143 | * (typically, "port" already in use) | 143 | * (typically, "port" already in use) |
144 | */ | 144 | */ |
145 | struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck | 145 | struct GNUNET_SERVER_Handle * |
146 | access, void *access_cls, | 146 | GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck access, void *access_cls, |
147 | struct sockaddr *const | 147 | struct sockaddr *const *serverAddr, |
148 | *serverAddr, | 148 | const socklen_t * socklen, |
149 | const socklen_t * socklen, | 149 | struct GNUNET_TIME_Relative idle_timeout, |
150 | struct GNUNET_TIME_Relative | 150 | int require_found); |
151 | idle_timeout, | ||
152 | int require_found); | ||
153 | 151 | ||
154 | 152 | ||
155 | /** | 153 | /** |
@@ -157,7 +155,8 @@ struct GNUNET_SERVER_Handle *GNUNET_SERVER_create (GNUNET_CONNECTION_AccessCheck | |||
157 | * | 155 | * |
158 | * @param s server to destroy | 156 | * @param s server to destroy |
159 | */ | 157 | */ |
160 | void GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); | 158 | void |
159 | GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); | ||
161 | 160 | ||
162 | 161 | ||
163 | /** | 162 | /** |
@@ -173,9 +172,10 @@ void GNUNET_SERVER_destroy (struct GNUNET_SERVER_Handle *s); | |||
173 | * the handlers array must exist until removed | 172 | * the handlers array must exist until removed |
174 | * (or server is destroyed). | 173 | * (or server is destroyed). |
175 | */ | 174 | */ |
176 | void GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, | 175 | void |
177 | const struct GNUNET_SERVER_MessageHandler | 176 | GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, |
178 | *handlers); | 177 | const struct GNUNET_SERVER_MessageHandler |
178 | *handlers); | ||
179 | 179 | ||
180 | 180 | ||
181 | /** | 181 | /** |
@@ -193,12 +193,12 @@ void GNUNET_SERVER_add_handlers (struct GNUNET_SERVER_Handle *server, | |||
193 | * GNUNET_CONNECTION_notify_transmit_ready_cancel. | 193 | * GNUNET_CONNECTION_notify_transmit_ready_cancel. |
194 | * NULL if we are already going to notify someone else (busy) | 194 | * NULL if we are already going to notify someone else (busy) |
195 | */ | 195 | */ |
196 | struct GNUNET_CONNECTION_TransmitHandle | 196 | struct GNUNET_CONNECTION_TransmitHandle * |
197 | *GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client, | 197 | GNUNET_SERVER_notify_transmit_ready (struct GNUNET_SERVER_Client *client, |
198 | size_t size, | 198 | size_t size, |
199 | struct GNUNET_TIME_Relative timeout, | 199 | struct GNUNET_TIME_Relative timeout, |
200 | GNUNET_CONNECTION_TransmitReadyNotify | 200 | GNUNET_CONNECTION_TransmitReadyNotify |
201 | callback, void *callback_cls); | 201 | callback, void *callback_cls); |
202 | 202 | ||
203 | 203 | ||
204 | /** | 204 | /** |
@@ -207,7 +207,8 @@ struct GNUNET_CONNECTION_TransmitHandle | |||
207 | * | 207 | * |
208 | * @param client the client to set the persistent flag on | 208 | * @param client the client to set the persistent flag on |
209 | */ | 209 | */ |
210 | void GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); | 210 | void |
211 | GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); | ||
211 | 212 | ||
212 | /** | 213 | /** |
213 | * Resume receiving from this client, we are done processing the | 214 | * Resume receiving from this client, we are done processing the |
@@ -221,8 +222,8 @@ void GNUNET_SERVER_client_persist_ (struct GNUNET_SERVER_Client *client); | |||
221 | * GNUNET_SYSERR to close the connection (signal | 222 | * GNUNET_SYSERR to close the connection (signal |
222 | * serious error) | 223 | * serious error) |
223 | */ | 224 | */ |
224 | void GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, | 225 | void |
225 | int success); | 226 | GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, int success); |
226 | 227 | ||
227 | 228 | ||
228 | /** | 229 | /** |
@@ -233,8 +234,9 @@ void GNUNET_SERVER_receive_done (struct GNUNET_SERVER_Client *client, | |||
233 | * @param client the client to update | 234 | * @param client the client to update |
234 | * @param timeout new timeout for activities on the socket | 235 | * @param timeout new timeout for activities on the socket |
235 | */ | 236 | */ |
236 | void GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, | 237 | void |
237 | struct GNUNET_TIME_Relative timeout); | 238 | GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, |
239 | struct GNUNET_TIME_Relative timeout); | ||
238 | 240 | ||
239 | 241 | ||
240 | /** | 242 | /** |
@@ -244,8 +246,9 @@ void GNUNET_SERVER_client_set_timeout (struct GNUNET_SERVER_Client *client, | |||
244 | * | 246 | * |
245 | * @param client client for which to disable the warning | 247 | * @param client client for which to disable the warning |
246 | */ | 248 | */ |
247 | void GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client | 249 | void |
248 | *client); | 250 | GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client |
251 | *client); | ||
249 | 252 | ||
250 | 253 | ||
251 | /** | 254 | /** |
@@ -263,9 +266,10 @@ void GNUNET_SERVER_disable_receive_done_warning (struct GNUNET_SERVER_Client | |||
263 | * GNUNET_SYSERR if the connection to the | 266 | * GNUNET_SYSERR if the connection to the |
264 | * client should be shut down | 267 | * client should be shut down |
265 | */ | 268 | */ |
266 | int GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, | 269 | int |
267 | struct GNUNET_SERVER_Client *sender, | 270 | GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, |
268 | const struct GNUNET_MessageHeader *message); | 271 | struct GNUNET_SERVER_Client *sender, |
272 | const struct GNUNET_MessageHeader *message); | ||
269 | 273 | ||
270 | 274 | ||
271 | /** | 275 | /** |
@@ -280,12 +284,9 @@ int GNUNET_SERVER_inject (struct GNUNET_SERVER_Handle *server, | |||
280 | * @return the client handle (client should call | 284 | * @return the client handle (client should call |
281 | * "client_drop" on the return value eventually) | 285 | * "client_drop" on the return value eventually) |
282 | */ | 286 | */ |
283 | struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct | 287 | struct GNUNET_SERVER_Client * |
284 | GNUNET_SERVER_Handle | 288 | GNUNET_SERVER_connect_socket (struct GNUNET_SERVER_Handle *server, |
285 | *server, | 289 | struct GNUNET_CONNECTION_Handle *connection); |
286 | struct | ||
287 | GNUNET_CONNECTION_Handle | ||
288 | *connection); | ||
289 | 290 | ||
290 | 291 | ||
291 | /** | 292 | /** |
@@ -295,7 +296,8 @@ struct GNUNET_SERVER_Client *GNUNET_SERVER_connect_socket (struct | |||
295 | * | 296 | * |
296 | * @param client the client to keep | 297 | * @param client the client to keep |
297 | */ | 298 | */ |
298 | void GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client); | 299 | void |
300 | GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client); | ||
299 | 301 | ||
300 | 302 | ||
301 | /** | 303 | /** |
@@ -306,7 +308,8 @@ void GNUNET_SERVER_client_keep (struct GNUNET_SERVER_Client *client); | |||
306 | * | 308 | * |
307 | * @param client the client to drop | 309 | * @param client the client to drop |
308 | */ | 310 | */ |
309 | void GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); | 311 | void |
312 | GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); | ||
310 | 313 | ||
311 | 314 | ||
312 | /** | 315 | /** |
@@ -317,8 +320,9 @@ void GNUNET_SERVER_client_drop (struct GNUNET_SERVER_Client *client); | |||
317 | * @param addrlen where to store the length of the address | 320 | * @param addrlen where to store the length of the address |
318 | * @return GNUNET_OK on success | 321 | * @return GNUNET_OK on success |
319 | */ | 322 | */ |
320 | int GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, | 323 | int |
321 | void **addr, size_t * addrlen); | 324 | GNUNET_SERVER_client_get_address (struct GNUNET_SERVER_Client *client, |
325 | void **addr, size_t * addrlen); | ||
322 | 326 | ||
323 | 327 | ||
324 | /** | 328 | /** |
@@ -348,9 +352,10 @@ typedef void (*GNUNET_SERVER_DisconnectCallback) (void *cls, | |||
348 | * @param callback function to call on disconnect | 352 | * @param callback function to call on disconnect |
349 | * @param callback_cls closure for callback | 353 | * @param callback_cls closure for callback |
350 | */ | 354 | */ |
351 | void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, | 355 | void |
352 | GNUNET_SERVER_DisconnectCallback callback, | 356 | GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, |
353 | void *callback_cls); | 357 | GNUNET_SERVER_DisconnectCallback callback, |
358 | void *callback_cls); | ||
354 | 359 | ||
355 | 360 | ||
356 | /** | 361 | /** |
@@ -360,10 +365,10 @@ void GNUNET_SERVER_disconnect_notify (struct GNUNET_SERVER_Handle *server, | |||
360 | * @param callback function to call on disconnect | 365 | * @param callback function to call on disconnect |
361 | * @param callback_cls closure for callback | 366 | * @param callback_cls closure for callback |
362 | */ | 367 | */ |
363 | void GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle | 368 | void |
364 | *server, | 369 | GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle *server, |
365 | GNUNET_SERVER_DisconnectCallback | 370 | GNUNET_SERVER_DisconnectCallback |
366 | callback, void *callback_cls); | 371 | callback, void *callback_cls); |
367 | 372 | ||
368 | 373 | ||
369 | /** | 374 | /** |
@@ -374,7 +379,8 @@ void GNUNET_SERVER_disconnect_notify_cancel (struct GNUNET_SERVER_Handle | |||
374 | * | 379 | * |
375 | * @param client the client to disconnect from | 380 | * @param client the client to disconnect from |
376 | */ | 381 | */ |
377 | void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); | 382 | void |
383 | GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); | ||
378 | 384 | ||
379 | 385 | ||
380 | /** | 386 | /** |
@@ -388,8 +394,8 @@ void GNUNET_SERVER_client_disconnect (struct GNUNET_SERVER_Client *client); | |||
388 | * @param h server handle | 394 | * @param h server handle |
389 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default | 395 | * @param do_ignore GNUNET_YES to ignore, GNUNET_NO to restore default |
390 | */ | 396 | */ |
391 | void GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, | 397 | void |
392 | int do_ignore); | 398 | GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, int do_ignore); |
393 | 399 | ||
394 | 400 | ||
395 | 401 | ||
@@ -401,7 +407,8 @@ void GNUNET_SERVER_ignore_shutdown (struct GNUNET_SERVER_Handle *h, | |||
401 | * @param client handle to the client | 407 | * @param client handle to the client |
402 | * @return GNUNET_OK on success | 408 | * @return GNUNET_OK on success |
403 | */ | 409 | */ |
404 | int GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client); | 410 | int |
411 | GNUNET_SERVER_client_disable_corking (struct GNUNET_SERVER_Client *client); | ||
405 | 412 | ||
406 | 413 | ||
407 | /** | 414 | /** |
@@ -419,9 +426,8 @@ struct GNUNET_SERVER_TransmitContext; | |||
419 | * @param client client to create the context for. | 426 | * @param client client to create the context for. |
420 | * @return NULL on error | 427 | * @return NULL on error |
421 | */ | 428 | */ |
422 | struct GNUNET_SERVER_TransmitContext | 429 | struct GNUNET_SERVER_TransmitContext * |
423 | *GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client | 430 | GNUNET_SERVER_transmit_context_create (struct GNUNET_SERVER_Client *client); |
424 | *client); | ||
425 | 431 | ||
426 | 432 | ||
427 | /** | 433 | /** |
@@ -434,10 +440,10 @@ struct GNUNET_SERVER_TransmitContext | |||
434 | * @param length length of data | 440 | * @param length length of data |
435 | * @param type type of the message | 441 | * @param type type of the message |
436 | */ | 442 | */ |
437 | void GNUNET_SERVER_transmit_context_append_data (struct | 443 | void |
438 | GNUNET_SERVER_TransmitContext | 444 | GNUNET_SERVER_transmit_context_append_data (struct GNUNET_SERVER_TransmitContext |
439 | *tc, const void *data, | 445 | *tc, const void *data, |
440 | size_t length, uint16_t type); | 446 | size_t length, uint16_t type); |
441 | 447 | ||
442 | 448 | ||
443 | /** | 449 | /** |
@@ -448,11 +454,12 @@ void GNUNET_SERVER_transmit_context_append_data (struct | |||
448 | * @param tc context to use | 454 | * @param tc context to use |
449 | * @param msg message to append | 455 | * @param msg message to append |
450 | */ | 456 | */ |
451 | void GNUNET_SERVER_transmit_context_append_message (struct | 457 | void |
452 | GNUNET_SERVER_TransmitContext | 458 | GNUNET_SERVER_transmit_context_append_message (struct |
453 | *tc, | 459 | GNUNET_SERVER_TransmitContext |
454 | const struct | 460 | *tc, |
455 | GNUNET_MessageHeader *msg); | 461 | const struct GNUNET_MessageHeader |
462 | *msg); | ||
456 | 463 | ||
457 | 464 | ||
458 | /** | 465 | /** |
@@ -464,9 +471,9 @@ void GNUNET_SERVER_transmit_context_append_message (struct | |||
464 | * @param tc transmission context to use | 471 | * @param tc transmission context to use |
465 | * @param timeout when to time out and abort the transmission | 472 | * @param timeout when to time out and abort the transmission |
466 | */ | 473 | */ |
467 | void GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext | 474 | void |
468 | *tc, | 475 | GNUNET_SERVER_transmit_context_run (struct GNUNET_SERVER_TransmitContext *tc, |
469 | struct GNUNET_TIME_Relative timeout); | 476 | struct GNUNET_TIME_Relative timeout); |
470 | 477 | ||
471 | 478 | ||
472 | 479 | ||
@@ -490,10 +497,9 @@ struct GNUNET_SERVER_NotificationContext; | |||
490 | * if the queue gets longer than this number of messages | 497 | * if the queue gets longer than this number of messages |
491 | * @return handle to the notification context | 498 | * @return handle to the notification context |
492 | */ | 499 | */ |
493 | struct GNUNET_SERVER_NotificationContext | 500 | struct GNUNET_SERVER_NotificationContext * |
494 | *GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle | 501 | GNUNET_SERVER_notification_context_create (struct GNUNET_SERVER_Handle *server, |
495 | *server, | 502 | unsigned int queue_length); |
496 | unsigned int queue_length); | ||
497 | 503 | ||
498 | 504 | ||
499 | /** | 505 | /** |
@@ -501,9 +507,10 @@ struct GNUNET_SERVER_NotificationContext | |||
501 | * | 507 | * |
502 | * @param nc context to destroy. | 508 | * @param nc context to destroy. |
503 | */ | 509 | */ |
504 | void GNUNET_SERVER_notification_context_destroy (struct | 510 | void |
505 | GNUNET_SERVER_NotificationContext | 511 | GNUNET_SERVER_notification_context_destroy (struct |
506 | *nc); | 512 | GNUNET_SERVER_NotificationContext |
513 | *nc); | ||
507 | 514 | ||
508 | 515 | ||
509 | /** | 516 | /** |
@@ -512,11 +519,10 @@ void GNUNET_SERVER_notification_context_destroy (struct | |||
512 | * @param nc context to modify | 519 | * @param nc context to modify |
513 | * @param client client to add | 520 | * @param client client to add |
514 | */ | 521 | */ |
515 | void GNUNET_SERVER_notification_context_add (struct | 522 | void |
516 | GNUNET_SERVER_NotificationContext | 523 | GNUNET_SERVER_notification_context_add (struct GNUNET_SERVER_NotificationContext |
517 | *nc, | 524 | *nc, |
518 | struct GNUNET_SERVER_Client | 525 | struct GNUNET_SERVER_Client *client); |
519 | *client); | ||
520 | 526 | ||
521 | 527 | ||
522 | /** | 528 | /** |
@@ -528,14 +534,13 @@ void GNUNET_SERVER_notification_context_add (struct | |||
528 | * @param msg message to send | 534 | * @param msg message to send |
529 | * @param can_drop can this message be dropped due to queue length limitations | 535 | * @param can_drop can this message be dropped due to queue length limitations |
530 | */ | 536 | */ |
531 | void GNUNET_SERVER_notification_context_unicast (struct | 537 | void |
532 | GNUNET_SERVER_NotificationContext | 538 | GNUNET_SERVER_notification_context_unicast (struct |
533 | *nc, | 539 | GNUNET_SERVER_NotificationContext |
534 | struct GNUNET_SERVER_Client | 540 | *nc, |
535 | *client, | 541 | struct GNUNET_SERVER_Client *client, |
536 | const struct | 542 | const struct GNUNET_MessageHeader |
537 | GNUNET_MessageHeader *msg, | 543 | *msg, int can_drop); |
538 | int can_drop); | ||
539 | 544 | ||
540 | 545 | ||
541 | /** | 546 | /** |
@@ -545,12 +550,12 @@ void GNUNET_SERVER_notification_context_unicast (struct | |||
545 | * @param msg message to send | 550 | * @param msg message to send |
546 | * @param can_drop can this message be dropped due to queue length limitations | 551 | * @param can_drop can this message be dropped due to queue length limitations |
547 | */ | 552 | */ |
548 | void GNUNET_SERVER_notification_context_broadcast (struct | 553 | void |
549 | GNUNET_SERVER_NotificationContext | 554 | GNUNET_SERVER_notification_context_broadcast (struct |
550 | *nc, | 555 | GNUNET_SERVER_NotificationContext |
551 | const struct | 556 | *nc, |
552 | GNUNET_MessageHeader *msg, | 557 | const struct GNUNET_MessageHeader |
553 | int can_drop); | 558 | *msg, int can_drop); |
554 | 559 | ||
555 | 560 | ||
556 | 561 | ||
@@ -580,9 +585,9 @@ typedef void (*GNUNET_SERVER_MessageTokenizerCallback) (void *cls, void *client, | |||
580 | * @param cb_cls closure for cb | 585 | * @param cb_cls closure for cb |
581 | * @return handle to tokenizer | 586 | * @return handle to tokenizer |
582 | */ | 587 | */ |
583 | struct GNUNET_SERVER_MessageStreamTokenizer | 588 | struct GNUNET_SERVER_MessageStreamTokenizer * |
584 | *GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb, | 589 | GNUNET_SERVER_mst_create (GNUNET_SERVER_MessageTokenizerCallback cb, |
585 | void *cb_cls); | 590 | void *cb_cls); |
586 | 591 | ||
587 | 592 | ||
588 | /** | 593 | /** |
@@ -601,9 +606,10 @@ struct GNUNET_SERVER_MessageStreamTokenizer | |||
601 | * GNUNET_NO if one_shot was set and we have another message ready | 606 | * GNUNET_NO if one_shot was set and we have another message ready |
602 | * GNUNET_SYSERR if the data stream is corrupt | 607 | * GNUNET_SYSERR if the data stream is corrupt |
603 | */ | 608 | */ |
604 | int GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, | 609 | int |
605 | void *client_identity, const char *buf, | 610 | GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, |
606 | size_t size, int purge, int one_shot); | 611 | void *client_identity, const char *buf, size_t size, |
612 | int purge, int one_shot); | ||
607 | 613 | ||
608 | 614 | ||
609 | /** | 615 | /** |
@@ -611,8 +617,8 @@ int GNUNET_SERVER_mst_receive (struct GNUNET_SERVER_MessageStreamTokenizer *mst, | |||
611 | * | 617 | * |
612 | * @param mst tokenizer to destroy | 618 | * @param mst tokenizer to destroy |
613 | */ | 619 | */ |
614 | void GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer | 620 | void |
615 | *mst); | 621 | GNUNET_SERVER_mst_destroy (struct GNUNET_SERVER_MessageStreamTokenizer *mst); |
616 | 622 | ||
617 | 623 | ||
618 | #if 0 /* keep Emacsens' auto-indent happy */ | 624 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h index 79453cbf6..1641e0f93 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 GNUNET_SERVICE_get_server_addresses (const char *serviceName, | 62 | int |
63 | const struct | 63 | GNUNET_SERVICE_get_server_addresses (const char *serviceName, |
64 | GNUNET_CONFIGURATION_Handle *cfg, | 64 | const struct GNUNET_CONFIGURATION_Handle |
65 | struct sockaddr ***addrs, | 65 | *cfg, struct sockaddr ***addrs, |
66 | socklen_t ** addr_lens); | 66 | socklen_t ** addr_lens); |
67 | 67 | ||
68 | 68 | ||
69 | /** | 69 | /** |
@@ -111,9 +111,10 @@ 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 GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName, | 114 | int |
115 | enum GNUNET_SERVICE_Options opt, | 115 | GNUNET_SERVICE_run (int argc, char *const *argv, const char *serviceName, |
116 | GNUNET_SERVICE_Main task, void *task_cls); | 116 | enum GNUNET_SERVICE_Options opt, GNUNET_SERVICE_Main task, |
117 | void *task_cls); | ||
117 | 118 | ||
118 | 119 | ||
119 | struct GNUNET_SERVICE_Context; | 120 | struct GNUNET_SERVICE_Context; |
@@ -126,10 +127,9 @@ struct GNUNET_SERVICE_Context; | |||
126 | * @param cfg configuration to use | 127 | * @param cfg configuration to use |
127 | * @return NULL on error, service handle | 128 | * @return NULL on error, service handle |
128 | */ | 129 | */ |
129 | struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName, | 130 | struct GNUNET_SERVICE_Context * |
130 | const struct | 131 | GNUNET_SERVICE_start (const char *serviceName, |
131 | GNUNET_CONFIGURATION_Handle | 132 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
132 | *cfg); | ||
133 | 133 | ||
134 | 134 | ||
135 | /** | 135 | /** |
@@ -139,9 +139,8 @@ struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName, | |||
139 | * @param ctx the service context returned from the start function | 139 | * @param ctx the service context returned from the start function |
140 | * @return handle to the server for this service, NULL if there is none | 140 | * @return handle to the server for this service, NULL if there is none |
141 | */ | 141 | */ |
142 | struct GNUNET_SERVER_Handle *GNUNET_SERVICE_get_server (struct | 142 | struct GNUNET_SERVER_Handle * |
143 | GNUNET_SERVICE_Context | 143 | GNUNET_SERVICE_get_server (struct GNUNET_SERVICE_Context *ctx); |
144 | *ctx); | ||
145 | 144 | ||
146 | 145 | ||
147 | /** | 146 | /** |
@@ -149,7 +148,8 @@ struct GNUNET_SERVER_Handle *GNUNET_SERVICE_get_server (struct | |||
149 | * | 148 | * |
150 | * @param sctx the service context returned from the start function | 149 | * @param sctx the service context returned from the start function |
151 | */ | 150 | */ |
152 | void GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx); | 151 | void |
152 | GNUNET_SERVICE_stop (struct GNUNET_SERVICE_Context *sctx); | ||
153 | 153 | ||
154 | 154 | ||
155 | #if 0 /* keep Emacsens' auto-indent happy */ | 155 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_signal_lib.h b/src/include/gnunet_signal_lib.h index e386ccc0e..1597c76d0 100644 --- a/src/include/gnunet_signal_lib.h +++ b/src/include/gnunet_signal_lib.h | |||
@@ -59,9 +59,8 @@ typedef void (*GNUNET_SIGNAL_Handler) (void); | |||
59 | * @param handler the function to call | 59 | * @param handler the function to call |
60 | * @return context that can be used to restore, NULL on error | 60 | * @return context that can be used to restore, NULL on error |
61 | */ | 61 | */ |
62 | struct GNUNET_SIGNAL_Context *GNUNET_SIGNAL_handler_install (int signal, | 62 | struct GNUNET_SIGNAL_Context * |
63 | GNUNET_SIGNAL_Handler | 63 | GNUNET_SIGNAL_handler_install (int signal, GNUNET_SIGNAL_Handler handler); |
64 | handler); | ||
65 | 64 | ||
66 | /** | 65 | /** |
67 | * Uninstall a previously installed signal hander. | 66 | * Uninstall a previously installed signal hander. |
@@ -69,7 +68,8 @@ struct GNUNET_SIGNAL_Context *GNUNET_SIGNAL_handler_install (int signal, | |||
69 | * @param ctx context that was returned when the | 68 | * @param ctx context that was returned when the |
70 | * signal handler was installed | 69 | * signal handler was installed |
71 | */ | 70 | */ |
72 | void GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx); | 71 | void |
72 | GNUNET_SIGNAL_handler_uninstall (struct GNUNET_SIGNAL_Context *ctx); | ||
73 | 73 | ||
74 | 74 | ||
75 | #if 0 /* keep Emacsens' auto-indent happy */ | 75 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h index 90cc612df..c246e7cda 100644 --- a/src/include/gnunet_statistics_service.h +++ b/src/include/gnunet_statistics_service.h | |||
@@ -72,11 +72,9 @@ typedef int (*GNUNET_STATISTICS_Iterator) (void *cls, const char *subsystem, | |||
72 | * @param cfg services configuration in use | 72 | * @param cfg services configuration in use |
73 | * @return handle to use | 73 | * @return handle to use |
74 | */ | 74 | */ |
75 | struct GNUNET_STATISTICS_Handle *GNUNET_STATISTICS_create (const char | 75 | struct GNUNET_STATISTICS_Handle * |
76 | *subsystem, | 76 | GNUNET_STATISTICS_create (const char *subsystem, |
77 | const struct | 77 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
78 | GNUNET_CONFIGURATION_Handle | ||
79 | *cfg); | ||
80 | 78 | ||
81 | 79 | ||
82 | /** | 80 | /** |
@@ -87,8 +85,8 @@ struct GNUNET_STATISTICS_Handle *GNUNET_STATISTICS_create (const char | |||
87 | * @param sync_first set to GNUNET_YES if pending SET requests should | 85 | * @param sync_first set to GNUNET_YES if pending SET requests should |
88 | * be completed | 86 | * be completed |
89 | */ | 87 | */ |
90 | void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, | 88 | void |
91 | int sync_first); | 89 | GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, int sync_first); |
92 | 90 | ||
93 | 91 | ||
94 | /** | 92 | /** |
@@ -103,9 +101,10 @@ void GNUNET_STATISTICS_destroy (struct GNUNET_STATISTICS_Handle *h, | |||
103 | * @param proc_cls closure for proc | 101 | * @param proc_cls closure for proc |
104 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 102 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
105 | */ | 103 | */ |
106 | int GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, | 104 | int |
107 | const char *subsystem, const char *name, | 105 | GNUNET_STATISTICS_watch (struct GNUNET_STATISTICS_Handle *handle, |
108 | GNUNET_STATISTICS_Iterator proc, void *proc_cls); | 106 | const char *subsystem, const char *name, |
107 | GNUNET_STATISTICS_Iterator proc, void *proc_cls); | ||
109 | 108 | ||
110 | 109 | ||
111 | /** | 110 | /** |
@@ -135,19 +134,12 @@ struct GNUNET_STATISTICS_GetHandle; | |||
135 | * @param cls closure for proc and cont | 134 | * @param cls closure for proc and cont |
136 | * @return NULL on error | 135 | * @return NULL on error |
137 | */ | 136 | */ |
138 | struct GNUNET_STATISTICS_GetHandle *GNUNET_STATISTICS_get (struct | 137 | struct GNUNET_STATISTICS_GetHandle * |
139 | GNUNET_STATISTICS_Handle | 138 | GNUNET_STATISTICS_get (struct GNUNET_STATISTICS_Handle *handle, |
140 | *handle, | 139 | const char *subsystem, const char *name, |
141 | const char | 140 | struct GNUNET_TIME_Relative timeout, |
142 | *subsystem, | 141 | GNUNET_STATISTICS_Callback cont, |
143 | const char *name, | 142 | GNUNET_STATISTICS_Iterator proc, void *cls); |
144 | struct | ||
145 | GNUNET_TIME_Relative | ||
146 | timeout, | ||
147 | GNUNET_STATISTICS_Callback | ||
148 | cont, | ||
149 | GNUNET_STATISTICS_Iterator | ||
150 | proc, void *cls); | ||
151 | 143 | ||
152 | 144 | ||
153 | /** | 145 | /** |
@@ -156,7 +148,8 @@ struct GNUNET_STATISTICS_GetHandle *GNUNET_STATISTICS_get (struct | |||
156 | * | 148 | * |
157 | * @param gh handle of the request to cancel | 149 | * @param gh handle of the request to cancel |
158 | */ | 150 | */ |
159 | void GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); | 151 | void |
152 | GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); | ||
160 | 153 | ||
161 | 154 | ||
162 | /** | 155 | /** |
@@ -168,9 +161,9 @@ void GNUNET_STATISTICS_get_cancel (struct GNUNET_STATISTICS_GetHandle *gh); | |||
168 | * @param value new value to set | 161 | * @param value new value to set |
169 | * @param make_persistent should the value be kept across restarts? | 162 | * @param make_persistent should the value be kept across restarts? |
170 | */ | 163 | */ |
171 | void GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, | 164 | void |
172 | const char *name, uint64_t value, | 165 | GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, |
173 | int make_persistent); | 166 | const char *name, uint64_t value, int make_persistent); |
174 | 167 | ||
175 | /** | 168 | /** |
176 | * Set statistic value for the peer. Will always use our | 169 | * Set statistic value for the peer. Will always use our |
@@ -181,9 +174,9 @@ void GNUNET_STATISTICS_set (struct GNUNET_STATISTICS_Handle *handle, | |||
181 | * @param delta change in value (added to existing value) | 174 | * @param delta change in value (added to existing value) |
182 | * @param make_persistent should the value be kept across restarts? | 175 | * @param make_persistent should the value be kept across restarts? |
183 | */ | 176 | */ |
184 | void GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, | 177 | void |
185 | const char *name, int64_t delta, | 178 | GNUNET_STATISTICS_update (struct GNUNET_STATISTICS_Handle *handle, |
186 | int make_persistent); | 179 | const char *name, int64_t delta, int make_persistent); |
187 | 180 | ||
188 | 181 | ||
189 | 182 | ||
diff --git a/src/include/gnunet_strings_lib.h b/src/include/gnunet_strings_lib.h index dd78aee35..6413fb102 100644 --- a/src/include/gnunet_strings_lib.h +++ b/src/include/gnunet_strings_lib.h | |||
@@ -56,7 +56,8 @@ extern "C" | |||
56 | * @param size number of bytes | 56 | * @param size number of bytes |
57 | * @return fancy representation of the size (possibly rounded) for humans | 57 | * @return fancy representation of the size (possibly rounded) for humans |
58 | */ | 58 | */ |
59 | char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | 59 | char * |
60 | GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | ||
60 | 61 | ||
61 | 62 | ||
62 | /** | 63 | /** |
@@ -69,8 +70,8 @@ char *GNUNET_STRINGS_byte_size_fancy (unsigned long long size); | |||
69 | * @param charset character set to convert from | 70 | * @param charset character set to convert from |
70 | * @return the converted string (0-terminated) | 71 | * @return the converted string (0-terminated) |
71 | */ | 72 | */ |
72 | char *GNUNET_STRINGS_to_utf8 (const char *input, size_t len, | 73 | char * |
73 | const char *charset); | 74 | GNUNET_STRINGS_to_utf8 (const char *input, size_t len, const char *charset); |
74 | 75 | ||
75 | 76 | ||
76 | /** | 77 | /** |
@@ -81,7 +82,8 @@ char *GNUNET_STRINGS_to_utf8 (const char *input, size_t len, | |||
81 | * @return the full file name, | 82 | * @return the full file name, |
82 | * NULL is returned on error | 83 | * NULL is returned on error |
83 | */ | 84 | */ |
84 | char *GNUNET_STRINGS_filename_expand (const char *fil); | 85 | char * |
86 | GNUNET_STRINGS_filename_expand (const char *fil); | ||
85 | 87 | ||
86 | /** | 88 | /** |
87 | * Fill a buffer of the given size with | 89 | * Fill a buffer of the given size with |
@@ -104,8 +106,8 @@ char *GNUNET_STRINGS_filename_expand (const char *fil); | |||
104 | * @return number of bytes written to the buffer | 106 | * @return number of bytes written to the buffer |
105 | * (or number of bytes that would have been written) | 107 | * (or number of bytes that would have been written) |
106 | */ | 108 | */ |
107 | size_t GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, | 109 | size_t |
108 | unsigned int count, ...); | 110 | GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, unsigned int count, ...); |
109 | 111 | ||
110 | 112 | ||
111 | /** | 113 | /** |
@@ -122,8 +124,9 @@ size_t GNUNET_STRINGS_buffer_fill (char *buffer, size_t size, | |||
122 | * @return offset of the character after the last 0-termination | 124 | * @return offset of the character after the last 0-termination |
123 | * in the buffer, or 0 on error. | 125 | * in the buffer, or 0 on error. |
124 | */ | 126 | */ |
125 | unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, | 127 | unsigned int |
126 | unsigned int count, ...); | 128 | GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, |
129 | unsigned int count, ...); | ||
127 | 130 | ||
128 | 131 | ||
129 | 132 | ||
@@ -134,7 +137,8 @@ unsigned int GNUNET_STRINGS_buffer_tokenize (const char *buffer, size_t size, | |||
134 | * @param t the absolute time to convert | 137 | * @param t the absolute time to convert |
135 | * @return timestamp in human-readable form | 138 | * @return timestamp in human-readable form |
136 | */ | 139 | */ |
137 | char *GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); | 140 | char * |
141 | GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); | ||
138 | 142 | ||
139 | 143 | ||
140 | /** | 144 | /** |
@@ -143,8 +147,8 @@ char *GNUNET_STRINGS_absolute_time_to_string (struct GNUNET_TIME_Absolute t); | |||
143 | * @param delta time in milli seconds | 147 | * @param delta time in milli seconds |
144 | * @return string in human-readable form | 148 | * @return string in human-readable form |
145 | */ | 149 | */ |
146 | char *GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative | 150 | char * |
147 | delta); | 151 | GNUNET_STRINGS_relative_time_to_string (struct GNUNET_TIME_Relative delta); |
148 | 152 | ||
149 | #if 0 /* keep Emacsens' auto-indent happy */ | 153 | #if 0 /* keep Emacsens' auto-indent happy */ |
150 | { | 154 | { |
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index cd673a082..5bedc406c 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -466,22 +466,15 @@ typedef void (*GNUNET_TESTING_NotifyTopology) (void *cls, | |||
466 | * @param cb_cls closure for cb | 466 | * @param cb_cls closure for cb |
467 | * @return handle to the daemon (actual start will be completed asynchronously) | 467 | * @return handle to the daemon (actual start will be completed asynchronously) |
468 | */ | 468 | */ |
469 | struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_start (const struct | 469 | struct GNUNET_TESTING_Daemon * |
470 | GNUNET_CONFIGURATION_Handle | 470 | GNUNET_TESTING_daemon_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
471 | *cfg, | 471 | struct GNUNET_TIME_Relative timeout, int pretend, |
472 | struct | 472 | const char *hostname, const char *ssh_username, |
473 | GNUNET_TIME_Relative | 473 | uint16_t sshport, const char *hostkey, |
474 | timeout, int pretend, | 474 | GNUNET_TESTING_NotifyHostkeyCreated |
475 | const char *hostname, | 475 | hostkey_callback, void *hostkey_cls, |
476 | const char | 476 | GNUNET_TESTING_NotifyDaemonRunning cb, |
477 | *ssh_username, | 477 | void *cb_cls); |
478 | uint16_t sshport, | ||
479 | const char *hostkey, | ||
480 | GNUNET_TESTING_NotifyHostkeyCreated | ||
481 | hostkey_callback, | ||
482 | void *hostkey_cls, | ||
483 | GNUNET_TESTING_NotifyDaemonRunning | ||
484 | cb, void *cb_cls); | ||
485 | 478 | ||
486 | /** | 479 | /** |
487 | * Continues GNUnet daemon startup when user wanted to be notified | 480 | * Continues GNUnet daemon startup when user wanted to be notified |
@@ -490,8 +483,8 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_start (const struct | |||
490 | * | 483 | * |
491 | * @param daemon the daemon to finish starting | 484 | * @param daemon the daemon to finish starting |
492 | */ | 485 | */ |
493 | void GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon | 486 | void |
494 | *daemon); | 487 | GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon *daemon); |
495 | 488 | ||
496 | /** | 489 | /** |
497 | * Check whether the given daemon is running. | 490 | * Check whether the given daemon is running. |
@@ -501,7 +494,8 @@ void GNUNET_TESTING_daemon_continue_startup (struct GNUNET_TESTING_Daemon | |||
501 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the | 494 | * @return GNUNET_YES if the daemon is up, GNUNET_NO if the |
502 | * daemon is down, GNUNET_SYSERR on error. | 495 | * daemon is down, GNUNET_SYSERR on error. |
503 | */ | 496 | */ |
504 | int GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | 497 | int |
498 | GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | ||
505 | 499 | ||
506 | /** | 500 | /** |
507 | * Restart (stop and start) a GNUnet daemon. | 501 | * Restart (stop and start) a GNUnet daemon. |
@@ -510,9 +504,10 @@ int GNUNET_TESTING_daemon_running (struct GNUNET_TESTING_Daemon *daemon); | |||
510 | * @param cb function called once the daemon is (re)started | 504 | * @param cb function called once the daemon is (re)started |
511 | * @param cb_cls closure for cb | 505 | * @param cb_cls closure for cb |
512 | */ | 506 | */ |
513 | void GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, | 507 | void |
514 | GNUNET_TESTING_NotifyDaemonRunning cb, | 508 | GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, |
515 | void *cb_cls); | 509 | GNUNET_TESTING_NotifyDaemonRunning cb, |
510 | void *cb_cls); | ||
516 | 511 | ||
517 | /** | 512 | /** |
518 | * Start a peer that has previously been stopped using the daemon_stop | 513 | * Start a peer that has previously been stopped using the daemon_stop |
@@ -523,10 +518,11 @@ void GNUNET_TESTING_daemon_restart (struct GNUNET_TESTING_Daemon *d, | |||
523 | * @param cb the callback for notification when the peer is running | 518 | * @param cb the callback for notification when the peer is running |
524 | * @param cb_cls closure for the callback | 519 | * @param cb_cls closure for the callback |
525 | */ | 520 | */ |
526 | void GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, | 521 | void |
527 | struct GNUNET_TIME_Relative timeout, | 522 | GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, |
528 | GNUNET_TESTING_NotifyDaemonRunning cb, | 523 | struct GNUNET_TIME_Relative timeout, |
529 | void *cb_cls); | 524 | GNUNET_TESTING_NotifyDaemonRunning cb, |
525 | void *cb_cls); | ||
530 | 526 | ||
531 | /** | 527 | /** |
532 | * Starts a GNUnet daemon's service. | 528 | * Starts a GNUnet daemon's service. |
@@ -537,11 +533,12 @@ void GNUNET_TESTING_daemon_start_stopped (struct GNUNET_TESTING_Daemon *daemon, | |||
537 | * @param cb function called once gnunet-arm returns | 533 | * @param cb function called once gnunet-arm returns |
538 | * @param cb_cls closure for cb | 534 | * @param cb_cls closure for cb |
539 | */ | 535 | */ |
540 | void GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, | 536 | void |
541 | char *service, | 537 | GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, |
542 | struct GNUNET_TIME_Relative timeout, | 538 | char *service, |
543 | GNUNET_TESTING_NotifyDaemonRunning cb, | 539 | struct GNUNET_TIME_Relative timeout, |
544 | void *cb_cls); | 540 | GNUNET_TESTING_NotifyDaemonRunning cb, |
541 | void *cb_cls); | ||
545 | 542 | ||
546 | /** | 543 | /** |
547 | * Starts a GNUnet daemon's service which has been previously turned off. | 544 | * Starts a GNUnet daemon's service which has been previously turned off. |
@@ -552,12 +549,13 @@ void GNUNET_TESTING_daemon_start_service (struct GNUNET_TESTING_Daemon *d, | |||
552 | * @param cb function called once gnunet-arm returns | 549 | * @param cb function called once gnunet-arm returns |
553 | * @param cb_cls closure for cb | 550 | * @param cb_cls closure for cb |
554 | */ | 551 | */ |
555 | void GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon | 552 | void |
556 | *d, char *service, | 553 | GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon *d, |
557 | struct GNUNET_TIME_Relative | 554 | char *service, |
558 | timeout, | 555 | struct GNUNET_TIME_Relative |
559 | GNUNET_TESTING_NotifyDaemonRunning | 556 | timeout, |
560 | cb, void *cb_cls); | 557 | GNUNET_TESTING_NotifyDaemonRunning |
558 | cb, void *cb_cls); | ||
561 | 559 | ||
562 | /** | 560 | /** |
563 | * Get a certain testing daemon handle. | 561 | * Get a certain testing daemon handle. |
@@ -565,10 +563,9 @@ void GNUNET_TESTING_daemon_start_stopped_service (struct GNUNET_TESTING_Daemon | |||
565 | * @param pg handle to the set of running peers | 563 | * @param pg handle to the set of running peers |
566 | * @param position the number of the peer to return | 564 | * @param position the number of the peer to return |
567 | */ | 565 | */ |
568 | struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get (struct | 566 | struct GNUNET_TESTING_Daemon * |
569 | GNUNET_TESTING_PeerGroup | 567 | GNUNET_TESTING_daemon_get (struct GNUNET_TESTING_PeerGroup *pg, |
570 | *pg, | 568 | unsigned int position); |
571 | unsigned int position); | ||
572 | 569 | ||
573 | /* | 570 | /* |
574 | * Get a daemon by peer identity, so callers can | 571 | * Get a daemon by peer identity, so callers can |
@@ -579,12 +576,9 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get (struct | |||
579 | * | 576 | * |
580 | * @return the daemon on success, or NULL if no such peer identity is found | 577 | * @return the daemon on success, or NULL if no such peer identity is found |
581 | */ | 578 | */ |
582 | struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get_by_id (struct | 579 | struct GNUNET_TESTING_Daemon * |
583 | GNUNET_TESTING_PeerGroup | 580 | GNUNET_TESTING_daemon_get_by_id (struct GNUNET_TESTING_PeerGroup *pg, |
584 | *pg, | 581 | struct GNUNET_PeerIdentity *peer_id); |
585 | struct | ||
586 | GNUNET_PeerIdentity | ||
587 | *peer_id); | ||
588 | 582 | ||
589 | /** | 583 | /** |
590 | * Stops a GNUnet daemon. | 584 | * Stops a GNUnet daemon. |
@@ -599,11 +593,11 @@ struct GNUNET_TESTING_Daemon *GNUNET_TESTING_daemon_get_by_id (struct | |||
599 | * @param allow_restart GNUNET_YES to restart peer later (using this API) | 593 | * @param allow_restart GNUNET_YES to restart peer later (using this API) |
600 | * GNUNET_NO to kill off and clean up for good | 594 | * GNUNET_NO to kill off and clean up for good |
601 | */ | 595 | */ |
602 | void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | 596 | void |
603 | struct GNUNET_TIME_Relative timeout, | 597 | GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, |
604 | GNUNET_TESTING_NotifyCompletion cb, | 598 | struct GNUNET_TIME_Relative timeout, |
605 | void *cb_cls, int delete_files, | 599 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls, |
606 | int allow_restart); | 600 | int delete_files, int allow_restart); |
607 | 601 | ||
608 | 602 | ||
609 | /** | 603 | /** |
@@ -614,10 +608,11 @@ void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | |||
614 | * @param cb function called once the configuration was changed | 608 | * @param cb function called once the configuration was changed |
615 | * @param cb_cls closure for cb | 609 | * @param cb_cls closure for cb |
616 | */ | 610 | */ |
617 | void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | 611 | void |
618 | struct GNUNET_CONFIGURATION_Handle *cfg, | 612 | GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, |
619 | GNUNET_TESTING_NotifyCompletion cb, | 613 | struct GNUNET_CONFIGURATION_Handle *cfg, |
620 | void *cb_cls); | 614 | GNUNET_TESTING_NotifyCompletion cb, |
615 | void *cb_cls); | ||
621 | 616 | ||
622 | /** | 617 | /** |
623 | * Stops a single service of a GNUnet daemon. Used like daemon_stop, | 618 | * Stops a single service of a GNUnet daemon. Used like daemon_stop, |
@@ -631,11 +626,12 @@ void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | |||
631 | * @param cb function called once the service was stopped | 626 | * @param cb function called once the service was stopped |
632 | * @param cb_cls closure for cb | 627 | * @param cb_cls closure for cb |
633 | */ | 628 | */ |
634 | void GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, | 629 | void |
635 | char *service, | 630 | GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, |
636 | struct GNUNET_TIME_Relative timeout, | 631 | char *service, |
637 | GNUNET_TESTING_NotifyCompletion cb, | 632 | struct GNUNET_TIME_Relative timeout, |
638 | void *cb_cls); | 633 | GNUNET_TESTING_NotifyCompletion cb, |
634 | void *cb_cls); | ||
639 | 635 | ||
640 | /** | 636 | /** |
641 | * Read a testing hosts file based on a configuration. | 637 | * Read a testing hosts file based on a configuration. |
@@ -646,9 +642,8 @@ void GNUNET_TESTING_daemon_stop_service (struct GNUNET_TESTING_Daemon *d, | |||
646 | * | 642 | * |
647 | * @return DLL of hosts on success, NULL on failure | 643 | * @return DLL of hosts on success, NULL on failure |
648 | */ | 644 | */ |
649 | struct GNUNET_TESTING_Host *GNUNET_TESTING_hosts_load (const struct | 645 | struct GNUNET_TESTING_Host * |
650 | GNUNET_CONFIGURATION_Handle | 646 | GNUNET_TESTING_hosts_load (const struct GNUNET_CONFIGURATION_Handle *cfg); |
651 | *cfg); | ||
652 | 647 | ||
653 | 648 | ||
654 | /** | 649 | /** |
@@ -678,31 +673,19 @@ struct GNUNET_TESTING_Host *GNUNET_TESTING_hosts_load (const struct | |||
678 | * | 673 | * |
679 | * @return NULL on error, otherwise handle to control peer group | 674 | * @return NULL on error, otherwise handle to control peer group |
680 | */ | 675 | */ |
681 | struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_daemons_start (const struct | 676 | struct GNUNET_TESTING_PeerGroup * |
682 | GNUNET_CONFIGURATION_Handle | 677 | GNUNET_TESTING_daemons_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
683 | *cfg, | 678 | unsigned int total, |
684 | unsigned int | 679 | unsigned int max_concurrent_connections, |
685 | total, | 680 | unsigned int max_concurrent_ssh, |
686 | unsigned int | 681 | struct GNUNET_TIME_Relative timeout, |
687 | max_concurrent_connections, | 682 | GNUNET_TESTING_NotifyHostkeyCreated |
688 | unsigned int | 683 | hostkey_callback, void *hostkey_cls, |
689 | max_concurrent_ssh, | 684 | GNUNET_TESTING_NotifyDaemonRunning cb, |
690 | struct | 685 | void *cb_cls, |
691 | GNUNET_TIME_Relative | 686 | GNUNET_TESTING_NotifyConnection connect_callback, |
692 | timeout, | 687 | void *connect_callback_cls, |
693 | GNUNET_TESTING_NotifyHostkeyCreated | 688 | const struct GNUNET_TESTING_Host *hostnames); |
694 | hostkey_callback, | ||
695 | void | ||
696 | *hostkey_cls, | ||
697 | GNUNET_TESTING_NotifyDaemonRunning | ||
698 | cb, void *cb_cls, | ||
699 | GNUNET_TESTING_NotifyConnection | ||
700 | connect_callback, | ||
701 | void | ||
702 | *connect_callback_cls, | ||
703 | const struct | ||
704 | GNUNET_TESTING_Host | ||
705 | *hostnames); | ||
706 | 689 | ||
707 | /** | 690 | /** |
708 | * Function which continues a peer group starting up | 691 | * Function which continues a peer group starting up |
@@ -710,8 +693,8 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_daemons_start (const struct | |||
710 | * | 693 | * |
711 | * @param pg the peer group to continue starting | 694 | * @param pg the peer group to continue starting |
712 | */ | 695 | */ |
713 | void GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup | 696 | void |
714 | *pg); | 697 | GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup *pg); |
715 | 698 | ||
716 | 699 | ||
717 | /** | 700 | /** |
@@ -728,13 +711,14 @@ void GNUNET_TESTING_daemons_continue_startup (struct GNUNET_TESTING_PeerGroup | |||
728 | * @param cb function to call at the end | 711 | * @param cb function to call at the end |
729 | * @param cb_cls closure for cb | 712 | * @param cb_cls closure for cb |
730 | */ | 713 | */ |
731 | void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | 714 | void |
732 | struct GNUNET_TESTING_Daemon *d2, | 715 | GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, |
733 | struct GNUNET_TIME_Relative timeout, | 716 | struct GNUNET_TESTING_Daemon *d2, |
734 | unsigned int max_connect_attempts, | 717 | struct GNUNET_TIME_Relative timeout, |
735 | int send_hello, | 718 | unsigned int max_connect_attempts, |
736 | GNUNET_TESTING_NotifyConnection cb, | 719 | int send_hello, |
737 | void *cb_cls); | 720 | GNUNET_TESTING_NotifyConnection cb, |
721 | void *cb_cls); | ||
738 | 722 | ||
739 | 723 | ||
740 | /** | 724 | /** |
@@ -744,9 +728,10 @@ void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | |||
744 | * @param callback function to call on completion (or failure) | 728 | * @param callback function to call on completion (or failure) |
745 | * @param callback_cls closure for the callback function | 729 | * @param callback_cls closure for the callback function |
746 | */ | 730 | */ |
747 | void GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, | 731 | void |
748 | GNUNET_TESTING_NotifyCompletion callback, | 732 | GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, |
749 | void *callback_cls); | 733 | GNUNET_TESTING_NotifyCompletion callback, |
734 | void *callback_cls); | ||
750 | 735 | ||
751 | 736 | ||
752 | /** | 737 | /** |
@@ -757,10 +742,10 @@ void GNUNET_TESTING_daemons_restart (struct GNUNET_TESTING_PeerGroup *pg, | |||
757 | * @param cb callback to notify upon success or failure | 742 | * @param cb callback to notify upon success or failure |
758 | * @param cb_cls closure for cb | 743 | * @param cb_cls closure for cb |
759 | */ | 744 | */ |
760 | void GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, | 745 | void |
761 | struct GNUNET_TIME_Relative timeout, | 746 | GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, |
762 | GNUNET_TESTING_NotifyCompletion cb, | 747 | struct GNUNET_TIME_Relative timeout, |
763 | void *cb_cls); | 748 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
764 | 749 | ||
765 | 750 | ||
766 | /** | 751 | /** |
@@ -770,8 +755,8 @@ void GNUNET_TESTING_daemons_stop (struct GNUNET_TESTING_PeerGroup *pg, | |||
770 | * | 755 | * |
771 | * @return the number of currently running peers in the peer group | 756 | * @return the number of currently running peers in the peer group |
772 | */ | 757 | */ |
773 | unsigned int GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup | 758 | unsigned int |
774 | *pg); | 759 | GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup *pg); |
775 | 760 | ||
776 | /** | 761 | /** |
777 | * Simulate churn by stopping some peers (and possibly | 762 | * Simulate churn by stopping some peers (and possibly |
@@ -796,12 +781,12 @@ unsigned int GNUNET_TESTING_daemons_running (struct GNUNET_TESTING_PeerGroup | |||
796 | * @param cb function to call at the end | 781 | * @param cb function to call at the end |
797 | * @param cb_cls closure for cb | 782 | * @param cb_cls closure for cb |
798 | */ | 783 | */ |
799 | void GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, | 784 | void |
800 | char *service, unsigned int voff, | 785 | GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, |
801 | unsigned int von, | 786 | char *service, unsigned int voff, |
802 | struct GNUNET_TIME_Relative timeout, | 787 | unsigned int von, |
803 | GNUNET_TESTING_NotifyCompletion cb, | 788 | struct GNUNET_TIME_Relative timeout, |
804 | void *cb_cls); | 789 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
805 | /* | 790 | /* |
806 | * Start a given service for each of the peers in the peer group. | 791 | * Start a given service for each of the peers in the peer group. |
807 | * | 792 | * |
@@ -813,11 +798,12 @@ void GNUNET_TESTING_daemons_churn (struct GNUNET_TESTING_PeerGroup *pg, | |||
813 | * @param cb_cls closure for cb | 798 | * @param cb_cls closure for cb |
814 | * | 799 | * |
815 | */ | 800 | */ |
816 | void GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, | 801 | void |
817 | char *service, | 802 | GNUNET_TESTING_daemons_start_service (struct GNUNET_TESTING_PeerGroup *pg, |
818 | struct GNUNET_TIME_Relative timeout, | 803 | char *service, |
819 | GNUNET_TESTING_NotifyCompletion cb, | 804 | struct GNUNET_TIME_Relative timeout, |
820 | void *cb_cls); | 805 | GNUNET_TESTING_NotifyCompletion cb, |
806 | void *cb_cls); | ||
821 | 807 | ||
822 | /** | 808 | /** |
823 | * Callback function to process statistic values. | 809 | * Callback function to process statistic values. |
@@ -847,10 +833,11 @@ typedef int (*GNUNET_TESTING_STATISTICS_Iterator) (void *cls, | |||
847 | * @param proc processing function for each statistic retrieved | 833 | * @param proc processing function for each statistic retrieved |
848 | * @param cls closure to pass to proc | 834 | * @param cls closure to pass to proc |
849 | */ | 835 | */ |
850 | void GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, | 836 | void |
851 | GNUNET_STATISTICS_Callback cont, | 837 | GNUNET_TESTING_get_statistics (struct GNUNET_TESTING_PeerGroup *pg, |
852 | GNUNET_TESTING_STATISTICS_Iterator proc, | 838 | GNUNET_STATISTICS_Callback cont, |
853 | void *cls); | 839 | GNUNET_TESTING_STATISTICS_Iterator proc, |
840 | void *cls); | ||
854 | 841 | ||
855 | /** | 842 | /** |
856 | * Topologies supported for testbeds. | 843 | * Topologies supported for testbeds. |
@@ -965,8 +952,9 @@ enum GNUNET_TESTING_TopologyOption | |||
965 | * @return GNUNET_YES if topology string matched a | 952 | * @return GNUNET_YES if topology string matched a |
966 | * known topology, GNUNET_NO if not | 953 | * known topology, GNUNET_NO if not |
967 | */ | 954 | */ |
968 | int GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, | 955 | int |
969 | const char *topology_string); | 956 | GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, |
957 | const char *topology_string); | ||
970 | 958 | ||
971 | /** | 959 | /** |
972 | * Get connect topology option from string input. | 960 | * Get connect topology option from string input. |
@@ -977,9 +965,10 @@ int GNUNET_TESTING_topology_get (enum GNUNET_TESTING_Topology *topology, | |||
977 | * @return GNUNET_YES if topology string matched a | 965 | * @return GNUNET_YES if topology string matched a |
978 | * known topology, GNUNET_NO if not | 966 | * known topology, GNUNET_NO if not |
979 | */ | 967 | */ |
980 | int GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption | 968 | int |
981 | *topology_option, | 969 | GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption |
982 | const char *topology_string); | 970 | *topology_option, |
971 | const char *topology_string); | ||
983 | 972 | ||
984 | 973 | ||
985 | /** | 974 | /** |
@@ -1018,13 +1007,11 @@ int GNUNET_TESTING_topology_option_get (enum GNUNET_TESTING_TopologyOption | |||
1018 | * @return the maximum number of connections were all allowed peers | 1007 | * @return the maximum number of connections were all allowed peers |
1019 | * connected to each other | 1008 | * connected to each other |
1020 | */ | 1009 | */ |
1021 | unsigned int GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup | 1010 | unsigned int |
1022 | *pg, | 1011 | GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1023 | enum GNUNET_TESTING_Topology | 1012 | enum GNUNET_TESTING_Topology topology, |
1024 | topology, | 1013 | enum GNUNET_TESTING_Topology restrict_topology, |
1025 | enum GNUNET_TESTING_Topology | 1014 | const char *restrict_transports); |
1026 | restrict_topology, | ||
1027 | const char *restrict_transports); | ||
1028 | 1015 | ||
1029 | /** | 1016 | /** |
1030 | * Iterate over all (running) peers in the peer group, retrieve | 1017 | * Iterate over all (running) peers in the peer group, retrieve |
@@ -1034,22 +1021,25 @@ unsigned int GNUNET_TESTING_create_topology (struct GNUNET_TESTING_PeerGroup | |||
1034 | * @param cb callback for topology information | 1021 | * @param cb callback for topology information |
1035 | * @param cls closure for callback | 1022 | * @param cls closure for callback |
1036 | */ | 1023 | */ |
1037 | void GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, | 1024 | void |
1038 | GNUNET_TESTING_NotifyTopology cb, void *cls); | 1025 | GNUNET_TESTING_get_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1026 | GNUNET_TESTING_NotifyTopology cb, void *cls); | ||
1039 | 1027 | ||
1040 | /** | 1028 | /** |
1041 | * Stop the connection process temporarily. | 1029 | * Stop the connection process temporarily. |
1042 | * | 1030 | * |
1043 | * @param pg the peer group to stop connecting | 1031 | * @param pg the peer group to stop connecting |
1044 | */ | 1032 | */ |
1045 | void GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); | 1033 | void |
1034 | GNUNET_TESTING_stop_connections (struct GNUNET_TESTING_PeerGroup *pg); | ||
1046 | 1035 | ||
1047 | /** | 1036 | /** |
1048 | * Resume the connection process. | 1037 | * Resume the connection process. |
1049 | * | 1038 | * |
1050 | * @param pg the peer group to resume connecting | 1039 | * @param pg the peer group to resume connecting |
1051 | */ | 1040 | */ |
1052 | void GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); | 1041 | void |
1042 | GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); | ||
1053 | 1043 | ||
1054 | /** | 1044 | /** |
1055 | * There are many ways to connect peers that are supported by this function. | 1045 | * There are many ways to connect peers that are supported by this function. |
@@ -1073,15 +1063,15 @@ void GNUNET_TESTING_resume_connections (struct GNUNET_TESTING_PeerGroup *pg); | |||
1073 | * | 1063 | * |
1074 | * @return the number of connections that will be attempted, GNUNET_SYSERR on error | 1064 | * @return the number of connections that will be attempted, GNUNET_SYSERR on error |
1075 | */ | 1065 | */ |
1076 | int GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, | 1066 | int |
1077 | enum GNUNET_TESTING_Topology topology, | 1067 | GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, |
1078 | enum GNUNET_TESTING_TopologyOption options, | 1068 | enum GNUNET_TESTING_Topology topology, |
1079 | double option_modifier, | 1069 | enum GNUNET_TESTING_TopologyOption options, |
1080 | struct GNUNET_TIME_Relative | 1070 | double option_modifier, |
1081 | connect_timeout, | 1071 | struct GNUNET_TIME_Relative connect_timeout, |
1082 | unsigned int connect_attempts, | 1072 | unsigned int connect_attempts, |
1083 | GNUNET_TESTING_NotifyCompletion | 1073 | GNUNET_TESTING_NotifyCompletion |
1084 | notify_callback, void *notify_cls); | 1074 | notify_callback, void *notify_cls); |
1085 | 1075 | ||
1086 | /** | 1076 | /** |
1087 | * Start or stop an individual peer from the given group. | 1077 | * Start or stop an individual peer from the given group. |
@@ -1093,11 +1083,11 @@ int GNUNET_TESTING_connect_topology (struct GNUNET_TESTING_PeerGroup *pg, | |||
1093 | * @param cb function to call at the end | 1083 | * @param cb function to call at the end |
1094 | * @param cb_cls closure for cb | 1084 | * @param cb_cls closure for cb |
1095 | */ | 1085 | */ |
1096 | void GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | 1086 | void |
1097 | unsigned int offset, int desired_status, | 1087 | GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, |
1098 | struct GNUNET_TIME_Relative timeout, | 1088 | unsigned int offset, int desired_status, |
1099 | GNUNET_TESTING_NotifyCompletion cb, | 1089 | struct GNUNET_TIME_Relative timeout, |
1100 | void *cb_cls); | 1090 | GNUNET_TESTING_NotifyCompletion cb, void *cb_cls); |
1101 | 1091 | ||
1102 | /** | 1092 | /** |
1103 | * Start a peer group with a given number of peers. Notify | 1093 | * Start a peer group with a given number of peers. Notify |
@@ -1116,23 +1106,14 @@ void GNUNET_TESTING_daemons_vary (struct GNUNET_TESTING_PeerGroup *pg, | |||
1116 | * | 1106 | * |
1117 | * @return NULL on error, otherwise handle to control peer group | 1107 | * @return NULL on error, otherwise handle to control peer group |
1118 | */ | 1108 | */ |
1119 | struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_peergroup_start (const struct | 1109 | struct GNUNET_TESTING_PeerGroup * |
1120 | GNUNET_CONFIGURATION_Handle | 1110 | GNUNET_TESTING_peergroup_start (const struct GNUNET_CONFIGURATION_Handle *cfg, |
1121 | *cfg, | 1111 | unsigned int total, |
1122 | unsigned int | 1112 | struct GNUNET_TIME_Relative timeout, |
1123 | total, | 1113 | GNUNET_TESTING_NotifyConnection connect_cb, |
1124 | struct | 1114 | GNUNET_TESTING_NotifyCompletion peergroup_cb, |
1125 | GNUNET_TIME_Relative | 1115 | void *peergroup_cls, |
1126 | timeout, | 1116 | const struct GNUNET_TESTING_Host *hostnames); |
1127 | GNUNET_TESTING_NotifyConnection | ||
1128 | connect_cb, | ||
1129 | GNUNET_TESTING_NotifyCompletion | ||
1130 | peergroup_cb, | ||
1131 | void | ||
1132 | *peergroup_cls, | ||
1133 | const struct | ||
1134 | GNUNET_TESTING_Host | ||
1135 | *hostnames); | ||
1136 | 1117 | ||
1137 | /** | 1118 | /** |
1138 | * Print current topology to a graphviz readable file. | 1119 | * Print current topology to a graphviz readable file. |
@@ -1143,11 +1124,11 @@ struct GNUNET_TESTING_PeerGroup *GNUNET_TESTING_peergroup_start (const struct | |||
1143 | * @param notify_cb_cls closure for notify_cb | 1124 | * @param notify_cb_cls closure for notify_cb |
1144 | * | 1125 | * |
1145 | */ | 1126 | */ |
1146 | void GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup | 1127 | void |
1147 | *pg, | 1128 | GNUNET_TESTING_peergroup_topology_to_file (struct GNUNET_TESTING_PeerGroup *pg, |
1148 | const char *output_filename, | 1129 | const char *output_filename, |
1149 | GNUNET_TESTING_NotifyCompletion | 1130 | GNUNET_TESTING_NotifyCompletion |
1150 | notify_cb, void *notify_cb_cls); | 1131 | notify_cb, void *notify_cb_cls); |
1151 | 1132 | ||
1152 | 1133 | ||
1153 | #if 0 /* keep Emacsens' auto-indent happy */ | 1134 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/gnunet_time_lib.h b/src/include/gnunet_time_lib.h index ffae1ce51..1f157631f 100644 --- a/src/include/gnunet_time_lib.h +++ b/src/include/gnunet_time_lib.h | |||
@@ -151,34 +151,40 @@ struct GNUNET_TIME_AbsoluteNBO | |||
151 | /** | 151 | /** |
152 | * Return relative time of 0ms. | 152 | * Return relative time of 0ms. |
153 | */ | 153 | */ |
154 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_zero (void); | 154 | struct GNUNET_TIME_Relative |
155 | GNUNET_TIME_relative_get_zero (void); | ||
155 | 156 | ||
156 | /** | 157 | /** |
157 | * Return absolute time of 0ms. | 158 | * Return absolute time of 0ms. |
158 | */ | 159 | */ |
159 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_zero (void); | 160 | struct GNUNET_TIME_Absolute |
161 | GNUNET_TIME_absolute_get_zero (void); | ||
160 | 162 | ||
161 | /** | 163 | /** |
162 | * Return relative time of 1ms. | 164 | * Return relative time of 1ms. |
163 | */ | 165 | */ |
164 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_unit (void); | 166 | struct GNUNET_TIME_Relative |
167 | GNUNET_TIME_relative_get_unit (void); | ||
165 | 168 | ||
166 | /** | 169 | /** |
167 | * Return "forever". | 170 | * Return "forever". |
168 | */ | 171 | */ |
169 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_get_forever (void); | 172 | struct GNUNET_TIME_Relative |
173 | GNUNET_TIME_relative_get_forever (void); | ||
170 | 174 | ||
171 | /** | 175 | /** |
172 | * Return "forever". | 176 | * Return "forever". |
173 | */ | 177 | */ |
174 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get_forever (void); | 178 | struct GNUNET_TIME_Absolute |
179 | GNUNET_TIME_absolute_get_forever (void); | ||
175 | 180 | ||
176 | /** | 181 | /** |
177 | * Get the current time. | 182 | * Get the current time. |
178 | * | 183 | * |
179 | * @return the current time | 184 | * @return the current time |
180 | */ | 185 | */ |
181 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get (void); | 186 | struct GNUNET_TIME_Absolute |
187 | GNUNET_TIME_absolute_get (void); | ||
182 | 188 | ||
183 | /** | 189 | /** |
184 | * Convert relative time to an absolute time in the | 190 | * Convert relative time to an absolute time in the |
@@ -187,9 +193,8 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_get (void); | |||
187 | * @param rel relative time to convert | 193 | * @param rel relative time to convert |
188 | * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow) | 194 | * @return timestamp that is "rel" in the future, or FOREVER if rel==FOREVER (or if we would overflow) |
189 | */ | 195 | */ |
190 | struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct | 196 | struct GNUNET_TIME_Absolute |
191 | GNUNET_TIME_Relative | 197 | GNUNET_TIME_relative_to_absolute (struct GNUNET_TIME_Relative rel); |
192 | rel); | ||
193 | 198 | ||
194 | /** | 199 | /** |
195 | * Return the minimum of two relative time values. | 200 | * Return the minimum of two relative time values. |
@@ -198,10 +203,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_relative_to_absolute (struct | |||
198 | * @param t2 other timestamp | 203 | * @param t2 other timestamp |
199 | * @return timestamp that is smaller | 204 | * @return timestamp that is smaller |
200 | */ | 205 | */ |
201 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct | 206 | struct GNUNET_TIME_Relative |
202 | GNUNET_TIME_Relative t1, | 207 | GNUNET_TIME_relative_min (struct GNUNET_TIME_Relative t1, |
203 | struct | 208 | struct GNUNET_TIME_Relative t2); |
204 | GNUNET_TIME_Relative t2); | ||
205 | 209 | ||
206 | 210 | ||
207 | /** | 211 | /** |
@@ -211,10 +215,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_min (struct | |||
211 | * @param t2 other timestamp | 215 | * @param t2 other timestamp |
212 | * @return timestamp that is larger | 216 | * @return timestamp that is larger |
213 | */ | 217 | */ |
214 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct | 218 | struct GNUNET_TIME_Relative |
215 | GNUNET_TIME_Relative t1, | 219 | GNUNET_TIME_relative_max (struct GNUNET_TIME_Relative t1, |
216 | struct | 220 | struct GNUNET_TIME_Relative t2); |
217 | GNUNET_TIME_Relative t2); | ||
218 | 221 | ||
219 | /** | 222 | /** |
220 | * Return the minimum of two absolute time values. | 223 | * Return the minimum of two absolute time values. |
@@ -223,10 +226,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_max (struct | |||
223 | * @param t2 other timestamp | 226 | * @param t2 other timestamp |
224 | * @return timestamp that is smaller | 227 | * @return timestamp that is smaller |
225 | */ | 228 | */ |
226 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct | 229 | struct GNUNET_TIME_Absolute |
227 | GNUNET_TIME_Absolute t1, | 230 | GNUNET_TIME_absolute_min (struct GNUNET_TIME_Absolute t1, |
228 | struct | 231 | struct GNUNET_TIME_Absolute t2); |
229 | GNUNET_TIME_Absolute t2); | ||
230 | 232 | ||
231 | /** | 233 | /** |
232 | * Return the maximum of two absolute time values. | 234 | * Return the maximum of two absolute time values. |
@@ -235,10 +237,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_min (struct | |||
235 | * @param t2 other timestamp | 237 | * @param t2 other timestamp |
236 | * @return timestamp that is smaller | 238 | * @return timestamp that is smaller |
237 | */ | 239 | */ |
238 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct | 240 | struct GNUNET_TIME_Absolute |
239 | GNUNET_TIME_Absolute t1, | 241 | GNUNET_TIME_absolute_max (struct GNUNET_TIME_Absolute t1, |
240 | struct | 242 | struct GNUNET_TIME_Absolute t2); |
241 | GNUNET_TIME_Absolute t2); | ||
242 | 243 | ||
243 | /** | 244 | /** |
244 | * Given a timestamp in the future, how much time | 245 | * Given a timestamp in the future, how much time |
@@ -247,9 +248,8 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_max (struct | |||
247 | * @param future some absolute time, typically in the future | 248 | * @param future some absolute time, typically in the future |
248 | * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER. | 249 | * @return future - now, or 0 if now >= future, or FOREVER if future==FOREVER. |
249 | */ | 250 | */ |
250 | struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining (struct | 251 | struct GNUNET_TIME_Relative |
251 | GNUNET_TIME_Absolute | 252 | GNUNET_TIME_absolute_get_remaining (struct GNUNET_TIME_Absolute future); |
252 | future); | ||
253 | 253 | ||
254 | 254 | ||
255 | /** | 255 | /** |
@@ -262,10 +262,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_remaining (struct | |||
262 | * @return remaining duration for the operation, | 262 | * @return remaining duration for the operation, |
263 | * assuming it continues at the same speed | 263 | * assuming it continues at the same speed |
264 | */ | 264 | */ |
265 | struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta (struct | 265 | struct GNUNET_TIME_Relative |
266 | GNUNET_TIME_Absolute | 266 | GNUNET_TIME_calculate_eta (struct GNUNET_TIME_Absolute start, uint64_t finished, |
267 | start, uint64_t finished, | 267 | uint64_t total); |
268 | uint64_t total); | ||
269 | 268 | ||
270 | 269 | ||
271 | /** | 270 | /** |
@@ -277,12 +276,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_calculate_eta (struct | |||
277 | * @param end some absolute time (typically larger or equal to start) | 276 | * @param end some absolute time (typically larger or equal to start) |
278 | * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start | 277 | * @return 0 if start >= end; FOREVER if end==FOREVER; otherwise end - start |
279 | */ | 278 | */ |
280 | struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference (struct | 279 | struct GNUNET_TIME_Relative |
281 | GNUNET_TIME_Absolute | 280 | GNUNET_TIME_absolute_get_difference (struct GNUNET_TIME_Absolute start, |
282 | start, | 281 | struct GNUNET_TIME_Absolute end); |
283 | struct | ||
284 | GNUNET_TIME_Absolute | ||
285 | end); | ||
286 | 282 | ||
287 | /** | 283 | /** |
288 | * Get the duration of an operation as the | 284 | * Get the duration of an operation as the |
@@ -291,9 +287,8 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_difference (struct | |||
291 | * @param whence some absolute time, typically in the past | 287 | * @param whence some absolute time, typically in the past |
292 | * @return aborts if hence==FOREVER, 0 if hence > now, otherwise now-hence. | 288 | * @return aborts if hence==FOREVER, 0 if hence > now, otherwise now-hence. |
293 | */ | 289 | */ |
294 | struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration (struct | 290 | struct GNUNET_TIME_Relative |
295 | GNUNET_TIME_Absolute | 291 | GNUNET_TIME_absolute_get_duration (struct GNUNET_TIME_Absolute whence); |
296 | whence); | ||
297 | 292 | ||
298 | 293 | ||
299 | /** | 294 | /** |
@@ -304,12 +299,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_absolute_get_duration (struct | |||
304 | * @param duration some relative time to add | 299 | * @param duration some relative time to add |
305 | * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise | 300 | * @return FOREVER if either argument is FOREVER or on overflow; start+duration otherwise |
306 | */ | 301 | */ |
307 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add (struct | 302 | struct GNUNET_TIME_Absolute |
308 | GNUNET_TIME_Absolute | 303 | GNUNET_TIME_absolute_add (struct GNUNET_TIME_Absolute start, |
309 | start, | 304 | struct GNUNET_TIME_Relative duration); |
310 | struct | ||
311 | GNUNET_TIME_Relative | ||
312 | duration); | ||
313 | 305 | ||
314 | 306 | ||
315 | /** | 307 | /** |
@@ -320,12 +312,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_add (struct | |||
320 | * @param duration some relative time to subtract | 312 | * @param duration some relative time to subtract |
321 | * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise | 313 | * @return ZERO if start <= duration, or FOREVER if start time is FOREVER; start-duration otherwise |
322 | */ | 314 | */ |
323 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct | 315 | struct GNUNET_TIME_Absolute |
324 | GNUNET_TIME_Absolute | 316 | GNUNET_TIME_absolute_subtract (struct GNUNET_TIME_Absolute start, |
325 | start, | 317 | struct GNUNET_TIME_Relative duration); |
326 | struct | ||
327 | GNUNET_TIME_Relative | ||
328 | duration); | ||
329 | 318 | ||
330 | /** | 319 | /** |
331 | * Multiply relative time by a given factor. | 320 | * Multiply relative time by a given factor. |
@@ -334,10 +323,9 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_subtract (struct | |||
334 | * @param factor integer to multiply with | 323 | * @param factor integer to multiply with |
335 | * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor | 324 | * @return FOREVER if rel=FOREVER or on overflow; otherwise rel*factor |
336 | */ | 325 | */ |
337 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct | 326 | struct GNUNET_TIME_Relative |
338 | GNUNET_TIME_Relative | 327 | GNUNET_TIME_relative_multiply (struct GNUNET_TIME_Relative rel, |
339 | rel, | 328 | unsigned int factor); |
340 | unsigned int factor); | ||
341 | 329 | ||
342 | /** | 330 | /** |
343 | * Divide relative time by a given factor. | 331 | * Divide relative time by a given factor. |
@@ -346,10 +334,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_multiply (struct | |||
346 | * @param factor integer to divide by | 334 | * @param factor integer to divide by |
347 | * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor | 335 | * @return FOREVER if rel=FOREVER or factor==0; otherwise rel/factor |
348 | */ | 336 | */ |
349 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct | 337 | struct GNUNET_TIME_Relative |
350 | GNUNET_TIME_Relative | 338 | GNUNET_TIME_relative_divide (struct GNUNET_TIME_Relative rel, |
351 | rel, | 339 | unsigned int factor); |
352 | unsigned int factor); | ||
353 | 340 | ||
354 | /** | 341 | /** |
355 | * Add relative times together. | 342 | * Add relative times together. |
@@ -358,10 +345,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_divide (struct | |||
358 | * @param a2 some other relative time | 345 | * @param a2 some other relative time |
359 | * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise | 346 | * @return FOREVER if either argument is FOREVER or on overflow; a1+a2 otherwise |
360 | */ | 347 | */ |
361 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct | 348 | struct GNUNET_TIME_Relative |
362 | GNUNET_TIME_Relative a1, | 349 | GNUNET_TIME_relative_add (struct GNUNET_TIME_Relative a1, |
363 | struct | 350 | struct GNUNET_TIME_Relative a2); |
364 | GNUNET_TIME_Relative a2); | ||
365 | 351 | ||
366 | /** | 352 | /** |
367 | * Subtract relative timestamp from the other. | 353 | * Subtract relative timestamp from the other. |
@@ -370,12 +356,9 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_add (struct | |||
370 | * @param a2 second timestamp | 356 | * @param a2 second timestamp |
371 | * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise | 357 | * @return ZERO if a2>=a1 (including both FOREVER), FOREVER if a1 is FOREVER, a1-a2 otherwise |
372 | */ | 358 | */ |
373 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract (struct | 359 | struct GNUNET_TIME_Relative |
374 | GNUNET_TIME_Relative | 360 | GNUNET_TIME_relative_subtract (struct GNUNET_TIME_Relative a1, |
375 | a1, | 361 | struct GNUNET_TIME_Relative a2); |
376 | struct | ||
377 | GNUNET_TIME_Relative | ||
378 | a2); | ||
379 | 362 | ||
380 | 363 | ||
381 | /** | 364 | /** |
@@ -384,9 +367,8 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_subtract (struct | |||
384 | * @param a time to convert | 367 | * @param a time to convert |
385 | * @return converted time value | 368 | * @return converted time value |
386 | */ | 369 | */ |
387 | struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton (struct | 370 | struct GNUNET_TIME_RelativeNBO |
388 | GNUNET_TIME_Relative | 371 | GNUNET_TIME_relative_hton (struct GNUNET_TIME_Relative a); |
389 | a); | ||
390 | 372 | ||
391 | /** | 373 | /** |
392 | * Convert relative time from network byte order. | 374 | * Convert relative time from network byte order. |
@@ -394,9 +376,8 @@ struct GNUNET_TIME_RelativeNBO GNUNET_TIME_relative_hton (struct | |||
394 | * @param a time to convert | 376 | * @param a time to convert |
395 | * @return converted time value | 377 | * @return converted time value |
396 | */ | 378 | */ |
397 | struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh (struct | 379 | struct GNUNET_TIME_Relative |
398 | GNUNET_TIME_RelativeNBO | 380 | GNUNET_TIME_relative_ntoh (struct GNUNET_TIME_RelativeNBO a); |
399 | a); | ||
400 | 381 | ||
401 | /** | 382 | /** |
402 | * Convert relative time to network byte order. | 383 | * Convert relative time to network byte order. |
@@ -404,9 +385,8 @@ struct GNUNET_TIME_Relative GNUNET_TIME_relative_ntoh (struct | |||
404 | * @param a time to convert | 385 | * @param a time to convert |
405 | * @return converted time value | 386 | * @return converted time value |
406 | */ | 387 | */ |
407 | struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton (struct | 388 | struct GNUNET_TIME_AbsoluteNBO |
408 | GNUNET_TIME_Absolute | 389 | GNUNET_TIME_absolute_hton (struct GNUNET_TIME_Absolute a); |
409 | a); | ||
410 | 390 | ||
411 | /** | 391 | /** |
412 | * Convert relative time from network byte order. | 392 | * Convert relative time from network byte order. |
@@ -414,9 +394,8 @@ struct GNUNET_TIME_AbsoluteNBO GNUNET_TIME_absolute_hton (struct | |||
414 | * @param a time to convert | 394 | * @param a time to convert |
415 | * @return converted time value | 395 | * @return converted time value |
416 | */ | 396 | */ |
417 | struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh (struct | 397 | struct GNUNET_TIME_Absolute |
418 | GNUNET_TIME_AbsoluteNBO | 398 | GNUNET_TIME_absolute_ntoh (struct GNUNET_TIME_AbsoluteNBO a); |
419 | a); | ||
420 | 399 | ||
421 | /** | 400 | /** |
422 | * Convert a relative time to a string. | 401 | * Convert a relative time to a string. |
@@ -426,14 +405,16 @@ struct GNUNET_TIME_Absolute GNUNET_TIME_absolute_ntoh (struct | |||
426 | * | 405 | * |
427 | * @return string form of the time (as milliseconds) | 406 | * @return string form of the time (as milliseconds) |
428 | */ | 407 | */ |
429 | const char *GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time); | 408 | const char * |
409 | GNUNET_TIME_relative_to_string (struct GNUNET_TIME_Relative time); | ||
430 | 410 | ||
431 | /** | 411 | /** |
432 | * Set the timestamp offset for this instance. | 412 | * Set the timestamp offset for this instance. |
433 | * | 413 | * |
434 | * @param offset the offset to skew the locale time by | 414 | * @param offset the offset to skew the locale time by |
435 | */ | 415 | */ |
436 | void GNUNET_TIME_set_offset (long long offset); | 416 | void |
417 | GNUNET_TIME_set_offset (long long offset); | ||
437 | 418 | ||
438 | #if 0 /* keep Emacsens' auto-indent happy */ | 419 | #if 0 /* keep Emacsens' auto-indent happy */ |
439 | { | 420 | { |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 7e0656956..988d55784 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -468,18 +468,12 @@ typedef void (*GNUNET_TRANSPORT_AddressLookUpCallback) (void *cls, | |||
468 | * @param nd function to call on disconnect events | 468 | * @param nd function to call on disconnect events |
469 | * @return NULL on error | 469 | * @return NULL on error |
470 | */ | 470 | */ |
471 | struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct | 471 | struct GNUNET_TRANSPORT_Handle * |
472 | GNUNET_CONFIGURATION_Handle | 472 | GNUNET_TRANSPORT_connect (const struct GNUNET_CONFIGURATION_Handle *cfg, |
473 | *cfg, | 473 | const struct GNUNET_PeerIdentity *self, void *cls, |
474 | const struct | 474 | GNUNET_TRANSPORT_ReceiveCallback rec, |
475 | GNUNET_PeerIdentity | 475 | GNUNET_TRANSPORT_NotifyConnect nc, |
476 | *self, void *cls, | 476 | GNUNET_TRANSPORT_NotifyDisconnect nd); |
477 | GNUNET_TRANSPORT_ReceiveCallback | ||
478 | rec, | ||
479 | GNUNET_TRANSPORT_NotifyConnect | ||
480 | nc, | ||
481 | GNUNET_TRANSPORT_NotifyDisconnect | ||
482 | nd); | ||
483 | 477 | ||
484 | 478 | ||
485 | /** | 479 | /** |
@@ -487,7 +481,8 @@ struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (const struct | |||
487 | * | 481 | * |
488 | * @param handle handle returned from connect | 482 | * @param handle handle returned from connect |
489 | */ | 483 | */ |
490 | void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); | 484 | void |
485 | GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); | ||
491 | 486 | ||
492 | 487 | ||
493 | /** | 488 | /** |
@@ -497,8 +492,9 @@ void GNUNET_TRANSPORT_disconnect (struct GNUNET_TRANSPORT_Handle *handle); | |||
497 | * @param handle connection to transport service | 492 | * @param handle connection to transport service |
498 | * @param target who we should try to connect to | 493 | * @param target who we should try to connect to |
499 | */ | 494 | */ |
500 | void GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, | 495 | void |
501 | const struct GNUNET_PeerIdentity *target); | 496 | GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, |
497 | const struct GNUNET_PeerIdentity *target); | ||
502 | 498 | ||
503 | 499 | ||
504 | /** | 500 | /** |
@@ -510,10 +506,11 @@ void GNUNET_TRANSPORT_try_connect (struct GNUNET_TRANSPORT_Handle *handle, | |||
510 | * @param quota_in incoming bandwidth quota | 506 | * @param quota_in incoming bandwidth quota |
511 | * @param quota_out outgoing bandwidth quota | 507 | * @param quota_out outgoing bandwidth quota |
512 | */ | 508 | */ |
513 | void GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, | 509 | void |
514 | const struct GNUNET_PeerIdentity *target, | 510 | GNUNET_TRANSPORT_set_quota (struct GNUNET_TRANSPORT_Handle *handle, |
515 | struct GNUNET_BANDWIDTH_Value32NBO quota_in, | 511 | const struct GNUNET_PeerIdentity *target, |
516 | struct GNUNET_BANDWIDTH_Value32NBO quota_out); | 512 | struct GNUNET_BANDWIDTH_Value32NBO quota_in, |
513 | struct GNUNET_BANDWIDTH_Value32NBO quota_out); | ||
517 | 514 | ||
518 | 515 | ||
519 | /** | 516 | /** |
@@ -541,16 +538,13 @@ struct GNUNET_TRANSPORT_TransmitHandle; | |||
541 | * non-NULL if the notify callback was queued (can be used to cancel | 538 | * non-NULL if the notify callback was queued (can be used to cancel |
542 | * using GNUNET_TRANSPORT_notify_transmit_ready_cancel) | 539 | * using GNUNET_TRANSPORT_notify_transmit_ready_cancel) |
543 | */ | 540 | */ |
544 | struct GNUNET_TRANSPORT_TransmitHandle | 541 | struct GNUNET_TRANSPORT_TransmitHandle * |
545 | *GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle | 542 | GNUNET_TRANSPORT_notify_transmit_ready (struct GNUNET_TRANSPORT_Handle *handle, |
546 | *handle, | 543 | const struct GNUNET_PeerIdentity |
547 | const struct GNUNET_PeerIdentity | 544 | *target, size_t size, uint32_t priority, |
548 | *target, size_t size, | 545 | struct GNUNET_TIME_Relative timeout, |
549 | uint32_t priority, | 546 | GNUNET_CONNECTION_TransmitReadyNotify |
550 | struct GNUNET_TIME_Relative | 547 | notify, void *notify_cls); |
551 | timeout, | ||
552 | GNUNET_CONNECTION_TransmitReadyNotify | ||
553 | notify, void *notify_cls); | ||
554 | 548 | ||
555 | 549 | ||
556 | /** | 550 | /** |
@@ -558,9 +552,10 @@ struct GNUNET_TRANSPORT_TransmitHandle | |||
558 | * | 552 | * |
559 | * @param th handle of the transmission notification request to cancel | 553 | * @param th handle of the transmission notification request to cancel |
560 | */ | 554 | */ |
561 | void GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct | 555 | void |
562 | GNUNET_TRANSPORT_TransmitHandle | 556 | GNUNET_TRANSPORT_notify_transmit_ready_cancel (struct |
563 | *th); | 557 | GNUNET_TRANSPORT_TransmitHandle |
558 | *th); | ||
564 | 559 | ||
565 | 560 | ||
566 | 561 | ||
@@ -584,9 +579,10 @@ typedef void (*GNUNET_TRANSPORT_HelloUpdateCallback) (void *cls, | |||
584 | * @param rec function to call with the HELLO | 579 | * @param rec function to call with the HELLO |
585 | * @param rec_cls closure for rec | 580 | * @param rec_cls closure for rec |
586 | */ | 581 | */ |
587 | void GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, | 582 | void |
588 | GNUNET_TRANSPORT_HelloUpdateCallback rec, | 583 | GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, |
589 | void *rec_cls); | 584 | GNUNET_TRANSPORT_HelloUpdateCallback rec, |
585 | void *rec_cls); | ||
590 | 586 | ||
591 | 587 | ||
592 | /** | 588 | /** |
@@ -596,9 +592,10 @@ void GNUNET_TRANSPORT_get_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
596 | * @param rec function previously registered to be called with the HELLOs | 592 | * @param rec function previously registered to be called with the HELLOs |
597 | * @param rec_cls closure for rec | 593 | * @param rec_cls closure for rec |
598 | */ | 594 | */ |
599 | void GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, | 595 | void |
600 | GNUNET_TRANSPORT_HelloUpdateCallback | 596 | GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, |
601 | rec, void *rec_cls); | 597 | GNUNET_TRANSPORT_HelloUpdateCallback rec, |
598 | void *rec_cls); | ||
602 | 599 | ||
603 | 600 | ||
604 | /** | 601 | /** |
@@ -612,9 +609,10 @@ void GNUNET_TRANSPORT_get_hello_cancel (struct GNUNET_TRANSPORT_Handle *handle, | |||
612 | * @param cls closure for continuation | 609 | * @param cls closure for continuation |
613 | * | 610 | * |
614 | */ | 611 | */ |
615 | void GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, | 612 | void |
616 | const struct GNUNET_MessageHeader *hello, | 613 | GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, |
617 | GNUNET_SCHEDULER_Task cont, void *cls); | 614 | const struct GNUNET_MessageHeader *hello, |
615 | GNUNET_SCHEDULER_Task cont, void *cls); | ||
618 | 616 | ||
619 | 617 | ||
620 | /** | 618 | /** |
@@ -630,13 +628,13 @@ void GNUNET_TRANSPORT_offer_hello (struct GNUNET_TRANSPORT_Handle *handle, | |||
630 | * @param aluc function to call with the results | 628 | * @param aluc function to call with the results |
631 | * @param aluc_cls closure for aluc | 629 | * @param aluc_cls closure for aluc |
632 | */ | 630 | */ |
633 | void GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle | 631 | void |
634 | *cfg, const char *address, | 632 | GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle *cfg, |
635 | size_t addressLen, int numeric, | 633 | const char *address, size_t addressLen, |
636 | const char *nameTrans, | 634 | int numeric, const char *nameTrans, |
637 | struct GNUNET_TIME_Relative timeout, | 635 | struct GNUNET_TIME_Relative timeout, |
638 | GNUNET_TRANSPORT_AddressLookUpCallback | 636 | GNUNET_TRANSPORT_AddressLookUpCallback aluc, |
639 | aluc, void *aluc_cls); | 637 | void *aluc_cls); |
640 | 638 | ||
641 | 639 | ||
642 | /** | 640 | /** |
@@ -649,14 +647,14 @@ void GNUNET_TRANSPORT_address_lookup (const struct GNUNET_CONFIGURATION_Handle | |||
649 | * @param peer_address_callback function to call with the results | 647 | * @param peer_address_callback function to call with the results |
650 | * @param peer_address_callback_cls closure for peer_address_callback | 648 | * @param peer_address_callback_cls closure for peer_address_callback |
651 | */ | 649 | */ |
652 | void GNUNET_TRANSPORT_peer_address_lookup (const struct | 650 | void |
653 | GNUNET_CONFIGURATION_Handle *cfg, | 651 | GNUNET_TRANSPORT_peer_address_lookup (const struct GNUNET_CONFIGURATION_Handle |
654 | const struct GNUNET_PeerIdentity | 652 | *cfg, |
655 | *peer, | 653 | const struct GNUNET_PeerIdentity *peer, |
656 | struct GNUNET_TIME_Relative timeout, | 654 | struct GNUNET_TIME_Relative timeout, |
657 | GNUNET_TRANSPORT_AddressLookUpCallback | 655 | GNUNET_TRANSPORT_AddressLookUpCallback |
658 | peer_address_callback, | 656 | peer_address_callback, |
659 | void *peer_address_callback_cls); | 657 | void *peer_address_callback_cls); |
660 | 658 | ||
661 | 659 | ||
662 | /** | 660 | /** |
@@ -668,12 +666,12 @@ void GNUNET_TRANSPORT_peer_address_lookup (const struct | |||
668 | * @param peer_address_callback function to call with the results | 666 | * @param peer_address_callback function to call with the results |
669 | * @param peer_address_callback_cls closure for peer_address_callback | 667 | * @param peer_address_callback_cls closure for peer_address_callback |
670 | */ | 668 | */ |
671 | void GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle | 669 | void |
672 | *cfg, | 670 | GNUNET_TRANSPORT_address_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, |
673 | struct GNUNET_TIME_Relative timeout, | 671 | struct GNUNET_TIME_Relative timeout, |
674 | GNUNET_TRANSPORT_AddressLookUpCallback | 672 | GNUNET_TRANSPORT_AddressLookUpCallback |
675 | peer_address_callback, | 673 | peer_address_callback, |
676 | void *peer_address_callback_cls); | 674 | void *peer_address_callback_cls); |
677 | 675 | ||
678 | 676 | ||
679 | /** | 677 | /** |
@@ -708,12 +706,10 @@ typedef int (*GNUNET_TRANSPORT_BlacklistCallback) (void *cls, | |||
708 | * @param cb_cls closure for cb | 706 | * @param cb_cls closure for cb |
709 | * @return NULL on error, otherwise handle for cancellation | 707 | * @return NULL on error, otherwise handle for cancellation |
710 | */ | 708 | */ |
711 | struct GNUNET_TRANSPORT_Blacklist *GNUNET_TRANSPORT_blacklist (const struct | 709 | struct GNUNET_TRANSPORT_Blacklist * |
712 | GNUNET_CONFIGURATION_Handle | 710 | GNUNET_TRANSPORT_blacklist (const struct GNUNET_CONFIGURATION_Handle *cfg, |
713 | *cfg, | 711 | GNUNET_TRANSPORT_BlacklistCallback cb, |
714 | GNUNET_TRANSPORT_BlacklistCallback | 712 | void *cb_cls); |
715 | cb, | ||
716 | void *cb_cls); | ||
717 | 713 | ||
718 | 714 | ||
719 | /** | 715 | /** |
@@ -722,7 +718,8 @@ struct GNUNET_TRANSPORT_Blacklist *GNUNET_TRANSPORT_blacklist (const struct | |||
722 | * | 718 | * |
723 | * @param br handle of the request that is to be cancelled | 719 | * @param br handle of the request that is to be cancelled |
724 | */ | 720 | */ |
725 | void GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br); | 721 | void |
722 | GNUNET_TRANSPORT_blacklist_cancel (struct GNUNET_TRANSPORT_Blacklist *br); | ||
726 | 723 | ||
727 | 724 | ||
728 | 725 | ||
diff --git a/src/include/gnunet_upnp_service.h b/src/include/gnunet_upnp_service.h index 70e50b354..1ac2ca58e 100644 --- a/src/include/gnunet_upnp_service.h +++ b/src/include/gnunet_upnp_service.h | |||
@@ -54,10 +54,11 @@ 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, int domain, | 57 | int |
58 | int type, int protocol, uint16_t port, | 58 | GNUNET_UPNP_get_ip (struct GNUNET_CONFIGURATION_Handle *cfg, int domain, |
59 | struct GNUNET_TIME_Relative timeout, | 59 | int type, int protocol, uint16_t port, |
60 | GNUNET_RESOLVER_AddressCallback callback, void *cls); | 60 | struct GNUNET_TIME_Relative timeout, |
61 | GNUNET_RESOLVER_AddressCallback callback, void *cls); | ||
61 | 62 | ||
62 | 63 | ||
63 | #if 0 /* keep Emacsens' auto-indent happy */ | 64 | #if 0 /* keep Emacsens' auto-indent happy */ |
diff --git a/src/include/platform.h b/src/include/platform.h index 4f9eb5eda..aa2434731 100644 --- a/src/include/platform.h +++ b/src/include/platform.h | |||
@@ -226,7 +226,8 @@ | |||
226 | 226 | ||
227 | 227 | ||
228 | #if !HAVE_ATOLL | 228 | #if !HAVE_ATOLL |
229 | long long atoll (const char *nptr); | 229 | long long |
230 | atoll (const char *nptr); | ||
230 | #endif | 231 | #endif |
231 | 232 | ||
232 | #if ENABLE_NLS | 233 | #if ENABLE_NLS |