diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/datastore/plugin_datastore_template.c | 1 | ||||
-rw-r--r-- | src/fs/fs_file_information.c | 9 | ||||
-rw-r--r-- | src/fs/fs_publish.c | 5 | ||||
-rw-r--r-- | src/fs/gnunet-service-fs.c | 15 | ||||
-rw-r--r-- | src/fs/gnunet-unindex.c | 2 | ||||
-rw-r--r-- | src/hostlist/hostlist-client.c | 3 | ||||
-rw-r--r-- | src/hostlist/hostlist-client.h | 3 | ||||
-rw-r--r-- | src/include/gnunet_configuration_lib.h | 9 | ||||
-rw-r--r-- | src/include/gnunet_container_lib.h | 1 | ||||
-rw-r--r-- | src/include/gnunet_fs_service.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_network_lib.h | 21 | ||||
-rw-r--r-- | src/util/client.c | 14 | ||||
-rw-r--r-- | src/util/common_logging.c | 52 | ||||
-rw-r--r-- | src/util/configuration.c | 191 | ||||
-rw-r--r-- | src/util/disk.c | 8 | ||||
-rw-r--r-- | src/util/getopt.c | 3 | ||||
-rw-r--r-- | src/util/network.c | 15 | ||||
-rw-r--r-- | src/util/os_network.c | 4 | ||||
-rw-r--r-- | src/util/pseudonym.c | 2 |
19 files changed, 315 insertions, 47 deletions
diff --git a/src/datastore/plugin_datastore_template.c b/src/datastore/plugin_datastore_template.c index 7f31ff703..6439bc019 100644 --- a/src/datastore/plugin_datastore_template.c +++ b/src/datastore/plugin_datastore_template.c | |||
@@ -194,6 +194,7 @@ template_plugin_iter_low_priority (void *cls, | |||
194 | * Select a subset of the items in the datastore and call | 194 | * Select a subset of the items in the datastore and call |
195 | * the given iterator for each of them. | 195 | * the given iterator for each of them. |
196 | * | 196 | * |
197 | * @param cls our "struct Plugin*" | ||
197 | * @param type entries of which type should be considered? | 198 | * @param type entries of which type should be considered? |
198 | * Use 0 for any type. | 199 | * Use 0 for any type. |
199 | * @param iter function to call on each matching value; | 200 | * @param iter function to call on each matching value; |
diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index e173b1149..84b79866a 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c | |||
@@ -53,11 +53,11 @@ GNUNET_FS_file_information_sync (struct GNUNET_FS_FileInformation * fi) | |||
53 | * Load file information from the file to which | 53 | * Load file information from the file to which |
54 | * it was sync'ed. | 54 | * it was sync'ed. |
55 | * | 55 | * |
56 | * @param filename name of the file to use | 56 | * @param fn name of the file to use |
57 | * @return NULL on error | 57 | * @return NULL on error |
58 | */ | 58 | */ |
59 | struct GNUNET_FS_FileInformation * | 59 | struct GNUNET_FS_FileInformation * |
60 | GNUNET_FS_file_information_recover (const char *name) | 60 | GNUNET_FS_file_information_recover (const char *fn) |
61 | { | 61 | { |
62 | struct GNUNET_FS_FileInformation *ret; | 62 | struct GNUNET_FS_FileInformation *ret; |
63 | ret = NULL; | 63 | ret = NULL; |
@@ -173,6 +173,7 @@ data_reader_file(void *cls, | |||
173 | /** | 173 | /** |
174 | * Create an entry for a file in a publish-structure. | 174 | * Create an entry for a file in a publish-structure. |
175 | * | 175 | * |
176 | * @param client_info initial value for the client-info value for this entry | ||
176 | * @param filename name of the file or directory to publish | 177 | * @param filename name of the file or directory to publish |
177 | * @param keywords under which keywords should this file be available | 178 | * @param keywords under which keywords should this file be available |
178 | * directly; can be NULL | 179 | * directly; can be NULL |
@@ -258,6 +259,7 @@ data_reader_copy(void *cls, | |||
258 | /** | 259 | /** |
259 | * Create an entry for a file in a publish-structure. | 260 | * Create an entry for a file in a publish-structure. |
260 | * | 261 | * |
262 | * @param client_info initial value for the client-info value for this entry | ||
261 | * @param length length of the file | 263 | * @param length length of the file |
262 | * @param data data for the file (should not be used afterwards by | 264 | * @param data data for the file (should not be used afterwards by |
263 | * the caller; caller will "free") | 265 | * the caller; caller will "free") |
@@ -300,6 +302,7 @@ GNUNET_FS_file_information_create_from_data (void *client_info, | |||
300 | /** | 302 | /** |
301 | * Create an entry for a file in a publish-structure. | 303 | * Create an entry for a file in a publish-structure. |
302 | * | 304 | * |
305 | * @param client_info initial value for the client-info value for this entry | ||
303 | * @param length length of the file | 306 | * @param length length of the file |
304 | * @param reader function that can be used to obtain the data for the file | 307 | * @param reader function that can be used to obtain the data for the file |
305 | * @param reader_cls closure for "reader" | 308 | * @param reader_cls closure for "reader" |
@@ -575,6 +578,7 @@ dirproc (void *cls, | |||
575 | * passed (GNUNET_FS_directory_scanner_default). This is strictly a | 578 | * passed (GNUNET_FS_directory_scanner_default). This is strictly a |
576 | * convenience function. | 579 | * convenience function. |
577 | * | 580 | * |
581 | * @param client_info initial value for the client-info value for this entry | ||
578 | * @param filename name of the top-level file or directory | 582 | * @param filename name of the top-level file or directory |
579 | * @param scanner function used to get a list of files in a directory | 583 | * @param scanner function used to get a list of files in a directory |
580 | * @param scanner_cls closure for scanner | 584 | * @param scanner_cls closure for scanner |
@@ -642,6 +646,7 @@ GNUNET_FS_file_information_create_from_directory (void *client_info, | |||
642 | * use of "GNUNET_FS_file_information_create_from_directory" | 646 | * use of "GNUNET_FS_file_information_create_from_directory" |
643 | * is not appropriate. | 647 | * is not appropriate. |
644 | * | 648 | * |
649 | * @param client_info initial value for the client-info value for this entry | ||
645 | * @param meta metadata for the directory | 650 | * @param meta metadata for the directory |
646 | * @param keywords under which keywords should this directory be available | 651 | * @param keywords under which keywords should this directory be available |
647 | * directly; can be NULL | 652 | * directly; can be NULL |
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 9ef691d2f..3ccc3c97a 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c | |||
@@ -94,7 +94,7 @@ struct PutContCtx | |||
94 | * Fill in all of the generic fields for | 94 | * Fill in all of the generic fields for |
95 | * a publish event. | 95 | * a publish event. |
96 | * | 96 | * |
97 | * @param pc structure to fill in | 97 | * @param pi structure to fill in |
98 | * @param sc overall publishing context | 98 | * @param sc overall publishing context |
99 | * @param p file information for the file being published | 99 | * @param p file information for the file being published |
100 | * @param offset where in the file are we so far | 100 | * @param offset where in the file are we so far |
@@ -129,7 +129,7 @@ make_publish_status (struct GNUNET_FS_ProgressInfo *pi, | |||
129 | * Cleanup the publish context, we're done | 129 | * Cleanup the publish context, we're done |
130 | * with it. | 130 | * with it. |
131 | * | 131 | * |
132 | * @param pc struct to clean up after | 132 | * @param sc struct to clean up after |
133 | */ | 133 | */ |
134 | static void | 134 | static void |
135 | publish_cleanup (struct GNUNET_FS_PublishContext *sc) | 135 | publish_cleanup (struct GNUNET_FS_PublishContext *sc) |
@@ -461,6 +461,7 @@ encode_cont (void *cls, | |||
461 | * | 461 | * |
462 | * @param cls closure | 462 | * @param cls closure |
463 | * @param query the query for the block (key for lookup in the datastore) | 463 | * @param query the query for the block (key for lookup in the datastore) |
464 | * @param offset offset of the block in the file | ||
464 | * @param type type of the block (IBLOCK or DBLOCK) | 465 | * @param type type of the block (IBLOCK or DBLOCK) |
465 | * @param block the (encrypted) block | 466 | * @param block the (encrypted) block |
466 | * @param block_size size of block (in bytes) | 467 | * @param block_size size of block (in bytes) |
diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 3264fdbc7..1e57ef73d 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c | |||
@@ -2659,7 +2659,7 @@ ds_get_request (void *cls, | |||
2659 | * value for the ttl that can be requested. | 2659 | * value for the ttl that can be requested. |
2660 | * | 2660 | * |
2661 | * @param ttl_in requested ttl | 2661 | * @param ttl_in requested ttl |
2662 | * @param priority given priority | 2662 | * @param prio given priority |
2663 | * @return ttl_in if ttl_in is below the limit, | 2663 | * @return ttl_in if ttl_in is below the limit, |
2664 | * otherwise the ttl-limit for the given priority | 2664 | * otherwise the ttl-limit for the given priority |
2665 | */ | 2665 | */ |
@@ -2702,7 +2702,7 @@ bound_priority (uint32_t prio_in, | |||
2702 | * Handle P2P "GET" request. | 2702 | * Handle P2P "GET" request. |
2703 | * | 2703 | * |
2704 | * @param cls closure, always NULL | 2704 | * @param cls closure, always NULL |
2705 | * @param peer the other peer involved (sender or receiver, NULL | 2705 | * @param other the other peer involved (sender or receiver, NULL |
2706 | * for loopback messages where we are both sender and receiver) | 2706 | * for loopback messages where we are both sender and receiver) |
2707 | * @param message the actual message | 2707 | * @param message the actual message |
2708 | * @return GNUNET_OK to keep the connection open, | 2708 | * @return GNUNET_OK to keep the connection open, |
@@ -3135,7 +3135,7 @@ check_sblock (const struct SBlock *sb, | |||
3135 | * Handle P2P "PUT" request. | 3135 | * Handle P2P "PUT" request. |
3136 | * | 3136 | * |
3137 | * @param cls closure, always NULL | 3137 | * @param cls closure, always NULL |
3138 | * @param peer the other peer involved (sender or receiver, NULL | 3138 | * @param other the other peer involved (sender or receiver, NULL |
3139 | * for loopback messages where we are both sender and receiver) | 3139 | * for loopback messages where we are both sender and receiver) |
3140 | * @param message the actual message | 3140 | * @param message the actual message |
3141 | * @return GNUNET_OK to keep the connection open, | 3141 | * @return GNUNET_OK to keep the connection open, |
@@ -3243,6 +3243,11 @@ core_connect_task (void *cls, | |||
3243 | /** | 3243 | /** |
3244 | * Function called by the core after we've | 3244 | * Function called by the core after we've |
3245 | * connected. | 3245 | * connected. |
3246 | * | ||
3247 | * @param cls closure, unused | ||
3248 | * @param server handle to the core service | ||
3249 | * @param my_identity our peer identity (unused) | ||
3250 | * @param publicKey our public key (unused) | ||
3246 | */ | 3251 | */ |
3247 | static void | 3252 | static void |
3248 | core_start_cb (void *cls, | 3253 | core_start_cb (void *cls, |
@@ -3297,9 +3302,9 @@ core_connect_task (void *cls, | |||
3297 | * Process fs requests. | 3302 | * Process fs requests. |
3298 | * | 3303 | * |
3299 | * @param cls closure | 3304 | * @param cls closure |
3300 | * @param sched scheduler to use | 3305 | * @param s scheduler to use |
3301 | * @param server the initialized server | 3306 | * @param server the initialized server |
3302 | * @param cfg configuration to use | 3307 | * @param c configuration to use |
3303 | */ | 3308 | */ |
3304 | static void | 3309 | static void |
3305 | run (void *cls, | 3310 | run (void *cls, |
diff --git a/src/fs/gnunet-unindex.c b/src/fs/gnunet-unindex.c index 9b335eec0..e6af09172 100644 --- a/src/fs/gnunet-unindex.c +++ b/src/fs/gnunet-unindex.c | |||
@@ -99,7 +99,7 @@ progress_cb (void *cls, | |||
99 | * @param sched the scheduler to use | 99 | * @param sched the scheduler to use |
100 | * @param args remaining command-line arguments | 100 | * @param args remaining command-line arguments |
101 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) | 101 | * @param cfgfile name of the configuration file used (for saving, can be NULL!) |
102 | * @param cfg configuration | 102 | * @param c configuration |
103 | */ | 103 | */ |
104 | static void | 104 | static void |
105 | run (void *cls, | 105 | run (void *cls, |
diff --git a/src/hostlist/hostlist-client.c b/src/hostlist/hostlist-client.c index cc24dc135..9b385c8ff 100644 --- a/src/hostlist/hostlist-client.c +++ b/src/hostlist/hostlist-client.c | |||
@@ -307,7 +307,8 @@ clean_up () | |||
307 | * Task that is run when we are ready to receive more data from the hostlist | 307 | * Task that is run when we are ready to receive more data from the hostlist |
308 | * server. | 308 | * server. |
309 | * | 309 | * |
310 | * @param tc | 310 | * @param cls closure, unused |
311 | * @param tc task context, unused | ||
311 | */ | 312 | */ |
312 | static void | 313 | static void |
313 | multi_ready (void *cls, | 314 | multi_ready (void *cls, |
diff --git a/src/hostlist/hostlist-client.h b/src/hostlist/hostlist-client.h index 8adf67af9..26c013505 100644 --- a/src/hostlist/hostlist-client.h +++ b/src/hostlist/hostlist-client.h | |||
@@ -35,6 +35,9 @@ | |||
35 | /** | 35 | /** |
36 | * Start downloading hostlists from hostlist servers as necessary. | 36 | * Start downloading hostlists from hostlist servers as necessary. |
37 | * | 37 | * |
38 | * @param c the configuration to use | ||
39 | * @param s the scheduler to use | ||
40 | * @param st hande for publishing statistics | ||
38 | * @param ch set to handler for connect notifications | 41 | * @param ch set to handler for connect notifications |
39 | * @param dh set to handler for disconnect notifications | 42 | * @param dh set to handler for disconnect notifications |
40 | * @return GNUNET_OK on success | 43 | * @return GNUNET_OK on success |
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 84c20bde0..8e2f8e6d9 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -156,6 +156,7 @@ int GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Han | |||
156 | const char *option, | 156 | const char *option, |
157 | unsigned long long *number); | 157 | unsigned long long *number); |
158 | 158 | ||
159 | |||
159 | /** | 160 | /** |
160 | * Get a configuration value that should be a relative time. | 161 | * Get a configuration value that should be a relative time. |
161 | * | 162 | * |
@@ -170,6 +171,7 @@ int GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handl | |||
170 | const char *option, | 171 | const char *option, |
171 | struct GNUNET_TIME_Relative *time); | 172 | struct GNUNET_TIME_Relative *time); |
172 | 173 | ||
174 | |||
173 | /** | 175 | /** |
174 | * Test if we have a value for a particular option | 176 | * Test if we have a value for a particular option |
175 | * | 177 | * |
@@ -181,6 +183,7 @@ int GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handl | |||
181 | int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, | 183 | int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, |
182 | const char *section, const char *option); | 184 | const char *section, const char *option); |
183 | 185 | ||
186 | |||
184 | /** | 187 | /** |
185 | * Get a configuration value that should be a string. | 188 | * Get a configuration value that should be a string. |
186 | * | 189 | * |
@@ -195,6 +198,7 @@ int GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Han | |||
195 | *cfg, const char *section, | 198 | *cfg, const char *section, |
196 | const char *option, char **value); | 199 | const char *option, char **value); |
197 | 200 | ||
201 | |||
198 | /** | 202 | /** |
199 | * Get a configuration value that should be the name of a file | 203 | * Get a configuration value that should be the name of a file |
200 | * or directory. | 204 | * or directory. |
@@ -267,11 +271,12 @@ int GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Hand | |||
267 | * "FOO" is set to "DIRECTORY". | 271 | * "FOO" is set to "DIRECTORY". |
268 | * | 272 | * |
269 | * @param cfg configuration to use for path expansion | 273 | * @param cfg configuration to use for path expansion |
270 | * @param old string to $-expand (will be freed!) | 274 | * @param orig string to $-expand (will be freed!) |
271 | * @return $-expanded string | 275 | * @return $-expanded string |
272 | */ | 276 | */ |
273 | char *GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle | 277 | char *GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle |
274 | *cfg, char *old); | 278 | *cfg, char *orig); |
279 | |||
275 | 280 | ||
276 | /** | 281 | /** |
277 | * Set a configuration value that should be a number. | 282 | * Set a configuration value that should be a number. |
diff --git a/src/include/gnunet_container_lib.h b/src/include/gnunet_container_lib.h index bd4f9b032..bbf1ba2cf 100644 --- a/src/include/gnunet_container_lib.h +++ b/src/include/gnunet_container_lib.h | |||
@@ -491,7 +491,6 @@ typedef int (*GNUNET_CONTAINER_HashMapIterator) (void *cls, | |||
491 | /** | 491 | /** |
492 | * Create a multi hash map. | 492 | * Create a multi hash map. |
493 | * | 493 | * |
494 | * @param map the map | ||
495 | * @param len initial size (map will grow as needed) | 494 | * @param len initial size (map will grow as needed) |
496 | * @return NULL on error | 495 | * @return NULL on error |
497 | */ | 496 | */ |
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 3f603e581..ae1b46a89 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -1525,11 +1525,11 @@ typedef int (*GNUNET_FS_FileInformationProcessor)(void *cls, | |||
1525 | /** | 1525 | /** |
1526 | * Recover file information structure from disk. | 1526 | * Recover file information structure from disk. |
1527 | * | 1527 | * |
1528 | * @param name filename for the structure on disk | 1528 | * @param fn filename for the structure on disk |
1529 | * @return NULL on error | 1529 | * @return NULL on error |
1530 | */ | 1530 | */ |
1531 | struct GNUNET_FS_FileInformation * | 1531 | struct GNUNET_FS_FileInformation * |
1532 | GNUNET_FS_file_information_recover (const char *name); | 1532 | GNUNET_FS_file_information_recover (const char *fn); |
1533 | 1533 | ||
1534 | 1534 | ||
1535 | /** | 1535 | /** |
diff --git a/src/include/gnunet_network_lib.h b/src/include/gnunet_network_lib.h index 492713c46..d966c3afe 100644 --- a/src/include/gnunet_network_lib.h +++ b/src/include/gnunet_network_lib.h | |||
@@ -68,17 +68,18 @@ GNUNET_NETWORK_socket_accept (const struct GNUNET_NETWORK_Handle *desc, | |||
68 | * Make a non-inheritable to child processes (sets the | 68 | * Make a non-inheritable to child processes (sets the |
69 | * close-on-exec flag). | 69 | * close-on-exec flag). |
70 | * | 70 | * |
71 | * @param socket | 71 | * @param h the socket to make non-inheritable |
72 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 72 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
73 | * @warning Not implemented on Windows | 73 | * @warning Not implemented on Windows |
74 | */ | 74 | */ |
75 | int | 75 | int |
76 | GNUNET_NETWORK_socket_set_inheritable (const struct GNUNET_NETWORK_Handle | 76 | GNUNET_NETWORK_socket_set_inheritable (const struct GNUNET_NETWORK_Handle |
77 | *desc); | 77 | *h); |
78 | 78 | ||
79 | /** | 79 | /** |
80 | * Bind to a connected socket | 80 | * Bind to a connected socket |
81 | * @param desc socket | 81 | * |
82 | * @param desc socket to bind | ||
82 | * @param address address to be bound | 83 | * @param address address to be bound |
83 | * @param address_len length of address | 84 | * @param address_len length of address |
84 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 85 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
@@ -88,14 +89,16 @@ int GNUNET_NETWORK_socket_bind (struct GNUNET_NETWORK_Handle *desc, | |||
88 | 89 | ||
89 | /** | 90 | /** |
90 | * Close a socket | 91 | * Close a socket |
91 | * @param desc socket | 92 | * |
93 | * @param desc socket to close | ||
92 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 94 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
93 | */ | 95 | */ |
94 | int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | 96 | int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); |
95 | 97 | ||
96 | /** | 98 | /** |
97 | * Connect a socket | 99 | * Connect a socket |
98 | * @param desc socket | 100 | * |
101 | * @param desc socket to connect | ||
99 | * @param address peer address | 102 | * @param address peer address |
100 | * @param length of address | 103 | * @param length of address |
101 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 104 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
@@ -103,9 +106,11 @@ int GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc); | |||
103 | int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | 106 | int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, |
104 | const struct sockaddr *address, socklen_t address_len); | 107 | const struct sockaddr *address, socklen_t address_len); |
105 | 108 | ||
109 | |||
106 | /** | 110 | /** |
107 | * Get socket options | 111 | * Get socket options |
108 | * @param desc socket | 112 | * |
113 | * @param desc socket to inspect | ||
109 | * @param level protocol level of the option | 114 | * @param level protocol level of the option |
110 | * @param optname identifier of the option | 115 | * @param optname identifier of the option |
111 | * @param optval options | 116 | * @param optval options |
@@ -115,9 +120,11 @@ int GNUNET_NETWORK_socket_connect (const struct GNUNET_NETWORK_Handle *desc, | |||
115 | int GNUNET_NETWORK_socket_getsockopt(const struct GNUNET_NETWORK_Handle *desc, int level, int optname, | 120 | int GNUNET_NETWORK_socket_getsockopt(const struct GNUNET_NETWORK_Handle *desc, int level, int optname, |
116 | void *optval, socklen_t *optlen); | 121 | void *optval, socklen_t *optlen); |
117 | 122 | ||
123 | |||
118 | /** | 124 | /** |
119 | * Listen on a socket | 125 | * Listen on a socket |
120 | * @param desc socket | 126 | * |
127 | * @param desc socket to start listening on | ||
121 | * @param backlog length of the listen queue | 128 | * @param backlog length of the listen queue |
122 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 129 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
123 | */ | 130 | */ |
diff --git a/src/util/client.c b/src/util/client.c index 82ab35d21..9a2f47678 100644 --- a/src/util/client.c +++ b/src/util/client.c | |||
@@ -303,25 +303,25 @@ receive_task (void *scls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
303 | * | 303 | * |
304 | * @param sock the service | 304 | * @param sock the service |
305 | * @param handler function to call with the message | 305 | * @param handler function to call with the message |
306 | * @param cls closure for handler | 306 | * @param handler_cls closure for handler |
307 | * @param timeout how long to wait until timing out | 307 | * @param timeout how long to wait until timing out |
308 | */ | 308 | */ |
309 | void | 309 | void |
310 | GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, | 310 | GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, |
311 | GNUNET_CLIENT_MessageHandler handler, | 311 | GNUNET_CLIENT_MessageHandler handler, |
312 | void *cls, struct GNUNET_TIME_Relative timeout) | 312 | void *handler_cls, struct GNUNET_TIME_Relative timeout) |
313 | { | 313 | { |
314 | if (sock->sock == NULL) | 314 | if (sock->sock == NULL) |
315 | { | 315 | { |
316 | /* already disconnected, fail instantly! */ | 316 | /* already disconnected, fail instantly! */ |
317 | GNUNET_break (0); /* this should not happen in well-written code! */ | 317 | GNUNET_break (0); /* this should not happen in well-written code! */ |
318 | handler (cls, NULL); | 318 | handler (handler_cls, NULL); |
319 | return; | 319 | return; |
320 | } | 320 | } |
321 | GNUNET_assert (sock->receiver_task == | 321 | GNUNET_assert (sock->receiver_task == |
322 | GNUNET_SCHEDULER_NO_TASK); | 322 | GNUNET_SCHEDULER_NO_TASK); |
323 | sock->receiver_handler = handler; | 323 | sock->receiver_handler = handler; |
324 | sock->receiver_handler_cls = cls; | 324 | sock->receiver_handler_cls = handler_cls; |
325 | sock->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout); | 325 | sock->receive_timeout = GNUNET_TIME_relative_to_absolute (timeout); |
326 | if (GNUNET_YES == sock->msg_complete) | 326 | if (GNUNET_YES == sock->msg_complete) |
327 | sock->receiver_task = GNUNET_SCHEDULER_add_after (sock->sched, | 327 | sock->receiver_task = GNUNET_SCHEDULER_add_after (sock->sched, |
@@ -331,9 +331,9 @@ GNUNET_CLIENT_receive (struct GNUNET_CLIENT_Connection *sock, | |||
331 | &receive_task, sock); | 331 | &receive_task, sock); |
332 | else | 332 | else |
333 | sock->receiver_task = GNUNET_CONNECTION_receive (sock->sock, | 333 | sock->receiver_task = GNUNET_CONNECTION_receive (sock->sock, |
334 | GNUNET_SERVER_MAX_MESSAGE_SIZE, | 334 | GNUNET_SERVER_MAX_MESSAGE_SIZE, |
335 | timeout, | 335 | timeout, |
336 | &receive_helper, sock); | 336 | &receive_helper, sock); |
337 | } | 337 | } |
338 | 338 | ||
339 | 339 | ||
diff --git a/src/util/common_logging.c b/src/util/common_logging.c index 436e009ab..ea3ab4f78 100644 --- a/src/util/common_logging.c +++ b/src/util/common_logging.c | |||
@@ -123,12 +123,17 @@ static struct CustomLogger *loggers; | |||
123 | */ | 123 | */ |
124 | static unsigned int skip_log; | 124 | static unsigned int skip_log; |
125 | 125 | ||
126 | /** | ||
127 | * File descriptor to use for "stderr", or NULL for none. | ||
128 | */ | ||
126 | static FILE *GNUNET_stderr; | 129 | static FILE *GNUNET_stderr; |
127 | 130 | ||
128 | /** | 131 | /** |
129 | * Convert a textual description of a loglevel | 132 | * Convert a textual description of a loglevel |
130 | * to the respective GNUNET_GE_KIND. | 133 | * to the respective GNUNET_GE_KIND. |
131 | * @returns GNUNET_GE_INVALID if log does not parse | 134 | * |
135 | * @param log loglevel to parse | ||
136 | * @return GNUNET_GE_INVALID if log does not parse | ||
132 | */ | 137 | */ |
133 | static enum GNUNET_ErrorType | 138 | static enum GNUNET_ErrorType |
134 | get_type (const char *log) | 139 | get_type (const char *log) |
@@ -144,6 +149,7 @@ get_type (const char *log) | |||
144 | return GNUNET_ERROR_TYPE_INVALID; | 149 | return GNUNET_ERROR_TYPE_INVALID; |
145 | } | 150 | } |
146 | 151 | ||
152 | |||
147 | /** | 153 | /** |
148 | * Setup logging. | 154 | * Setup logging. |
149 | * | 155 | * |
@@ -219,6 +225,15 @@ GNUNET_logger_remove (GNUNET_Logger logger, void *logger_cls) | |||
219 | GNUNET_free (pos); | 225 | GNUNET_free (pos); |
220 | } | 226 | } |
221 | 227 | ||
228 | |||
229 | /** | ||
230 | * Actually output the log message. | ||
231 | * | ||
232 | * @param kind how severe was the issue | ||
233 | * @param comp component responsible | ||
234 | * @param datestr current date/time | ||
235 | * @param msg the actual message | ||
236 | */ | ||
222 | static void | 237 | static void |
223 | output_message (enum GNUNET_ErrorType kind, | 238 | output_message (enum GNUNET_ErrorType kind, |
224 | const char *comp, const char *datestr, const char *msg) | 239 | const char *comp, const char *datestr, const char *msg) |
@@ -235,6 +250,12 @@ output_message (enum GNUNET_ErrorType kind, | |||
235 | } | 250 | } |
236 | } | 251 | } |
237 | 252 | ||
253 | |||
254 | /** | ||
255 | * Flush an existing bulk report to the output. | ||
256 | * | ||
257 | * @param datastr our current timestamp | ||
258 | */ | ||
238 | static void | 259 | static void |
239 | flush_bulk (const char *datestr) | 260 | flush_bulk (const char *datestr) |
240 | { | 261 | { |
@@ -294,6 +315,14 @@ GNUNET_log_skip (unsigned int n, int check_reset) | |||
294 | } | 315 | } |
295 | 316 | ||
296 | 317 | ||
318 | /** | ||
319 | * Output a log message using the default mechanism. | ||
320 | * | ||
321 | * @param kind how severe was the issue | ||
322 | * @param comp component responsible | ||
323 | * @param message the actual message | ||
324 | * @param va arguments to the format string "message" | ||
325 | */ | ||
297 | static void | 326 | static void |
298 | mylog (enum GNUNET_ErrorType kind, | 327 | mylog (enum GNUNET_ErrorType kind, |
299 | const char *comp, const char *message, va_list va) | 328 | const char *comp, const char *message, va_list va) |
@@ -346,6 +375,13 @@ mylog (enum GNUNET_ErrorType kind, | |||
346 | } | 375 | } |
347 | 376 | ||
348 | 377 | ||
378 | /** | ||
379 | * Main log function. | ||
380 | * | ||
381 | * @param kind how serious is the error? | ||
382 | * @param message what is the message (format string) | ||
383 | * @param ... arguments for format string | ||
384 | */ | ||
349 | void | 385 | void |
350 | GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...) | 386 | GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...) |
351 | { | 387 | { |
@@ -356,6 +392,15 @@ GNUNET_log (enum GNUNET_ErrorType kind, const char *message, ...) | |||
356 | } | 392 | } |
357 | 393 | ||
358 | 394 | ||
395 | /** | ||
396 | * Log function that specifies an alternative component. | ||
397 | * This function should be used by plugins. | ||
398 | * | ||
399 | * @param kind how serious is the error? | ||
400 | * @param comp component responsible for generating the message | ||
401 | * @param message what is the message (format string) | ||
402 | * @param ... arguments for format string | ||
403 | */ | ||
359 | void | 404 | void |
360 | GNUNET_log_from (enum GNUNET_ErrorType kind, | 405 | GNUNET_log_from (enum GNUNET_ErrorType kind, |
361 | const char *comp, const char *message, ...) | 406 | const char *comp, const char *message, ...) |
@@ -368,7 +413,10 @@ GNUNET_log_from (enum GNUNET_ErrorType kind, | |||
368 | 413 | ||
369 | 414 | ||
370 | /** | 415 | /** |
371 | * Convert KIND to String | 416 | * Convert error type to string. |
417 | * | ||
418 | * @param kind type to convert | ||
419 | * @return string corresponding to the type | ||
372 | */ | 420 | */ |
373 | const char * | 421 | const char * |
374 | GNUNET_error_type_to_string (enum GNUNET_ErrorType kind) | 422 | GNUNET_error_type_to_string (enum GNUNET_ErrorType kind) |
diff --git a/src/util/configuration.c b/src/util/configuration.c index 8c32618e2..569c4adcf 100644 --- a/src/util/configuration.c +++ b/src/util/configuration.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include "gnunet_os_lib.h" | 33 | #include "gnunet_os_lib.h" |
34 | #include "gnunet_strings_lib.h" | 34 | #include "gnunet_strings_lib.h" |
35 | 35 | ||
36 | |||
36 | /** | 37 | /** |
37 | * @brief configuration entry | 38 | * @brief configuration entry |
38 | */ | 39 | */ |
@@ -55,6 +56,7 @@ struct ConfigEntry | |||
55 | char *val; | 56 | char *val; |
56 | }; | 57 | }; |
57 | 58 | ||
59 | |||
58 | /** | 60 | /** |
59 | * @brief configuration section | 61 | * @brief configuration section |
60 | */ | 62 | */ |
@@ -76,6 +78,7 @@ struct ConfigSection | |||
76 | char *name; | 78 | char *name; |
77 | }; | 79 | }; |
78 | 80 | ||
81 | |||
79 | /** | 82 | /** |
80 | * @brief configuration data | 83 | * @brief configuration data |
81 | */ | 84 | */ |
@@ -95,8 +98,11 @@ struct GNUNET_CONFIGURATION_Handle | |||
95 | 98 | ||
96 | }; | 99 | }; |
97 | 100 | ||
101 | |||
98 | /** | 102 | /** |
99 | * Create a GNUNET_CONFIGURATION_Configuration. | 103 | * Create a GNUNET_CONFIGURATION_Handle. |
104 | * | ||
105 | * @return fresh configuration object | ||
100 | */ | 106 | */ |
101 | struct GNUNET_CONFIGURATION_Handle * | 107 | struct GNUNET_CONFIGURATION_Handle * |
102 | GNUNET_CONFIGURATION_create () | 108 | GNUNET_CONFIGURATION_create () |
@@ -104,6 +110,12 @@ GNUNET_CONFIGURATION_create () | |||
104 | return GNUNET_malloc (sizeof (struct GNUNET_CONFIGURATION_Handle)); | 110 | return GNUNET_malloc (sizeof (struct GNUNET_CONFIGURATION_Handle)); |
105 | } | 111 | } |
106 | 112 | ||
113 | |||
114 | /** | ||
115 | * Destroy configuration object. | ||
116 | * | ||
117 | * @param cfg configuration to destroy | ||
118 | */ | ||
107 | void | 119 | void |
108 | GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg) | 120 | GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg) |
109 | { | 121 | { |
@@ -126,6 +138,15 @@ GNUNET_CONFIGURATION_destroy (struct GNUNET_CONFIGURATION_Handle *cfg) | |||
126 | GNUNET_free (cfg); | 138 | GNUNET_free (cfg); |
127 | } | 139 | } |
128 | 140 | ||
141 | |||
142 | /** | ||
143 | * Parse a configuration file, add all of the options in the | ||
144 | * file to the configuration environment. | ||
145 | * | ||
146 | * @param cfg configuration to update | ||
147 | * @param filename name of the configuration file | ||
148 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
149 | */ | ||
129 | int | 150 | int |
130 | GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | 151 | GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, |
131 | const char *filename) | 152 | const char *filename) |
@@ -234,12 +255,28 @@ GNUNET_CONFIGURATION_parse (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
234 | return ret; | 255 | return ret; |
235 | } | 256 | } |
236 | 257 | ||
258 | |||
259 | /** | ||
260 | * Test if there are configuration options that were | ||
261 | * changed since the last save. | ||
262 | * | ||
263 | * @param cfg configuration to inspect | ||
264 | * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) | ||
265 | */ | ||
237 | int | 266 | int |
238 | GNUNET_CONFIGURATION_test_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg) | 267 | GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg) |
239 | { | 268 | { |
240 | return cfg->dirty; | 269 | return cfg->dirty; |
241 | } | 270 | } |
242 | 271 | ||
272 | |||
273 | /** | ||
274 | * Write configuration file. | ||
275 | * | ||
276 | * @param cfg configuration to write | ||
277 | * @param filename where to write the configuration | ||
278 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
279 | */ | ||
243 | int | 280 | int |
244 | GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *data, | 281 | GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *data, |
245 | const char *filename) | 282 | const char *filename) |
@@ -315,6 +352,13 @@ GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *data, | |||
315 | } | 352 | } |
316 | 353 | ||
317 | 354 | ||
355 | /** | ||
356 | * Iterate over all options in the configuration. | ||
357 | * | ||
358 | * @param cfg configuration to inspect | ||
359 | * @param iter function to call on each option | ||
360 | * @param iter_cls closure for iter | ||
361 | */ | ||
318 | void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, | 362 | void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg, |
319 | GNUNET_CONFIGURATION_Iterator iter, | 363 | GNUNET_CONFIGURATION_Iterator iter, |
320 | void *iter_cls) | 364 | void *iter_cls) |
@@ -336,6 +380,14 @@ void GNUNET_CONFIGURATION_iterate (const struct GNUNET_CONFIGURATION_Handle *cfg | |||
336 | } | 380 | } |
337 | 381 | ||
338 | 382 | ||
383 | /** | ||
384 | * FIXME. | ||
385 | * | ||
386 | * @param cls the destination configuration (struct GNUNET_CONFIGURATION_Handle*) | ||
387 | * @param section FIXME | ||
388 | * @param option FIXME | ||
389 | * @param value FIXME | ||
390 | */ | ||
339 | static void | 391 | static void |
340 | copy_entry (void *cls, | 392 | copy_entry (void *cls, |
341 | const char *section, | 393 | const char *section, |
@@ -347,6 +399,12 @@ copy_entry (void *cls, | |||
347 | } | 399 | } |
348 | 400 | ||
349 | 401 | ||
402 | /** | ||
403 | * Duplicate an existing configuration object. | ||
404 | * | ||
405 | * @param c configuration to duplicate | ||
406 | * @return duplicate configuration | ||
407 | */ | ||
350 | struct GNUNET_CONFIGURATION_Handle * | 408 | struct GNUNET_CONFIGURATION_Handle * |
351 | GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg) | 409 | GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg) |
352 | { | 410 | { |
@@ -358,6 +416,13 @@ GNUNET_CONFIGURATION_dup (const struct GNUNET_CONFIGURATION_Handle *cfg) | |||
358 | } | 416 | } |
359 | 417 | ||
360 | 418 | ||
419 | /** | ||
420 | * FIXME. | ||
421 | * | ||
422 | * @param data FIXME | ||
423 | * @param section FIXME | ||
424 | * @return matching entry, NULL if not found | ||
425 | */ | ||
361 | static struct ConfigSection * | 426 | static struct ConfigSection * |
362 | findSection (const struct GNUNET_CONFIGURATION_Handle *data, const char *section) | 427 | findSection (const struct GNUNET_CONFIGURATION_Handle *data, const char *section) |
363 | { | 428 | { |
@@ -370,6 +435,14 @@ findSection (const struct GNUNET_CONFIGURATION_Handle *data, const char *section | |||
370 | } | 435 | } |
371 | 436 | ||
372 | 437 | ||
438 | /** | ||
439 | * FIXME. | ||
440 | * | ||
441 | * @param data FIXME | ||
442 | * @param section FIXME | ||
443 | * @param key FIXME | ||
444 | * @return matching entry, NULL if not found | ||
445 | */ | ||
373 | static struct ConfigEntry * | 446 | static struct ConfigEntry * |
374 | findEntry (const struct GNUNET_CONFIGURATION_Handle *data, | 447 | findEntry (const struct GNUNET_CONFIGURATION_Handle *data, |
375 | const char *section, const char *key) | 448 | const char *section, const char *key) |
@@ -386,6 +459,15 @@ findEntry (const struct GNUNET_CONFIGURATION_Handle *data, | |||
386 | return pos; | 459 | return pos; |
387 | } | 460 | } |
388 | 461 | ||
462 | |||
463 | /** | ||
464 | * Set a configuration value that should be a string. | ||
465 | * | ||
466 | * @param cfg configuration to update | ||
467 | * @param section section of interest | ||
468 | * @param option option of interest | ||
469 | * @param value value to set | ||
470 | */ | ||
389 | void | 471 | void |
390 | GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle | 472 | GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle |
391 | *data, | 473 | *data, |
@@ -417,6 +499,15 @@ GNUNET_CONFIGURATION_set_value_string (struct GNUNET_CONFIGURATION_Handle | |||
417 | sec->entries = e; | 499 | sec->entries = e; |
418 | } | 500 | } |
419 | 501 | ||
502 | |||
503 | /** | ||
504 | * Set a configuration value that should be a number. | ||
505 | * | ||
506 | * @param cfg configuration to update | ||
507 | * @param section section of interest | ||
508 | * @param option option of interest | ||
509 | * @param number value to set | ||
510 | */ | ||
420 | void | 511 | void |
421 | GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle | 512 | GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle |
422 | *cfg, const char *section, | 513 | *cfg, const char *section, |
@@ -428,6 +519,16 @@ GNUNET_CONFIGURATION_set_value_number (struct GNUNET_CONFIGURATION_Handle | |||
428 | GNUNET_CONFIGURATION_set_value_string (cfg, section, option, s); | 519 | GNUNET_CONFIGURATION_set_value_string (cfg, section, option, s); |
429 | } | 520 | } |
430 | 521 | ||
522 | |||
523 | /** | ||
524 | * Get a configuration value that should be a number. | ||
525 | * | ||
526 | * @param cfg configuration to inspect | ||
527 | * @param section section of interest | ||
528 | * @param option option of interest | ||
529 | * @param number where to store the numeric value of the option | ||
530 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
531 | */ | ||
431 | int | 532 | int |
432 | GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle | 533 | GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle |
433 | *cfg, const char *section, | 534 | *cfg, const char *section, |
@@ -444,6 +545,16 @@ GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle | |||
444 | return GNUNET_OK; | 545 | return GNUNET_OK; |
445 | } | 546 | } |
446 | 547 | ||
548 | |||
549 | /** | ||
550 | * Get a configuration value that should be a relative time. | ||
551 | * | ||
552 | * @param cfg configuration to inspect | ||
553 | * @param section section of interest | ||
554 | * @param option option of interest | ||
555 | * @param time set to the time value stored in the configuration | ||
556 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
557 | */ | ||
447 | int | 558 | int |
448 | GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle | 559 | GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle |
449 | *cfg, const char *section, | 560 | *cfg, const char *section, |
@@ -462,6 +573,17 @@ GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle | |||
462 | return ret; | 573 | return ret; |
463 | } | 574 | } |
464 | 575 | ||
576 | |||
577 | /** | ||
578 | * Get a configuration value that should be a string. | ||
579 | * | ||
580 | * @param cfg configuration to inspect | ||
581 | * @param section section of interest | ||
582 | * @param option option of interest | ||
583 | * @param value will be set to a freshly allocated configuration | ||
584 | * value, or NULL if option is not specified | ||
585 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
586 | */ | ||
465 | int | 587 | int |
466 | GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle | 588 | GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle |
467 | *cfg, const char *section, | 589 | *cfg, const char *section, |
@@ -479,6 +601,19 @@ GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle | |||
479 | return GNUNET_OK; | 601 | return GNUNET_OK; |
480 | } | 602 | } |
481 | 603 | ||
604 | |||
605 | /** | ||
606 | * Get a configuration value that should be in a set of | ||
607 | * predefined strings | ||
608 | * | ||
609 | * @param cfg configuration to inspect | ||
610 | * @param section section of interest | ||
611 | * @param option option of interest | ||
612 | * @param choices NULL-terminated list of legal values | ||
613 | * @param value will be set to an entry in the legal list, | ||
614 | * or NULL if option is not specified and no default given | ||
615 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
616 | */ | ||
482 | int | 617 | int |
483 | GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle | 618 | GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle |
484 | *cfg, const char *section, | 619 | *cfg, const char *section, |
@@ -511,8 +646,12 @@ GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle | |||
511 | return GNUNET_OK; | 646 | return GNUNET_OK; |
512 | } | 647 | } |
513 | 648 | ||
649 | |||
514 | /** | 650 | /** |
515 | * Test if we have a value for a particular option | 651 | * Test if we have a value for a particular option |
652 | * @param cfg configuration to inspect | ||
653 | * @param section section of interest | ||
654 | * @param option option of interest | ||
516 | * @return GNUNET_YES if so, GNUNET_NO if not. | 655 | * @return GNUNET_YES if so, GNUNET_NO if not. |
517 | */ | 656 | */ |
518 | int | 657 | int |
@@ -525,11 +664,13 @@ GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
525 | return GNUNET_YES; | 664 | return GNUNET_YES; |
526 | } | 665 | } |
527 | 666 | ||
667 | |||
528 | /** | 668 | /** |
529 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" | 669 | * Expand an expression of the form "$FOO/BAR" to "DIRECTORY/BAR" |
530 | * where either in the "PATHS" section or the environtment | 670 | * where either in the "PATHS" section or the environtment |
531 | * "FOO" is set to "DIRECTORY". | 671 | * "FOO" is set to "DIRECTORY". |
532 | * | 672 | * |
673 | * @param cfg configuration to use for path expansion | ||
533 | * @param old string to $-expand (will be freed!) | 674 | * @param old string to $-expand (will be freed!) |
534 | * @return $-expanded string | 675 | * @return $-expanded string |
535 | */ | 676 | */ |
@@ -579,8 +720,13 @@ GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle *cf | |||
579 | return result; | 720 | return result; |
580 | } | 721 | } |
581 | 722 | ||
723 | |||
582 | /** | 724 | /** |
583 | * Get a configuration value that should be a string. | 725 | * Get a configuration value that should be a string. |
726 | * | ||
727 | * @param cfg configuration to inspect | ||
728 | * @param section section of interest | ||
729 | * @param option option of interest | ||
584 | * @param value will be set to a freshly allocated configuration | 730 | * @param value will be set to a freshly allocated configuration |
585 | * value, or NULL if option is not specified | 731 | * value, or NULL if option is not specified |
586 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 732 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
@@ -612,10 +758,14 @@ GNUNET_CONFIGURATION_get_value_filename (const struct GNUNET_CONFIGURATION_Handl | |||
612 | return ret; | 758 | return ret; |
613 | } | 759 | } |
614 | 760 | ||
761 | |||
615 | /** | 762 | /** |
616 | * Get a configuration value that should be in a set of | 763 | * Get a configuration value that should be in a set of |
617 | * "GNUNET_YES" or "GNUNET_NO". | 764 | * "GNUNET_YES" or "GNUNET_NO". |
618 | * | 765 | * |
766 | * @param cfg configuration to inspect | ||
767 | * @param section section of interest | ||
768 | * @param option option of interest | ||
619 | * @return GNUNET_YES, GNUNET_NO or GNUNET_SYSERR | 769 | * @return GNUNET_YES, GNUNET_NO or GNUNET_SYSERR |
620 | */ | 770 | */ |
621 | int | 771 | int |
@@ -639,15 +789,20 @@ GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle * | |||
639 | /** | 789 | /** |
640 | * Iterate over the set of filenames stored in a configuration value. | 790 | * Iterate over the set of filenames stored in a configuration value. |
641 | * | 791 | * |
792 | * @param cfg configuration to inspect | ||
793 | * @param section section of interest | ||
794 | * @param option option of interest | ||
795 | * @param cb function to call on each filename | ||
796 | * @param cb_cls closure for cb | ||
642 | * @return number of filenames iterated over, -1 on error | 797 | * @return number of filenames iterated over, -1 on error |
643 | */ | 798 | */ |
644 | int | 799 | int |
645 | GNUNET_CONFIGURATION_iterate_value_filenames (const struct | 800 | GNUNET_CONFIGURATION_iterate_value_filenames (const struct |
646 | GNUNET_CONFIGURATION_Handle | 801 | GNUNET_CONFIGURATION_Handle |
647 | *cfg, const char *section, | 802 | *cfg, const char *section, |
648 | const char *option, | 803 | const char *option, |
649 | GNUNET_FileNameCallback cb, | 804 | GNUNET_FileNameCallback cb, |
650 | void *cls) | 805 | void *cb_cls) |
651 | { | 806 | { |
652 | char *list; | 807 | char *list; |
653 | char *pos; | 808 | char *pos; |
@@ -692,7 +847,7 @@ GNUNET_CONFIGURATION_iterate_value_filenames (const struct | |||
692 | if (strlen (pos) > 0) | 847 | if (strlen (pos) > 0) |
693 | { | 848 | { |
694 | ret++; | 849 | ret++; |
695 | if ((cb != NULL) && (GNUNET_OK != cb (cls, pos))) | 850 | if ((cb != NULL) && (GNUNET_OK != cb (cb_cls, pos))) |
696 | { | 851 | { |
697 | ret = GNUNET_SYSERR; | 852 | ret = GNUNET_SYSERR; |
698 | break; | 853 | break; |
@@ -706,6 +861,13 @@ GNUNET_CONFIGURATION_iterate_value_filenames (const struct | |||
706 | return ret; | 861 | return ret; |
707 | } | 862 | } |
708 | 863 | ||
864 | |||
865 | /** | ||
866 | * FIXME. | ||
867 | * | ||
868 | * @param value FIXME | ||
869 | * @return FIXME | ||
870 | */ | ||
709 | static char * | 871 | static char * |
710 | escape_name (const char *value) | 872 | escape_name (const char *value) |
711 | { | 873 | { |
@@ -736,6 +898,14 @@ escape_name (const char *value) | |||
736 | return escaped; | 898 | return escaped; |
737 | } | 899 | } |
738 | 900 | ||
901 | |||
902 | /** | ||
903 | * FIXME. | ||
904 | * | ||
905 | * @param cls string we compare with (const char*) | ||
906 | * @param fn filename we are currently looking at | ||
907 | * @return GNUNET_OK if the names do not match, GNUNET_SYSERR if they do | ||
908 | */ | ||
739 | static int | 909 | static int |
740 | test_match (void *cls, const char *fn) | 910 | test_match (void *cls, const char *fn) |
741 | { | 911 | { |
@@ -743,10 +913,14 @@ test_match (void *cls, const char *fn) | |||
743 | return (0 == strcmp (of, fn)) ? GNUNET_SYSERR : GNUNET_OK; | 913 | return (0 == strcmp (of, fn)) ? GNUNET_SYSERR : GNUNET_OK; |
744 | } | 914 | } |
745 | 915 | ||
916 | |||
746 | /** | 917 | /** |
747 | * Append a filename to a configuration value that | 918 | * Append a filename to a configuration value that |
748 | * represents a list of filenames | 919 | * represents a list of filenames |
749 | * | 920 | * |
921 | * @param cfg configuration to update | ||
922 | * @param section section of interest | ||
923 | * @param option option of interest | ||
750 | * @param value filename to append | 924 | * @param value filename to append |
751 | * @return GNUNET_OK on success, | 925 | * @return GNUNET_OK on success, |
752 | * GNUNET_NO if the filename already in the list | 926 | * GNUNET_NO if the filename already in the list |
@@ -790,6 +964,9 @@ GNUNET_CONFIGURATION_append_value_filename (struct GNUNET_CONFIGURATION_Handle | |||
790 | * Remove a filename from a configuration value that | 964 | * Remove a filename from a configuration value that |
791 | * represents a list of filenames | 965 | * represents a list of filenames |
792 | * | 966 | * |
967 | * @param cfg configuration to update | ||
968 | * @param section section of interest | ||
969 | * @param option option of interest | ||
793 | * @param value filename to remove | 970 | * @param value filename to remove |
794 | * @return GNUNET_OK on success, | 971 | * @return GNUNET_OK on success, |
795 | * GNUNET_NO if the filename is not in the list, | 972 | * GNUNET_NO if the filename is not in the list, |
@@ -870,6 +1047,10 @@ GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle | |||
870 | /** | 1047 | /** |
871 | * Load configuration (starts with defaults, then loads | 1048 | * Load configuration (starts with defaults, then loads |
872 | * system-specific configuration). | 1049 | * system-specific configuration). |
1050 | * | ||
1051 | * @param cfg configuration to update | ||
1052 | * @param filename name of the configuration file | ||
1053 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | ||
873 | */ | 1054 | */ |
874 | int | 1055 | int |
875 | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, | 1056 | GNUNET_CONFIGURATION_load (struct GNUNET_CONFIGURATION_Handle *cfg, |
diff --git a/src/util/disk.c b/src/util/disk.c index 9f2f8dcf7..a3d5db097 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -230,7 +230,7 @@ int GNUNET_DISK_file_get_identifiers (const char *filename, | |||
230 | /** | 230 | /** |
231 | * Create an (empty) temporary file on disk. | 231 | * Create an (empty) temporary file on disk. |
232 | * | 232 | * |
233 | * @param template component to use for the name; | 233 | * @param t component to use for the name; |
234 | * does NOT contain "XXXXXX" or "/tmp/". | 234 | * does NOT contain "XXXXXX" or "/tmp/". |
235 | * @return NULL on error, otherwise name of fresh | 235 | * @return NULL on error, otherwise name of fresh |
236 | * file on disk in directory for temporary files | 236 | * file on disk in directory for temporary files |
@@ -480,7 +480,7 @@ GNUNET_DISK_directory_create (const char *dir) | |||
480 | * Create the directory structure for storing | 480 | * Create the directory structure for storing |
481 | * a file. | 481 | * a file. |
482 | * | 482 | * |
483 | * @param filename name of a file in the directory | 483 | * @param dir name of a file in the directory |
484 | * @returns GNUNET_OK on success, | 484 | * @returns GNUNET_OK on success, |
485 | * GNUNET_SYSERR on failure, | 485 | * GNUNET_SYSERR on failure, |
486 | * GNUNET_NO if the directory | 486 | * GNUNET_NO if the directory |
@@ -1058,8 +1058,8 @@ GNUNET_DISK_file_lock (struct GNUNET_DISK_FileHandle *fh, off_t lockStart, | |||
1058 | /** | 1058 | /** |
1059 | * Unlock a part of a file | 1059 | * Unlock a part of a file |
1060 | * @param fh file handle | 1060 | * @param fh file handle |
1061 | * @param lockStart absolute position from where to unlock | 1061 | * @param unlockStart absolute position from where to unlock |
1062 | * @param lockEnd absolute position until where to unlock | 1062 | * @param unlockEnd absolute position until where to unlock |
1063 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 1063 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
1064 | */ | 1064 | */ |
1065 | int | 1065 | int |
diff --git a/src/util/getopt.c b/src/util/getopt.c index 799146e77..e37390a3a 100644 --- a/src/util/getopt.c +++ b/src/util/getopt.c | |||
@@ -987,8 +987,7 @@ GNgetopt_long (int argc, | |||
987 | /** | 987 | /** |
988 | * Parse the command line. | 988 | * Parse the command line. |
989 | * | 989 | * |
990 | * @param binaryName name of the binary / application with options | 990 | * @param binaryOptions name of this binary / application |
991 | * @param cfg for storing/accessing configuration data | ||
992 | * @param allOptions defined options and handlers | 991 | * @param allOptions defined options and handlers |
993 | * @param argc number of arguments | 992 | * @param argc number of arguments |
994 | * @param argv actual arguments | 993 | * @param argv actual arguments |
diff --git a/src/util/network.c b/src/util/network.c index e112d9093..4ac46fa0b 100644 --- a/src/util/network.c +++ b/src/util/network.c | |||
@@ -169,7 +169,7 @@ GNUNET_NETWORK_socket_close (struct GNUNET_NETWORK_Handle *desc) | |||
169 | * Connect a socket | 169 | * Connect a socket |
170 | * @param desc socket | 170 | * @param desc socket |
171 | * @param address peer address | 171 | * @param address peer address |
172 | * @param length of address | 172 | * @param address_len length of address |
173 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise | 173 | * @return GNUNET_OK on success, GNUNET_SYSERR otherwise |
174 | */ | 174 | */ |
175 | int | 175 | int |
@@ -406,6 +406,7 @@ GNUNET_NETWORK_socket_set_inheritable (const struct GNUNET_NETWORK_Handle | |||
406 | #endif | 406 | #endif |
407 | } | 407 | } |
408 | 408 | ||
409 | |||
409 | /** | 410 | /** |
410 | * Reset FD set | 411 | * Reset FD set |
411 | * @param fds fd set | 412 | * @param fds fd set |
@@ -422,6 +423,7 @@ GNUNET_NETWORK_fdset_zero (struct GNUNET_NETWORK_FDSet *fds) | |||
422 | #endif | 423 | #endif |
423 | } | 424 | } |
424 | 425 | ||
426 | |||
425 | /** | 427 | /** |
426 | * Add a socket to the FD set | 428 | * Add a socket to the FD set |
427 | * @param fds fd set | 429 | * @param fds fd set |
@@ -437,10 +439,12 @@ GNUNET_NETWORK_fdset_set (struct GNUNET_NETWORK_FDSet *fds, | |||
437 | fds->nsds = desc->fd + 1; | 439 | fds->nsds = desc->fd + 1; |
438 | } | 440 | } |
439 | 441 | ||
442 | |||
440 | /** | 443 | /** |
441 | * Check whether a socket is part of the fd set | 444 | * Check whether a socket is part of the fd set |
442 | * @param fds fd set | 445 | * @param fds fd set |
443 | * @param desc socket | 446 | * @param desc socket |
447 | * @return 0 if the FD is not set | ||
444 | */ | 448 | */ |
445 | int | 449 | int |
446 | GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | 450 | GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, |
@@ -449,6 +453,7 @@ GNUNET_NETWORK_fdset_isset (const struct GNUNET_NETWORK_FDSet *fds, | |||
449 | return FD_ISSET (desc->fd, &fds->sds); | 453 | return FD_ISSET (desc->fd, &fds->sds); |
450 | } | 454 | } |
451 | 455 | ||
456 | |||
452 | /** | 457 | /** |
453 | * Add one fd set to another | 458 | * Add one fd set to another |
454 | * @param dst the fd set to add to | 459 | * @param dst the fd set to add to |
@@ -469,6 +474,7 @@ GNUNET_NETWORK_fdset_add (struct GNUNET_NETWORK_FDSet *dst, | |||
469 | } | 474 | } |
470 | } | 475 | } |
471 | 476 | ||
477 | |||
472 | /** | 478 | /** |
473 | * Copy one fd set to another | 479 | * Copy one fd set to another |
474 | * @param to destination | 480 | * @param to destination |
@@ -494,11 +500,12 @@ GNUNET_NETWORK_fdset_copy (struct GNUNET_NETWORK_FDSet *to, | |||
494 | #endif | 500 | #endif |
495 | } | 501 | } |
496 | 502 | ||
503 | |||
497 | /** | 504 | /** |
498 | * Copy a native fd set | 505 | * Copy a native fd set |
499 | * @param to destination | 506 | * @param to destination |
500 | * @param from native source set | 507 | * @param from native source set |
501 | * @param the biggest socket number in from + 1 | 508 | * @param nfds the biggest socket number in from + 1 |
502 | */ | 509 | */ |
503 | void | 510 | void |
504 | GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | 511 | GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, |
@@ -508,6 +515,7 @@ GNUNET_NETWORK_fdset_copy_native (struct GNUNET_NETWORK_FDSet *to, | |||
508 | to->nsds = nfds; | 515 | to->nsds = nfds; |
509 | } | 516 | } |
510 | 517 | ||
518 | |||
511 | /** | 519 | /** |
512 | * Add a file handle to the fd set | 520 | * Add a file handle to the fd set |
513 | * @param fds fd set | 521 | * @param fds fd set |
@@ -591,6 +599,7 @@ GNUNET_NETWORK_fdset_create () | |||
591 | return fds; | 599 | return fds; |
592 | } | 600 | } |
593 | 601 | ||
602 | |||
594 | /** | 603 | /** |
595 | * Releases the associated memory of an fd set | 604 | * Releases the associated memory of an fd set |
596 | * @param fds fd set | 605 | * @param fds fd set |
@@ -604,6 +613,7 @@ GNUNET_NETWORK_fdset_destroy (struct GNUNET_NETWORK_FDSet *fds) | |||
604 | GNUNET_free (fds); | 613 | GNUNET_free (fds); |
605 | } | 614 | } |
606 | 615 | ||
616 | |||
607 | /** | 617 | /** |
608 | * Check if sockets meet certain conditions | 618 | * Check if sockets meet certain conditions |
609 | * @param rfds set of sockets to be checked for readability | 619 | * @param rfds set of sockets to be checked for readability |
@@ -821,4 +831,5 @@ GNUNET_NETWORK_socket_select (struct GNUNET_NETWORK_FDSet *rfds, | |||
821 | #endif | 831 | #endif |
822 | } | 832 | } |
823 | 833 | ||
834 | |||
824 | /* end of network.c */ | 835 | /* end of network.c */ |
diff --git a/src/util/os_network.c b/src/util/os_network.c index c872350c5..c78dc71c5 100644 --- a/src/util/os_network.c +++ b/src/util/os_network.c | |||
@@ -33,7 +33,9 @@ | |||
33 | 33 | ||
34 | /** | 34 | /** |
35 | * @brief Enumerate all network interfaces | 35 | * @brief Enumerate all network interfaces |
36 | * @param callback the callback function | 36 | * |
37 | * @param proc the callback function | ||
38 | * @param cls closure for proc | ||
37 | */ | 39 | */ |
38 | void | 40 | void |
39 | GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, | 41 | GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc, |
diff --git a/src/util/pseudonym.c b/src/util/pseudonym.c index 5d9750f5b..8687b5c4d 100644 --- a/src/util/pseudonym.c +++ b/src/util/pseudonym.c | |||
@@ -592,7 +592,7 @@ merge_meta_helper (void *cls, | |||
592 | * | 592 | * |
593 | * @param cfg overall configuration | 593 | * @param cfg overall configuration |
594 | * @param id the pseudonym identifier | 594 | * @param id the pseudonym identifier |
595 | * @param metadata for the pseudonym | 595 | * @param meta metadata for the pseudonym |
596 | */ | 596 | */ |
597 | void | 597 | void |
598 | GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, | 598 | GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, |