Logo Tesseroids 1.0: User Manual and API Documentation

src/c/cmd.h File Reference

Command line parsing tools. More...

Go to the source code of this file.

Data Structures

struct  BASIC_ARGS
 Store basic input arguments and option flags. More...
struct  TESSMASS_ARGS
 Store input arguments and option flags for tessmass program. More...
struct  TESSMODGEN_ARGS
 Store input arguments and option flags for tessmodgen program. More...
struct  TESSG_ARGS
 Store input arguments and option flags for tessg* programs. More...
struct  TESSGRD_ARGS
 Store input arguments and option flags for tessgrd program. More...

Functions

int parse_basic_args (int argc, char **argv, const char *progname, BASIC_ARGS *args, void(*print_help)(void))
 Parse basic command line arguments for programs.
int parse_tessmass_args (int argc, char **argv, const char *progname, TESSMASS_ARGS *args, void(*print_help)(void))
 Parse command line arguments for tessmass program.
int parse_tessmodgen_args (int argc, char **argv, const char *progname, TESSMODGEN_ARGS *args, void(*print_help)(void))
 Parse command line arguments for tessmodgen program.
int parse_tessg_args (int argc, char **argv, const char *progname, TESSG_ARGS *args)
 Parse command line arguments for tessg* programs.
int parse_tessgrd_args (int argc, char **argv, TESSGRD_ARGS *args)
 Parse command line arguments for tessgrd program.
void print_tessg_help (const char *progname)
 Print the help message for tessg* programs.
void print_tessgrd_help ()
 Print the help message for tessmkgrd program.

Detailed Description

Command line parsing tools.

Author:
Leonardo Uieda
Date:
02 Feb 2011

Function Documentation

int parse_basic_args ( int  argc,
char **  argv,
const char *  progname,
BASIC_ARGS args,
void(*)(void)  print_help 
)

Parse basic command line arguments for programs.

Basic arguments are: -h (for help msg), -v (for verbose), -l (for log file), --version and an input file.

Parameters:
argc number of command line arguments
argv command line arguments
progname name of the specific program
args to return the parsed arguments
print_help pointer to a function that prints the help message for the program
Returns:
Return code:
  • 0: if all went well
  • 1: if there were bad arguments and program should exit
  • 2: if printed help or version info and program should exit
  • 3: if input file was missing (doesn't log an error)
int parse_tessg_args ( int  argc,
char **  argv,
const char *  progname,
TESSG_ARGS args 
)

Parse command line arguments for tessg* programs.

logs the bad argument warnings using logger.h

Parameters:
argc number of command line arguments
argv command line arguments
progname name of the specific program
args to return the parsed arguments
Returns:
Return code:
  • 0: if all went well
  • 1: if there were bad arguments and program should exit
  • 2: if printed help or version info and program should exit
int parse_tessgrd_args ( int  argc,
char **  argv,
TESSGRD_ARGS args 
)

Parse command line arguments for tessgrd program.

logs the bad argument warnings using logger.h

Parameters:
argc number of command line arguments
argv command line arguments
args to return the parsed arguments
Returns:
Return code:
  • 0: if all went well
  • 1: if there were bad arguments and program should exit
  • 2: if printed help or version info and program should exit
int parse_tessmass_args ( int  argc,
char **  argv,
const char *  progname,
TESSMASS_ARGS args,
void(*)(void)  print_help 
)

Parse command line arguments for tessmass program.

Parameters:
argc number of command line arguments
argv command line arguments
progname name of the program
args to return the parsed arguments
print_help pointer to a function that prints the help message for the program
Returns:
Return code:
  • 0: if all went well
  • 1: if there were bad arguments and program should exit
  • 2: if printed help or version info and program should exit
  • 3: if input file was missing (doesn't log an error)
int parse_tessmodgen_args ( int  argc,
char **  argv,
const char *  progname,
TESSMODGEN_ARGS args,
void(*)(void)  print_help 
)

Parse command line arguments for tessmodgen program.

Parameters:
argc number of command line arguments
argv command line arguments
progname name of the program
args to return the parsed arguments
print_help pointer to a function that prints the help message for the program
Returns:
Return code:
  • 0: if all went well
  • 1: if there were bad arguments and program should exit
  • 2: if printed help or version info and program should exit
void print_tessg_help ( const char *  progname  ) 

Print the help message for tessg* programs.

Parameters:
progname name of the specific tessg* program
void print_tessgrd_help (  ) 

Print the help message for tessmkgrd program.

Prints to stdout.

Generated on Tue Apr 26 12:17:07 2011 for Tesseroids 1.0: User manual and API documentation by doxygen 1.6.3