Prechádzať zdrojové kódy

lib/parser: more doxygen documentation

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62219 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 10 rokov pred
rodič
commit
598421b52d
2 zmenil súbory, kde vykonal 40 pridanie a 19 odobranie
  1. 13 13
      lib/gis/parser.c
  2. 27 6
      lib/gis/parser_dependencies.c

+ 13 - 13
lib/gis/parser.c

@@ -290,19 +290,19 @@ struct GModule *G_define_module(void)
  *
  * The usual order a module calls functions is:
  *
- *  # G_gisinit()
- *  # G_define_module()
- *  # G_define_standard_flag()
- *  # G_define_standard_option()
- *  # G_define_flag()
- *  # G_define_option()
- *  # G_option_exclusive()
- *  # G_option_required()
- *  # G_option_requires()
- *  # G_option_requires_all()
- *  # G_option_excludes()
- *  # G_option_collective()
- *  # G_parser()
+ *  1. G_gisinit()
+ *  2. G_define_module()
+ *  3. G_define_standard_flag()
+ *  4. G_define_standard_option()
+ *  5. G_define_flag()
+ *  6. G_define_option()
+ *  7. G_option_exclusive()
+ *  8. G_option_required()
+ *  9. G_option_requires()
+ *  10. G_option_requires_all()
+ *  11. G_option_excludes()
+ *  12. G_option_collective()
+ *  13. G_parser()
  *
  * \param argc number of arguments
  * \param argv argument list

+ 27 - 6
lib/gis/parser_dependencies.c

@@ -176,7 +176,11 @@ static void append_error(const char *msg)
     st->error[st->n_errors++] = G_store(msg);
 }
 
-/* at most one option from a set */
+/*! \brief Sets the options to be mutually exclusive.
+
+    When running the module, at most one option from a set can be
+    provided.
+*/
 void G_option_exclusive(void *first, ...)
 {
     va_list ap;
@@ -214,8 +218,17 @@ static void check_required(const struct rule *rule)
     }
 }
 
-/* if the first option is present, at least one of the other
-   options must also be present */
+/*! \brief Define a list of options from which at least one option
+    is required if first option is present.
+
+    If the first option is present, at least one of the other
+    options must also be present.
+
+    If you want all options to be provided use G_option_requires_all()
+    function.
+    If you want more than one option to be present but not all,
+    call this function multiple times.
+*/
 void G_option_requires(void *first, ...)
 {
     va_list ap;
@@ -236,8 +249,16 @@ static void check_requires(const struct rule *rule)
     }
 }
 
-/* if the first option is present, all the other options must also
-   be present. */
+/*! \brief Define additionally required options for an option.
+
+    If the first option is present, all the other options must also
+    be present.
+
+    If it is enough if only one option from a set is present,
+    use G_option_requires() function.
+
+    \see G_option_collective()
+*/
 void G_option_requires_all(void *first, ...)
 {
     va_list ap;
@@ -258,7 +279,7 @@ static void check_requires_all(const struct rule *rule)
     }
 }
 
-/* if the first option is present, none of the other options may also
+/* if the first option is present, none of the other options may also (should?)
    be present. */
 void G_option_excludes(void *first, ...)
 {