Main Page   Modules   Data Structures   File List   Data Fields   Globals  

Miscellaneous routines to handle arguments


#define set_arglabel(arglabel)   strcpy(pt_ArgLabels[j],arglabel);
#define set_argval(argvalue)


int set_arglist (char *arg_label)
int set_purpose (char *text)
int parse_arg (char **argv, int argno, char ***pt_arglabel, char ***pt_argval)
void get_argval (int i, char *format, void *value)


char Calling_Prog []

Define Documentation

#define set_arglabel arglabel   )     strcpy(pt_ArgLabels[j],arglabel);

Definition at line 150 of file parse_arg.c.

Referenced by parse_arg().

#define set_argval argvalue   ) 


argvalue[0] = '\0'; \
        if (i+1 != argno) { \
        if (argv[i+1][0] != '-') {\
                        strcpy(argvalue,argv[i+1]); \
                        i++; \
                } \
                else { \
                        if (is_num(argv[i+1][1])) {\
                                strcpy(argvalue,argv[i+1]); \
                                i++; \
                        } \
                } \

Definition at line 153 of file parse_arg.c.

Referenced by parse_arg().

Function Documentation

int set_arglist char *  arg_label  ) 

specify list of options allowed and their default values

arg_label [char *] description string for options provided as : "-option1 def_value1 -option2 def_value2 ..." No default value means boolean option type. Use "none" if no default value is given. Default values may contain comma or blanks.

Definition at line 69 of file parse_arg.c.

References Arg_List, DefVal_List, DEFVALUE_MAXSIZE, Handle_Error(), is_num, and List_Length.

int set_purpose char *  text  ) 

describes the general purpose of the program

text [char *] description string

Definition at line 143 of file parse_arg.c.

References General_Purpose.

int parse_arg char **  argv,
int  argno,
char ***  pt_arglabel,
char ***  pt_argval

parse arguments, return values and decode the standard ones the routine allocates the array of returned values by it's own

argv [char **] parameter list passed to main program
argno [int ] number of parameters
pt_arglabel [char ***] labels of options ordered by appearence in the definition string (cf. set_arglist()).
pt_argval [char ***] decoded values ordered by their appearance in the definition string (cf. set_arglist()).

Definition at line 185 of file parse_arg.c.

References alloc2d(), Arg_List, ASK, Calling_Prog, CHAR, DEBUG, DefVal_List, DEFVALUE_MAXSIZE, ERR_NB_PARAM, General_Purpose, Handle_Error(), LIBRARY_VERSION, List_Length, print_msg(), pt_ArgLabels, pt_ArgValues, Quiet_Mode, set_arglabel, set_argval, set_inputformat(), set_outputformat(), soft_version, StandardArg_List, StandardList_Length, TK, and VERBOSE.

Referenced by init_session().

void get_argval int  i,
char *  format,
void *  value

decode the value of the ith argument using given scan format and returns if the scan was OK. Otherwise, display error message and exit

i [int ] argument indix (from 0 to n)
format [char *] decoding format (like in scanf)
value [void *] decoded value

Definition at line 367 of file parse_arg.c.

References ERR_BAD_PARAM, exit_session(), print_error(), pt_ArgLabels, and pt_ArgValues.

Variable Documentation

char Calling_Prog[]

Definition at line 168 of file parse_arg.c.

Referenced by exit_session(), init_session(), and parse_arg().

Generated on Tue Jul 1 17:35:48 2003 for IFU_C_iolibs by doxygen1.3