[hipl-dev] [Branch ~toxedvirus/hipl/hipfw-modules] Rev 5009: Add documentation for hip_cmd_options_parase, add documentation for missing paramter, fix typo in...

  • From: noreply@xxxxxxxxxxxxx
  • To: HIPL core team <hipl-dev@xxxxxxxxxxxxx>
  • Date: Tue, 09 Nov 2010 13:08:30 -0000

------------------------------------------------------------
revno: 5009
committer: Andrius Bentkus <andrius.bentkus@xxxxxxxxxxxxxx>
branch nick: hipfw-modules
timestamp: Tue 2010-11-09 14:05:36 +0100
message:
  Add documentation for hip_cmd_options_parase, add documentation for missing 
paramter, fix typo in documentation, comply to grammar fanatics.
modified:
  lib/core/options.c


--
lp:~toxedvirus/hipl/hipfw-modules
https://code.launchpad.net/~toxedvirus/hipl/hipfw-modules

Your team HIPL core team is subscribed to branch 
lp:~toxedvirus/hipl/hipfw-modules.
To unsubscribe from this branch go to 
https://code.launchpad.net/~toxedvirus/hipl/hipfw-modules/+edit-subscription
=== modified file 'lib/core/options.c'
--- lib/core/options.c  2010-11-09 13:04:44 +0000
+++ lib/core/options.c  2010-11-09 13:05:36 +0000
@@ -61,10 +61,10 @@
 #include "lib/core/linkedlist.h"
 
 /**
- * Print a well formated help huide for a given list of options.
+ * Print a well formated help guide for a given list of options.
  *
- * @param appname uses the following application name in the help
- * @param list    uses the following list of options in the process of help 
generation
+ * @param appname Name of the application name to be used in the help.
+ * @param list    List of options to be used in the generation of the help 
message.
  */
 void hip_cmd_print_usage(const char *appname, const struct hip_cmd_option_list 
*list)
 {
@@ -102,10 +102,10 @@
 /**
  * Get an option from a list
  *
- * @param list       Pointer to a list where to search for the option.
- * @param short_name Option name (one character) for which to search
- * @return Success = pointer to the specific option struct
- *         Error   = NULL (not found)
+ * @param list       Pointer to a list in which to search for the option.
+ * @param short_name Option name (one character) for which to search.
+ * @return Success = Pointer to the specific option struct,
+ *         Error   = NULL (not found).
  */
 static struct hip_cmd_option *hip_cmd_options_get(const struct 
hip_cmd_option_list *list, char short_name)
 {
@@ -125,11 +125,11 @@
 
 /**
  * Check if elements of a given list of options don't occure already.
- * Directly exit's the application.
+ * Directly exits the application if it finds one.
  *
  * @param list    Pointer to a list to check against.
  * @param options A list of options to check with.
- * @param size    number of the entries in the list
+ * @param size    Number of the entries in the list.
  */
 static void hip_cmd_options_check(const struct hip_cmd_option_list *list,
                                   struct hip_cmd_option *options,
@@ -148,7 +148,7 @@
  * Count options in a list.
  *
  * @param list Pointer to a list which to count.
- * @return     the number of options added to the option list.
+ * @return     Number of options added to the option list.
  */
 unsigned int hip_cmd_options_count(const struct hip_cmd_option_list *list)
 {
@@ -165,7 +165,7 @@
 /**
  * Default handler for missing option.
  *
- * @param option Option as a character.
+ * @param option Invoked optioncharacter.
  */
 static void missing_option(const char option)
 {
@@ -184,9 +184,9 @@
 
 /**
  * Initializes option list with standard handler functions.
- * Initialized the linked list aswell.
+ * Initializes the linked list aswell.
  *
- * @param list Pointer to an empty list
+ * @param list Pointer to an uninitialized list.
  */
 void hip_cmd_options_init(struct hip_cmd_option_list *list)
 {
@@ -200,9 +200,9 @@
  * Calculate the size of the option string needed by optarg.
  *
  * @param  list Pointer to the list from which to generate the option string.
- * @return size of the generated string that is needed by hold the information
- *         of getopt including the space for the string delimter.
- * @note   the function includes the trailing white space size requiremet
+ * @return      Size of the generated string that is needed to hold the 
information
+ *              of getopt including the space for the string delimter.
+ * @note        the function includes the string terminator.
  */
 static unsigned int hip_cmd_options_string_size(const struct 
hip_cmd_option_list *list)
 {
@@ -222,9 +222,9 @@
 /**
  * Add option block to option list.
  *
- * @param list    Pointer to list, head must be initialized with NULL.
- * @param options Pointer to options to be added.
- * @return        Size (element count) of the options array to be added.
+ * @param list    Pointer to the list, head must be initialized with NULL.
+ * @param options Pointer to the option block to be added.
+ * @param size    Count of elements in the options struct.
  */
 void hip_cmd_options_add(struct hip_cmd_option_list *list,
                          struct hip_cmd_option *options,
@@ -241,9 +241,9 @@
 }
 
 /**
- * Frees the allocated option block, used in hip_ll_uninit
+ * Frees the allocated option block, used in hip_ll_uninit.
  *
- * @param ptr pointer to the option
+ * @param ptr Pointer to the allocated option block.
  */
 static void hip_cmd_options_uninit_block(void *ptr)
 {
@@ -261,10 +261,10 @@
 }
 
 /**
- * Generate the optarg string from a list of options
+ * Generates the optarg string from a list of options.
  *
- * @param  list pointer to the list.
- * @return      pointer to an allocated char array (a string).
+ * @param  list Pointer to the option list.
+ * @return      Pointer to an allocated char array (a string).
  */
 static char *hip_cmd_options_create_string(const struct hip_cmd_option_list 
*list)
 {
@@ -302,6 +302,10 @@
  * @param argc Argument count.
  * @param argv Array of argument strings.
  * @param list List of options to check against.
+ * @return     1 if the missing_option   handler is not existent but needed,
+ *             2 if the missing_argument handler is not existent but needed,
+ *             Passes the error code of the option handler if it faces some 
error,
+ *             0 on success.
  */
 int hip_cmd_options_parse(const int argc,
                           char **argv,
@@ -350,9 +354,9 @@
 /**
  * Load module command line option definitions.
  *
- * @param option_list target option list to be used in adding process
- * @param modules     an array containing module information
- * @param size        number of the module entries in the array
+ * @param option_list Target option list to be used in adding process.
+ * @param modules     An array containing the module information.
+ * @param size        Number of the module entries in the array.
  * @return            1 if one of the paramteres where not set,
  *                    0 on success.
  */

Other related posts: