aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_getopt_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-01-24 13:22:43 +0000
committerChristian Grothoff <christian@grothoff.org>2011-01-24 13:22:43 +0000
commitd9408bf11420e74e8defd6e26d4aa178632eefe9 (patch)
treeda38a61a9b73ea3869f36812608e465ff901403e /src/include/gnunet_getopt_lib.h
parentc45ae3089f9c7dfd619cf978726a6be5c317c47d (diff)
downloadgnunet-d9408bf11420e74e8defd6e26d4aa178632eefe9.tar.gz
gnunet-d9408bf11420e74e8defd6e26d4aa178632eefe9.zip
docu
Diffstat (limited to 'src/include/gnunet_getopt_lib.h')
-rw-r--r--src/include/gnunet_getopt_lib.h83
1 files changed, 76 insertions, 7 deletions
diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h
index d5f3d1198..6464f6ff9 100644
--- a/src/include/gnunet_getopt_lib.h
+++ b/src/include/gnunet_getopt_lib.h
@@ -198,35 +198,91 @@ int GNUNET_GETOPT_run (const char *binaryOptions,
198 *allOptions, unsigned int argc, char *const *argv); 198 *allOptions, unsigned int argc, char *const *argv);
199 199
200/** 200/**
201 * FIXME 201 * Set an option of type 'unsigned long long' from the command line.
202 * A pointer to this function should be passed as part of the
203 * 'struct GNUNET_GETOPT_CommandLineOption' array to initialize options
204 * of this type. It should be followed by a pointer to a value of
205 * type 'unsigned long long'.
206 *
207 * @param ctx command line processing context
208 * @param scls additional closure (will point to the 'unsigned long long')
209 * @param option name of the option
210 * @param value actual value of the option as a string.
211 * @return GNUNET_OK if parsing the value worked
202 */ 212 */
203int GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext 213int GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext
204 *ctx, void *scls, const char *option, 214 *ctx, void *scls, const char *option,
205 const char *value); 215 const char *value);
206 216
217
207/** 218/**
208 * FIXME 219 * Set an option of type 'unsigned long long' from the command line.
220 * A pointer to this function should be passed as part of the
221 * 'struct GNUNET_GETOPT_CommandLineOption' array to initialize options
222 * of this type. It should be followed by a pointer to a value of
223 * type 'unsigned int'.
224 *
225 * @param ctx command line processing context
226 * @param scls additional closure (will point to the 'unsigned int')
227 * @param option name of the option
228 * @param value actual value of the option as a string.
229 * @return GNUNET_OK if parsing the value worked
209 */ 230 */
210int GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext 231int GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext
211 *ctx, void *scls, const char *option, 232 *ctx, void *scls, const char *option,
212 const char *value); 233 const char *value);
213 234
235
214/** 236/**
215 * FIXME 237 * Set an option of type 'int' from the command line to 1 if the
238 * given option is present.
239 * A pointer to this function should be passed as part of the
240 * 'struct GNUNET_GETOPT_CommandLineOption' array to initialize options
241 * of this type. It should be followed by a pointer to a value of
242 * type 'int'.
243 *
244 * @param ctx command line processing context
245 * @param scls additional closure (will point to the 'int')
246 * @param option name of the option
247 * @param value not used (NULL)
248 * @return GNUNET_OK
216 */ 249 */
217int GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext 250int GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext
218 *ctx, void *scls, const char *option, 251 *ctx, void *scls, const char *option,
219 const char *value); 252 const char *value);
220 253
254
221/** 255/**
222 * FIXME 256 * Set an option of type 'char *' from the command line.
257 * A pointer to this function should be passed as part of the
258 * 'struct GNUNET_GETOPT_CommandLineOption' array to initialize options
259 * of this type. It should be followed by a pointer to a value of
260 * type 'char *'.
261 *
262 * @param ctx command line processing context
263 * @param scls additional closure (will point to the 'char *',
264 * which will be allocated)
265 * @param option name of the option
266 * @param value actual value of the option (a string)
267 * @return GNUNET_OK
223 */ 268 */
224int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext 269int GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext
225 *ctx, void *scls, const char *option, 270 *ctx, void *scls, const char *option,
226 const char *value); 271 const char *value);
227 272
228/** 273/**
229 * FIXME 274 * Set an option of type 'unsigned int' from the command line. Each
275 * time the option flag is given, the value is incremented by one.
276 * A pointer to this function should be passed as part of the
277 * 'struct GNUNET_GETOPT_CommandLineOption' array to initialize options
278 * of this type. It should be followed by a pointer to a value of
279 * type 'int'.
280 *
281 * @param ctx command line processing context
282 * @param scls additional closure (will point to the 'int')
283 * @param option name of the option
284 * @param value not used (NULL)
285 * @return GNUNET_OK
230 */ 286 */
231int 287int
232GNUNET_GETOPT_increment_value (struct 288GNUNET_GETOPT_increment_value (struct
@@ -234,10 +290,17 @@ GNUNET_GETOPT_increment_value (struct
234 void *scls, const char *option, 290 void *scls, const char *option,
235 const char *value); 291 const char *value);
236 292
293
237/* *************** internal prototypes - use macros above! ************* */ 294/* *************** internal prototypes - use macros above! ************* */
238 295
239/** 296/**
240 * FIXME 297 * Print out details on command line options (implements --help).
298 *
299 * @param ctx command line processing context
300 * @param scls additional closure (points to about text)
301 * @param option name of the option
302 * @param value not used (NULL)
303 * @return GNUNET_SYSERR (do not continue)
241 */ 304 */
242int GNUNET_GETOPT_format_help_ (struct 305int GNUNET_GETOPT_format_help_ (struct
243 GNUNET_GETOPT_CommandLineProcessorContext 306 GNUNET_GETOPT_CommandLineProcessorContext
@@ -245,7 +308,13 @@ int GNUNET_GETOPT_format_help_ (struct
245 const char *value); 308 const char *value);
246 309
247/** 310/**
248 * FIXME 311 * Print out program version (implements --version).
312 *
313 * @param ctx command line processing context
314 * @param scls additional closure (points to version string)
315 * @param option name of the option
316 * @param value not used (NULL)
317 * @return GNUNET_SYSERR (do not continue)
249 */ 318 */
250int GNUNET_GETOPT_print_version_ (struct 319int GNUNET_GETOPT_print_version_ (struct
251 GNUNET_GETOPT_CommandLineProcessorContext 320 GNUNET_GETOPT_CommandLineProcessorContext