1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
|
#ifndef DYNAMITEcommandlineHEADERFILE
#define DYNAMITEcommandlineHEADERFILE
#ifdef _cplusplus
extern "C" {
#endif
#include "wisebase.h"
/***************************************************/
/* Callable functions */
/* These are the functions you are expected to use */
/***************************************************/
/* Function: strip_out_remaining_options_with_warning(argc,argv)
*
* Descrip: This removes all remaining options, issuing warnings
* through warn
*
*
* Arg: argc [UNKN ] Undocumented argument [int *]
* Arg: argv [UNKN ] Undocumented argument [char **]
*
* Return [UNKN ] Undocumented return value [boolean]
*
*/
boolean Wise2_strip_out_remaining_options_with_warning(int * argc,char ** argv);
#define strip_out_remaining_options_with_warning Wise2_strip_out_remaining_options_with_warning
/* Function: strip_out_boolean_argument(argc,argv,tag)
*
* Descrip: This removes argument in tag from the commandline if there and
* returns TRUE
*
* otherwise returns FALSE
*
*
* Arg: argc [UNKN ] argc from main declaration (call as &argc) [int *]
* Arg: argv [UNKN ] argv from main declaration [char **]
* Arg: tag [READ ] -[string] argument to find [char *]
*
* Return [UNKN ] Undocumented return value [boolean]
*
*/
boolean Wise2_strip_out_boolean_argument(int * argc,char ** argv,char * tag);
#define strip_out_boolean_argument Wise2_strip_out_boolean_argument
/* Function: strip_out_boolean_def_argument(argc,argv,tag,value)
*
* Descrip: This sets a boolean argument as
* -tag == TRUE
* -notag == FALSE
*
* This is probably better than strip_out_boolean_argument
* as
* defaults can be provided
* user can switch either on or off
*
*
* Arg: argc [UNKN ] argc from main declaration (call as &argc) [int *]
* Arg: argv [UNKN ] argv from main declaration [char **]
* Arg: tag [READ ] -[string] argument to find [char *]
* Arg: value [WRITE] boolean pointer to write value to [boolean *]
*
* Return [UNKN ] Undocumented return value [boolean]
*
*/
boolean Wise2_strip_out_boolean_def_argument(int * argc,char ** argv,char * tag,boolean * value);
#define strip_out_boolean_def_argument Wise2_strip_out_boolean_def_argument
/* Function: strip_out_assigned_argument(argc,argv,tag)
*
* Descrip: This removes argument in tag from the commandline if there and
* returns the argument to it (in -tag arg - ie with a space).
*
* otherwise returns NULL
*
*
* Arg: argc [UNKN ] argc from main declaration (call as &argc) [int *]
* Arg: argv [UNKN ] argv from main declaration [char **]
* Arg: tag [READ ] -[string] argument to find [char *]
*
* Return [UNKN ] Undocumented return value [char *]
*
*/
char * Wise2_strip_out_assigned_argument(int * argc,char ** argv,char * tag);
#define strip_out_assigned_argument Wise2_strip_out_assigned_argument
/* Function: strip_out_integer_argument(argc,argv,tag,value)
*
* Descrip: This removes argument in tag from the commandline if there, and
* looks at the argument as whether it is an int or not.
*
* No tag - returns FALSE and leaves value alone
* Tag but no integer value - issues warning, returns FALSE
* tag but integer value - sets value, returns true
*
*
* Arg: argc [UNKN ] argc from main declaration (call as &argc) [int *]
* Arg: argv [UNKN ] argv from main declaration [char **]
* Arg: tag [READ ] -[string] argument to find [char *]
* Arg: value [WRITE] int pointer to write value to [int *]
*
* Return [UNKN ] Undocumented return value [boolean]
*
*/
boolean Wise2_strip_out_integer_argument(int * argc,char ** argv,char * tag,int * value);
#define strip_out_integer_argument Wise2_strip_out_integer_argument
/* Function: strip_out_float_argument(argc,argv,tag,value)
*
* Descrip: This removes argument in tag from the commandline if there, and
* looks at the argument as whether it is a double or not.
*
* No tag - returns FALSE and leaves value alone
* Tag but no integer value - issues warning, returns FALSE
* tag but integer value - sets value, returns true
*
*
* Arg: argc [UNKN ] argc from main declaration (call as &argc) [int *]
* Arg: argv [UNKN ] argv from main declaration [char **]
* Arg: tag [READ ] -[string] argument to find [char *]
* Arg: value [WRITE] double pointer to write value to [double *]
*
* Return [UNKN ] Undocumented return value [boolean]
*
*/
boolean Wise2_strip_out_float_argument(int * argc,char ** argv,char * tag,double * value);
#define strip_out_float_argument Wise2_strip_out_float_argument
/* Function: show_standard_options(ofp)
*
* Descrip: Shows standard options
*
*
* Arg: ofp [UNKN ] Undocumented argument [FILE *]
*
*/
void Wise2_show_standard_options(FILE * ofp);
#define show_standard_options Wise2_show_standard_options
/* Function: strip_out_standard_options(argc,show_version,show_help,argv)
*
* Descrip: Handles default arguments correctly, setting help,version,errors
* handling
*
*
* Arg: argc [UNKN ] Undocumented argument [int *]
* Arg: show_version [UNKN ] Undocumented argument [NullString]
* Arg: show_help [UNKN ] Undocumented argument [NullString]
* Arg: argv [UNKN ] Undocumented argument [char **]
*
*/
void Wise2_strip_out_standard_options(int * argc,char ** argv,void (*show_help)(FILE * ofp),void (*show_version)(FILE * ofp));
#define strip_out_standard_options Wise2_strip_out_standard_options
/* Unplaced functions */
/* There has been no indication of the use of these functions */
/***************************************************/
/* Internal functions */
/* you are not expected to have to call these */
/***************************************************/
#ifdef _cplusplus
}
#endif
#endif
|