cryptutils

Cryptographic Software Utilities
git clone http://git.omkov.net/cryptutils
Log | Tree | Refs | README | LICENCE | Download

cryptutils/src/util/optget.h (37 lines, 582 B) -rw-r--r-- file download

03b01d2 Jamozed 2022-03-06 17:10:01
0
// util/optget.h, version 1.6.2
c01a723 Jamozed 2022-02-05 19:04:03
1
// optget header file from libutil
40437ba Jamozed 2020-08-28 23:41:53
2
// Copyright (C) 2020, Jakob Wakeling
03b01d2 Jamozed 2022-03-06 17:10:01
3
// MIT Licence
40437ba Jamozed 2020-08-28 23:41:53
4
c01a723 Jamozed 2022-02-05 19:04:03
5
#ifndef UTIL_OPTGET_H_W3LIZK1S
c01a723 Jamozed 2022-02-05 19:04:03
6
#define UTIL_OPTGET_H_W3LIZK1S
03b01d2 Jamozed 2022-03-06 17:10:01
7
03b01d2 Jamozed 2022-03-06 17:10:01
8
#ifdef __cplusplus
03b01d2 Jamozed 2022-03-06 17:10:01
9
extern "C" {
03b01d2 Jamozed 2022-03-06 17:10:01
10
#endif
40437ba Jamozed 2020-08-28 23:41:53
11
40437ba Jamozed 2020-08-28 23:41:53
12
#define ARG_NUL 0
40437ba Jamozed 2020-08-28 23:41:53
13
#define ARG_REQ 1
40437ba Jamozed 2020-08-28 23:41:53
14
#define ARG_OPT 2
40437ba Jamozed 2020-08-28 23:41:53
15
40437ba Jamozed 2020-08-28 23:41:53
16
struct lop {
40437ba Jamozed 2020-08-28 23:41:53
17
	char *str;
40437ba Jamozed 2020-08-28 23:41:53
18
	int arg, val;
40437ba Jamozed 2020-08-28 23:41:53
19
};
40437ba Jamozed 2020-08-28 23:41:53
20
40437ba Jamozed 2020-08-28 23:41:53
21
struct opt {
40437ba Jamozed 2020-08-28 23:41:53
22
	int ind, opt, pos, nop;
40437ba Jamozed 2020-08-28 23:41:53
23
	char *arg, *lop, *str;
40437ba Jamozed 2020-08-28 23:41:53
24
	struct lop *lops;
40437ba Jamozed 2020-08-28 23:41:53
25
};
40437ba Jamozed 2020-08-28 23:41:53
26
40437ba Jamozed 2020-08-28 23:41:53
27
extern const struct opt OPTGET_INIT;
40437ba Jamozed 2020-08-28 23:41:53
28
40437ba Jamozed 2020-08-28 23:41:53
29
extern int optget(struct opt *opt, char *av[], int flags);
03b01d2 Jamozed 2022-03-06 17:10:01
30
03b01d2 Jamozed 2022-03-06 17:10:01
31
#ifdef __cplusplus
03b01d2 Jamozed 2022-03-06 17:10:01
32
} // extern "C"
03b01d2 Jamozed 2022-03-06 17:10:01
33
#endif
40437ba Jamozed 2020-08-28 23:41:53
34
c01a723 Jamozed 2022-02-05 19:04:03
35
#endif // UTIL_OPTGET_H_W3LIZK1S
36