diff th_args.c @ 436:9148bc3fa838

Begin adding Doxygen documentation for some things. Very rudimentary, and most things are not documented yet.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 10 May 2017 21:00:37 +0300
parents 1b3472ba7b23
children 2991e6b52d95
line wrap: on
line diff
--- a/th_args.c	Fri Apr 07 02:49:08 2017 +0300
+++ b/th_args.c	Wed May 10 21:00:37 2017 +0300
@@ -5,6 +5,8 @@
  *
  * Please read file 'COPYING' for information on license and distribution.
  */
+/// @file
+/// @brief Simple commandline argument processing functions
 #ifndef TH_EXTERNAL
 #include "th_util.h"
 #include "th_args.h"
@@ -12,7 +14,17 @@
 #endif
 
 
-/* Parse long and short options
+/**
+ * Parse and optionally handle the given long or short option argument.
+ * @param currArg current argument string
+ * @param argIndex pointer to index of current argument in argv[]
+ * @param argc number of arguments
+ * @param argv argument string array
+ * @param opts options list array
+ * @param nopts number of elements in options list array
+ * @param handle_option function pointer to callback that handles option arguments
+ * @param doProcess if TRUE, actually handle the argument, aka call the handle_option() function. if FALSE, only validity of options are checked.
+ * @param isLong TRUE if the option is a --long-format one
  */
 static BOOL th_args_process_opt(
     char *currArg, int *argIndex,
@@ -95,8 +107,18 @@
 }
 
 
-/* Process arguments, handling short and long options by
- * calling the given callback functions.
+/**
+ * Process given array of commandline arguments, handling short
+ * and long options by calling the respective callback functions.
+ *
+ * @param argc number of arguments
+ * @param argv argument list
+ * @param opts supported option list array
+ * @param nopts number of elements in the option list array
+ * @param handle_option callback function
+ * @param handle_other callback function
+ * @param flags processing flags
+ * @return return TRUE if all is well
  */
 BOOL th_args_process(int argc, char *argv[],
      const th_optarg *opts, const int nopts,
@@ -157,7 +179,12 @@
 }
 
 
-/* Print help for commandline arguments/options
+/**
+ * Print help for commandline arguments/options
+ * @param fh stdio file handle to output to
+ * @param opts options list array
+ * @param nopts number of elements in options list array
+ * @param flags flags (currently unused)
  */
 void th_args_help(FILE *fh,
     const th_optarg *opts, const int nopts,