le_args.h
Go to the documentation of this file.
1 
195 //--------------------------------------------------------------------------------------------------
203 #ifndef LEGATO_ARGS_INCLUDE_GUARD
204 #define LEGATO_ARGS_INCLUDE_GUARD
205 
206 
207 //--------------------------------------------------------------------------------------------------
213 //--------------------------------------------------------------------------------------------------
214 const char* le_arg_GetProgramName
215 (
216  void
217 );
218 
219 
220 //--------------------------------------------------------------------------------------------------
227 //--------------------------------------------------------------------------------------------------
228 size_t le_arg_NumArgs
229 (
230  void
231 );
232 
233 
234 //--------------------------------------------------------------------------------------------------
240 //--------------------------------------------------------------------------------------------------
241 const char* le_arg_GetArg
242 (
243  size_t argIndex
244 );
245 
246 
247 //--------------------------------------------------------------------------------------------------
259 //--------------------------------------------------------------------------------------------------
261 (
262  const char* shortName,
263  const char* longName
264 );
265 
266 
267 //--------------------------------------------------------------------------------------------------
281 //--------------------------------------------------------------------------------------------------
283 (
284  int* varPtr,
285  const char* shortName,
286  const char* longName
287 );
288 
289 
290 //--------------------------------------------------------------------------------------------------
306 //--------------------------------------------------------------------------------------------------
308 (
309  const char** varPtr,
310  const char* shortName,
311  const char* longName
312 );
313 
314 
315 //--------------------------------------------------------------------------------------------------
324 //--------------------------------------------------------------------------------------------------
326 (
327  bool* varPtr,
328  const char* shortName,
329  const char* longName
330 );
331 
332 
333 //--------------------------------------------------------------------------------------------------
342 //--------------------------------------------------------------------------------------------------
343 void le_arg_SetIntVar
344 (
345  int* varPtr,
346  const char* shortName,
347  const char* longName
348 );
349 
350 
351 //--------------------------------------------------------------------------------------------------
365 //--------------------------------------------------------------------------------------------------
367 (
368  const char** varPtr,
369  const char* shortName,
370  const char* longName
371 );
372 
373 
374 //--------------------------------------------------------------------------------------------------
381 //--------------------------------------------------------------------------------------------------
382 typedef void (*le_arg_FlagCallbackFunc_t)(void);
383 
384 //--------------------------------------------------------------------------------------------------
393 //--------------------------------------------------------------------------------------------------
395 (
397  const char* shortName,
398  const char* longName
399 );
400 
401 
402 //--------------------------------------------------------------------------------------------------
411 //--------------------------------------------------------------------------------------------------
412 typedef void (*le_arg_IntCallbackFunc_t)
413 (
414  int value
415 );
416 
417 //--------------------------------------------------------------------------------------------------
427 //--------------------------------------------------------------------------------------------------
429 (
431  const char* shortName,
432  const char* longName
433 );
434 
435 
436 //--------------------------------------------------------------------------------------------------
445 //--------------------------------------------------------------------------------------------------
446 typedef void (*le_arg_StringCallbackFunc_t)
447 (
448  const char* value
449 );
450 
451 //--------------------------------------------------------------------------------------------------
460 //--------------------------------------------------------------------------------------------------
462 (
464  const char* shortName,
465  const char* longName
466 );
467 
468 
469 //--------------------------------------------------------------------------------------------------
486 //--------------------------------------------------------------------------------------------------
488 (
490 );
491 
492 
493 //--------------------------------------------------------------------------------------------------
503 //--------------------------------------------------------------------------------------------------
505 (
506  void
507 );
508 
509 
510 //--------------------------------------------------------------------------------------------------
520 //--------------------------------------------------------------------------------------------------
522 (
523  void
524 );
525 
526 
527 //--------------------------------------------------------------------------------------------------
548 //--------------------------------------------------------------------------------------------------
549 typedef size_t (*le_arg_ErrorHandlerFunc_t)
550 (
551  size_t argIndex,
552  le_result_t errorCode
553 );
554 
555 
556 //--------------------------------------------------------------------------------------------------
561 //--------------------------------------------------------------------------------------------------
563 (
564  le_arg_ErrorHandlerFunc_t errorHandlerFunc
565 );
566 
567 
568 //--------------------------------------------------------------------------------------------------
573 //--------------------------------------------------------------------------------------------------
574 void le_arg_Scan
575 (
576  void
577 );
578 
579 
580 //--------------------------------------------------------------------------------------------------
587 //--------------------------------------------------------------------------------------------------
588 void le_arg_SetArgs
589 (
590  const size_t argc,
591  char** argv
592 );
593 
594 
595 #endif // LEGATO_ARGS_INCLUDE_GUARD
size_t le_arg_NumArgs(void)
le_result_t
Definition: le_basics.h:35
le_result_t le_arg_GetIntOption(int *varPtr, const char *shortName, const char *longName)
void le_arg_SetStringCallback(le_arg_StringCallbackFunc_t func, const char *shortName, const char *longName)
void le_arg_SetStringVar(const char **varPtr, const char *shortName, const char *longName)
void le_arg_AllowMorePositionalArgsThanCallbacks(void)
void(* le_arg_FlagCallbackFunc_t)(void)
Definition: le_args.h:382
void le_arg_SetIntVar(int *varPtr, const char *shortName, const char *longName)
const char * le_arg_GetProgramName(void)
void le_arg_SetFlagCallback(le_arg_FlagCallbackFunc_t func, const char *shortName, const char *longName)
void le_arg_Scan(void)
void le_arg_SetFlagVar(bool *varPtr, const char *shortName, const char *longName)
const char * le_arg_GetArg(size_t argIndex)
void le_arg_AddPositionalCallback(le_arg_StringCallbackFunc_t func)
void(* le_arg_IntCallbackFunc_t)(int value)
Definition: le_args.h:413
void le_arg_AllowLessPositionalArgsThanCallbacks(void)
void le_arg_SetErrorHandler(le_arg_ErrorHandlerFunc_t errorHandlerFunc)
size_t(* le_arg_ErrorHandlerFunc_t)(size_t argIndex, le_result_t errorCode)
Definition: le_args.h:550
void(* le_arg_StringCallbackFunc_t)(const char *value)
Definition: le_args.h:447
void le_arg_SetArgs(const size_t argc, char **argv)
le_result_t le_arg_GetFlagOption(const char *shortName, const char *longName)
void le_arg_SetIntCallback(le_arg_IntCallbackFunc_t func, const char *shortName, const char *longName)
le_result_t le_arg_GetStringOption(const char **varPtr, const char *shortName, const char *longName)