-
Notifications
You must be signed in to change notification settings - Fork 0
/
myopts2struct.h.example
33 lines (29 loc) · 1.02 KB
/
myopts2struct.h.example
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* this file should only be included by opts2struct.h
* after the definition of OPTS2STRUCT but before the
* function prototypes beginning with opts2struct_
*/
/**
* OPTS2STRUCT(<comma-separated keys>) : set your options here. The
* OPTS2STRUCT macro in opts2struct.h will
* auto-generate a structure definition from it.
* argv format: "[--]key=value"
*
*/
OPTS2STRUCT(stars, bunnies, dogs)
/**
* OPTS2DEFAULTS(<comma-separated values>) : set default values here
*/
OPTS2DEFAULTS(3.5, 3, "brown")
/**
* OPTS2SHORTNAMES(<comma-separated short keys>) : set short names for
* your options here.
* argv format: "-key value"
*/
OPTS2SHORTNAMES(-s, -b, -d)
/**
* OPTS2EMPTY: the value used to initialize options before parsing argv[]
*
* limitation: must be a valid "int". Also, be sure it is a value
* that is outside the range of valid values for all options!
*/
#define OPTS2EMPTY -999