diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-07-26 21:20:11 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-07-26 21:20:11 +0000 |
commit | 7bc466bbdb8b64cac68c5ee59eb7ab6b9d85c420 (patch) | |
tree | dc415457e57f9cfda58eb22ca400a941ebcf602e /src/include | |
parent | 4f8ba34b32328bd99b2f0c2ff9a2372712022b32 (diff) | |
download | gnunet-7bc466bbdb8b64cac68c5ee59eb7ab6b9d85c420.tar.gz gnunet-7bc466bbdb8b64cac68c5ee59eb7ab6b9d85c420.zip |
const-ing of config-handles
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/gnunet_arm_service.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_client_lib.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_configuration_lib.h | 20 | ||||
-rw-r--r-- | src/include/gnunet_core_service.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_datacache_lib.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_datastore_service.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_disk_lib.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_fs_service.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_getopt_lib.h | 7 | ||||
-rw-r--r-- | src/include/gnunet_os_lib.h | 5 | ||||
-rw-r--r-- | src/include/gnunet_peerinfo_service.h | 4 | ||||
-rw-r--r-- | src/include/gnunet_program_lib.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_pseudonym_lib.h | 12 | ||||
-rw-r--r-- | src/include/gnunet_resolver_service.h | 6 | ||||
-rw-r--r-- | src/include/gnunet_service_lib.h | 6 | ||||
-rw-r--r-- | src/include/gnunet_statistics_service.h | 2 | ||||
-rw-r--r-- | src/include/gnunet_testing_lib.h | 39 | ||||
-rw-r--r-- | src/include/gnunet_transport_service.h | 2 |
18 files changed, 71 insertions, 52 deletions
diff --git a/src/include/gnunet_arm_service.h b/src/include/gnunet_arm_service.h index 5a929a37e..bbb8cb0f6 100644 --- a/src/include/gnunet_arm_service.h +++ b/src/include/gnunet_arm_service.h | |||
@@ -71,7 +71,7 @@ typedef void (*GNUNET_ARM_Callback) (void *cls, int success); | |||
71 | */ | 71 | */ |
72 | void | 72 | void |
73 | GNUNET_ARM_start_service (const char *service_name, | 73 | GNUNET_ARM_start_service (const char *service_name, |
74 | struct GNUNET_CONFIGURATION_Handle *cfg, | 74 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
75 | struct GNUNET_SCHEDULER_Handle *sched, | 75 | struct GNUNET_SCHEDULER_Handle *sched, |
76 | struct GNUNET_TIME_Relative timeout, | 76 | struct GNUNET_TIME_Relative timeout, |
77 | GNUNET_ARM_Callback cb, void *cb_cls); | 77 | GNUNET_ARM_Callback cb, void *cb_cls); |
@@ -91,7 +91,7 @@ GNUNET_ARM_start_service (const char *service_name, | |||
91 | */ | 91 | */ |
92 | void | 92 | void |
93 | GNUNET_ARM_stop_service (const char *service_name, | 93 | GNUNET_ARM_stop_service (const char *service_name, |
94 | struct GNUNET_CONFIGURATION_Handle *cfg, | 94 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
95 | struct GNUNET_SCHEDULER_Handle *sched, | 95 | struct GNUNET_SCHEDULER_Handle *sched, |
96 | struct GNUNET_TIME_Relative timeout, | 96 | struct GNUNET_TIME_Relative timeout, |
97 | GNUNET_ARM_Callback cb, void *cb_cls); | 97 | GNUNET_ARM_Callback cb, void *cb_cls); |
diff --git a/src/include/gnunet_client_lib.h b/src/include/gnunet_client_lib.h index 6a77aa391..eb8e1d127 100644 --- a/src/include/gnunet_client_lib.h +++ b/src/include/gnunet_client_lib.h | |||
@@ -59,7 +59,7 @@ struct GNUNET_CLIENT_Connection *GNUNET_CLIENT_connect (struct | |||
59 | *sched, | 59 | *sched, |
60 | const char | 60 | const char |
61 | *service_name, | 61 | *service_name, |
62 | struct | 62 | const struct |
63 | GNUNET_CONFIGURATION_Handle | 63 | GNUNET_CONFIGURATION_Handle |
64 | *cfg); | 64 | *cfg); |
65 | 65 | ||
@@ -143,7 +143,7 @@ void GNUNET_CLIENT_service_shutdown (struct GNUNET_CLIENT_Connection *sock); | |||
143 | */ | 143 | */ |
144 | void GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched, | 144 | void GNUNET_CLIENT_service_test (struct GNUNET_SCHEDULER_Handle *sched, |
145 | const char *service, | 145 | const char *service, |
146 | struct GNUNET_CONFIGURATION_Handle *cfg, | 146 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
147 | struct GNUNET_TIME_Relative timeout, | 147 | struct GNUNET_TIME_Relative timeout, |
148 | GNUNET_SCHEDULER_Task task, void *task_cls); | 148 | GNUNET_SCHEDULER_Task task, void *task_cls); |
149 | 149 | ||
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index 3f7d099ce..abbfe2eec 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -88,13 +88,13 @@ int GNUNET_CONFIGURATION_write (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
88 | * changed since the last save. | 88 | * changed since the last save. |
89 | * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) | 89 | * @return GNUNET_NO if clean, GNUNET_YES if dirty, GNUNET_SYSERR on error (i.e. last save failed) |
90 | */ | 90 | */ |
91 | int GNUNET_CONFIGURATION_is_dirty (struct GNUNET_CONFIGURATION_Handle *cfg); | 91 | int GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); |
92 | 92 | ||
93 | /** | 93 | /** |
94 | * Get a configuration value that should be a number. | 94 | * Get a configuration value that should be a number. |
95 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 95 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
96 | */ | 96 | */ |
97 | int GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle | 97 | int GNUNET_CONFIGURATION_get_value_number (const struct GNUNET_CONFIGURATION_Handle |
98 | *cfg, const char *section, | 98 | *cfg, const char *section, |
99 | const char *option, | 99 | const char *option, |
100 | unsigned long long *number); | 100 | unsigned long long *number); |
@@ -105,7 +105,7 @@ int GNUNET_CONFIGURATION_get_value_number (struct GNUNET_CONFIGURATION_Handle | |||
105 | * @param time set to the time value stored in the configuration | 105 | * @param time set to the time value stored in the configuration |
106 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 106 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
107 | */ | 107 | */ |
108 | int GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle | 108 | int GNUNET_CONFIGURATION_get_value_time (const struct GNUNET_CONFIGURATION_Handle |
109 | *cfg, const char *section, | 109 | *cfg, const char *section, |
110 | const char *option, | 110 | const char *option, |
111 | struct GNUNET_TIME_Relative *time); | 111 | struct GNUNET_TIME_Relative *time); |
@@ -114,7 +114,7 @@ int GNUNET_CONFIGURATION_get_value_time (struct GNUNET_CONFIGURATION_Handle | |||
114 | * Test if we have a value for a particular option | 114 | * Test if we have a value for a particular option |
115 | * @return GNUNET_YES if so, GNUNET_NO if not. | 115 | * @return GNUNET_YES if so, GNUNET_NO if not. |
116 | */ | 116 | */ |
117 | int GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg, | 117 | int GNUNET_CONFIGURATION_have_value (const struct GNUNET_CONFIGURATION_Handle *cfg, |
118 | const char *section, const char *option); | 118 | const char *section, const char *option); |
119 | 119 | ||
120 | /** | 120 | /** |
@@ -123,7 +123,7 @@ int GNUNET_CONFIGURATION_have_value (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
123 | * value, or NULL if option is not specified | 123 | * value, or NULL if option is not specified |
124 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 124 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
125 | */ | 125 | */ |
126 | int GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle | 126 | int GNUNET_CONFIGURATION_get_value_string (const struct GNUNET_CONFIGURATION_Handle |
127 | *cfg, const char *section, | 127 | *cfg, const char *section, |
128 | const char *option, char **value); | 128 | const char *option, char **value); |
129 | 129 | ||
@@ -135,7 +135,7 @@ int GNUNET_CONFIGURATION_get_value_string (struct GNUNET_CONFIGURATION_Handle | |||
135 | * value, or NULL if option is not specified | 135 | * value, or NULL if option is not specified |
136 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 136 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
137 | */ | 137 | */ |
138 | int GNUNET_CONFIGURATION_get_value_filename (struct | 138 | int GNUNET_CONFIGURATION_get_value_filename (const struct |
139 | GNUNET_CONFIGURATION_Handle *cfg, | 139 | GNUNET_CONFIGURATION_Handle *cfg, |
140 | const char *section, | 140 | const char *section, |
141 | const char *option, | 141 | const char *option, |
@@ -146,7 +146,7 @@ int GNUNET_CONFIGURATION_get_value_filename (struct | |||
146 | * | 146 | * |
147 | * @return number of filenames iterated over, -1 on error | 147 | * @return number of filenames iterated over, -1 on error |
148 | */ | 148 | */ |
149 | int GNUNET_CONFIGURATION_iterate_value_filenames (struct | 149 | int GNUNET_CONFIGURATION_iterate_value_filenames (const struct |
150 | GNUNET_CONFIGURATION_Handle | 150 | GNUNET_CONFIGURATION_Handle |
151 | *cfg, | 151 | *cfg, |
152 | const char *section, | 152 | const char *section, |
@@ -163,7 +163,7 @@ int GNUNET_CONFIGURATION_iterate_value_filenames (struct | |||
163 | * or NULL if option is not specified and no default given | 163 | * or NULL if option is not specified and no default given |
164 | * @return GNUNET_OK on success, GNUNET_SYSERR on error | 164 | * @return GNUNET_OK on success, GNUNET_SYSERR on error |
165 | */ | 165 | */ |
166 | int GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle | 166 | int GNUNET_CONFIGURATION_get_value_choice (const struct GNUNET_CONFIGURATION_Handle |
167 | *cfg, const char *section, | 167 | *cfg, const char *section, |
168 | const char *option, | 168 | const char *option, |
169 | const char **choices, | 169 | const char **choices, |
@@ -175,7 +175,7 @@ int GNUNET_CONFIGURATION_get_value_choice (struct GNUNET_CONFIGURATION_Handle | |||
175 | * | 175 | * |
176 | * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR | 176 | * @return GNUNET_YES, GNUNET_NO or if option has no valid value, GNUNET_SYSERR |
177 | */ | 177 | */ |
178 | int GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle | 178 | int GNUNET_CONFIGURATION_get_value_yesno (const struct GNUNET_CONFIGURATION_Handle |
179 | *cfg, const char *section, | 179 | *cfg, const char *section, |
180 | const char *option); | 180 | const char *option); |
181 | 181 | ||
@@ -187,7 +187,7 @@ int GNUNET_CONFIGURATION_get_value_yesno (struct GNUNET_CONFIGURATION_Handle | |||
187 | * @param old string to $-expand (will be freed!) | 187 | * @param old string to $-expand (will be freed!) |
188 | * @return $-expanded string | 188 | * @return $-expanded string |
189 | */ | 189 | */ |
190 | char *GNUNET_CONFIGURATION_expand_dollar (struct GNUNET_CONFIGURATION_Handle | 190 | char *GNUNET_CONFIGURATION_expand_dollar (const struct GNUNET_CONFIGURATION_Handle |
191 | *cfg, char *old); | 191 | *cfg, char *old); |
192 | 192 | ||
193 | /** | 193 | /** |
diff --git a/src/include/gnunet_core_service.h b/src/include/gnunet_core_service.h index a096569ef..a77281336 100644 --- a/src/include/gnunet_core_service.h +++ b/src/include/gnunet_core_service.h | |||
@@ -171,7 +171,7 @@ typedef void | |||
171 | */ | 171 | */ |
172 | void | 172 | void |
173 | GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched, | 173 | GNUNET_CORE_connect (struct GNUNET_SCHEDULER_Handle *sched, |
174 | struct GNUNET_CONFIGURATION_Handle *cfg, | 174 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
175 | struct GNUNET_TIME_Relative timeout, | 175 | struct GNUNET_TIME_Relative timeout, |
176 | void *cls, | 176 | void *cls, |
177 | GNUNET_CORE_StartupCallback init, | 177 | GNUNET_CORE_StartupCallback init, |
diff --git a/src/include/gnunet_datacache_lib.h b/src/include/gnunet_datacache_lib.h index c913a6462..8eb724bfa 100644 --- a/src/include/gnunet_datacache_lib.h +++ b/src/include/gnunet_datacache_lib.h | |||
@@ -58,7 +58,7 @@ struct GNUNET_DATACACHE_Handle; | |||
58 | */ | 58 | */ |
59 | struct GNUNET_DATACACHE_Handle * | 59 | struct GNUNET_DATACACHE_Handle * |
60 | GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched, | 60 | GNUNET_DATACACHE_create (struct GNUNET_SCHEDULER_Handle *sched, |
61 | struct GNUNET_CONFIGURATION_Handle *cfg, | 61 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
62 | const char *section); | 62 | const char *section); |
63 | 63 | ||
64 | 64 | ||
diff --git a/src/include/gnunet_datastore_service.h b/src/include/gnunet_datastore_service.h index ccbe4e076..28419126f 100644 --- a/src/include/gnunet_datastore_service.h +++ b/src/include/gnunet_datastore_service.h | |||
@@ -55,7 +55,7 @@ struct GNUNET_DATASTORE_Handle; | |||
55 | * @param sched scheduler to use | 55 | * @param sched scheduler to use |
56 | * @return handle to use to access the service | 56 | * @return handle to use to access the service |
57 | */ | 57 | */ |
58 | struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (struct | 58 | struct GNUNET_DATASTORE_Handle *GNUNET_DATASTORE_connect (const struct |
59 | GNUNET_CONFIGURATION_Handle | 59 | GNUNET_CONFIGURATION_Handle |
60 | *cfg, | 60 | *cfg, |
61 | struct | 61 | struct |
diff --git a/src/include/gnunet_disk_lib.h b/src/include/gnunet_disk_lib.h index a8a51ab78..7f463b83e 100644 --- a/src/include/gnunet_disk_lib.h +++ b/src/include/gnunet_disk_lib.h | |||
@@ -359,7 +359,7 @@ int GNUNET_DISK_file_change_owner (const char *filename, const char *user); | |||
359 | * private directory name. | 359 | * private directory name. |
360 | * @return the constructed filename | 360 | * @return the constructed filename |
361 | */ | 361 | */ |
362 | char *GNUNET_DISK_get_home_filename (struct GNUNET_CONFIGURATION_Handle *cfg, | 362 | char *GNUNET_DISK_get_home_filename (const struct GNUNET_CONFIGURATION_Handle *cfg, |
363 | const char *serviceName, ...); | 363 | const char *serviceName, ...); |
364 | 364 | ||
365 | 365 | ||
diff --git a/src/include/gnunet_fs_service.h b/src/include/gnunet_fs_service.h index 0f61bc764..e45a46ef4 100644 --- a/src/include/gnunet_fs_service.h +++ b/src/include/gnunet_fs_service.h | |||
@@ -1368,7 +1368,7 @@ struct GNUNET_FS_Handle; | |||
1368 | */ | 1368 | */ |
1369 | struct GNUNET_FS_Handle * | 1369 | struct GNUNET_FS_Handle * |
1370 | GNUNET_FS_start (struct GNUNET_SCHEDULER_Handle *sched, | 1370 | GNUNET_FS_start (struct GNUNET_SCHEDULER_Handle *sched, |
1371 | struct GNUNET_CONFIGURATION_Handle *cfg, | 1371 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
1372 | const char *client_name, | 1372 | const char *client_name, |
1373 | GNUNET_FS_ProgressCallback upcb, | 1373 | GNUNET_FS_ProgressCallback upcb, |
1374 | void *upcb_cls); | 1374 | void *upcb_cls); |
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h index 722155568..e7063d3d0 100644 --- a/src/include/gnunet_getopt_lib.h +++ b/src/include/gnunet_getopt_lib.h | |||
@@ -60,11 +60,6 @@ struct GNUNET_GETOPT_CommandLineProcessorContext | |||
60 | const struct GNUNET_GETOPT_CommandLineOption *allOptions; | 60 | const struct GNUNET_GETOPT_CommandLineOption *allOptions; |
61 | 61 | ||
62 | /** | 62 | /** |
63 | * For configuration | ||
64 | */ | ||
65 | struct GNUNET_CONFIGURATION_Handle *cfg; | ||
66 | |||
67 | /** | ||
68 | * Original command line | 63 | * Original command line |
69 | */ | 64 | */ |
70 | char *const *argv; | 65 | char *const *argv; |
@@ -192,7 +187,6 @@ struct GNUNET_GETOPT_CommandLineOption | |||
192 | * Parse the command line. | 187 | * Parse the command line. |
193 | * | 188 | * |
194 | * @param binaryName name of the binary / application with options | 189 | * @param binaryName name of the binary / application with options |
195 | * @param cfg for storing/accessing configuration data | ||
196 | * @param allOptions defined options and handlers | 190 | * @param allOptions defined options and handlers |
197 | * @param argc number of arguments | 191 | * @param argc number of arguments |
198 | * @param argv actual arguments | 192 | * @param argv actual arguments |
@@ -200,7 +194,6 @@ struct GNUNET_GETOPT_CommandLineOption | |||
200 | * argument, or GNUNET_SYSERR on error | 194 | * argument, or GNUNET_SYSERR on error |
201 | */ | 195 | */ |
202 | int GNUNET_GETOPT_run (const char *binaryName, | 196 | int GNUNET_GETOPT_run (const char *binaryName, |
203 | struct GNUNET_CONFIGURATION_Handle *cfg, | ||
204 | const struct GNUNET_GETOPT_CommandLineOption | 197 | const struct GNUNET_GETOPT_CommandLineOption |
205 | *allOptions, unsigned int argc, char *const *argv); | 198 | *allOptions, unsigned int argc, char *const *argv); |
206 | 199 | ||
diff --git a/src/include/gnunet_os_lib.h b/src/include/gnunet_os_lib.h index 1d4d47441..cce805ba0 100644 --- a/src/include/gnunet_os_lib.h +++ b/src/include/gnunet_os_lib.h | |||
@@ -115,7 +115,8 @@ void GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor | |||
115 | * @return -1 on error, otherwise load value (between 0 and 100, | 115 | * @return -1 on error, otherwise load value (between 0 and 100, |
116 | * (100 is equivalent to full load for one CPU) | 116 | * (100 is equivalent to full load for one CPU) |
117 | */ | 117 | */ |
118 | int GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg); | 118 | int GNUNET_OS_load_cpu_get (const struct GNUNET_CONFIGURATION_Handle *cfg); |
119 | |||
119 | 120 | ||
120 | /** | 121 | /** |
121 | * Get the current IO load. | 122 | * Get the current IO load. |
@@ -125,7 +126,7 @@ int GNUNET_OS_load_cpu_get (struct GNUNET_CONFIGURATION_Handle *cfg); | |||
125 | * 100 means that we spend all of our cycles waiting for | 126 | * 100 means that we spend all of our cycles waiting for |
126 | * the disk) | 127 | * the disk) |
127 | */ | 128 | */ |
128 | int GNUNET_OS_load_disk_get (struct GNUNET_CONFIGURATION_Handle *cfg); | 129 | int GNUNET_OS_load_disk_get (const struct GNUNET_CONFIGURATION_Handle *cfg); |
129 | 130 | ||
130 | 131 | ||
131 | /** | 132 | /** |
diff --git a/src/include/gnunet_peerinfo_service.h b/src/include/gnunet_peerinfo_service.h index 45c52c447..54fc68033 100644 --- a/src/include/gnunet_peerinfo_service.h +++ b/src/include/gnunet_peerinfo_service.h | |||
@@ -51,7 +51,7 @@ extern "C" | |||
51 | * @param hello the verified (!) HELLO message | 51 | * @param hello the verified (!) HELLO message |
52 | */ | 52 | */ |
53 | void | 53 | void |
54 | GNUNET_PEERINFO_add_peer (struct GNUNET_CONFIGURATION_Handle *cfg, | 54 | GNUNET_PEERINFO_add_peer (const struct GNUNET_CONFIGURATION_Handle *cfg, |
55 | struct GNUNET_SCHEDULER_Handle *sched, | 55 | struct GNUNET_SCHEDULER_Handle *sched, |
56 | const struct GNUNET_PeerIdentity *peer, | 56 | const struct GNUNET_PeerIdentity *peer, |
57 | const struct GNUNET_HELLO_Message *hello); | 57 | const struct GNUNET_HELLO_Message *hello); |
@@ -90,7 +90,7 @@ typedef void | |||
90 | * @param callback_cls closure for callback | 90 | * @param callback_cls closure for callback |
91 | */ | 91 | */ |
92 | void | 92 | void |
93 | GNUNET_PEERINFO_for_all (struct GNUNET_CONFIGURATION_Handle *cfg, | 93 | GNUNET_PEERINFO_for_all (const struct GNUNET_CONFIGURATION_Handle *cfg, |
94 | struct GNUNET_SCHEDULER_Handle *sched, | 94 | struct GNUNET_SCHEDULER_Handle *sched, |
95 | const struct GNUNET_PeerIdentity *peer, | 95 | const struct GNUNET_PeerIdentity *peer, |
96 | int trust_delta, | 96 | int trust_delta, |
diff --git a/src/include/gnunet_program_lib.h b/src/include/gnunet_program_lib.h index fcd00b8ef..a44f4f11e 100644 --- a/src/include/gnunet_program_lib.h +++ b/src/include/gnunet_program_lib.h | |||
@@ -52,7 +52,7 @@ typedef void (*GNUNET_PROGRAM_Main) (void *cls, | |||
52 | struct GNUNET_SCHEDULER_Handle * sched, | 52 | struct GNUNET_SCHEDULER_Handle * sched, |
53 | char *const *args, | 53 | char *const *args, |
54 | const char *cfgfile, | 54 | const char *cfgfile, |
55 | struct GNUNET_CONFIGURATION_Handle * | 55 | const struct GNUNET_CONFIGURATION_Handle * |
56 | cfg); | 56 | cfg); |
57 | 57 | ||
58 | 58 | ||
diff --git a/src/include/gnunet_pseudonym_lib.h b/src/include/gnunet_pseudonym_lib.h index 0ee9ce7ac..ced9bf387 100644 --- a/src/include/gnunet_pseudonym_lib.h +++ b/src/include/gnunet_pseudonym_lib.h | |||
@@ -59,7 +59,7 @@ typedef int (*GNUNET_PSEUDONYM_Iterator) (void *cls, | |||
59 | * @param delta by how much should the rating be changed? | 59 | * @param delta by how much should the rating be changed? |
60 | * @return new rating of the namespace | 60 | * @return new rating of the namespace |
61 | */ | 61 | */ |
62 | int GNUNET_PSEUDONYM_rank (struct GNUNET_CONFIGURATION_Handle *cfg, | 62 | int GNUNET_PSEUDONYM_rank (const struct GNUNET_CONFIGURATION_Handle *cfg, |
63 | const GNUNET_HashCode * pseudonym, int delta); | 63 | const GNUNET_HashCode * pseudonym, int delta); |
64 | 64 | ||
65 | /** | 65 | /** |
@@ -67,7 +67,7 @@ int GNUNET_PSEUDONYM_rank (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
67 | * | 67 | * |
68 | * @param pseudonym the pseudonym's identifier | 68 | * @param pseudonym the pseudonym's identifier |
69 | */ | 69 | */ |
70 | void GNUNET_PSEUDONYM_add (struct GNUNET_CONFIGURATION_Handle *cfg, | 70 | void GNUNET_PSEUDONYM_add (const struct GNUNET_CONFIGURATION_Handle *cfg, |
71 | const GNUNET_HashCode * pseudo, | 71 | const GNUNET_HashCode * pseudo, |
72 | const struct GNUNET_CONTAINER_MetaData *meta); | 72 | const struct GNUNET_CONTAINER_MetaData *meta); |
73 | 73 | ||
@@ -75,7 +75,7 @@ void GNUNET_PSEUDONYM_add (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
75 | /** | 75 | /** |
76 | * List all known pseudonyms. | 76 | * List all known pseudonyms. |
77 | */ | 77 | */ |
78 | int GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg, | 78 | int GNUNET_PSEUDONYM_list_all (const struct GNUNET_CONFIGURATION_Handle *cfg, |
79 | GNUNET_PSEUDONYM_Iterator iterator, | 79 | GNUNET_PSEUDONYM_Iterator iterator, |
80 | void *closure); | 80 | void *closure); |
81 | 81 | ||
@@ -83,7 +83,7 @@ int GNUNET_PSEUDONYM_list_all (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
83 | * Register callback to be invoked whenever we discover | 83 | * Register callback to be invoked whenever we discover |
84 | * a new pseudonym. | 84 | * a new pseudonym. |
85 | */ | 85 | */ |
86 | int GNUNET_PSEUDONYM_discovery_callback_register (struct | 86 | int GNUNET_PSEUDONYM_discovery_callback_register (const struct |
87 | GNUNET_CONFIGURATION_Handle | 87 | GNUNET_CONFIGURATION_Handle |
88 | *cfg, | 88 | *cfg, |
89 | GNUNET_PSEUDONYM_Iterator | 89 | GNUNET_PSEUDONYM_Iterator |
@@ -101,7 +101,7 @@ GNUNET_PSEUDONYM_discovery_callback_unregister (GNUNET_PSEUDONYM_Iterator | |||
101 | * | 101 | * |
102 | * @return NULL on failure (should never happen) | 102 | * @return NULL on failure (should never happen) |
103 | */ | 103 | */ |
104 | char *GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg, | 104 | char *GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg, |
105 | const GNUNET_HashCode * pseudo); | 105 | const GNUNET_HashCode * pseudo); |
106 | 106 | ||
107 | /** | 107 | /** |
@@ -109,7 +109,7 @@ char *GNUNET_PSEUDONYM_id_to_name (struct GNUNET_CONFIGURATION_Handle *cfg, | |||
109 | * | 109 | * |
110 | * @return GNUNET_OK on success | 110 | * @return GNUNET_OK on success |
111 | */ | 111 | */ |
112 | int GNUNET_PSEUDONYM_name_to_id (struct GNUNET_CONFIGURATION_Handle *cfg, | 112 | int GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, |
113 | const char *hname, GNUNET_HashCode * psid); | 113 | const char *hname, GNUNET_HashCode * psid); |
114 | 114 | ||
115 | 115 | ||
diff --git a/src/include/gnunet_resolver_service.h b/src/include/gnunet_resolver_service.h index ac7aebcc7..6d96cc56f 100644 --- a/src/include/gnunet_resolver_service.h +++ b/src/include/gnunet_resolver_service.h | |||
@@ -65,7 +65,7 @@ typedef void (*GNUNET_RESOLVER_AddressCallback) (void *cls, | |||
65 | */ | 65 | */ |
66 | void | 66 | void |
67 | GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched, | 67 | GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched, |
68 | struct GNUNET_CONFIGURATION_Handle *cfg, | 68 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
69 | const char *hostname, | 69 | const char *hostname, |
70 | int domain, | 70 | int domain, |
71 | struct GNUNET_TIME_Relative timeout, | 71 | struct GNUNET_TIME_Relative timeout, |
@@ -84,7 +84,7 @@ GNUNET_RESOLVER_ip_get (struct GNUNET_SCHEDULER_Handle *sched, | |||
84 | */ | 84 | */ |
85 | void | 85 | void |
86 | GNUNET_RESOLVER_hostname_resolve (struct GNUNET_SCHEDULER_Handle *sched, | 86 | GNUNET_RESOLVER_hostname_resolve (struct GNUNET_SCHEDULER_Handle *sched, |
87 | struct GNUNET_CONFIGURATION_Handle *cfg, | 87 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
88 | int domain, | 88 | int domain, |
89 | struct GNUNET_TIME_Relative timeout, | 89 | struct GNUNET_TIME_Relative timeout, |
90 | GNUNET_RESOLVER_AddressCallback callback, | 90 | GNUNET_RESOLVER_AddressCallback callback, |
@@ -115,7 +115,7 @@ typedef void (*GNUNET_RESOLVER_HostnameCallback) (void *cls, | |||
115 | * @param cls closure for callback | 115 | * @param cls closure for callback |
116 | */ | 116 | */ |
117 | void GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched, | 117 | void GNUNET_RESOLVER_hostname_get (struct GNUNET_SCHEDULER_Handle *sched, |
118 | struct GNUNET_CONFIGURATION_Handle *cfg, | 118 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
119 | const struct sockaddr *sa, | 119 | const struct sockaddr *sa, |
120 | socklen_t salen, | 120 | socklen_t salen, |
121 | int do_resolve, | 121 | int do_resolve, |
diff --git a/src/include/gnunet_service_lib.h b/src/include/gnunet_service_lib.h index dbfb2588b..4d0eefb98 100644 --- a/src/include/gnunet_service_lib.h +++ b/src/include/gnunet_service_lib.h | |||
@@ -50,7 +50,7 @@ extern "C" | |||
50 | typedef void (*GNUNET_SERVICE_Main) (void *cls, | 50 | typedef void (*GNUNET_SERVICE_Main) (void *cls, |
51 | struct GNUNET_SCHEDULER_Handle * sched, | 51 | struct GNUNET_SCHEDULER_Handle * sched, |
52 | struct GNUNET_SERVER_Handle * server, | 52 | struct GNUNET_SERVER_Handle * server, |
53 | struct GNUNET_CONFIGURATION_Handle * | 53 | const struct GNUNET_CONFIGURATION_Handle * |
54 | cfg); | 54 | cfg); |
55 | 55 | ||
56 | 56 | ||
@@ -62,7 +62,7 @@ typedef void (*GNUNET_SERVICE_Main) (void *cls, | |||
62 | * @param cfg configuration to use | 62 | * @param cfg configuration to use |
63 | */ | 63 | */ |
64 | typedef void (*GNUNET_SERVICE_Term) (void *cls, | 64 | typedef void (*GNUNET_SERVICE_Term) (void *cls, |
65 | struct GNUNET_CONFIGURATION_Handle * | 65 | const struct GNUNET_CONFIGURATION_Handle * |
66 | cfg); | 66 | cfg); |
67 | 67 | ||
68 | 68 | ||
@@ -103,7 +103,7 @@ struct GNUNET_SERVICE_Context *GNUNET_SERVICE_start (const char *serviceName, | |||
103 | struct | 103 | struct |
104 | GNUNET_SCHEDULER_Handle | 104 | GNUNET_SCHEDULER_Handle |
105 | *sched, | 105 | *sched, |
106 | struct | 106 | const struct |
107 | GNUNET_CONFIGURATION_Handle | 107 | GNUNET_CONFIGURATION_Handle |
108 | *cfg); | 108 | *cfg); |
109 | 109 | ||
diff --git a/src/include/gnunet_statistics_service.h b/src/include/gnunet_statistics_service.h index 8dd11094c..2496f4091 100644 --- a/src/include/gnunet_statistics_service.h +++ b/src/include/gnunet_statistics_service.h | |||
@@ -78,7 +78,7 @@ typedef int (*GNUNET_STATISTICS_Iterator) (void *cls, | |||
78 | struct GNUNET_STATISTICS_Handle | 78 | struct GNUNET_STATISTICS_Handle |
79 | *GNUNET_STATISTICS_create (struct GNUNET_SCHEDULER_Handle *sched, | 79 | *GNUNET_STATISTICS_create (struct GNUNET_SCHEDULER_Handle *sched, |
80 | const char *subsystem, | 80 | const char *subsystem, |
81 | struct GNUNET_CONFIGURATION_Handle *cfg); | 81 | const struct GNUNET_CONFIGURATION_Handle *cfg); |
82 | 82 | ||
83 | 83 | ||
84 | /** | 84 | /** |
diff --git a/src/include/gnunet_testing_lib.h b/src/include/gnunet_testing_lib.h index 41dc21f75..3a18a17c3 100644 --- a/src/include/gnunet_testing_lib.h +++ b/src/include/gnunet_testing_lib.h | |||
@@ -58,16 +58,21 @@ struct GNUNET_TESTING_Daemon; | |||
58 | * | 58 | * |
59 | * @param cls closure | 59 | * @param cls closure |
60 | * @param id identifier for the daemon, NULL on error | 60 | * @param id identifier for the daemon, NULL on error |
61 | * @param d handle to the daemon, NULL if starting the daemon failed | 61 | * @param d handle for the daemon |
62 | * @param emsg error message (NULL on success) | ||
62 | */ | 63 | */ |
63 | typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls, | 64 | typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls, |
64 | const struct GNUNET_PeerIdentity *id, | 65 | const struct GNUNET_PeerIdentity *id, |
65 | struct GNUNET_TESTING_Daemon *d); | 66 | const struct GNUNET_CONFIGURATION_Handle *cfg, |
67 | struct GNUNET_TESTING_Daemon *d, | ||
68 | const char *emsg); | ||
66 | 69 | ||
67 | 70 | ||
68 | /** | 71 | /** |
69 | * Starts a GNUnet daemon. | 72 | * Starts a GNUnet daemon. |
70 | * | 73 | * |
74 | * @param sched scheduler to use | ||
75 | * @param cfg configuration to use | ||
71 | * @param service_home directory to use as the service home directory | 76 | * @param service_home directory to use as the service home directory |
72 | * @param transports transport services that should be loaded | 77 | * @param transports transport services that should be loaded |
73 | * @param applications application services and daemons that should be started | 78 | * @param applications application services and daemons that should be started |
@@ -76,8 +81,9 @@ typedef void (*GNUNET_TESTING_NotifyDaemonRunning)(void *cls, | |||
76 | * (use NULL for localhost). | 81 | * (use NULL for localhost). |
77 | * @param cb function to call with the result | 82 | * @param cb function to call with the result |
78 | * @param cb_cls closure for cb | 83 | * @param cb_cls closure for cb |
84 | * @return handle to the daemon (actual start will be completed asynchronously) | ||
79 | */ | 85 | */ |
80 | void | 86 | struct GNUNET_TESTING_Daemon * |
81 | GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched, | 87 | GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched, |
82 | struct GNUNET_CONFIGURATION_Handle *cfg, | 88 | struct GNUNET_CONFIGURATION_Handle *cfg, |
83 | const char *service_home, | 89 | const char *service_home, |
@@ -94,10 +100,10 @@ GNUNET_TESTING_daemon_start (struct GNUNET_SCHEDULER_Handle *sched, | |||
94 | * particular operation was completed the testing library. | 100 | * particular operation was completed the testing library. |
95 | * | 101 | * |
96 | * @param cls closure | 102 | * @param cls closure |
97 | * @param success GNUNET_YES on success | 103 | * @param emsg NULL on success |
98 | */ | 104 | */ |
99 | typedef void (*GNUNET_TESTING_NotifyCompletion)(void *cls, | 105 | typedef void (*GNUNET_TESTING_NotifyCompletion)(void *cls, |
100 | int success); | 106 | const char *emsg); |
101 | 107 | ||
102 | 108 | ||
103 | /** | 109 | /** |
@@ -112,17 +118,34 @@ void GNUNET_TESTING_daemon_stop (struct GNUNET_TESTING_Daemon *d, | |||
112 | void * cb_cls); | 118 | void * cb_cls); |
113 | 119 | ||
114 | 120 | ||
121 | /** | ||
122 | * Changes the configuration of a GNUnet daemon. | ||
123 | * | ||
124 | * @param d the daemon that should be modified | ||
125 | * @param cfg the new configuration for the daemon | ||
126 | * @param cb function called once the configuration was changed | ||
127 | * @param cb_cls closure for cb | ||
128 | */ | ||
129 | void GNUNET_TESTING_daemon_reconfigure (struct GNUNET_TESTING_Daemon *d, | ||
130 | struct GNUNET_CONFIGURATION_Handle *cfg, | ||
131 | GNUNET_TESTING_NotifyCompletion cb, | ||
132 | void * cb_cls); | ||
133 | |||
134 | |||
115 | 135 | ||
116 | /** | 136 | /** |
117 | * Establish a connection between two GNUnet daemons. | 137 | * Establish a connection between two GNUnet daemons. |
118 | * | 138 | * |
119 | * @param d1 handle for the first daemon | 139 | * @param d1 handle for the first daemon |
120 | * @param d2 handle for the second daemon | 140 | * @param d2 handle for the second daemon |
141 | * @param timeout how long is the connection attempt | ||
142 | * allowed to take? | ||
121 | * @param cb function to call at the end | 143 | * @param cb function to call at the end |
122 | * @param cb_cls closure for cb | 144 | * @param cb_cls closure for cb |
123 | */ | 145 | */ |
124 | void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | 146 | void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, |
125 | struct GNUNET_TESTING_Daemon *d2, | 147 | struct GNUNET_TESTING_Daemon *d2, |
148 | struct GNUNET_TIME_Relative timeout, | ||
126 | GNUNET_TESTING_NotifyCompletion cb, | 149 | GNUNET_TESTING_NotifyCompletion cb, |
127 | void *cb_cls); | 150 | void *cb_cls); |
128 | 151 | ||
@@ -134,11 +157,13 @@ void GNUNET_TESTING_daemons_connect (struct GNUNET_TESTING_Daemon *d1, | |||
134 | * be computed by adding delta each time (zero | 157 | * be computed by adding delta each time (zero |
135 | * times for the first peer). | 158 | * times for the first peer). |
136 | * | 159 | * |
160 | * @param sched scheduler to use | ||
161 | * @param cfg configuration to use | ||
137 | * @param total number of daemons to start | 162 | * @param total number of daemons to start |
138 | * @param service_home_prefix path to use as the prefix for the home of the services | 163 | * @param service_home_prefix path to use as the prefix for the home of the services; |
164 | * a number will be added for the different peers | ||
139 | * @param transports which transports should all peers use | 165 | * @param transports which transports should all peers use |
140 | * @param applications which applications should be used? | 166 | * @param applications which applications should be used? |
141 | * @param timeout how long is this allowed to take? | ||
142 | * @param cb function to call on each daemon that was started | 167 | * @param cb function to call on each daemon that was started |
143 | * @param cb_cls closure for cb | 168 | * @param cb_cls closure for cb |
144 | * @param cbe function to call at the end | 169 | * @param cbe function to call at the end |
diff --git a/src/include/gnunet_transport_service.h b/src/include/gnunet_transport_service.h index 391a87e9d..037a247a2 100644 --- a/src/include/gnunet_transport_service.h +++ b/src/include/gnunet_transport_service.h | |||
@@ -111,7 +111,7 @@ typedef void | |||
111 | struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (struct | 111 | struct GNUNET_TRANSPORT_Handle *GNUNET_TRANSPORT_connect (struct |
112 | GNUNET_SCHEDULER_Handle | 112 | GNUNET_SCHEDULER_Handle |
113 | *sched, | 113 | *sched, |
114 | struct | 114 | const struct |
115 | GNUNET_CONFIGURATION_Handle | 115 | GNUNET_CONFIGURATION_Handle |
116 | *cfg, void *cls, | 116 | *cfg, void *cls, |
117 | GNUNET_TRANSPORT_ReceiveCallback | 117 | GNUNET_TRANSPORT_ReceiveCallback |