CoMD
A Mini-app for Co-Design of Classical Molecular Dynamics.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
cmdLineParser.h
Go to the documentation of this file.
1 /// \file
2 /// A parser for command line arguments.
3 ///
4 /// \author Sriram Swaminarayan
5 /// \date July 24, 2007
6 
7 #ifndef CMDLINEPARSER_H_
8 #define CMDLINEPARSER_H_
9 
10 /// Specifies a command line argument that should be accepted by the program.
11 /// \param [in] longOption The long name of option i.e., --optionname
12 /// \param [in] shortOption The short name of option i.e., -o
13 /// \param [in] has_arg Whether this option has an argument i.e., -o value.
14 /// If has_arg is 0, then dataPtr must be an integer
15 /// pointer.
16 /// \param [in] type The type of the argument. Valid values are:
17 /// - i integer
18 /// - f float
19 /// - d double
20 /// - s string
21 /// - c character
22 ///
23 /// \param [in] dataPtr A pointer to where the value will be stored.
24 /// \param [in] dataSize The length of dataPtr, only useful for character
25 /// strings.
26 /// \param [in] help A short help string, preferably a single line or
27 /// less.
28 int addArg(const char *longOption, const char shortOption,
29  int has_arg, const char type, void *dataPtr, int dataSize,
30  const char *help);
31 
32 /// Call this to process your arguments.
33 void processArgs(int argc, char **argv);
34 
35 /// Prints the arguments to the stdout stream.
36 void printArgs(void);
37 
38 void freeArgs(void);
39 
40 #endif