CoMD
A Mini-app for Co-Design of Classical Molecular Dynamics.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cmdLineParser.h File Reference

A parser for command line arguments. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int addArg (const char *longOption, const char shortOption, int has_arg, const char type, void *dataPtr, int dataSize, const char *help)
 Specifies a command line argument that should be accepted by the program. More...
 
void processArgs (int argc, char **argv)
 Call this to process your arguments. More...
 
void printArgs (void)
 Prints the arguments to the stdout stream. More...
 
void freeArgs (void)
 

Detailed Description

A parser for command line arguments.

Author
Sriram Swaminarayan
Date
July 24, 2007

Definition in file cmdLineParser.h.

Function Documentation

int addArg ( const char *  longOption,
const char  shortOption,
int  has_arg,
const char  type,
void *  dataPtr,
int  dataSize,
const char *  help 
)

Specifies a command line argument that should be accepted by the program.

Parameters
[in]longOptionThe long name of option i.e., –optionname
[in]shortOptionThe short name of option i.e., -o
[in]has_argWhether this option has an argument i.e., -o value. If has_arg is 0, then dataPtr must be an integer pointer.
[in]typeThe type of the argument. Valid values are:
  • i integer
  • f float
  • d double
  • s string
  • c character
[in]dataPtrA pointer to where the value will be stored.
[in]dataSizeThe length of dataPtr, only useful for character strings.
[in]helpA short help string, preferably a single line or less.

Definition at line 96 of file cmdLineParser.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void freeArgs ( void  )

Definition at line 114 of file cmdLineParser.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void printArgs ( void  )

Prints the arguments to the stdout stream.

Definition at line 123 of file cmdLineParser.c.

Here is the caller graph for this function:

void processArgs ( int  argc,
char **  argv 
)

Call this to process your arguments.

Definition at line 144 of file cmdLineParser.c.

Here is the call graph for this function:

Here is the caller graph for this function: