forked from cloudflare/keyless
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkssl_getopt.h
42 lines (30 loc) · 924 Bytes
/
kssl_getopt.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
// kssl_getopt.h: header for kssl_getopt.c
//
// Copyright (c) 2014 CloudFlare, Inc.
#ifndef INCLUDED_KSSL_CLI
#define INCLUDED_KSSL_CLI 1
#include "kssl.h"
#if __GNUC__
#include <getopt.h>
#else // __GNUC__
// On other platforms use the code in kssl_getopt.c
#define GNU_COMPATIBLE /* Be more compatible, configure's use us! */
struct option
{
const char *name;
int has_arg;
int *flag;
int val;
};
#define no_argument 0
#define required_argument 1
#define optional_argument 2
extern int opterr; /* if error message should be printed */
extern int optind; /* index into parent argv vector */
extern int optopt; /* character checked for validity */
extern int optreset; /* reset getopt */
extern char *optarg; /* argument associated with option */
int getopt(int, char**, char*);
int getopt_long(int, char**, char*, struct option*, int*);
#endif // __GNUC__
#endif // INCLUDED_KSSL_CLI