diff options
Diffstat (limited to 'src/include/gnunet_configuration_lib.h')
-rw-r--r-- | src/include/gnunet_configuration_lib.h | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/include/gnunet_configuration_lib.h b/src/include/gnunet_configuration_lib.h index e3eefa18d..ec3d12738 100644 --- a/src/include/gnunet_configuration_lib.h +++ b/src/include/gnunet_configuration_lib.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | Copyright (C) 2006, 2008, 2009 GNUnet e.V. | 3 | Copyright (C) 2006, 2008, 2009, 2018 GNUnet e.V. |
4 | 4 | ||
5 | GNUnet is free software: you can redistribute it and/or modify it | 5 | GNUnet is free software: you can redistribute it and/or modify it |
6 | under the terms of the GNU Affero General Public License as published | 6 | under the terms of the GNU Affero General Public License as published |
@@ -191,6 +191,35 @@ GNUNET_CONFIGURATION_is_dirty (const struct GNUNET_CONFIGURATION_Handle *cfg); | |||
191 | 191 | ||
192 | 192 | ||
193 | /** | 193 | /** |
194 | * Signature of a function to be run with a configuration. | ||
195 | * | ||
196 | * @param cls closure | ||
197 | * @param cfg the configuration | ||
198 | * @return status code | ||
199 | */ | ||
200 | typedef int | ||
201 | (*GNUNET_CONFIGURATION_Callback)(void *cls, | ||
202 | const struct GNUNET_CONFIGURATION_Handle *cfg); | ||
203 | |||
204 | |||
205 | /** | ||
206 | * Parse a configuration file @a filename and run the function | ||
207 | * @a cb with the resulting configuration object. Then free the | ||
208 | * configuration object and return the status value from @a cb. | ||
209 | * | ||
210 | * @param filename configuration to parse, NULL for "default" | ||
211 | * @param cb function to run | ||
212 | * @param cb_cls closure for @a cb | ||
213 | * @return #GNUNET_SYSERR if parsing the configuration failed, | ||
214 | * otherwise return value from @a cb. | ||
215 | */ | ||
216 | int | ||
217 | GNUNET_CONFIGURATION_parse_and_run (const char *filename, | ||
218 | GNUNET_CONFIGURATION_Callback cb, | ||
219 | void *cb_cls); | ||
220 | |||
221 | |||
222 | /** | ||
194 | * Function to iterate over options. | 223 | * Function to iterate over options. |
195 | * | 224 | * |
196 | * @param cls closure | 225 | * @param cls closure |