1
/* @(#)pgm.h 19.1 (ESO-IPG) 02/25/03 13:49:38 */
2
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6
.AUTHOR Francois Ochsenbein [ESO]
7
.CATEGORY Macros for Main routines (main parameters)
10
.COMMENTS There are several ways to get the parameters of a main
12
1) char *NextParm() move in the vector of parameters
13
2) char *GetParmString() find a named parameter,
14
e.g. GetParmString("x=")
16
.VERSION 1.0 20-Feb-1986 Creation by extraction from STESODEF
17
.VERSION 1.1 06-Nov-1986 Inclusion of parameter functions (mp_...)
18
.VERSION 2.0 01-Jun-1988 Added GetsOption(letter) (eg -Ofile)
19
.VERSION 2.1 22-Jun-1989 Added SetParm
20
.VERSION 2.2 08-Dec-1989 Added GetParmString, GetParmInt, etc...
22
------------------------------------------------------------*/
31
#define PGM(name) int main(argc,argv,envp) /* name Main Program */ \
32
int argc; char **argv,**envp; /* Main routine */
35
/*===========================================================================
37
*===========================================================================*/
38
int mp_save (int argc, char **argv, char **envp);
40
char *mp_get (int arg_number);
42
char *mp_anext (void);
43
char *mp_flagged (char flag_char); /* Example: '<' */
44
int mp_option (char option_char); /* Example: -t80 */
45
char *mp_poption (char option_flag); /* Example: -iInput */
46
char *mp_gs (char *start_string); /* Example: name=value */
47
long mp_gl (char *start_string); /* Example: name=number */
48
/* double mp_gf (char *start_string); /* Example: name=number */
51
char *mp_get(), *mp_next(), *mp_anext(), *mp_poption(), *mp_gs(),
57
#define SaveParm(n,p1,p2) mp_save(n,p1,p2) /* Save main params */
58
#define SaveParms() SaveParm(argc,argv,envp)/* Save main params */
59
#define ResetParms() mp_reset()
60
#define GetParm(n) mp_get(n)
61
#define GetProgramFile() mp_get(0)
62
#define NextParm() mp_anext()
63
#define GetNextParm() mp_next()
64
#define GetFlaggedParm(x) mp_flagged(x)
65
#define GetInputFile() mp_flagged('<')
66
#define GetOutputFile() mp_flagged('>')
67
#define GetTerminalName() mp_flagged('^')
68
#define GetOption(x) mp_option(x)
69
#define GetsOption(x) mp_poption(x)
71
#define GetParmString(s) mp_gs(s)
72
#define GetParmInteger(s) mp_gl(s)
73
#define GetParmFloat(s) mp_gf(s)