xref: /freebsd/contrib/ntp/sntp/libopts/proto.h (revision 4928135658a9d0eaee37003df6137ab363fcb0b4)
1 /* -*- buffer-read-only: t -*- vi: set ro:
2  *
3  * Prototypes for autoopts
4  * Generated Sat Apr 25 09:53:18 PDT 2015
5  */
6 #ifndef AUTOOPTS_PROTO_H_GUARD
7 #define AUTOOPTS_PROTO_H_GUARD 1
8 
9 /*
10  *  Extracted from alias.c
11  */
12 static tSuccess
13 too_many_occurrences(tOptions * opts, tOptDesc * od);
14 
15 /*
16  *  Extracted from autoopts.c
17  */
18 static void *
19 ao_malloc(size_t sz);
20 
21 static void *
22 ao_realloc(void *p, size_t sz);
23 
24 static char *
25 ao_strdup(char const *str);
26 
27 static tSuccess
28 handle_opt(tOptions * opts, tOptState * o_st);
29 
30 static tSuccess
31 next_opt(tOptions * opts, tOptState * o_st);
32 
33 static tSuccess
34 regular_opts(tOptions * opts);
35 
36 /*
37  *  Extracted from check.c
38  */
39 static bool
40 is_consistent(tOptions * pOpts);
41 
42 /*
43  *  Extracted from configfile.c
44  */
45 static void
46 intern_file_load(tOptions * opts);
47 
48 static char const *
49 parse_attrs(tOptions * opts, char const * txt, tOptionLoadMode * pMode,
50             tOptionValue * pType);
51 
52 /*
53  *  Extracted from env.c
54  */
55 static void
56 doPrognameEnv(tOptions * pOpts, teEnvPresetType type);
57 
58 static void
59 env_presets(tOptions * pOpts, teEnvPresetType type);
60 
61 /*
62  *  Extracted from find.c
63  */
64 static tSuccess
65 opt_find_long(tOptions * opts, char const * opt_name, tOptState * state);
66 
67 static tSuccess
68 opt_find_short(tOptions * pOpts, uint_t optValue, tOptState * pOptState);
69 
70 static tSuccess
71 get_opt_arg(tOptions * opts, tOptState * o_st);
72 
73 static tSuccess
74 find_opt(tOptions * opts, tOptState * o_st);
75 
76 /*
77  *  Extracted from init.c
78  */
79 static tSuccess
80 validate_struct(tOptions * opts, char const * pname);
81 
82 static tSuccess
83 immediate_opts(tOptions * opts);
84 
85 static bool
86 ao_initialize(tOptions * opts, int a_ct, char ** a_v);
87 
88 /*
89  *  Extracted from load.c
90  */
91 static void
92 munge_str(char * txt, tOptionLoadMode mode);
93 
94 static void
95 load_opt_line(tOptions * opts, tOptState * opt_state, char * line,
96               tDirection direction, tOptionLoadMode load_mode );
97 
98 /*
99  *  Extracted from makeshell.c
100  */
101 static noreturn void
102 option_exits(int exit_code);
103 
104 static noreturn void
105 ao_bug(char const * msg);
106 
107 static void
108 fserr_warn(char const * prog, char const * op, char const * fname);
109 
110 static noreturn void
111 fserr_exit(char const * prog, char const * op, char const * fname);
112 
113 /*
114  *  Extracted from nested.c
115  */
116 static void
117 unload_arg_list(tArgList * arg_list);
118 
119 static tOptionValue *
120 optionLoadNested(char const * text, char const * name, size_t nm_len);
121 
122 static int
123 get_special_char(char const ** ppz, int * ct);
124 
125 static void
126 emit_special_char(FILE * fp, int ch);
127 
128 /*
129  *  Extracted from sort.c
130  */
131 static void
132 optionSort(tOptions * opts);
133 
134 /*
135  *  Extracted from stack.c
136  */
137 static void
138 addArgListEntry(void ** ppAL, void * entry);
139 
140 /*
141  *  Extracted from usage.c
142  */
143 static void
144 set_usage_flags(tOptions * opts, char const * flg_txt);
145 
146 #endif /* AUTOOPTS_PROTO_H_GUARD */
147