summaryrefslogtreecommitdiffstats
path: root/bsd/freebsd/contrib/ntp/sntp/libopts/proto.h
blob: a78b794fc6a5389fa1091382eda84540add754b1 (plain) (blame)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
/* -*- buffer-read-only: t -*- vi: set ro:
 *
 * Prototypes for autoopts
 * Generated Sat Apr 25 09:53:18 PDT 2015
 */
#ifndef AUTOOPTS_PROTO_H_GUARD
#define AUTOOPTS_PROTO_H_GUARD 1

/*
 *  Extracted from alias.c
 */
static tSuccess
too_many_occurrences(tOptions * opts, tOptDesc * od);

/*
 *  Extracted from autoopts.c
 */
static void *
ao_malloc(size_t sz);

static void *
ao_realloc(void *p, size_t sz);

static char *
ao_strdup(char const *str);

static tSuccess
handle_opt(tOptions * opts, tOptState * o_st);

static tSuccess
next_opt(tOptions * opts, tOptState * o_st);

static tSuccess
regular_opts(tOptions * opts);

/*
 *  Extracted from check.c
 */
static bool
is_consistent(tOptions * pOpts);

/*
 *  Extracted from configfile.c
 */
static void
intern_file_load(tOptions * opts);

static char const *
parse_attrs(tOptions * opts, char const * txt, tOptionLoadMode * pMode,
            tOptionValue * pType);

/*
 *  Extracted from env.c
 */
static void
doPrognameEnv(tOptions * pOpts, teEnvPresetType type);

static void
env_presets(tOptions * pOpts, teEnvPresetType type);

/*
 *  Extracted from find.c
 */
static tSuccess
opt_find_long(tOptions * opts, char const * opt_name, tOptState * state);

static tSuccess
opt_find_short(tOptions * pOpts, uint_t optValue, tOptState * pOptState);

static tSuccess
get_opt_arg(tOptions * opts, tOptState * o_st);

static tSuccess
find_opt(tOptions * opts, tOptState * o_st);

/*
 *  Extracted from init.c
 */
static tSuccess
validate_struct(tOptions * opts, char const * pname);

static tSuccess
immediate_opts(tOptions * opts);

static bool
ao_initialize(tOptions * opts, int a_ct, char ** a_v);

/*
 *  Extracted from load.c
 */
static void
munge_str(char * txt, tOptionLoadMode mode);

static void
load_opt_line(tOptions * opts, tOptState * opt_state, char * line,
              tDirection direction, tOptionLoadMode load_mode );

/*
 *  Extracted from makeshell.c
 */
static noreturn void
option_exits(int exit_code);

static noreturn void
ao_bug(char const * msg);

static void
fserr_warn(char const * prog, char const * op, char const * fname);

static noreturn void
fserr_exit(char const * prog, char const * op, char const * fname);

/*
 *  Extracted from nested.c
 */
static void
unload_arg_list(tArgList * arg_list);

static tOptionValue *
optionLoadNested(char const * text, char const * name, size_t nm_len);

static int
get_special_char(char const ** ppz, int * ct);

static void
emit_special_char(FILE * fp, int ch);

/*
 *  Extracted from sort.c
 */
static void
optionSort(tOptions * opts);

/*
 *  Extracted from stack.c
 */
static void
addArgListEntry(void ** ppAL, void * entry);

/*
 *  Extracted from usage.c
 */
static void
set_usage_flags(tOptions * opts, char const * flg_txt);

#endif /* AUTOOPTS_PROTO_H_GUARD */