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