aboutsummaryrefslogtreecommitdiff
path: root/src/util/getopt_helpers.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2015-04-13 20:26:36 +0000
committerChristian Grothoff <christian@grothoff.org>2015-04-13 20:26:36 +0000
commitdc08cf45466193ee67fbbe97cddee413f0273cff (patch)
treee344595737de9c912cbd5251c9cfe20ea55c0a46 /src/util/getopt_helpers.c
parentb5b42150a32afbe1d1c29b8075312dcccb052fa2 (diff)
downloadgnunet-dc08cf45466193ee67fbbe97cddee413f0273cff.tar.gz
gnunet-dc08cf45466193ee67fbbe97cddee413f0273cff.zip
-doxygen, build system fixes, minor API extension
Diffstat (limited to 'src/util/getopt_helpers.c')
-rw-r--r--src/util/getopt_helpers.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c
index c9eb25f2f..c41f78235 100644
--- a/src/util/getopt_helpers.c
+++ b/src/util/getopt_helpers.c
@@ -36,21 +36,26 @@
36 * @param scls additional closure (points to version string) 36 * @param scls additional closure (points to version string)
37 * @param option name of the option 37 * @param option name of the option
38 * @param value not used (NULL) 38 * @param value not used (NULL)
39 * @return GNUNET_NO (do not continue, not an error) 39 * @return #GNUNET_NO (do not continue, not an error)
40 */ 40 */
41int 41int
42GNUNET_GETOPT_print_version_ (struct GNUNET_GETOPT_CommandLineProcessorContext 42GNUNET_GETOPT_print_version_ (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
43 *ctx, void *scls, const char *option, 43 void *scls,
44 const char *option,
44 const char *value) 45 const char *value)
45{ 46{
46 const char *version = scls; 47 const char *version = scls;
47 48
48 printf ("%s v%s\n", ctx->binaryName, version); 49 printf ("%s v%s\n",
50 ctx->binaryName,
51 version);
49 return GNUNET_NO; 52 return GNUNET_NO;
50} 53}
51 54
52 55
53 56/**
57 * At what offset does the help text start?
58 */
54#define BORDER 29 59#define BORDER 29
55 60
56/** 61/**
@@ -60,11 +65,12 @@ GNUNET_GETOPT_print_version_ (struct GNUNET_GETOPT_CommandLineProcessorContext
60 * @param scls additional closure (points to about text) 65 * @param scls additional closure (points to about text)
61 * @param option name of the option 66 * @param option name of the option
62 * @param value not used (NULL) 67 * @param value not used (NULL)
63 * @return GNUNET_NO (do not continue, not an error) 68 * @return #GNUNET_NO (do not continue, not an error)
64 */ 69 */
65int 70int
66GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext 71GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
67 *ctx, void *scls, const char *option, 72 void *scls,
73 const char *option,
68 const char *value) 74 const char *value)
69{ 75{
70 const char *about = scls; 76 const char *about = scls;
@@ -166,7 +172,7 @@ OUTER:
166 * @param scls additional closure (will point to the 'int') 172 * @param scls additional closure (will point to the 'int')
167 * @param option name of the option 173 * @param option name of the option
168 * @param value not used (NULL) 174 * @param value not used (NULL)
169 * @return GNUNET_OK 175 * @return #GNUNET_OK
170 */ 176 */
171int 177int
172GNUNET_GETOPT_increment_value (struct GNUNET_GETOPT_CommandLineProcessorContext 178GNUNET_GETOPT_increment_value (struct GNUNET_GETOPT_CommandLineProcessorContext
@@ -192,7 +198,7 @@ GNUNET_GETOPT_increment_value (struct GNUNET_GETOPT_CommandLineProcessorContext
192 * @param scls additional closure (will point to the 'int') 198 * @param scls additional closure (will point to the 'int')
193 * @param option name of the option 199 * @param option name of the option
194 * @param value not used (NULL) 200 * @param value not used (NULL)
195 * @return GNUNET_OK 201 * @return #GNUNET_OK
196 */ 202 */
197int 203int
198GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, 204GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
@@ -217,7 +223,7 @@ GNUNET_GETOPT_set_one (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
217 * which will be allocated) 223 * which will be allocated)
218 * @param option name of the option 224 * @param option name of the option
219 * @param value actual value of the option (a string) 225 * @param value actual value of the option (a string)
220 * @return GNUNET_OK 226 * @return #GNUNET_OK
221 */ 227 */
222int 228int
223GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, 229GNUNET_GETOPT_set_string (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
@@ -255,7 +261,7 @@ GNUNET_GETOPT_set_filename (struct GNUNET_GETOPT_CommandLineProcessorContext *ct
255 * @param scls additional closure (will point to the 'unsigned long long') 261 * @param scls additional closure (will point to the 'unsigned long long')
256 * @param option name of the option 262 * @param option name of the option
257 * @param value actual value of the option as a string. 263 * @param value actual value of the option as a string.
258 * @return GNUNET_OK if parsing the value worked 264 * @return #GNUNET_OK if parsing the value worked
259 */ 265 */
260int 266int
261GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, 267GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
@@ -283,7 +289,7 @@ GNUNET_GETOPT_set_ulong (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
283 * @param scls additional closure (will point to the 'struct GNUNET_TIME_Relative') 289 * @param scls additional closure (will point to the 'struct GNUNET_TIME_Relative')
284 * @param option name of the option 290 * @param option name of the option
285 * @param value actual value of the option as a string. 291 * @param value actual value of the option as a string.
286 * @return GNUNET_OK if parsing the value worked 292 * @return #GNUNET_OK if parsing the value worked
287 */ 293 */
288int 294int
289GNUNET_GETOPT_set_relative_time (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, 295GNUNET_GETOPT_set_relative_time (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,
@@ -313,7 +319,7 @@ GNUNET_GETOPT_set_relative_time (struct GNUNET_GETOPT_CommandLineProcessorContex
313 * @param scls additional closure (will point to the 'unsigned int') 319 * @param scls additional closure (will point to the 'unsigned int')
314 * @param option name of the option 320 * @param option name of the option
315 * @param value actual value of the option as a string. 321 * @param value actual value of the option as a string.
316 * @return GNUNET_OK if parsing the value worked 322 * @return #GNUNET_OK if parsing the value worked
317 */ 323 */
318int 324int
319GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx, 325GNUNET_GETOPT_set_uint (struct GNUNET_GETOPT_CommandLineProcessorContext *ctx,