]>
Commit | Line | Data |
---|---|---|
726f6388 JA |
1 | /* externs.h -- extern function declarations which do not appear in their |
2 | own header file. */ | |
3 | ||
74091dd4 | 4 | /* Copyright (C) 1993-2021 Free Software Foundation, Inc. |
726f6388 JA |
5 | |
6 | This file is part of GNU Bash, the Bourne Again SHell. | |
7 | ||
3185942a JA |
8 | Bash is free software: you can redistribute it and/or modify |
9 | it under the terms of the GNU General Public License as published by | |
10 | the Free Software Foundation, either version 3 of the License, or | |
11 | (at your option) any later version. | |
726f6388 | 12 | |
3185942a JA |
13 | Bash is distributed in the hope that it will be useful, |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
726f6388 | 17 | |
3185942a JA |
18 | You should have received a copy of the GNU General Public License |
19 | along with Bash. If not, see <http://www.gnu.org/licenses/>. | |
20 | */ | |
726f6388 JA |
21 | |
22 | /* Make sure that this is included *after* config.h! */ | |
23 | ||
ccc6cda3 JA |
24 | #if !defined (_EXTERNS_H_) |
25 | # define _EXTERNS_H_ | |
726f6388 JA |
26 | |
27 | #include "stdc.h" | |
28 | ||
29 | /* Functions from expr.c. */ | |
d233b485 CR |
30 | #define EXP_EXPANDED 0x01 |
31 | ||
8868edaf | 32 | extern intmax_t evalexp PARAMS((char *, int, int *)); |
726f6388 JA |
33 | |
34 | /* Functions from print_cmd.c. */ | |
3185942a JA |
35 | #define FUNC_MULTILINE 0x01 |
36 | #define FUNC_EXTERNAL 0x02 | |
37 | ||
8868edaf | 38 | extern char *make_command_string PARAMS((COMMAND *)); |
74091dd4 | 39 | extern char *print_comsub PARAMS((COMMAND *)); |
8868edaf | 40 | extern char *named_function_string PARAMS((char *, COMMAND *, int)); |
b80f6443 | 41 | |
8868edaf CR |
42 | extern void print_command PARAMS((COMMAND *)); |
43 | extern void print_simple_command PARAMS((SIMPLE_COM *)); | |
44 | extern void print_word_list PARAMS((WORD_LIST *, char *)); | |
b80f6443 JA |
45 | |
46 | /* debugger support */ | |
8868edaf | 47 | extern void print_for_command_head PARAMS((FOR_COM *)); |
b80f6443 | 48 | #if defined (SELECT_COMMAND) |
8868edaf | 49 | extern void print_select_command_head PARAMS((SELECT_COM *)); |
b80f6443 | 50 | #endif |
8868edaf | 51 | extern void print_case_command_head PARAMS((CASE_COM *)); |
b80f6443 | 52 | #if defined (DPAREN_ARITHMETIC) |
8868edaf | 53 | extern void print_arith_command PARAMS((WORD_LIST *)); |
b80f6443 JA |
54 | #endif |
55 | #if defined (COND_COMMAND) | |
8868edaf | 56 | extern void print_cond_command PARAMS((COND_COM *)); |
b80f6443 JA |
57 | #endif |
58 | ||
59 | /* set -x support */ | |
8868edaf | 60 | extern void xtrace_init PARAMS((void)); |
0001803f | 61 | #ifdef NEED_XTRACE_SET_DECL |
8868edaf CR |
62 | extern void xtrace_set PARAMS((int, FILE *)); |
63 | #endif | |
64 | extern void xtrace_fdchk PARAMS((int)); | |
65 | extern void xtrace_reset PARAMS((void)); | |
66 | extern char *indirection_level_string PARAMS((void)); | |
67 | extern void xtrace_print_assignment PARAMS((char *, char *, int, int)); | |
68 | extern void xtrace_print_word_list PARAMS((WORD_LIST *, int)); | |
69 | extern void xtrace_print_for_command_head PARAMS((FOR_COM *)); | |
b80f6443 | 70 | #if defined (SELECT_COMMAND) |
8868edaf | 71 | extern void xtrace_print_select_command_head PARAMS((SELECT_COM *)); |
b80f6443 | 72 | #endif |
8868edaf | 73 | extern void xtrace_print_case_command_head PARAMS((CASE_COM *)); |
cce855bc | 74 | #if defined (DPAREN_ARITHMETIC) |
8868edaf | 75 | extern void xtrace_print_arith_cmd PARAMS((WORD_LIST *)); |
cce855bc JA |
76 | #endif |
77 | #if defined (COND_COMMAND) | |
8868edaf | 78 | extern void xtrace_print_cond_term PARAMS((int, int, WORD_DESC *, char *, char *)); |
cce855bc | 79 | #endif |
726f6388 JA |
80 | |
81 | /* Functions from shell.c. */ | |
8868edaf CR |
82 | extern void exit_shell PARAMS((int)) __attribute__((__noreturn__)); |
83 | extern void sh_exit PARAMS((int)) __attribute__((__noreturn__)); | |
84 | extern void subshell_exit PARAMS((int)) __attribute__((__noreturn__)); | |
85 | extern void set_exit_status PARAMS((int)); | |
86 | extern void disable_priv_mode PARAMS((void)); | |
87 | extern void unbind_args PARAMS((void)); | |
ccc6cda3 JA |
88 | |
89 | #if defined (RESTRICTED_SHELL) | |
8868edaf CR |
90 | extern int shell_is_restricted PARAMS((char *)); |
91 | extern int maybe_make_restricted PARAMS((char *)); | |
ccc6cda3 JA |
92 | #endif |
93 | ||
8868edaf CR |
94 | extern void unset_bash_input PARAMS((int)); |
95 | extern void get_current_user_info PARAMS((void)); | |
d166f048 | 96 | |
ccc6cda3 | 97 | /* Functions from eval.c. */ |
8868edaf CR |
98 | extern int reader_loop PARAMS((void)); |
99 | extern int pretty_print_loop PARAMS((void)); | |
100 | extern int parse_command PARAMS((void)); | |
101 | extern int read_command PARAMS((void)); | |
726f6388 JA |
102 | |
103 | /* Functions from braces.c. */ | |
104 | #if defined (BRACE_EXPANSION) | |
8868edaf | 105 | extern char **brace_expand PARAMS((char *)); |
726f6388 JA |
106 | #endif |
107 | ||
ccc6cda3 | 108 | /* Miscellaneous functions from parse.y */ |
8868edaf CR |
109 | extern int yyparse PARAMS((void)); |
110 | extern int return_EOF PARAMS((void)); | |
111 | extern void push_token PARAMS((int)); | |
112 | extern char *xparse_dolparen PARAMS((char *, char *, int *, int)); | |
74091dd4 | 113 | extern COMMAND *parse_string_to_command PARAMS((char *, int)); |
8868edaf CR |
114 | extern void reset_parser PARAMS((void)); |
115 | extern void reset_readahead_token PARAMS((void)); | |
116 | extern WORD_LIST *parse_string_to_word_list PARAMS((char *, int, const char *)); | |
b80f6443 | 117 | |
8868edaf CR |
118 | extern int parser_will_prompt PARAMS((void)); |
119 | extern int parser_in_command_position PARAMS((void)); | |
ac50fbac | 120 | |
8868edaf | 121 | extern void free_pushed_string_input PARAMS((void)); |
bb70624e | 122 | |
8868edaf CR |
123 | extern int parser_expanding_alias PARAMS((void)); |
124 | extern void parser_save_alias PARAMS((void)); | |
125 | extern void parser_restore_alias PARAMS((void)); | |
ac50fbac | 126 | |
8868edaf | 127 | extern void clear_shell_input_line PARAMS((void)); |
a0c0a00f | 128 | |
8868edaf | 129 | extern char *decode_prompt_string PARAMS((char *)); |
7117c2d2 | 130 | |
8868edaf CR |
131 | extern int get_current_prompt_level PARAMS((void)); |
132 | extern void set_current_prompt_level PARAMS((int)); | |
ccc6cda3 | 133 | |
f73dda09 | 134 | #if defined (HISTORY) |
8868edaf | 135 | extern char *history_delimiting_chars PARAMS((const char *)); |
f73dda09 | 136 | #endif |
ccc6cda3 JA |
137 | |
138 | /* Declarations for functions defined in locale.c */ | |
8868edaf CR |
139 | extern void set_default_locale PARAMS((void)); |
140 | extern void set_default_locale_vars PARAMS((void)); | |
141 | extern int set_locale_var PARAMS((char *, char *)); | |
142 | extern int set_lang PARAMS((char *, char *)); | |
143 | extern void set_default_lang PARAMS((void)); | |
144 | extern char *get_locale_var PARAMS((char *)); | |
145 | extern char *localetrans PARAMS((char *, int, int *)); | |
146 | extern char *mk_msgstr PARAMS((char *, int *)); | |
74091dd4 | 147 | extern char *locale_expand PARAMS((char *, int, int, int, int *)); |
d233b485 | 148 | #ifndef locale_decpoint |
8868edaf | 149 | extern int locale_decpoint PARAMS((void)); |
d233b485 | 150 | #endif |
ccc6cda3 JA |
151 | |
152 | /* Declarations for functions defined in list.c. */ | |
8868edaf CR |
153 | extern void list_walk PARAMS((GENERIC_LIST *, sh_glist_func_t *)); |
154 | extern void wlist_walk PARAMS((WORD_LIST *, sh_icpfunc_t *)); | |
7117c2d2 | 155 | extern GENERIC_LIST *list_reverse (); |
ccc6cda3 JA |
156 | extern int list_length (); |
157 | extern GENERIC_LIST *list_append (); | |
7117c2d2 | 158 | extern GENERIC_LIST *list_remove (); |
ccc6cda3 | 159 | |
cce855bc | 160 | /* Declarations for functions defined in stringlib.c */ |
8868edaf CR |
161 | extern int find_string_in_alist PARAMS((char *, STRING_INT_ALIST *, int)); |
162 | extern char *find_token_in_alist PARAMS((int, STRING_INT_ALIST *, int)); | |
163 | extern int find_index_in_alist PARAMS((char *, STRING_INT_ALIST *, int)); | |
bb70624e | 164 | |
8868edaf CR |
165 | extern char *substring PARAMS((const char *, int, int)); |
166 | extern char *strsub PARAMS((char *, char *, char *, int)); | |
167 | extern char *strcreplace PARAMS((char *, int, const char *, int)); | |
168 | extern void strip_leading PARAMS((char *)); | |
169 | extern void strip_trailing PARAMS((char *, int, int)); | |
170 | extern void xbcopy PARAMS((char *, char *, int)); | |
cce855bc | 171 | |
b80f6443 | 172 | /* Functions from version.c. */ |
8868edaf CR |
173 | extern char *shell_version_string PARAMS((void)); |
174 | extern void show_shell_version PARAMS((int)); | |
b80f6443 | 175 | |
cce855bc JA |
176 | /* Functions from the bash library, lib/sh/libsh.a. These should really |
177 | go into a separate include file. */ | |
28ef6c31 | 178 | |
3185942a | 179 | /* declarations for functions defined in lib/sh/casemod.c */ |
8868edaf | 180 | extern char *sh_modcase PARAMS((const char *, char *, int)); |
3185942a JA |
181 | |
182 | /* Defines for flags argument to sh_modcase. These need to agree with what's | |
183 | in lib/sh/casemode.c */ | |
17345e5a JA |
184 | #define CASE_LOWER 0x0001 |
185 | #define CASE_UPPER 0x0002 | |
186 | #define CASE_CAPITALIZE 0x0004 | |
187 | #define CASE_UNCAP 0x0008 | |
188 | #define CASE_TOGGLE 0x0010 | |
189 | #define CASE_TOGGLEALL 0x0020 | |
190 | #define CASE_UPFIRST 0x0040 | |
191 | #define CASE_LOWFIRST 0x0080 | |
192 | ||
193 | #define CASE_USEWORDS 0x1000 | |
3185942a | 194 | |
28ef6c31 | 195 | /* declarations for functions defined in lib/sh/clktck.c */ |
8868edaf | 196 | extern long get_clk_tck PARAMS((void)); |
28ef6c31 JA |
197 | |
198 | /* declarations for functions defined in lib/sh/clock.c */ | |
199 | extern void clock_t_to_secs (); | |
200 | extern void print_clock_t (); | |
201 | ||
495aee44 CR |
202 | /* Declarations for functions defined in lib/sh/dprintf.c */ |
203 | #if !defined (HAVE_DPRINTF) | |
8868edaf | 204 | extern void dprintf PARAMS((int, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); |
495aee44 | 205 | #endif |
3185942a | 206 | |
f73dda09 JA |
207 | /* Declarations for functions defined in lib/sh/fmtulong.c */ |
208 | #define FL_PREFIX 0x01 /* add 0x, 0X, or 0 prefix as appropriate */ | |
209 | #define FL_ADDBASE 0x02 /* add base# prefix to converted value */ | |
210 | #define FL_HEXUPPER 0x04 /* use uppercase when converting to hex */ | |
211 | #define FL_UNSIGNED 0x08 /* don't add any sign */ | |
212 | ||
8868edaf | 213 | extern char *fmtulong PARAMS((unsigned long int, int, char *, size_t, int)); |
f73dda09 JA |
214 | |
215 | /* Declarations for functions defined in lib/sh/fmtulong.c */ | |
74091dd4 | 216 | #if defined (HAVE_LONG_LONG_INT) |
8868edaf | 217 | extern char *fmtullong PARAMS((unsigned long long int, int, char *, size_t, int)); |
f73dda09 JA |
218 | #endif |
219 | ||
7117c2d2 | 220 | /* Declarations for functions defined in lib/sh/fmtumax.c */ |
8868edaf | 221 | extern char *fmtumax PARAMS((uintmax_t, int, char *, size_t, int)); |
7117c2d2 | 222 | |
0001803f | 223 | /* Declarations for functions defined in lib/sh/fnxform.c */ |
8868edaf CR |
224 | extern char *fnx_fromfs PARAMS((char *, size_t)); |
225 | extern char *fnx_tofs PARAMS((char *, size_t)); | |
0001803f | 226 | |
3185942a | 227 | /* Declarations for functions defined in lib/sh/fpurge.c */ |
89a92869 CR |
228 | |
229 | #if defined NEED_FPURGE_DECL | |
3185942a JA |
230 | #if !HAVE_DECL_FPURGE |
231 | ||
232 | #if HAVE_FPURGE | |
233 | # define fpurge _bash_fpurge | |
234 | #endif | |
8868edaf | 235 | extern int fpurge PARAMS((FILE *stream)); |
3185942a JA |
236 | |
237 | #endif /* HAVE_DECL_FPURGE */ | |
89a92869 | 238 | #endif /* NEED_FPURGE_DECL */ |
3185942a | 239 | |
cce855bc JA |
240 | /* Declarations for functions defined in lib/sh/getcwd.c */ |
241 | #if !defined (HAVE_GETCWD) | |
8868edaf | 242 | extern char *getcwd PARAMS((char *, size_t)); |
cce855bc JA |
243 | #endif |
244 | ||
3185942a | 245 | /* Declarations for functions defined in lib/sh/input_avail.c */ |
8868edaf | 246 | extern int input_avail PARAMS((int)); |
3185942a | 247 | |
cce855bc | 248 | /* Declarations for functions defined in lib/sh/itos.c */ |
8868edaf CR |
249 | extern char *inttostr PARAMS((intmax_t, char *, size_t)); |
250 | extern char *itos PARAMS((intmax_t)); | |
251 | extern char *mitos PARAMS((intmax_t)); | |
252 | extern char *uinttostr PARAMS((uintmax_t, char *, size_t)); | |
253 | extern char *uitos PARAMS((uintmax_t)); | |
cce855bc | 254 | |
28ef6c31 JA |
255 | /* declarations for functions defined in lib/sh/makepath.c */ |
256 | #define MP_DOTILDE 0x01 | |
257 | #define MP_DOCWD 0x02 | |
258 | #define MP_RMDOT 0x04 | |
3185942a | 259 | #define MP_IGNDOT 0x08 |
ccc6cda3 | 260 | |
8868edaf | 261 | extern char *sh_makepath PARAMS((const char *, const char *, int)); |
ccc6cda3 | 262 | |
0001803f CR |
263 | /* declarations for functions defined in lib/sh/mbscasecmp.c */ |
264 | #if !defined (HAVE_MBSCASECMP) | |
8868edaf | 265 | extern char *mbscasecmp PARAMS((const char *, const char *)); |
0001803f CR |
266 | #endif |
267 | ||
268 | /* declarations for functions defined in lib/sh/mbschr.c */ | |
269 | #if !defined (HAVE_MBSCHR) | |
8868edaf | 270 | extern char *mbschr PARAMS((const char *, int)); |
0001803f CR |
271 | #endif |
272 | ||
273 | /* declarations for functions defined in lib/sh/mbscmp.c */ | |
274 | #if !defined (HAVE_MBSCMP) | |
8868edaf | 275 | extern char *mbscmp PARAMS((const char *, const char *)); |
0001803f CR |
276 | #endif |
277 | ||
7117c2d2 | 278 | /* declarations for functions defined in lib/sh/netconn.c */ |
8868edaf | 279 | extern int isnetconn PARAMS((int)); |
7117c2d2 | 280 | |
28ef6c31 | 281 | /* declarations for functions defined in lib/sh/netopen.c */ |
8868edaf | 282 | extern int netopen PARAMS((char *)); |
28ef6c31 JA |
283 | |
284 | /* Declarations for functions defined in lib/sh/oslib.c */ | |
ccc6cda3 | 285 | |
7117c2d2 | 286 | #if !defined (HAVE_DUP2) || defined (DUP2_BROKEN) |
8868edaf | 287 | extern int dup2 PARAMS((int, int)); |
7117c2d2 | 288 | #endif |
726f6388 | 289 | |
28ef6c31 | 290 | #if !defined (HAVE_GETDTABLESIZE) |
8868edaf | 291 | extern int getdtablesize PARAMS((void)); |
28ef6c31 JA |
292 | #endif /* !HAVE_GETDTABLESIZE */ |
293 | ||
ccc6cda3 | 294 | #if !defined (HAVE_GETHOSTNAME) |
8868edaf | 295 | extern int gethostname PARAMS((char *, int)); |
ccc6cda3 JA |
296 | #endif /* !HAVE_GETHOSTNAME */ |
297 | ||
8868edaf CR |
298 | extern int getmaxgroups PARAMS((void)); |
299 | extern long getmaxchild PARAMS((void)); | |
7117c2d2 | 300 | |
28ef6c31 JA |
301 | /* declarations for functions defined in lib/sh/pathcanon.c */ |
302 | #define PATH_CHECKDOTDOT 0x0001 | |
303 | #define PATH_CHECKEXISTS 0x0002 | |
304 | #define PATH_HARDPATH 0x0004 | |
305 | #define PATH_NOALLOC 0x0008 | |
306 | ||
8868edaf | 307 | extern char *sh_canonpath PARAMS((char *, int)); |
28ef6c31 JA |
308 | |
309 | /* declarations for functions defined in lib/sh/pathphys.c */ | |
8868edaf CR |
310 | extern char *sh_physpath PARAMS((char *, int)); |
311 | extern char *sh_realpath PARAMS((const char *, char *)); | |
312 | ||
313 | /* declarations for functions defined in lib/sh/random.c */ | |
314 | extern int brand PARAMS((void)); | |
315 | extern void sbrand PARAMS((unsigned long)); /* set bash random number generator. */ | |
316 | extern void seedrand PARAMS((void)); /* seed generator randomly */ | |
317 | extern void seedrand32 PARAMS((void)); | |
318 | extern u_bits32_t get_urandom32 PARAMS((void)); | |
ccc6cda3 | 319 | |
28ef6c31 | 320 | /* declarations for functions defined in lib/sh/setlinebuf.c */ |
f73dda09 | 321 | #ifdef NEED_SH_SETLINEBUF_DECL |
8868edaf | 322 | extern int sh_setlinebuf PARAMS((FILE *)); |
ccc6cda3 | 323 | #endif |
726f6388 | 324 | |
0628567a | 325 | /* declarations for functions defined in lib/sh/shaccess.c */ |
8868edaf | 326 | extern int sh_eaccess PARAMS((const char *, int)); |
0628567a | 327 | |
b80f6443 | 328 | /* declarations for functions defined in lib/sh/shmatch.c */ |
8868edaf | 329 | extern int sh_regmatch PARAMS((const char *, const char *, int)); |
b80f6443 JA |
330 | |
331 | /* defines for flags argument to sh_regmatch. */ | |
332 | #define SHMAT_SUBEXP 0x001 /* save subexpressions in SH_REMATCH */ | |
333 | #define SHMAT_PWARN 0x002 /* print a warning message on invalid regexp */ | |
334 | ||
495aee44 | 335 | /* declarations for functions defined in lib/sh/shmbchar.c */ |
8868edaf CR |
336 | extern size_t mbstrlen PARAMS((const char *)); |
337 | extern char *mbsmbchar PARAMS((const char *)); | |
338 | extern int sh_mbsnlen PARAMS((const char *, size_t, int)); | |
495aee44 | 339 | |
28ef6c31 | 340 | /* declarations for functions defined in lib/sh/shquote.c */ |
8868edaf CR |
341 | extern char *sh_single_quote PARAMS((const char *)); |
342 | extern char *sh_double_quote PARAMS((const char *)); | |
343 | extern char *sh_mkdoublequoted PARAMS((const char *, int, int)); | |
344 | extern char *sh_un_double_quote PARAMS((char *)); | |
345 | extern char *sh_backslash_quote PARAMS((char *, const char *, int)); | |
74091dd4 | 346 | extern char *sh_backslash_quote_for_double_quotes PARAMS((char *, int)); |
8868edaf CR |
347 | extern char *sh_quote_reusable PARAMS((char *, int)); |
348 | extern int sh_contains_shell_metas PARAMS((const char *)); | |
349 | extern int sh_contains_quotes PARAMS((const char *)); | |
28ef6c31 JA |
350 | |
351 | /* declarations for functions defined in lib/sh/spell.c */ | |
8868edaf CR |
352 | extern int spname PARAMS((char *, char *)); |
353 | extern char *dirspell PARAMS((char *)); | |
28ef6c31 JA |
354 | |
355 | /* declarations for functions defined in lib/sh/strcasecmp.c */ | |
356 | #if !defined (HAVE_STRCASECMP) | |
8868edaf CR |
357 | extern int strncasecmp PARAMS((const char *, const char *, size_t)); |
358 | extern int strcasecmp PARAMS((const char *, const char *)); | |
28ef6c31 JA |
359 | #endif /* HAVE_STRCASECMP */ |
360 | ||
0001803f CR |
361 | /* declarations for functions defined in lib/sh/strcasestr.c */ |
362 | #if ! HAVE_STRCASESTR | |
8868edaf | 363 | extern char *strcasestr PARAMS((const char *, const char *)); |
0001803f CR |
364 | #endif |
365 | ||
495aee44 CR |
366 | /* declarations for functions defined in lib/sh/strchrnul.c */ |
367 | #if ! HAVE_STRCHRNUL | |
8868edaf | 368 | extern char *strchrnul PARAMS((const char *, int)); |
495aee44 CR |
369 | #endif |
370 | ||
28ef6c31 | 371 | /* declarations for functions defined in lib/sh/strerror.c */ |
0628567a | 372 | #if !defined (HAVE_STRERROR) && !defined (strerror) |
8868edaf | 373 | extern char *strerror PARAMS((int)); |
28ef6c31 JA |
374 | #endif |
375 | ||
7117c2d2 JA |
376 | /* declarations for functions defined in lib/sh/strftime.c */ |
377 | #if !defined (HAVE_STRFTIME) && defined (NEED_STRFTIME_DECL) | |
8868edaf | 378 | extern size_t strftime PARAMS((char *, size_t, const char *, const struct tm *)); |
7117c2d2 JA |
379 | #endif |
380 | ||
28ef6c31 JA |
381 | /* declarations for functions and structures defined in lib/sh/stringlist.c */ |
382 | ||
383 | /* This is a general-purpose argv-style array struct. */ | |
384 | typedef struct _list_of_strings { | |
385 | char **list; | |
386 | int list_size; | |
387 | int list_len; | |
388 | } STRINGLIST; | |
389 | ||
8868edaf CR |
390 | typedef int sh_strlist_map_func_t PARAMS((char *)); |
391 | ||
392 | extern STRINGLIST *strlist_create PARAMS((int)); | |
393 | extern STRINGLIST *strlist_resize PARAMS((STRINGLIST *, int)); | |
394 | extern void strlist_flush PARAMS((STRINGLIST *)); | |
395 | extern void strlist_dispose PARAMS((STRINGLIST *)); | |
396 | extern int strlist_remove PARAMS((STRINGLIST *, char *)); | |
397 | extern STRINGLIST *strlist_copy PARAMS((STRINGLIST *)); | |
398 | extern STRINGLIST *strlist_merge PARAMS((STRINGLIST *, STRINGLIST *)); | |
399 | extern STRINGLIST *strlist_append PARAMS((STRINGLIST *, STRINGLIST *)); | |
400 | extern STRINGLIST *strlist_prefix_suffix PARAMS((STRINGLIST *, char *, char *)); | |
401 | extern void strlist_print PARAMS((STRINGLIST *, char *)); | |
402 | extern void strlist_walk PARAMS((STRINGLIST *, sh_strlist_map_func_t *)); | |
403 | extern void strlist_sort PARAMS((STRINGLIST *)); | |
28ef6c31 JA |
404 | |
405 | /* declarations for functions defined in lib/sh/stringvec.c */ | |
406 | ||
8868edaf CR |
407 | extern char **strvec_create PARAMS((int)); |
408 | extern char **strvec_resize PARAMS((char **, int)); | |
409 | extern char **strvec_mcreate PARAMS((int)); | |
410 | extern char **strvec_mresize PARAMS((char **, int)); | |
411 | extern void strvec_flush PARAMS((char **)); | |
412 | extern void strvec_dispose PARAMS((char **)); | |
413 | extern int strvec_remove PARAMS((char **, char *)); | |
414 | extern int strvec_len PARAMS((char **)); | |
415 | extern int strvec_search PARAMS((char **, char *)); | |
416 | extern char **strvec_copy PARAMS((char **)); | |
417 | extern int strvec_posixcmp PARAMS((char **, char **)); | |
418 | extern int strvec_strcmp PARAMS((char **, char **)); | |
419 | extern void strvec_sort PARAMS((char **, int)); | |
420 | ||
421 | extern char **strvec_from_word_list PARAMS((WORD_LIST *, int, int, int *)); | |
422 | extern WORD_LIST *strvec_to_word_list PARAMS((char **, int, int)); | |
28ef6c31 | 423 | |
95732b49 JA |
424 | /* declarations for functions defined in lib/sh/strnlen.c */ |
425 | #if !defined (HAVE_STRNLEN) | |
8868edaf | 426 | extern size_t strnlen PARAMS((const char *, size_t)); |
95732b49 JA |
427 | #endif |
428 | ||
429 | /* declarations for functions defined in lib/sh/strpbrk.c */ | |
430 | #if !defined (HAVE_STRPBRK) | |
8868edaf | 431 | extern char *strpbrk PARAMS((const char *, const char *)); |
95732b49 JA |
432 | #endif |
433 | ||
cce855bc JA |
434 | /* declarations for functions defined in lib/sh/strtod.c */ |
435 | #if !defined (HAVE_STRTOD) | |
8868edaf | 436 | extern double strtod PARAMS((const char *, char **)); |
cce855bc | 437 | #endif |
ccc6cda3 | 438 | |
cce855bc | 439 | /* declarations for functions defined in lib/sh/strtol.c */ |
f73dda09 | 440 | #if !HAVE_DECL_STRTOL |
8868edaf | 441 | extern long strtol PARAMS((const char *, char **, int)); |
cce855bc JA |
442 | #endif |
443 | ||
f73dda09 | 444 | /* declarations for functions defined in lib/sh/strtoll.c */ |
74091dd4 | 445 | #if defined (HAVE_LONG_LONG_INT) && !HAVE_DECL_STRTOLL |
8868edaf | 446 | extern long long strtoll PARAMS((const char *, char **, int)); |
f73dda09 JA |
447 | #endif |
448 | ||
cce855bc | 449 | /* declarations for functions defined in lib/sh/strtoul.c */ |
f73dda09 | 450 | #if !HAVE_DECL_STRTOUL |
8868edaf | 451 | extern unsigned long strtoul PARAMS((const char *, char **, int)); |
cce855bc | 452 | #endif |
ccc6cda3 | 453 | |
f73dda09 | 454 | /* declarations for functions defined in lib/sh/strtoull.c */ |
74091dd4 | 455 | #if defined (HAVE_UNSIGNED_LONG_LONG_INT) && !HAVE_DECL_STRTOULL |
8868edaf | 456 | extern unsigned long long strtoull PARAMS((const char *, char **, int)); |
f73dda09 JA |
457 | #endif |
458 | ||
459 | /* declarations for functions defined in lib/sh/strimax.c */ | |
f73dda09 | 460 | #if !HAVE_DECL_STRTOIMAX |
8868edaf | 461 | extern intmax_t strtoimax PARAMS((const char *, char **, int)); |
f73dda09 JA |
462 | #endif |
463 | ||
464 | /* declarations for functions defined in lib/sh/strumax.c */ | |
465 | #if !HAVE_DECL_STRTOUMAX | |
8868edaf | 466 | extern uintmax_t strtoumax PARAMS((const char *, char **, int)); |
f73dda09 JA |
467 | #endif |
468 | ||
28ef6c31 | 469 | /* declarations for functions defined in lib/sh/strtrans.c */ |
8868edaf CR |
470 | extern char *ansicstr PARAMS((char *, int, int, int *, int *)); |
471 | extern char *ansic_quote PARAMS((char *, int, int *)); | |
472 | extern int ansic_shouldquote PARAMS((const char *)); | |
473 | extern char *ansiexpand PARAMS((char *, int, int, int *)); | |
bb70624e | 474 | |
74091dd4 CR |
475 | /* declarations for functions defined in lib/sh/strvis.c */ |
476 | extern int sh_charvis PARAMS((const char *, size_t *, size_t, char *, size_t *)); | |
477 | extern char *sh_strvis PARAMS((const char *)); | |
478 | ||
bb70624e JA |
479 | /* declarations for functions defined in lib/sh/timeval.c. No prototypes |
480 | so we don't have to count on having a definition of struct timeval in | |
481 | scope when this file is included. */ | |
482 | extern void timeval_to_secs (); | |
483 | extern void print_timeval (); | |
484 | ||
28ef6c31 JA |
485 | /* declarations for functions defined in lib/sh/tmpfile.c */ |
486 | #define MT_USETMPDIR 0x0001 | |
487 | #define MT_READWRITE 0x0002 | |
488 | #define MT_USERANDOM 0x0004 | |
8868edaf | 489 | #define MT_TEMPLATE 0x0008 |
bb70624e | 490 | |
8868edaf CR |
491 | extern char *sh_mktmpname PARAMS((char *, int)); |
492 | extern int sh_mktmpfd PARAMS((char *, int, char **)); | |
493 | /* extern FILE *sh_mktmpfp PARAMS((char *, int, char **)); */ | |
494 | extern char *sh_mktmpdir PARAMS((char *, int)); | |
bb70624e | 495 | |
3185942a | 496 | /* declarations for functions defined in lib/sh/uconvert.c */ |
8868edaf | 497 | extern int uconvert PARAMS((char *, long *, long *, char **)); |
3185942a JA |
498 | |
499 | /* declarations for functions defined in lib/sh/ufuncs.c */ | |
8868edaf CR |
500 | extern unsigned int falarm PARAMS((unsigned int, unsigned int)); |
501 | extern unsigned int fsleep PARAMS((unsigned int, unsigned int)); | |
3185942a | 502 | |
495aee44 | 503 | /* declarations for functions defined in lib/sh/unicode.c */ |
8868edaf CR |
504 | extern int u32cconv PARAMS((unsigned long, char *)); |
505 | extern void u32reset PARAMS((void)); | |
ac50fbac | 506 | |
d233b485 | 507 | /* declarations for functions defined in lib/sh/utf8.c */ |
8868edaf CR |
508 | extern char *utf8_mbschr PARAMS((const char *, int)); |
509 | extern int utf8_mbscmp PARAMS((const char *, const char *)); | |
510 | extern char *utf8_mbsmbchar PARAMS((const char *)); | |
511 | extern int utf8_mbsnlen PARAMS((const char *, size_t, int)); | |
512 | extern int utf8_mblen PARAMS((const char *, size_t)); | |
513 | extern size_t utf8_mbstrlen PARAMS((const char *)); | |
d233b485 | 514 | |
ac50fbac CR |
515 | /* declarations for functions defined in lib/sh/wcsnwidth.c */ |
516 | #if defined (HANDLE_MULTIBYTE) | |
8868edaf | 517 | extern int wcsnwidth PARAMS((const wchar_t *, size_t, int)); |
ac50fbac | 518 | #endif |
495aee44 | 519 | |
95732b49 | 520 | /* declarations for functions defined in lib/sh/winsize.c */ |
8868edaf | 521 | extern void get_new_window_size PARAMS((int, int *, int *)); |
95732b49 | 522 | |
95732b49 | 523 | /* declarations for functions defined in lib/sh/zcatfd.c */ |
8868edaf | 524 | extern int zcatfd PARAMS((int, int, char *)); |
95732b49 | 525 | |
3185942a | 526 | /* declarations for functions defined in lib/sh/zgetline.c */ |
8868edaf | 527 | extern ssize_t zgetline PARAMS((int, char **, size_t *, int, int)); |
3185942a JA |
528 | |
529 | /* declarations for functions defined in lib/sh/zmapfd.c */ | |
8868edaf | 530 | extern int zmapfd PARAMS((int, char **, char *)); |
3185942a | 531 | |
28ef6c31 | 532 | /* declarations for functions defined in lib/sh/zread.c */ |
8868edaf CR |
533 | extern ssize_t zread PARAMS((int, char *, size_t)); |
534 | extern ssize_t zreadretry PARAMS((int, char *, size_t)); | |
535 | extern ssize_t zreadintr PARAMS((int, char *, size_t)); | |
536 | extern ssize_t zreadc PARAMS((int, char *)); | |
537 | extern ssize_t zreadcintr PARAMS((int, char *)); | |
538 | extern ssize_t zreadn PARAMS((int, char *, size_t)); | |
539 | extern void zreset PARAMS((void)); | |
540 | extern void zsyncfd PARAMS((int)); | |
28ef6c31 JA |
541 | |
542 | /* declarations for functions defined in lib/sh/zwrite.c */ | |
8868edaf | 543 | extern int zwrite PARAMS((int, char *, size_t)); |
bb70624e | 544 | |
495aee44 | 545 | /* declarations for functions defined in lib/glob/gmisc.c */ |
8868edaf CR |
546 | extern int match_pattern_char PARAMS((char *, char *, int)); |
547 | extern int umatchlen PARAMS((char *, size_t)); | |
495aee44 CR |
548 | |
549 | #if defined (HANDLE_MULTIBYTE) | |
8868edaf CR |
550 | extern int match_pattern_wchar PARAMS((wchar_t *, wchar_t *, int)); |
551 | extern int wmatchlen PARAMS((wchar_t *, size_t)); | |
495aee44 CR |
552 | #endif |
553 | ||
ccc6cda3 | 554 | #endif /* _EXTERNS_H_ */ |