]> git.ipfire.org Git - thirdparty/bash.git/blame - externs.h
Bash-5.2 patch 26: fix typo when specifying readline's custom color prefix
[thirdparty/bash.git] / externs.h
CommitLineData
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 32extern 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 38extern char *make_command_string PARAMS((COMMAND *));
74091dd4 39extern char *print_comsub PARAMS((COMMAND *));
8868edaf 40extern char *named_function_string PARAMS((char *, COMMAND *, int));
b80f6443 41
8868edaf
CR
42extern void print_command PARAMS((COMMAND *));
43extern void print_simple_command PARAMS((SIMPLE_COM *));
44extern void print_word_list PARAMS((WORD_LIST *, char *));
b80f6443
JA
45
46/* debugger support */
8868edaf 47extern void print_for_command_head PARAMS((FOR_COM *));
b80f6443 48#if defined (SELECT_COMMAND)
8868edaf 49extern void print_select_command_head PARAMS((SELECT_COM *));
b80f6443 50#endif
8868edaf 51extern void print_case_command_head PARAMS((CASE_COM *));
b80f6443 52#if defined (DPAREN_ARITHMETIC)
8868edaf 53extern void print_arith_command PARAMS((WORD_LIST *));
b80f6443
JA
54#endif
55#if defined (COND_COMMAND)
8868edaf 56extern void print_cond_command PARAMS((COND_COM *));
b80f6443
JA
57#endif
58
59/* set -x support */
8868edaf 60extern void xtrace_init PARAMS((void));
0001803f 61#ifdef NEED_XTRACE_SET_DECL
8868edaf
CR
62extern void xtrace_set PARAMS((int, FILE *));
63#endif
64extern void xtrace_fdchk PARAMS((int));
65extern void xtrace_reset PARAMS((void));
66extern char *indirection_level_string PARAMS((void));
67extern void xtrace_print_assignment PARAMS((char *, char *, int, int));
68extern void xtrace_print_word_list PARAMS((WORD_LIST *, int));
69extern void xtrace_print_for_command_head PARAMS((FOR_COM *));
b80f6443 70#if defined (SELECT_COMMAND)
8868edaf 71extern void xtrace_print_select_command_head PARAMS((SELECT_COM *));
b80f6443 72#endif
8868edaf 73extern void xtrace_print_case_command_head PARAMS((CASE_COM *));
cce855bc 74#if defined (DPAREN_ARITHMETIC)
8868edaf 75extern void xtrace_print_arith_cmd PARAMS((WORD_LIST *));
cce855bc
JA
76#endif
77#if defined (COND_COMMAND)
8868edaf 78extern 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
82extern void exit_shell PARAMS((int)) __attribute__((__noreturn__));
83extern void sh_exit PARAMS((int)) __attribute__((__noreturn__));
84extern void subshell_exit PARAMS((int)) __attribute__((__noreturn__));
85extern void set_exit_status PARAMS((int));
86extern void disable_priv_mode PARAMS((void));
87extern void unbind_args PARAMS((void));
ccc6cda3
JA
88
89#if defined (RESTRICTED_SHELL)
8868edaf
CR
90extern int shell_is_restricted PARAMS((char *));
91extern int maybe_make_restricted PARAMS((char *));
ccc6cda3
JA
92#endif
93
8868edaf
CR
94extern void unset_bash_input PARAMS((int));
95extern void get_current_user_info PARAMS((void));
d166f048 96
ccc6cda3 97/* Functions from eval.c. */
8868edaf
CR
98extern int reader_loop PARAMS((void));
99extern int pretty_print_loop PARAMS((void));
100extern int parse_command PARAMS((void));
101extern int read_command PARAMS((void));
726f6388
JA
102
103/* Functions from braces.c. */
104#if defined (BRACE_EXPANSION)
8868edaf 105extern char **brace_expand PARAMS((char *));
726f6388
JA
106#endif
107
ccc6cda3 108/* Miscellaneous functions from parse.y */
8868edaf
CR
109extern int yyparse PARAMS((void));
110extern int return_EOF PARAMS((void));
111extern void push_token PARAMS((int));
112extern char *xparse_dolparen PARAMS((char *, char *, int *, int));
74091dd4 113extern COMMAND *parse_string_to_command PARAMS((char *, int));
8868edaf
CR
114extern void reset_parser PARAMS((void));
115extern void reset_readahead_token PARAMS((void));
116extern WORD_LIST *parse_string_to_word_list PARAMS((char *, int, const char *));
b80f6443 117
8868edaf
CR
118extern int parser_will_prompt PARAMS((void));
119extern int parser_in_command_position PARAMS((void));
ac50fbac 120
8868edaf 121extern void free_pushed_string_input PARAMS((void));
bb70624e 122
8868edaf
CR
123extern int parser_expanding_alias PARAMS((void));
124extern void parser_save_alias PARAMS((void));
125extern void parser_restore_alias PARAMS((void));
ac50fbac 126
8868edaf 127extern void clear_shell_input_line PARAMS((void));
a0c0a00f 128
8868edaf 129extern char *decode_prompt_string PARAMS((char *));
7117c2d2 130
8868edaf
CR
131extern int get_current_prompt_level PARAMS((void));
132extern void set_current_prompt_level PARAMS((int));
ccc6cda3 133
f73dda09 134#if defined (HISTORY)
8868edaf 135extern char *history_delimiting_chars PARAMS((const char *));
f73dda09 136#endif
ccc6cda3
JA
137
138/* Declarations for functions defined in locale.c */
8868edaf
CR
139extern void set_default_locale PARAMS((void));
140extern void set_default_locale_vars PARAMS((void));
141extern int set_locale_var PARAMS((char *, char *));
142extern int set_lang PARAMS((char *, char *));
143extern void set_default_lang PARAMS((void));
144extern char *get_locale_var PARAMS((char *));
145extern char *localetrans PARAMS((char *, int, int *));
146extern char *mk_msgstr PARAMS((char *, int *));
74091dd4 147extern char *locale_expand PARAMS((char *, int, int, int, int *));
d233b485 148#ifndef locale_decpoint
8868edaf 149extern int locale_decpoint PARAMS((void));
d233b485 150#endif
ccc6cda3
JA
151
152/* Declarations for functions defined in list.c. */
8868edaf
CR
153extern void list_walk PARAMS((GENERIC_LIST *, sh_glist_func_t *));
154extern void wlist_walk PARAMS((WORD_LIST *, sh_icpfunc_t *));
7117c2d2 155extern GENERIC_LIST *list_reverse ();
ccc6cda3
JA
156extern int list_length ();
157extern GENERIC_LIST *list_append ();
7117c2d2 158extern GENERIC_LIST *list_remove ();
ccc6cda3 159
cce855bc 160/* Declarations for functions defined in stringlib.c */
8868edaf
CR
161extern int find_string_in_alist PARAMS((char *, STRING_INT_ALIST *, int));
162extern char *find_token_in_alist PARAMS((int, STRING_INT_ALIST *, int));
163extern int find_index_in_alist PARAMS((char *, STRING_INT_ALIST *, int));
bb70624e 164
8868edaf
CR
165extern char *substring PARAMS((const char *, int, int));
166extern char *strsub PARAMS((char *, char *, char *, int));
167extern char *strcreplace PARAMS((char *, int, const char *, int));
168extern void strip_leading PARAMS((char *));
169extern void strip_trailing PARAMS((char *, int, int));
170extern void xbcopy PARAMS((char *, char *, int));
cce855bc 171
b80f6443 172/* Functions from version.c. */
8868edaf
CR
173extern char *shell_version_string PARAMS((void));
174extern 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 180extern 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 196extern long get_clk_tck PARAMS((void));
28ef6c31
JA
197
198/* declarations for functions defined in lib/sh/clock.c */
199extern void clock_t_to_secs ();
200extern void print_clock_t ();
201
495aee44
CR
202/* Declarations for functions defined in lib/sh/dprintf.c */
203#if !defined (HAVE_DPRINTF)
8868edaf 204extern 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 213extern 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 217extern 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 221extern 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
224extern char *fnx_fromfs PARAMS((char *, size_t));
225extern 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 235extern 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 242extern char *getcwd PARAMS((char *, size_t));
cce855bc
JA
243#endif
244
3185942a 245/* Declarations for functions defined in lib/sh/input_avail.c */
8868edaf 246extern int input_avail PARAMS((int));
3185942a 247
cce855bc 248/* Declarations for functions defined in lib/sh/itos.c */
8868edaf
CR
249extern char *inttostr PARAMS((intmax_t, char *, size_t));
250extern char *itos PARAMS((intmax_t));
251extern char *mitos PARAMS((intmax_t));
252extern char *uinttostr PARAMS((uintmax_t, char *, size_t));
253extern 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 261extern 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 265extern 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 270extern 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 275extern char *mbscmp PARAMS((const char *, const char *));
0001803f
CR
276#endif
277
7117c2d2 278/* declarations for functions defined in lib/sh/netconn.c */
8868edaf 279extern int isnetconn PARAMS((int));
7117c2d2 280
28ef6c31 281/* declarations for functions defined in lib/sh/netopen.c */
8868edaf 282extern 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 287extern int dup2 PARAMS((int, int));
7117c2d2 288#endif
726f6388 289
28ef6c31 290#if !defined (HAVE_GETDTABLESIZE)
8868edaf 291extern int getdtablesize PARAMS((void));
28ef6c31
JA
292#endif /* !HAVE_GETDTABLESIZE */
293
ccc6cda3 294#if !defined (HAVE_GETHOSTNAME)
8868edaf 295extern int gethostname PARAMS((char *, int));
ccc6cda3
JA
296#endif /* !HAVE_GETHOSTNAME */
297
8868edaf
CR
298extern int getmaxgroups PARAMS((void));
299extern 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 307extern char *sh_canonpath PARAMS((char *, int));
28ef6c31
JA
308
309/* declarations for functions defined in lib/sh/pathphys.c */
8868edaf
CR
310extern char *sh_physpath PARAMS((char *, int));
311extern char *sh_realpath PARAMS((const char *, char *));
312
313/* declarations for functions defined in lib/sh/random.c */
314extern int brand PARAMS((void));
315extern void sbrand PARAMS((unsigned long)); /* set bash random number generator. */
316extern void seedrand PARAMS((void)); /* seed generator randomly */
317extern void seedrand32 PARAMS((void));
318extern 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 322extern int sh_setlinebuf PARAMS((FILE *));
ccc6cda3 323#endif
726f6388 324
0628567a 325/* declarations for functions defined in lib/sh/shaccess.c */
8868edaf 326extern int sh_eaccess PARAMS((const char *, int));
0628567a 327
b80f6443 328/* declarations for functions defined in lib/sh/shmatch.c */
8868edaf 329extern 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
336extern size_t mbstrlen PARAMS((const char *));
337extern char *mbsmbchar PARAMS((const char *));
338extern int sh_mbsnlen PARAMS((const char *, size_t, int));
495aee44 339
28ef6c31 340/* declarations for functions defined in lib/sh/shquote.c */
8868edaf
CR
341extern char *sh_single_quote PARAMS((const char *));
342extern char *sh_double_quote PARAMS((const char *));
343extern char *sh_mkdoublequoted PARAMS((const char *, int, int));
344extern char *sh_un_double_quote PARAMS((char *));
345extern char *sh_backslash_quote PARAMS((char *, const char *, int));
74091dd4 346extern char *sh_backslash_quote_for_double_quotes PARAMS((char *, int));
8868edaf
CR
347extern char *sh_quote_reusable PARAMS((char *, int));
348extern int sh_contains_shell_metas PARAMS((const char *));
349extern int sh_contains_quotes PARAMS((const char *));
28ef6c31
JA
350
351/* declarations for functions defined in lib/sh/spell.c */
8868edaf
CR
352extern int spname PARAMS((char *, char *));
353extern char *dirspell PARAMS((char *));
28ef6c31
JA
354
355/* declarations for functions defined in lib/sh/strcasecmp.c */
356#if !defined (HAVE_STRCASECMP)
8868edaf
CR
357extern int strncasecmp PARAMS((const char *, const char *, size_t));
358extern 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 363extern 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 368extern 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 373extern 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 378extern 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. */
384typedef struct _list_of_strings {
385 char **list;
386 int list_size;
387 int list_len;
388} STRINGLIST;
389
8868edaf
CR
390typedef int sh_strlist_map_func_t PARAMS((char *));
391
392extern STRINGLIST *strlist_create PARAMS((int));
393extern STRINGLIST *strlist_resize PARAMS((STRINGLIST *, int));
394extern void strlist_flush PARAMS((STRINGLIST *));
395extern void strlist_dispose PARAMS((STRINGLIST *));
396extern int strlist_remove PARAMS((STRINGLIST *, char *));
397extern STRINGLIST *strlist_copy PARAMS((STRINGLIST *));
398extern STRINGLIST *strlist_merge PARAMS((STRINGLIST *, STRINGLIST *));
399extern STRINGLIST *strlist_append PARAMS((STRINGLIST *, STRINGLIST *));
400extern STRINGLIST *strlist_prefix_suffix PARAMS((STRINGLIST *, char *, char *));
401extern void strlist_print PARAMS((STRINGLIST *, char *));
402extern void strlist_walk PARAMS((STRINGLIST *, sh_strlist_map_func_t *));
403extern void strlist_sort PARAMS((STRINGLIST *));
28ef6c31
JA
404
405/* declarations for functions defined in lib/sh/stringvec.c */
406
8868edaf
CR
407extern char **strvec_create PARAMS((int));
408extern char **strvec_resize PARAMS((char **, int));
409extern char **strvec_mcreate PARAMS((int));
410extern char **strvec_mresize PARAMS((char **, int));
411extern void strvec_flush PARAMS((char **));
412extern void strvec_dispose PARAMS((char **));
413extern int strvec_remove PARAMS((char **, char *));
414extern int strvec_len PARAMS((char **));
415extern int strvec_search PARAMS((char **, char *));
416extern char **strvec_copy PARAMS((char **));
417extern int strvec_posixcmp PARAMS((char **, char **));
418extern int strvec_strcmp PARAMS((char **, char **));
419extern void strvec_sort PARAMS((char **, int));
420
421extern char **strvec_from_word_list PARAMS((WORD_LIST *, int, int, int *));
422extern 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 426extern 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 431extern 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 436extern 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 441extern 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 446extern 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 451extern 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 456extern 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 461extern 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 466extern 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
470extern char *ansicstr PARAMS((char *, int, int, int *, int *));
471extern char *ansic_quote PARAMS((char *, int, int *));
472extern int ansic_shouldquote PARAMS((const char *));
473extern char *ansiexpand PARAMS((char *, int, int, int *));
bb70624e 474
74091dd4
CR
475/* declarations for functions defined in lib/sh/strvis.c */
476extern int sh_charvis PARAMS((const char *, size_t *, size_t, char *, size_t *));
477extern 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. */
482extern void timeval_to_secs ();
483extern 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
491extern char *sh_mktmpname PARAMS((char *, int));
492extern int sh_mktmpfd PARAMS((char *, int, char **));
493/* extern FILE *sh_mktmpfp PARAMS((char *, int, char **)); */
494extern char *sh_mktmpdir PARAMS((char *, int));
bb70624e 495
3185942a 496/* declarations for functions defined in lib/sh/uconvert.c */
8868edaf 497extern int uconvert PARAMS((char *, long *, long *, char **));
3185942a
JA
498
499/* declarations for functions defined in lib/sh/ufuncs.c */
8868edaf
CR
500extern unsigned int falarm PARAMS((unsigned int, unsigned int));
501extern unsigned int fsleep PARAMS((unsigned int, unsigned int));
3185942a 502
495aee44 503/* declarations for functions defined in lib/sh/unicode.c */
8868edaf
CR
504extern int u32cconv PARAMS((unsigned long, char *));
505extern void u32reset PARAMS((void));
ac50fbac 506
d233b485 507/* declarations for functions defined in lib/sh/utf8.c */
8868edaf
CR
508extern char *utf8_mbschr PARAMS((const char *, int));
509extern int utf8_mbscmp PARAMS((const char *, const char *));
510extern char *utf8_mbsmbchar PARAMS((const char *));
511extern int utf8_mbsnlen PARAMS((const char *, size_t, int));
512extern int utf8_mblen PARAMS((const char *, size_t));
513extern 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 517extern 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 521extern void get_new_window_size PARAMS((int, int *, int *));
95732b49 522
95732b49 523/* declarations for functions defined in lib/sh/zcatfd.c */
8868edaf 524extern int zcatfd PARAMS((int, int, char *));
95732b49 525
3185942a 526/* declarations for functions defined in lib/sh/zgetline.c */
8868edaf 527extern ssize_t zgetline PARAMS((int, char **, size_t *, int, int));
3185942a
JA
528
529/* declarations for functions defined in lib/sh/zmapfd.c */
8868edaf 530extern int zmapfd PARAMS((int, char **, char *));
3185942a 531
28ef6c31 532/* declarations for functions defined in lib/sh/zread.c */
8868edaf
CR
533extern ssize_t zread PARAMS((int, char *, size_t));
534extern ssize_t zreadretry PARAMS((int, char *, size_t));
535extern ssize_t zreadintr PARAMS((int, char *, size_t));
536extern ssize_t zreadc PARAMS((int, char *));
537extern ssize_t zreadcintr PARAMS((int, char *));
538extern ssize_t zreadn PARAMS((int, char *, size_t));
539extern void zreset PARAMS((void));
540extern void zsyncfd PARAMS((int));
28ef6c31
JA
541
542/* declarations for functions defined in lib/sh/zwrite.c */
8868edaf 543extern int zwrite PARAMS((int, char *, size_t));
bb70624e 544
495aee44 545/* declarations for functions defined in lib/glob/gmisc.c */
8868edaf
CR
546extern int match_pattern_char PARAMS((char *, char *, int));
547extern int umatchlen PARAMS((char *, size_t));
495aee44
CR
548
549#if defined (HANDLE_MULTIBYTE)
8868edaf
CR
550extern int match_pattern_wchar PARAMS((wchar_t *, wchar_t *, int));
551extern int wmatchlen PARAMS((wchar_t *, size_t));
495aee44
CR
552#endif
553
ccc6cda3 554#endif /* _EXTERNS_H_ */