forked from wilhelmtell/inspext
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoptions.h
57 lines (50 loc) · 1.64 KB
/
options.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
/******************************************************************************
* Copyright (C) 2010 Matan Nassau
*
* This file is part of INSPext.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along with
* this program. If not, see <http://www.gnu.org/licenses/>.
*****************************************************************************/
#ifndef OPTIONS_H_
#define OPTIONS_H_
#include <stdio.h>
#include "parse.h"
typedef struct input_file {
FILE* stream;
char* filename;
struct input_file* next;
} input_file;
typedef struct conf {
void (*gen)(FILE*,node*);
struct input_file* input_files;
FILE* output_file;
enum verbose_type {
VERBOSE_DEFAULT = 1,
VERBOSE_FATAL = 0,
VERBOSE_ERROR = 1,
VERBOSE_WARNING,
VERBOSE_INFO,
VERBOSE_DEBUG
} verbose;
} conf;
typedef enum {
OPTS_ERR_UNRECOGNIZED_TARGET = 1,
OPTS_ERR_OPEN_WRITE,
OPTS_ERR_UNKNOWN_OPTION,
OPTS_ERR_OPEN_READ
} options_error;
char* options_error_s(options_error err);
void print_usage(void);
options_error parse_cl_opts(int argc, char* argv[], conf* opts);
#endif /* OPTIONS_H_ */