-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsysutils.h
66 lines (47 loc) · 1.59 KB
/
sysutils.h
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/* System Utilities */
/* M. Nielsen [email protected] */
/* Modifiede version of parser made by Garry Gippert */
extern void sysinfo(int argc, char *argv[]);
#define PTYPE_SWITCH 1
#define PTYPE_INT 2
#define PTYPE_FLOAT 3
#define PTYPE_LONG 4
#define PTYPE_DOUBLE 5
#define PTYPE_CHAR 8
#define PTYPE_STRING 10
#define PTYPE_FILENAME 11
#define PTYPE_LINE 12
typedef struct parameters {
char *p_name; /* parameter command line id (short form) */
int p_selc; /* parameter selected */
int p_type; /* parameter type */
char *p_addr; /* parameter name variable address */
char *p_desc; /* parameter description */
char *p_init; /* parameter default value */
} PARAM;
#define VPP (char *)&
#define VSWITCH 0,PTYPE_SWITCH,VPP
#define VINT 0,PTYPE_INT,VPP
#define VFLOAT 0,PTYPE_FLOAT,VPP
#define VLONG 0,PTYPE_LONG,VPP
#define VDOUBLE 0,PTYPE_DOUBLE,VPP
#define VCHAR 0,PTYPE_CHAR,VPP
#define VSTRING 0,PTYPE_STRING,
#define VFILENAME 0,PTYPE_FILENAME,
#define VLINE 0,PTYPE_LINE,
#define VWORD VSTRING
#define VFNAME VFILENAME
#define TOGGLE(A) (A)=((A)+1)%2
extern int param_env(PARAM param[]);
extern void pprint(PARAM param[]);
extern void usage(PARAM param[]);
extern void pparse(int *argc, char **argv[], PARAM param[],
int n, char *descr);
extern void spparse(int *argc, char **argv[], PARAM param[],
int n, char *descr);
extern char *tdate(char *date);
extern int filereadable(char *filename);
extern void setseed(long rs);
extern char *envfile(char *efilename, char *filename);
extern char *xenvfile(char *str, char *tmp);
extern char *envir(char *var, char *buf);