nix-archive-1(type directoryentry(nameincludenode(type directoryentry(namebashnode(type directoryentry(namealias.hnode(typeregularcontentsÏ/* alias.h -- structure definitions. */ /* Copyright (C) 1987-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_ALIAS_H_) #define _ALIAS_H_ #include "stdc.h" #include "hashlib.h" typedef struct alias { char *name; char *value; char flags; } alias_t; /* Values for `flags' member of struct alias. */ #define AL_EXPANDNEXT 0x1 #define AL_BEINGEXPANDED 0x2 /* The list of known aliases. */ extern HASH_TABLE *aliases; extern void initialize_aliases PARAMS((void)); /* Scan the list of aliases looking for one with NAME. Return NULL if the alias doesn't exist, else a pointer to the alias. */ extern alias_t *find_alias PARAMS((char *)); /* Return the value of the alias for NAME, or NULL if there is none. */ extern char *get_alias_value PARAMS((char *)); /* Make a new alias from NAME and VALUE. If NAME can be found, then replace its value. */ extern void add_alias PARAMS((char *, char *)); /* Remove the alias with name NAME from the alias list. Returns the index of the removed alias, or -1 if the alias didn't exist. */ extern int remove_alias PARAMS((char *)); /* Remove all aliases. */ extern void delete_all_aliases PARAMS((void)); /* Return an array of all defined aliases. */ extern alias_t **all_aliases PARAMS((void)); /* Expand a single word for aliases. */ extern char *alias_expand_word PARAMS((char *)); /* Return a new line, with any aliases expanded. */ extern char *alias_expand PARAMS((char *)); /* Helper definition for the parser */ extern void clear_string_list_expander PARAMS((alias_t *)); #endif /* _ALIAS_H_ */ ))entry(namearray.hnode(typeregularcontentsm/* array.h -- definitions for the interface exported by array.c that allows the rest of the shell to manipulate array variables. */ /* Copyright (C) 1997-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _ARRAY_H_ #define _ARRAY_H_ #include "stdc.h" typedef intmax_t arrayind_t; enum atype {array_indexed, array_assoc}; /* only array_indexed used */ typedef struct array { enum atype type; arrayind_t max_index; int num_elements; struct array_element *head; struct array_element *lastref; } ARRAY; typedef struct array_element { arrayind_t ind; char *value; struct array_element *next, *prev; } ARRAY_ELEMENT; typedef int sh_ae_map_func_t PARAMS((ARRAY_ELEMENT *, void *)); /* Basic operations on entire arrays */ extern ARRAY *array_create PARAMS((void)); extern void array_flush PARAMS((ARRAY *)); extern void array_dispose PARAMS((ARRAY *)); extern ARRAY *array_copy PARAMS((ARRAY *)); extern ARRAY *array_slice PARAMS((ARRAY *, ARRAY_ELEMENT *, ARRAY_ELEMENT *)); extern void array_walk PARAMS((ARRAY *, sh_ae_map_func_t *, void *)); extern ARRAY_ELEMENT *array_shift PARAMS((ARRAY *, int, int)); extern int array_rshift PARAMS((ARRAY *, int, char *)); extern ARRAY_ELEMENT *array_unshift_element PARAMS((ARRAY *)); extern int array_shift_element PARAMS((ARRAY *, char *)); extern ARRAY *array_quote PARAMS((ARRAY *)); extern ARRAY *array_quote_escapes PARAMS((ARRAY *)); extern ARRAY *array_dequote PARAMS((ARRAY *)); extern ARRAY *array_dequote_escapes PARAMS((ARRAY *)); extern ARRAY *array_remove_quoted_nulls PARAMS((ARRAY *)); extern char *array_subrange PARAMS((ARRAY *, arrayind_t, arrayind_t, int, int, int)); extern char *array_patsub PARAMS((ARRAY *, char *, char *, int)); extern char *array_modcase PARAMS((ARRAY *, char *, int, int)); /* Basic operations on array elements. */ extern ARRAY_ELEMENT *array_create_element PARAMS((arrayind_t, char *)); extern ARRAY_ELEMENT *array_copy_element PARAMS((ARRAY_ELEMENT *)); extern void array_dispose_element PARAMS((ARRAY_ELEMENT *)); extern int array_insert PARAMS((ARRAY *, arrayind_t, char *)); extern ARRAY_ELEMENT *array_remove PARAMS((ARRAY *, arrayind_t)); extern char *array_reference PARAMS((ARRAY *, arrayind_t)); /* Converting to and from arrays */ extern WORD_LIST *array_to_word_list PARAMS((ARRAY *)); extern ARRAY *array_from_word_list PARAMS((WORD_LIST *)); extern WORD_LIST *array_keys_to_word_list PARAMS((ARRAY *)); extern ARRAY *array_assign_list PARAMS((ARRAY *, WORD_LIST *)); extern char **array_to_argv PARAMS((ARRAY *, int *)); extern char *array_to_kvpair PARAMS((ARRAY *, int)); extern char *array_to_assign PARAMS((ARRAY *, int)); extern char *array_to_string PARAMS((ARRAY *, char *, int)); extern ARRAY *array_from_string PARAMS((char *, char *)); /* Flags for array_shift */ #define AS_DISPOSE 0x01 #define array_num_elements(a) ((a)->num_elements) #define array_max_index(a) ((a)->max_index) #define array_first_index(a) ((a)->head->next->ind) #define array_head(a) ((a)->head) #define array_empty(a) ((a)->num_elements == 0) #define element_value(ae) ((ae)->value) #define element_index(ae) ((ae)->ind) #define element_forw(ae) ((ae)->next) #define element_back(ae) ((ae)->prev) #define set_element_value(ae, val) ((ae)->value = (val)) /* Convenience */ #define array_push(a,v) \ do { array_rshift ((a), 1, (v)); } while (0) #define array_pop(a) \ do { array_dispose_element (array_shift ((a), 1, 0)); } while (0) #define GET_ARRAY_FROM_VAR(n, v, a) \ do { \ (v) = find_variable (n); \ (a) = ((v) && array_p ((v))) ? array_cell (v) : (ARRAY *)0; \ } while (0) #define ALL_ELEMENT_SUB(c) ((c) == '@' || (c) == '*') /* In eval.c, but uses ARRAY * */ extern int execute_array_command PARAMS((ARRAY *, void *)); #endif /* _ARRAY_H_ */ ))entry(name arrayfunc.hnode(typeregularcontents,/* arrayfunc.h -- declarations for miscellaneous array functions in arrayfunc.c */ /* Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_ARRAYFUNC_H_) #define _ARRAYFUNC_H_ /* Must include variables.h before including this file. */ #if defined (ARRAY_VARS) /* This variable means to not expand associative array subscripts more than once, when performing variable expansion. */ extern int assoc_expand_once; /* The analog for indexed array subscripts */ extern int array_expand_once; /* Flags for array_value_internal and callers array_value/get_array_value */ #define AV_ALLOWALL 0x001 #define AV_QUOTED 0x002 #define AV_USEIND 0x004 #define AV_USEVAL 0x008 /* XXX - should move this */ #define AV_ASSIGNRHS 0x010 /* no splitting, special case ${a[@]} */ #define AV_NOEXPAND 0x020 /* don't run assoc subscripts through word expansion */ /* Flags for valid_array_reference. Value 1 is reserved for skipsubscript() */ #define VA_NOEXPAND 0x001 #define VA_ONEWORD 0x002 extern SHELL_VAR *convert_var_to_array PARAMS((SHELL_VAR *)); extern SHELL_VAR *convert_var_to_assoc PARAMS((SHELL_VAR *)); extern char *make_array_variable_value PARAMS((SHELL_VAR *, arrayind_t, char *, char *, int)); extern SHELL_VAR *bind_array_variable PARAMS((char *, arrayind_t, char *, int)); extern SHELL_VAR *bind_array_element PARAMS((SHELL_VAR *, arrayind_t, char *, int)); extern SHELL_VAR *assign_array_element PARAMS((char *, char *, int)); extern SHELL_VAR *bind_assoc_variable PARAMS((SHELL_VAR *, char *, char *, char *, int)); extern SHELL_VAR *find_or_make_array_variable PARAMS((char *, int)); extern SHELL_VAR *assign_array_from_string PARAMS((char *, char *, int)); extern SHELL_VAR *assign_array_var_from_word_list PARAMS((SHELL_VAR *, WORD_LIST *, int)); extern WORD_LIST *expand_compound_array_assignment PARAMS((SHELL_VAR *, char *, int)); extern void assign_compound_array_list PARAMS((SHELL_VAR *, WORD_LIST *, int)); extern SHELL_VAR *assign_array_var_from_string PARAMS((SHELL_VAR *, char *, int)); extern char *expand_and_quote_assoc_word PARAMS((char *, int)); extern void quote_compound_array_list PARAMS((WORD_LIST *, int)); extern int kvpair_assignment_p PARAMS((WORD_LIST *)); extern char *expand_and_quote_kvpair_word PARAMS((char *)); extern int unbind_array_element PARAMS((SHELL_VAR *, char *, int)); extern int skipsubscript PARAMS((const char *, int, int)); extern void print_array_assignment PARAMS((SHELL_VAR *, int)); extern void print_assoc_assignment PARAMS((SHELL_VAR *, int)); extern arrayind_t array_expand_index PARAMS((SHELL_VAR *, char *, int, int)); extern int valid_array_reference PARAMS((const char *, int)); extern char *array_value PARAMS((const char *, int, int, int *, arrayind_t *)); extern char *get_array_value PARAMS((const char *, int, int *, arrayind_t *)); extern char *array_keys PARAMS((char *, int, int)); extern char *array_variable_name PARAMS((const char *, int, char **, int *)); extern SHELL_VAR *array_variable_part PARAMS((const char *, int, char **, int *)); #else #define AV_ALLOWALL 0 #define AV_QUOTED 0 #define AV_USEIND 0 #define AV_ASSIGNRHS 0 #define VA_ONEWORD 0 #endif #endif /* !_ARRAYFUNC_H_ */ ))entry(nameassoc.hnode(typeregularcontents™ /* assoc.h -- definitions for the interface exported by assoc.c that allows the rest of the shell to manipulate associative array variables. */ /* Copyright (C) 2008,2009-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _ASSOC_H_ #define _ASSOC_H_ #include "stdc.h" #include "hashlib.h" #define ASSOC_HASH_BUCKETS 1024 #define assoc_empty(h) ((h)->nentries == 0) #define assoc_num_elements(h) ((h)->nentries) #define assoc_create(n) (hash_create((n))) #define assoc_copy(h) (hash_copy((h), 0)) #define assoc_walk(h, f) (hash_walk((h), (f)) extern void assoc_dispose PARAMS((HASH_TABLE *)); extern void assoc_flush PARAMS((HASH_TABLE *)); extern int assoc_insert PARAMS((HASH_TABLE *, char *, char *)); extern PTR_T assoc_replace PARAMS((HASH_TABLE *, char *, char *)); extern void assoc_remove PARAMS((HASH_TABLE *, char *)); extern char *assoc_reference PARAMS((HASH_TABLE *, char *)); extern char *assoc_subrange PARAMS((HASH_TABLE *, arrayind_t, arrayind_t, int, int, int)); extern char *assoc_patsub PARAMS((HASH_TABLE *, char *, char *, int)); extern char *assoc_modcase PARAMS((HASH_TABLE *, char *, int, int)); extern HASH_TABLE *assoc_quote PARAMS((HASH_TABLE *)); extern HASH_TABLE *assoc_quote_escapes PARAMS((HASH_TABLE *)); extern HASH_TABLE *assoc_dequote PARAMS((HASH_TABLE *)); extern HASH_TABLE *assoc_dequote_escapes PARAMS((HASH_TABLE *)); extern HASH_TABLE *assoc_remove_quoted_nulls PARAMS((HASH_TABLE *)); extern char *assoc_to_kvpair PARAMS((HASH_TABLE *, int)); extern char *assoc_to_assign PARAMS((HASH_TABLE *, int)); extern WORD_LIST *assoc_to_word_list PARAMS((HASH_TABLE *)); extern WORD_LIST *assoc_keys_to_word_list PARAMS((HASH_TABLE *)); extern char *assoc_to_string PARAMS((HASH_TABLE *, char *, int)); #endif /* _ASSOC_H_ */ ))entry(name bashansi.hnode(typeregularcontentsî/* bashansi.h -- Typically included information required by picky compilers. */ /* Copyright (C) 1993-2009 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_BASHANSI_H_) #define _BASHANSI_H_ #if defined (HAVE_STRING_H) # if ! defined (STDC_HEADERS) && defined (HAVE_MEMORY_H) # include # endif # include #endif /* !HAVE_STRING_H */ #if defined (HAVE_STRINGS_H) # include #endif /* !HAVE_STRINGS_H */ #if defined (HAVE_STDLIB_H) # include #else # include "ansi_stdlib.h" #endif /* !HAVE_STDLIB_H */ #endif /* !_BASHANSI_H_ */ ))entry(name bashintl.hnode(typeregularcontents¶/* bashintl.h -- Internationalization functions and defines. */ /* Copyright (C) 1996-2009 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_BASHINTL_H_) #define _BASHINTL_H_ #if defined (BUILDTOOL) # undef ENABLE_NLS # define ENABLE_NLS 0 #endif /* Include this *after* config.h */ #include "gettext.h" #if defined (HAVE_LOCALE_H) # include #endif #define _(msgid) gettext(msgid) #define N_(msgid) msgid #define D_(d, msgid) dgettext(d, msgid) #define P_(m1, m2, n) ngettext(m1, m2, n) #if defined (HAVE_SETLOCALE) && !defined (LC_ALL) # undef HAVE_SETLOCALE #endif #if !defined (HAVE_SETLOCALE) # define setlocale(cat, loc) #endif #if !defined (HAVE_LOCALE_H) || !defined (HAVE_LOCALECONV) # define locale_decpoint() '.' #endif #endif /* !_BASHINTL_H_ */ ))entry(name bashjmp.hnode(typeregularcontentsn/* bashjmp.h -- wrapper for setjmp.h with necessary bash definitions. */ /* Copyright (C) 1987-2009 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _BASHJMP_H_ #define _BASHJMP_H_ #include "posixjmp.h" extern procenv_t top_level; extern procenv_t subshell_top_level; extern procenv_t return_catch; /* used by `return' builtin */ extern procenv_t wait_intr_buf; extern int no_longjmp_on_fatal_error; #define SHFUNC_RETURN() sh_longjmp (return_catch, 1) #define COPY_PROCENV(old, save) \ xbcopy ((char *)old, (char *)save, sizeof (procenv_t)); /* Values for the second argument to longjmp/siglongjmp. */ #define NOT_JUMPED 0 /* Not returning from a longjmp. */ #define FORCE_EOF 1 /* We want to stop parsing. */ #define DISCARD 2 /* Discard current command. */ #define EXITPROG 3 /* Unconditionally exit the program now. */ #define ERREXIT 4 /* Exit due to error condition */ #define SIGEXIT 5 /* Exit due to fatal terminating signal */ #endif /* _BASHJMP_H_ */ ))entry(name bashtypes.hnode(typeregularcontents>/* bashtypes.h -- Bash system types. */ /* Copyright (C) 1993-2009 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_BASHTYPES_H_) # define _BASHTYPES_H_ #if defined (CRAY) # define word __word #endif #include #if defined (CRAY) # undef word #endif #if defined (HAVE_INTTYPES_H) # include #endif #if HAVE_STDINT_H # include #endif #endif /* _BASHTYPES_H_ */ ))entry(namebuiltinsnode(type directoryentry(name bashgetopt.hnode(typeregularcontentsú/* bashgetopt.h -- extern declarations for stuff defined in bashgetopt.c. */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* See getopt.h for the explanation of these variables. */ #if !defined (__BASH_GETOPT_H) # define __BASH_GETOPT_H #include #define GETOPT_EOF -1 #define GETOPT_HELP -99 extern char *list_optarg; extern int list_optopt; extern int list_opttype; extern WORD_LIST *lcurrent; extern WORD_LIST *loptend; extern int internal_getopt PARAMS((WORD_LIST *, char *)); extern void reset_internal_getopt PARAMS((void)); #endif /* !__BASH_GETOPT_H */ ))entry(name builtext.hnode(typeregularcontentsø/* builtext.h - The list of builtins found in libbuiltins.a. */ #if defined (ALIAS) extern int alias_builtin PARAMS((WORD_LIST *)); extern char * const alias_doc[]; #endif /* ALIAS */ #if defined (ALIAS) extern int unalias_builtin PARAMS((WORD_LIST *)); extern char * const unalias_doc[]; #endif /* ALIAS */ #if defined (READLINE) extern int bind_builtin PARAMS((WORD_LIST *)); extern char * const bind_doc[]; #endif /* READLINE */ extern int break_builtin PARAMS((WORD_LIST *)); extern char * const break_doc[]; extern int continue_builtin PARAMS((WORD_LIST *)); extern char * const continue_doc[]; extern int builtin_builtin PARAMS((WORD_LIST *)); extern char * const builtin_doc[]; #if defined (DEBUGGER) extern int caller_builtin PARAMS((WORD_LIST *)); extern char * const caller_doc[]; #endif /* DEBUGGER */ extern int cd_builtin PARAMS((WORD_LIST *)); extern char * const cd_doc[]; extern int pwd_builtin PARAMS((WORD_LIST *)); extern char * const pwd_doc[]; extern int colon_builtin PARAMS((WORD_LIST *)); extern char * const colon_doc[]; extern int colon_builtin PARAMS((WORD_LIST *)); extern char * const true_doc[]; extern int false_builtin PARAMS((WORD_LIST *)); extern char * const false_doc[]; extern int command_builtin PARAMS((WORD_LIST *)); extern char * const command_doc[]; extern int declare_builtin PARAMS((WORD_LIST *)); extern char * const declare_doc[]; extern int declare_builtin PARAMS((WORD_LIST *)); extern char * const typeset_doc[]; extern int local_builtin PARAMS((WORD_LIST *)); extern char * const local_doc[]; #if defined (V9_ECHO) extern int echo_builtin PARAMS((WORD_LIST *)); extern char * const echo_doc[]; #endif /* V9_ECHO */ #if !defined (V9_ECHO) extern int echo_builtin PARAMS((WORD_LIST *)); extern char * const echo_doc[]; #endif /* !V9_ECHO */ extern int enable_builtin PARAMS((WORD_LIST *)); extern char * const enable_doc[]; extern int eval_builtin PARAMS((WORD_LIST *)); extern char * const eval_doc[]; extern int getopts_builtin PARAMS((WORD_LIST *)); extern char * const getopts_doc[]; extern int exec_builtin PARAMS((WORD_LIST *)); extern char * const exec_doc[]; extern int exit_builtin PARAMS((WORD_LIST *)); extern char * const exit_doc[]; extern int logout_builtin PARAMS((WORD_LIST *)); extern char * const logout_doc[]; #if defined (HISTORY) extern int fc_builtin PARAMS((WORD_LIST *)); extern char * const fc_doc[]; #endif /* HISTORY */ #if defined (JOB_CONTROL) extern int fg_builtin PARAMS((WORD_LIST *)); extern char * const fg_doc[]; #endif /* JOB_CONTROL */ #if defined (JOB_CONTROL) extern int bg_builtin PARAMS((WORD_LIST *)); extern char * const bg_doc[]; #endif /* JOB_CONTROL */ extern int hash_builtin PARAMS((WORD_LIST *)); extern char * const hash_doc[]; #if defined (HELP_BUILTIN) extern int help_builtin PARAMS((WORD_LIST *)); extern char * const help_doc[]; #endif /* HELP_BUILTIN */ #if defined (HISTORY) extern int history_builtin PARAMS((WORD_LIST *)); extern char * const history_doc[]; #endif /* HISTORY */ #if defined (JOB_CONTROL) extern int jobs_builtin PARAMS((WORD_LIST *)); extern char * const jobs_doc[]; #endif /* JOB_CONTROL */ #if defined (JOB_CONTROL) extern int disown_builtin PARAMS((WORD_LIST *)); extern char * const disown_doc[]; #endif /* JOB_CONTROL */ extern int kill_builtin PARAMS((WORD_LIST *)); extern char * const kill_doc[]; extern int let_builtin PARAMS((WORD_LIST *)); extern char * const let_doc[]; extern int read_builtin PARAMS((WORD_LIST *)); extern char * const read_doc[]; extern int return_builtin PARAMS((WORD_LIST *)); extern char * const return_doc[]; extern int set_builtin PARAMS((WORD_LIST *)); extern char * const set_doc[]; extern int unset_builtin PARAMS((WORD_LIST *)); extern char * const unset_doc[]; extern int export_builtin PARAMS((WORD_LIST *)); extern char * const export_doc[]; extern int readonly_builtin PARAMS((WORD_LIST *)); extern char * const readonly_doc[]; extern int shift_builtin PARAMS((WORD_LIST *)); extern char * const shift_doc[]; extern int source_builtin PARAMS((WORD_LIST *)); extern char * const source_doc[]; extern int source_builtin PARAMS((WORD_LIST *)); extern char * const dot_doc[]; #if defined (JOB_CONTROL) extern int suspend_builtin PARAMS((WORD_LIST *)); extern char * const suspend_doc[]; #endif /* JOB_CONTROL */ extern int test_builtin PARAMS((WORD_LIST *)); extern char * const test_doc[]; extern int test_builtin PARAMS((WORD_LIST *)); extern char * const test_bracket_doc[]; extern int times_builtin PARAMS((WORD_LIST *)); extern char * const times_doc[]; extern int trap_builtin PARAMS((WORD_LIST *)); extern char * const trap_doc[]; extern int type_builtin PARAMS((WORD_LIST *)); extern char * const type_doc[]; #if !defined (_MINIX) extern int ulimit_builtin PARAMS((WORD_LIST *)); extern char * const ulimit_doc[]; #endif /* !_MINIX */ extern int umask_builtin PARAMS((WORD_LIST *)); extern char * const umask_doc[]; #if defined (JOB_CONTROL) extern int wait_builtin PARAMS((WORD_LIST *)); extern char * const wait_doc[]; #endif /* JOB_CONTROL */ #if !defined (JOB_CONTROL) extern int wait_builtin PARAMS((WORD_LIST *)); extern char * const wait_doc[]; #endif /* !JOB_CONTROL */ extern char * const for_doc[]; extern char * const arith_for_doc[]; extern char * const select_doc[]; extern char * const time_doc[]; extern char * const case_doc[]; extern char * const if_doc[]; extern char * const while_doc[]; extern char * const until_doc[]; extern char * const coproc_doc[]; extern char * const function_doc[]; extern char * const grouping_braces_doc[]; extern char * const fg_percent_doc[]; extern char * const arith_doc[]; extern char * const conditional_doc[]; extern char * const variable_help_doc[]; #if defined (PUSHD_AND_POPD) extern int pushd_builtin PARAMS((WORD_LIST *)); extern char * const pushd_doc[]; #endif /* PUSHD_AND_POPD */ #if defined (PUSHD_AND_POPD) extern int popd_builtin PARAMS((WORD_LIST *)); extern char * const popd_doc[]; #endif /* PUSHD_AND_POPD */ #if defined (PUSHD_AND_POPD) extern int dirs_builtin PARAMS((WORD_LIST *)); extern char * const dirs_doc[]; #endif /* PUSHD_AND_POPD */ extern int shopt_builtin PARAMS((WORD_LIST *)); extern char * const shopt_doc[]; extern int printf_builtin PARAMS((WORD_LIST *)); extern char * const printf_doc[]; #if defined (PROGRAMMABLE_COMPLETION) extern int complete_builtin PARAMS((WORD_LIST *)); extern char * const complete_doc[]; #endif /* PROGRAMMABLE_COMPLETION */ #if defined (PROGRAMMABLE_COMPLETION) extern int compgen_builtin PARAMS((WORD_LIST *)); extern char * const compgen_doc[]; #endif /* PROGRAMMABLE_COMPLETION */ #if defined (PROGRAMMABLE_COMPLETION) extern int compopt_builtin PARAMS((WORD_LIST *)); extern char * const compopt_doc[]; #endif /* PROGRAMMABLE_COMPLETION */ extern int mapfile_builtin PARAMS((WORD_LIST *)); extern char * const mapfile_doc[]; extern int mapfile_builtin PARAMS((WORD_LIST *)); extern char * const readarray_doc[]; ))entry(namecommon.hnode(typeregularcontentsu#/* common.h -- extern declarations for functions defined in common.c. */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (__COMMON_H) # define __COMMON_H #include "stdc.h" #define ISOPTION(s, c) (s[0] == '-' && s[1] == c && !s[2]) #define ISHELP(s) (STREQ ((s), "--help")) #define CHECK_HELPOPT(l) \ do { \ if ((l) && (l)->word && ISHELP((l)->word->word)) \ { \ builtin_help (); \ return (EX_USAGE); \ } \ } while (0) #define CASE_HELPOPT \ case GETOPT_HELP: \ builtin_help (); \ return (EX_USAGE) /* Flag values for parse_and_execute () */ #define SEVAL_NONINT 0x001 #define SEVAL_INTERACT 0x002 #define SEVAL_NOHIST 0x004 #define SEVAL_NOFREE 0x008 #define SEVAL_RESETLINE 0x010 #define SEVAL_PARSEONLY 0x020 #define SEVAL_NOLONGJMP 0x040 #define SEVAL_FUNCDEF 0x080 /* only allow function definitions */ #define SEVAL_ONECMD 0x100 /* only allow a single command */ #define SEVAL_NOHISTEXP 0x200 /* inhibit history expansion */ /* Flags for describe_command, shared between type.def and command.def */ #define CDESC_ALL 0x001 /* type -a */ #define CDESC_SHORTDESC 0x002 /* command -V */ #define CDESC_REUSABLE 0x004 /* command -v */ #define CDESC_TYPE 0x008 /* type -t */ #define CDESC_PATH_ONLY 0x010 /* type -p */ #define CDESC_FORCE_PATH 0x020 /* type -ap or type -P */ #define CDESC_NOFUNCS 0x040 /* type -f */ #define CDESC_ABSPATH 0x080 /* convert to absolute path, no ./ */ #define CDESC_STDPATH 0x100 /* command -p */ /* Flags for get_job_by_name */ #define JM_PREFIX 0x01 /* prefix of job name */ #define JM_SUBSTRING 0x02 /* substring of job name */ #define JM_EXACT 0x04 /* match job name exactly */ #define JM_STOPPED 0x08 /* match stopped jobs only */ #define JM_FIRSTMATCH 0x10 /* return first matching job */ /* Flags for remember_args and value of changed_dollar_vars */ #define ARGS_NONE 0x0 #define ARGS_INVOC 0x01 #define ARGS_FUNC 0x02 #define ARGS_SETBLTIN 0x04 /* Maximum number of attribute letters */ #define MAX_ATTRIBUTES 16 /* Functions from common.c */ extern void builtin_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); extern void builtin_warning PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); extern void builtin_usage PARAMS((void)); extern void no_args PARAMS((WORD_LIST *)); extern int no_options PARAMS((WORD_LIST *)); /* common error message functions */ extern void sh_needarg PARAMS((char *)); extern void sh_neednumarg PARAMS((char *)); extern void sh_notfound PARAMS((char *)); extern void sh_invalidopt PARAMS((char *)); extern void sh_invalidoptname PARAMS((char *)); extern void sh_invalidid PARAMS((char *)); extern void sh_invalidnum PARAMS((char *)); extern void sh_invalidsig PARAMS((char *)); extern void sh_erange PARAMS((char *, char *)); extern void sh_badpid PARAMS((char *)); extern void sh_badjob PARAMS((char *)); extern void sh_readonly PARAMS((const char *)); extern void sh_nojobs PARAMS((char *)); extern void sh_restricted PARAMS((char *)); extern void sh_notbuiltin PARAMS((char *)); extern void sh_wrerror PARAMS((void)); extern void sh_ttyerror PARAMS((int)); extern int sh_chkwrite PARAMS((int)); extern char **make_builtin_argv PARAMS((WORD_LIST *, int *)); extern void remember_args PARAMS((WORD_LIST *, int)); extern void shift_args PARAMS((int)); extern int number_of_args PARAMS((void)); extern int dollar_vars_changed PARAMS((void)); extern void set_dollar_vars_unchanged PARAMS((void)); extern void set_dollar_vars_changed PARAMS((void)); extern int get_numeric_arg PARAMS((WORD_LIST *, int, intmax_t *)); extern int get_exitstat PARAMS((WORD_LIST *)); extern int read_octal PARAMS((char *)); /* Keeps track of the current working directory. */ extern char *the_current_working_directory; extern char *get_working_directory PARAMS((char *)); extern void set_working_directory PARAMS((char *)); #if defined (JOB_CONTROL) extern int get_job_by_name PARAMS((const char *, int)); extern int get_job_spec PARAMS((WORD_LIST *)); #endif extern int display_signal_list PARAMS((WORD_LIST *, int)); /* It's OK to declare a function as returning a Function * without providing a definition of what a `Function' is. */ extern struct builtin *builtin_address_internal PARAMS((char *, int)); extern sh_builtin_func_t *find_shell_builtin PARAMS((char *)); extern sh_builtin_func_t *builtin_address PARAMS((char *)); extern sh_builtin_func_t *find_special_builtin PARAMS((char *)); extern void initialize_shell_builtins PARAMS((void)); /* Functions from exit.def */ extern void bash_logout PARAMS((void)); /* Functions from getopts.def */ extern void getopts_reset PARAMS((int)); /* Functions from help.def */ extern void builtin_help PARAMS((void)); /* Functions from read.def */ extern void read_tty_cleanup PARAMS((void)); extern int read_tty_modified PARAMS((void)); /* Functions from set.def */ extern int minus_o_option_value PARAMS((char *)); extern void list_minus_o_opts PARAMS((int, int)); extern char **get_minus_o_opts PARAMS((void)); extern int set_minus_o_option PARAMS((int, char *)); extern void set_shellopts PARAMS((void)); extern void parse_shellopts PARAMS((char *)); extern void initialize_shell_options PARAMS((int)); extern void reset_shell_options PARAMS((void)); extern char *get_current_options PARAMS((void)); extern void set_current_options PARAMS((const char *)); /* Functions from shopt.def */ extern void reset_shopt_options PARAMS((void)); extern char **get_shopt_options PARAMS((void)); extern int shopt_setopt PARAMS((char *, int)); extern int shopt_listopt PARAMS((char *, int)); extern int set_login_shell PARAMS((char *, int)); extern void set_bashopts PARAMS((void)); extern void parse_bashopts PARAMS((char *)); extern void initialize_bashopts PARAMS((int)); extern void set_compatibility_opts PARAMS((void)); /* Functions from type.def */ extern int describe_command PARAMS((char *, int)); /* Functions from setattr.def */ extern int set_or_show_attributes PARAMS((WORD_LIST *, int, int)); extern int show_all_var_attributes PARAMS((int, int)); extern int show_local_var_attributes PARAMS((int, int)); extern int show_var_attributes PARAMS((SHELL_VAR *, int, int)); extern int show_name_attributes PARAMS((char *, int)); extern int show_localname_attributes PARAMS((char *, int)); extern int show_func_attributes PARAMS((char *, int)); extern void set_var_attribute PARAMS((char *, int, int)); extern int var_attribute_string PARAMS((SHELL_VAR *, int, char *)); /* Functions from pushd.def */ extern char *get_dirstack_from_string PARAMS((char *)); extern char *get_dirstack_element PARAMS((intmax_t, int)); extern void set_dirstack_element PARAMS((intmax_t, int, char *)); extern WORD_LIST *get_directory_stack PARAMS((int)); /* Functions from evalstring.c */ extern int parse_and_execute PARAMS((char *, const char *, int)); extern int evalstring PARAMS((char *, const char *, int)); extern void parse_and_execute_cleanup PARAMS((int)); extern int parse_string PARAMS((char *, const char *, int, char **)); extern int should_suppress_fork PARAMS((COMMAND *)); extern int can_optimize_connection PARAMS((COMMAND *)); extern void optimize_fork PARAMS((COMMAND *)); extern void optimize_subshell_command PARAMS((COMMAND *)); extern void optimize_shell_function PARAMS((COMMAND *)); /* Functions from evalfile.c */ extern int maybe_execute_file PARAMS((const char *, int)); extern int force_execute_file PARAMS((const char *, int)); extern int source_file PARAMS((const char *, int)); extern int fc_execute_file PARAMS((const char *)); /* variables from common.c */ extern sh_builtin_func_t *this_shell_builtin; extern sh_builtin_func_t *last_shell_builtin; extern SHELL_VAR *builtin_bind_variable PARAMS((char *, char *, int)); extern int builtin_unbind_variable PARAMS((const char *)); /* variables from evalfile.c */ extern int sourcelevel; /* variables from evalstring.c */ extern int parse_and_execute_level; /* variables from break.def/continue.def */ extern int breaking; extern int continuing; extern int loop_level; /* variables from read.def */ extern int sigalrm_seen; /* variables from shift.def */ extern int print_shift_error; /* variables from source.def */ extern int source_searches_cwd; extern int source_uses_path; /* variables from wait.def */ extern int wait_intr_flag; #endif /* !__COMMON_H */ ))entry(namegetopt.hnode(typeregularcontents /* getopt.h - declarations for getopt. */ /* Copyright (C) 1989-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* XXX THIS HAS BEEN MODIFIED FOR INCORPORATION INTO BASH XXX */ #ifndef _SH_GETOPT_H #define _SH_GETOPT_H 1 #include "stdc.h" /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, the argument value is returned here. Also, when `ordering' is RETURN_IN_ORDER, each non-option ARGV-element is returned here. */ extern char *sh_optarg; /* Index in ARGV of the next element to be scanned. This is used for communication to and from the caller and for communication between successive calls to `getopt'. On entry to `getopt', zero means this is the first call; initialize. When `getopt' returns EOF, this is the index of the first of the non-option elements that the caller should itself scan. Otherwise, `sh_optind' communicates from one call to the next how much of ARGV has been scanned so far. */ extern int sh_optind; /* Callers store zero here to inhibit the error message `getopt' prints for unrecognized options. */ extern int sh_opterr; /* Set to an option character which was unrecognized. */ extern int sh_optopt; /* Set to 1 when an unrecognized option is encountered. */ extern int sh_badopt; extern int sh_getopt PARAMS((int, char *const *, const char *)); typedef struct sh_getopt_state { char *gs_optarg; int gs_optind; int gs_curopt; char *gs_nextchar; int gs_charindex; int gs_flags; } sh_getopt_state_t; extern void sh_getopt_restore_state PARAMS((char **)); extern sh_getopt_state_t *sh_getopt_alloc_istate PARAMS((void)); extern void sh_getopt_dispose_istate PARAMS((sh_getopt_state_t *)); extern sh_getopt_state_t *sh_getopt_save_istate PARAMS((void)); extern void sh_getopt_restore_istate PARAMS((sh_getopt_state_t *)); #endif /* _SH_GETOPT_H */ ))))entry(name builtins.hnode(typeregularcontentsE /* builtins.h -- What a builtin looks like, and where to find them. */ /* Copyright (C) 1987-2009 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef BUILTINS_H #define BUILTINS_H #include "config.h" #if defined (HAVE_UNISTD_H) # ifdef _MINIX # include # endif # include #endif #include "command.h" #include "general.h" #if defined (ALIAS) #include "alias.h" #endif /* Flags describing various things about a builtin. */ #define BUILTIN_ENABLED 0x01 /* This builtin is enabled. */ #define BUILTIN_DELETED 0x02 /* This has been deleted with enable -d. */ #define STATIC_BUILTIN 0x04 /* This builtin is not dynamically loaded. */ #define SPECIAL_BUILTIN 0x08 /* This is a Posix `special' builtin. */ #define ASSIGNMENT_BUILTIN 0x10 /* This builtin takes assignment statements. */ #define POSIX_BUILTIN 0x20 /* This builtins is special in the Posix command search order. */ #define LOCALVAR_BUILTIN 0x40 /* This builtin creates local variables */ #define BASE_INDENT 4 /* The thing that we build the array of builtins out of. */ struct builtin { char *name; /* The name that the user types. */ sh_builtin_func_t *function; /* The address of the invoked function. */ int flags; /* One of the #defines above. */ char * const *long_doc; /* NULL terminated array of strings. */ const char *short_doc; /* Short version of documentation. */ char *handle; /* for future use */ }; /* Found in builtins.c, created by builtins/mkbuiltins. */ extern int num_shell_builtins; /* Number of shell builtins. */ extern struct builtin static_shell_builtins[]; extern struct builtin *shell_builtins; extern struct builtin *current_builtin; #endif /* BUILTINS_H */ ))entry(name command.hnode(typeregularcontentsó=/* command.h -- The structures used internally to represent commands, and the extern declarations of the functions used to create them. */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_COMMAND_H_) #define _COMMAND_H_ #include "stdc.h" /* Instructions describing what kind of thing to do for a redirection. */ enum r_instruction { r_output_direction, r_input_direction, r_inputa_direction, r_appending_to, r_reading_until, r_reading_string, r_duplicating_input, r_duplicating_output, r_deblank_reading_until, r_close_this, r_err_and_out, r_input_output, r_output_force, r_duplicating_input_word, r_duplicating_output_word, r_move_input, r_move_output, r_move_input_word, r_move_output_word, r_append_err_and_out }; /* Redirection flags; values for rflags */ #define REDIR_VARASSIGN 0x01 /* Redirection errors. */ #define AMBIGUOUS_REDIRECT -1 #define NOCLOBBER_REDIRECT -2 #define RESTRICTED_REDIRECT -3 /* can only happen in restricted shells. */ #define HEREDOC_REDIRECT -4 /* here-doc temp file can't be created */ #define BADVAR_REDIRECT -5 /* something wrong with {varname}redir */ #define CLOBBERING_REDIRECT(ri) \ (ri == r_output_direction || ri == r_err_and_out) #define OUTPUT_REDIRECT(ri) \ (ri == r_output_direction || ri == r_input_output || ri == r_err_and_out || ri == r_append_err_and_out) #define INPUT_REDIRECT(ri) \ (ri == r_input_direction || ri == r_inputa_direction || ri == r_input_output) #define WRITE_REDIRECT(ri) \ (ri == r_output_direction || \ ri == r_input_output || \ ri == r_err_and_out || \ ri == r_appending_to || \ ri == r_append_err_and_out || \ ri == r_output_force) /* redirection needs translation */ #define TRANSLATE_REDIRECT(ri) \ (ri == r_duplicating_input_word || ri == r_duplicating_output_word || \ ri == r_move_input_word || ri == r_move_output_word) /* Command Types: */ enum command_type { cm_for, cm_case, cm_while, cm_if, cm_simple, cm_select, cm_connection, cm_function_def, cm_until, cm_group, cm_arith, cm_cond, cm_arith_for, cm_subshell, cm_coproc }; /* Possible values for the `flags' field of a WORD_DESC. */ #define W_HASDOLLAR (1 << 0) /* Dollar sign present. */ #define W_QUOTED (1 << 1) /* Some form of quote character is present. */ #define W_ASSIGNMENT (1 << 2) /* This word is a variable assignment. */ #define W_SPLITSPACE (1 << 3) /* Split this word on " " regardless of IFS */ #define W_NOSPLIT (1 << 4) /* Do not perform word splitting on this word because ifs is empty string. */ #define W_NOGLOB (1 << 5) /* Do not perform globbing on this word. */ #define W_NOSPLIT2 (1 << 6) /* Don't split word except for $@ expansion (using spaces) because context does not allow it. */ #define W_TILDEEXP (1 << 7) /* Tilde expand this assignment word */ #define W_DOLLARAT (1 << 8) /* $@ and its special handling -- UNUSED */ #define W_DOLLARSTAR (1 << 9) /* $* and its special handling -- UNUSED */ #define W_NOCOMSUB (1 << 10) /* Don't perform command substitution on this word */ #define W_ASSIGNRHS (1 << 11) /* Word is rhs of an assignment statement */ #define W_NOTILDE (1 << 12) /* Don't perform tilde expansion on this word */ #define W_ITILDE (1 << 13) /* Internal flag for word expansion */ #define W_EXPANDRHS (1 << 14) /* Expanding word in ${paramOPword} */ #define W_COMPASSIGN (1 << 15) /* Compound assignment */ #define W_ASSNBLTIN (1 << 16) /* word is a builtin command that takes assignments */ #define W_ASSIGNARG (1 << 17) /* word is assignment argument to command */ #define W_HASQUOTEDNULL (1 << 18) /* word contains a quoted null character */ #define W_DQUOTE (1 << 19) /* word should be treated as if double-quoted */ #define W_NOPROCSUB (1 << 20) /* don't perform process substitution */ #define W_SAWQUOTEDNULL (1 << 21) /* word contained a quoted null that was removed */ #define W_ASSIGNASSOC (1 << 22) /* word looks like associative array assignment */ #define W_ASSIGNARRAY (1 << 23) /* word looks like a compound indexed array assignment */ #define W_ARRAYIND (1 << 24) /* word is an array index being expanded */ #define W_ASSNGLOBAL (1 << 25) /* word is a global assignment to declare (declare/typeset -g) */ #define W_NOBRACE (1 << 26) /* Don't perform brace expansion */ #define W_COMPLETE (1 << 27) /* word is being expanded for completion */ #define W_CHKLOCAL (1 << 28) /* check for local vars on assignment */ #define W_NOASSNTILDE (1 << 29) /* don't do tilde expansion like an assignment statement */ #define W_FORCELOCAL (1 << 30) /* force assignments to be to local variables, non-fatal on assignment errors */ /* Flags for the `pflags' argument to param_expand() and various parameter_brace_expand_xxx functions; also used for string_list_dollar_at */ #define PF_NOCOMSUB 0x01 /* Do not perform command substitution */ #define PF_IGNUNBOUND 0x02 /* ignore unbound vars even if -u set */ #define PF_NOSPLIT2 0x04 /* same as W_NOSPLIT2 */ #define PF_ASSIGNRHS 0x08 /* same as W_ASSIGNRHS */ #define PF_COMPLETE 0x10 /* same as W_COMPLETE, sets SX_COMPLETE */ #define PF_EXPANDRHS 0x20 /* same as W_EXPANDRHS */ #define PF_ALLINDS 0x40 /* array, act as if [@] was supplied */ /* Possible values for subshell_environment */ #define SUBSHELL_ASYNC 0x01 /* subshell caused by `command &' */ #define SUBSHELL_PAREN 0x02 /* subshell caused by ( ... ) */ #define SUBSHELL_COMSUB 0x04 /* subshell caused by `command` or $(command) */ #define SUBSHELL_FORK 0x08 /* subshell caused by executing a disk command */ #define SUBSHELL_PIPE 0x10 /* subshell from a pipeline element */ #define SUBSHELL_PROCSUB 0x20 /* subshell caused by <(command) or >(command) */ #define SUBSHELL_COPROC 0x40 /* subshell from a coproc pipeline */ #define SUBSHELL_RESETTRAP 0x80 /* subshell needs to reset trap strings on first call to trap */ #define SUBSHELL_IGNTRAP 0x100 /* subshell should reset trapped signals from trap_handler */ /* A structure which represents a word. */ typedef struct word_desc { char *word; /* Zero terminated string. */ int flags; /* Flags associated with this word. */ } WORD_DESC; /* A linked list of words. */ typedef struct word_list { struct word_list *next; WORD_DESC *word; } WORD_LIST; /* **************************************************************** */ /* */ /* Shell Command Structs */ /* */ /* **************************************************************** */ /* What a redirection descriptor looks like. If the redirection instruction is ri_duplicating_input or ri_duplicating_output, use DEST, otherwise use the file in FILENAME. Out-of-range descriptors are identified by a negative DEST. */ typedef union { int dest; /* Place to redirect REDIRECTOR to, or ... */ WORD_DESC *filename; /* filename to redirect to. */ } REDIRECTEE; /* Structure describing a redirection. If REDIRECTOR is negative, the parser (or translator in redir.c) encountered an out-of-range file descriptor. */ typedef struct redirect { struct redirect *next; /* Next element, or NULL. */ REDIRECTEE redirector; /* Descriptor or varname to be redirected. */ int rflags; /* Private flags for this redirection */ int flags; /* Flag value for `open'. */ enum r_instruction instruction; /* What to do with the information. */ REDIRECTEE redirectee; /* File descriptor or filename */ char *here_doc_eof; /* The word that appeared in <flags. */ #define CMD_WANT_SUBSHELL 0x01 /* User wants a subshell: ( command ) */ #define CMD_FORCE_SUBSHELL 0x02 /* Shell needs to force a subshell. */ #define CMD_INVERT_RETURN 0x04 /* Invert the exit value. */ #define CMD_IGNORE_RETURN 0x08 /* Ignore the exit value. For set -e. */ #define CMD_NO_FUNCTIONS 0x10 /* Ignore functions during command lookup. */ #define CMD_INHIBIT_EXPANSION 0x20 /* Do not expand the command words. */ #define CMD_NO_FORK 0x40 /* Don't fork; just call execve */ #define CMD_TIME_PIPELINE 0x80 /* Time a pipeline */ #define CMD_TIME_POSIX 0x100 /* time -p; use POSIX.2 time output spec. */ #define CMD_AMPERSAND 0x200 /* command & */ #define CMD_STDIN_REDIR 0x400 /* async command needs implicit . */ /*********************************************************/ /* Modify or set defines based on the configure results. */ /*********************************************************/ #if !defined (HAVE_VPRINTF) && defined (HAVE_DOPRNT) # define USE_VFPRINTF_EMULATION # define HAVE_VPRINTF #endif #if defined (HAVE_SYS_RESOURCE_H) && defined (HAVE_GETRLIMIT) # define HAVE_RESOURCE #endif #if !defined (GETPGRP_VOID) # define HAVE_BSD_PGRP #endif /* Try this without testing __STDC__ for the time being. */ #if defined (HAVE_STDARG_H) # define PREFER_STDARG # define USE_VARARGS #else # if defined (HAVE_VARARGS_H) # define PREFER_VARARGS # define USE_VARARGS # endif #endif #if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H) # define HAVE_NETWORK #endif #if defined (HAVE_REGEX_H) && defined (HAVE_REGCOMP) && defined (HAVE_REGEXEC) # define HAVE_POSIX_REGEXP #endif /* backwards compatibility between different autoconf versions */ #if HAVE_DECL_SYS_SIGLIST && !defined (SYS_SIGLIST_DECLARED) # define SYS_SIGLIST_DECLARED #endif /***********************************************************************/ /* Unset defines based on what configure reports as missing or broken. */ /***********************************************************************/ /* Ultrix botches type-ahead when switching from canonical to non-canonical mode, at least through version 4.3 */ #if !defined (HAVE_TERMIOS_H) || !defined (HAVE_TCGETATTR) || defined (ultrix) # define TERMIOS_MISSING #endif /* If we have a getcwd(3), but one that does not dynamically allocate memory, #undef HAVE_GETCWD so the replacement in getcwd.c will be built. We do not do this on Solaris, because their implementation of loopback mounts breaks the traditional file system assumptions that getcwd uses. */ #if defined (HAVE_GETCWD) && defined (GETCWD_BROKEN) && !defined (SOLARIS) # undef HAVE_GETCWD #endif #if !defined (HAVE_DEV_FD) && defined (NAMED_PIPES_MISSING) # undef PROCESS_SUBSTITUTION #endif #if defined (JOB_CONTROL_MISSING) # undef JOB_CONTROL #endif #if defined (STRCOLL_BROKEN) # undef HAVE_STRCOLL #endif #if !defined (HAVE_POSIX_REGEXP) # undef COND_REGEXP #endif #if !HAVE_MKSTEMP # undef USE_MKSTEMP #endif #if !HAVE_MKDTEMP # undef USE_MKDTMP #endif /* If the shell is called by this name, it will become restricted. */ #if defined (RESTRICTED_SHELL) # define RESTRICTED_SHELL_NAME "rbash" #endif /***********************************************************/ /* Make sure feature defines have necessary prerequisites. */ /***********************************************************/ /* BANG_HISTORY requires HISTORY. */ #if defined (BANG_HISTORY) && !defined (HISTORY) # define HISTORY #endif /* BANG_HISTORY && !HISTORY */ #if defined (READLINE) && !defined (HISTORY) # define HISTORY #endif #if defined (PROGRAMMABLE_COMPLETION) && !defined (READLINE) # undef PROGRAMMABLE_COMPLETION #endif #if !defined (V9_ECHO) # undef DEFAULT_ECHO_TO_XPG #endif #if !defined (PROMPT_STRING_DECODE) # undef PPROMPT # define PPROMPT "$ " #endif #if !defined (HAVE_SYSLOG) || !defined (HAVE_SYSLOG_H) # undef SYSLOG_HISTORY #endif /************************************************/ /* check multibyte capability for I18N code */ /************************************************/ /* For platforms which support the ISO C amendment 1 functionality we support user defined character classes. */ /* Solaris 2.5 has a bug: must be included before . */ #if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) && defined (HAVE_LOCALE_H) # include # include # if defined (HAVE_ISWCTYPE) && \ defined (HAVE_ISWLOWER) && \ defined (HAVE_ISWUPPER) && \ defined (HAVE_MBSRTOWCS) && \ defined (HAVE_MBRTOWC) && \ defined (HAVE_MBRLEN) && \ defined (HAVE_TOWLOWER) && \ defined (HAVE_TOWUPPER) && \ defined (HAVE_WCHAR_T) && \ defined (HAVE_WCTYPE_T) && \ defined (HAVE_WINT_T) && \ defined (HAVE_WCWIDTH) && \ defined (HAVE_WCTYPE) /* system is supposed to support XPG5 */ # define HANDLE_MULTIBYTE 1 # endif #endif /* If we don't want multibyte chars even on a system that supports them, let the configuring user turn multibyte support off. */ #if defined (NO_MULTIBYTE_SUPPORT) # undef HANDLE_MULTIBYTE #endif /* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */ #if HANDLE_MULTIBYTE && !defined (HAVE_MBSTATE_T) # define wcsrtombs(dest, src, len, ps) (wcsrtombs) (dest, src, len, 0) # define mbsrtowcs(dest, src, len, ps) (mbsrtowcs) (dest, src, len, 0) # define wcrtomb(s, wc, ps) (wcrtomb) (s, wc, 0) # define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) # define mbrlen(s, n, ps) (mbrlen) (s, n, 0) # define mbstate_t int #endif /* Make sure MB_LEN_MAX is at least 16 (some systems define MB_LEN_MAX as 1) */ #ifdef HANDLE_MULTIBYTE # include # if defined(MB_LEN_MAX) && (MB_LEN_MAX < 16) # undef MB_LEN_MAX # endif # if !defined (MB_LEN_MAX) # define MB_LEN_MAX 16 # endif #endif /************************************************/ /* end of multibyte capability checks for I18N */ /************************************************/ /******************************************************************/ /* Placeholder for builders to #undef any unwanted features from */ /* config-top.h or created by configure (such as the default mail */ /* file for mail checking). */ /******************************************************************/ /* If you don't want bash to provide a default mail file to check. */ /* #undef DEFAULT_MAIL_DIRECTORY */ ))entry(name config-top.hnode(typeregularcontentsø/* config-top.h - various user-settable options not under the control of autoconf. */ /* Copyright (C) 2002-2009 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* Define CONTINUE_AFTER_KILL_ERROR if you want the kill command to continue processing arguments after one of them fails. This is what POSIX.2 specifies. */ #define CONTINUE_AFTER_KILL_ERROR /* Define BREAK_COMPLAINS if you want the non-standard, but useful error messages about `break' and `continue' out of context. */ #define BREAK_COMPLAINS /* Define CD_COMPLAINS if you want the non-standard, but sometimes-desired error messages about multiple directory arguments to `cd'. */ #define CD_COMPLAINS /* Define BUFFERED_INPUT if you want the shell to do its own input buffering, rather than using stdio. Do not undefine this; it's required to preserve semantics required by POSIX. */ #define BUFFERED_INPUT /* Define ONESHOT if you want sh -c 'command' to avoid forking to execute `command' whenever possible. This is a big efficiency improvement. */ #define ONESHOT /* Define V9_ECHO if you want to give the echo builtin backslash-escape interpretation using the -e option, in the style of the Bell Labs 9th Edition version of echo. You cannot emulate the System V echo behavior without this option. */ #define V9_ECHO /* Define DONT_REPORT_SIGPIPE if you don't want to see `Broken pipe' messages when a job like `cat jobs.c | exit 1' terminates due to a SIGPIPE. */ #define DONT_REPORT_SIGPIPE /* Define DONT_REPORT_SIGTERM if you don't want to see `Terminates' message when a job exits due to SIGTERM, since that's the default signal sent by the kill builtin. */ #define DONT_REPORT_SIGTERM /* Define DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS if you don't want builtins like `echo' and `printf' to report errors when output does not succeed due to EPIPE. */ /* #define DONT_REPORT_BROKEN_PIPE_WRITE_ERRORS */ /* The default value of the PATH variable. */ #ifndef DEFAULT_PATH_VALUE #define DEFAULT_PATH_VALUE \ "/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin:." #endif /* If you want to unconditionally set a value for PATH in every restricted shell, set this. */ /* #define RBASH_STATIC_PATH_VALUE "/rbin:/usr/rbin" */ /* The value for PATH when invoking `command -p'. This is only used when the Posix.2 confstr () function, or CS_PATH define are not present. */ #ifndef STANDARD_UTILS_PATH #define STANDARD_UTILS_PATH \ "/bin:/usr/bin:/sbin:/usr/sbin:/etc:/usr/etc" #endif /* Default primary and secondary prompt strings. */ #define PPROMPT "\\s-\\v\\$ " #define SPROMPT "> " /* Undefine this if you don't want the ksh-compatible behavior of reprinting the select menu after a valid choice is made only if REPLY is set to NULL in the body of the select command. The menu is always reprinted if the reply to the select query is an empty line. */ #define KSH_COMPATIBLE_SELECT /* Default interactive shell startup file. */ #define DEFAULT_BASHRC "~/.bashrc" /* System-wide .bashrc file for interactive shells. */ /* #define SYS_BASHRC "/etc/bash.bashrc" */ /* System-wide .bash_logout for login shells. */ /* #define SYS_BASH_LOGOUT "/etc/bash.bash_logout" */ /* Define this to make non-interactive shells begun with argv[0][0] == '-' run the startup files when not in posix mode. */ /* #define NON_INTERACTIVE_LOGIN_SHELLS */ /* Define this if you want bash to try to check whether it's being run by sshd and source the .bashrc if so (like the rshd behavior). This checks for the presence of SSH_CLIENT or SSH2_CLIENT in the initial environment, which can be fooled under certain not-uncommon circumstances. */ /* #define SSH_SOURCE_BASHRC */ /* Define if you want the case-toggling operators (~[~]) and the `capcase' variable attribute (declare -c). */ /* TAG: bash-5.2 disable */ #define CASEMOD_TOGGLECASE #define CASEMOD_CAPCASE /* This is used as the name of a shell function to call when a command name is not found. If you want to name it something other than the default ("command_not_found_handle"), change it here. */ /* #define NOTFOUND_HOOK "command_not_found_handle" */ /* Define if you want each line saved to the history list in bashhist.c: bash_add_history() to be sent to syslog(). */ /* #define SYSLOG_HISTORY */ #if defined (SYSLOG_HISTORY) # define SYSLOG_FACILITY LOG_USER # define SYSLOG_LEVEL LOG_INFO # define OPENLOG_OPTS LOG_PID #endif /* Define if you want syslogging history to be controllable at runtime via a shell option; if defined, the value is the default for the syslog_history shopt option */ #if defined (SYSLOG_HISTORY) /* #define SYSLOG_SHOPT 1 */ #endif /* Define if you want to include code in shell.c to support wordexp(3) */ /* #define WORDEXP_OPTION */ /* Define as 1 if you want to enable code that implements multiple coprocs executing simultaneously */ #ifndef MULTIPLE_COPROCS # define MULTIPLE_COPROCS 0 #endif /* Define to 0 if you want the checkwinsize option off by default, 1 if you want it on. */ #define CHECKWINSIZE_DEFAULT 1 /* Define to 1 if you want to optimize for sequential array assignment when using indexed arrays, 0 if you want bash-4.2 behavior, which favors random access but is O(N) for each array assignment. */ #define OPTIMIZE_SEQUENTIAL_ARRAY_ASSIGNMENT 1 /* Define to 1 if you want to be able to export indexed arrays to processes using the foo=([0]=one [1]=two) and so on */ /* #define ARRAY_EXPORT 1 */ /* Define to 1 if you want the shell to exit if it is running setuid and its attempt to drop privilege using setuid(getuid()) fails with errno == EAGAIN */ /* #define EXIT_ON_SETUID_FAILURE 1 */ /* Define to 1 if you want the shell to re-check $PATH if a hashed filename no longer exists. This behavior is the default in Posix mode. */ #define CHECKHASH_DEFAULT 0 /* Define to the maximum level of recursion you want for the eval builtin and trap handlers (since traps are run as if run by eval). 0 means the limit is not active. */ #define EVALNEST_MAX 0 /* Define to the maximum level of recursion you want for the source/. builtin. 0 means the limit is not active. */ #define SOURCENEST_MAX 0 /* Define to use libc mktemp/mkstemp instead of replacements in lib/sh/tmpfile.c */ #define USE_MKTEMP #define USE_MKSTEMP #define USE_MKDTEMP /* Define to force the value of OLDPWD inherited from the environment to be a directory */ #define OLDPWD_CHECK_DIRECTORY 1 /* Define to set the initial size of the history list ($HISTSIZE). This must be a string. */ /*#define HISTSIZE_DEFAULT "500"*/ /* Define to 0 if you want history expansion to be disabled by default in interactive shells; define to 1 for the historical behavior of enabling when the shell is interactive. */ #define HISTEXPAND_DEFAULT 1 /* Undefine or define to 0 if you don't want to allow associative array assignment using a compound list of key-value pairs. */ #define ASSOC_KVPAIR_ASSIGNMENT 1 ))entry(nameconfig.hnode(typeregularcontentsÑ€/* config.h. Generated from config.h.in by configure. */ /* config.h -- Configuration file for bash. */ /* Copyright (C) 1987-2009,2011-2012,2013-2019 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _CONFIG_H_ #define _CONFIG_H_ /* Template settings for autoconf */ #define __EXTENSIONS__ 1 #define _ALL_SOURCE 1 #define _GNU_SOURCE 1 /* #undef _POSIX_SOURCE */ /* #undef _POSIX_1_SOURCE */ #define _POSIX_PTHREAD_SEMANTICS 1 #define _TANDEM_SOURCE 1 /* #undef _MINIX */ /* Configuration feature settings controllable by autoconf. */ /* Define JOB_CONTROL if your operating system supports BSD-like job control. */ #define JOB_CONTROL 1 /* Define ALIAS if you want the alias features. */ #define ALIAS 1 /* Define PUSHD_AND_POPD if you want those commands to be compiled in. (Also the `dirs' commands.) */ #define PUSHD_AND_POPD 1 /* Define BRACE_EXPANSION if you want curly brace expansion a la Csh: foo{a,b} -> fooa foob. Even if this is compiled in (the default) you can turn it off at shell startup with `-nobraceexpansion', or during shell execution with `set +o braceexpand'. */ #define BRACE_EXPANSION 1 /* Define READLINE to get the nifty/glitzy editing features. This is on by default. You can turn it off interactively with the -nolineediting flag. */ #define READLINE 1 /* Define BANG_HISTORY if you want to have Csh style "!" history expansion. This is unrelated to READLINE. */ #define BANG_HISTORY 1 /* Define HISTORY if you want to have access to previously typed commands. If both HISTORY and READLINE are defined, you can get at the commands with line editing commands, and you can directly manipulate the history from the command line. If only HISTORY is defined, the `fc' and `history' builtins are available. */ #define HISTORY 1 /* Define this if you want completion that puts all alternatives into a brace expansion shell expression. */ #if defined (BRACE_EXPANSION) && defined (READLINE) # define BRACE_COMPLETION #endif /* BRACE_EXPANSION */ /* Define DEFAULT_ECHO_TO_XPG if you want the echo builtin to interpret the backslash-escape characters by default, like the XPG Single Unix Specification V2 for echo. This requires that V9_ECHO be defined. */ /* #undef DEFAULT_ECHO_TO_XPG */ /* Define HELP_BUILTIN if you want the `help' shell builtin and the long documentation strings compiled into the shell. */ #define HELP_BUILTIN 1 /* Define RESTRICTED_SHELL if you want the generated shell to have the ability to be a restricted one. The shell thus generated can become restricted by being run with the name "rbash", or by setting the -r flag. */ #define RESTRICTED_SHELL 1 /* Define DISABLED_BUILTINS if you want "builtin foo" to always run the shell builtin "foo", even if it has been disabled with "enable -n foo". */ /* #undef DISABLED_BUILTINS */ /* Define PROCESS_SUBSTITUTION if you want the K*rn shell-like process substitution features "<(file)". */ /* Right now, you cannot do this on machines without fully operational FIFO support. This currently include NeXT and Alliant. */ #define PROCESS_SUBSTITUTION 1 /* Define PROMPT_STRING_DECODE if you want the backslash-escaped special characters in PS1 and PS2 expanded. Variable expansion will still be performed. */ #define PROMPT_STRING_DECODE 1 /* Define SELECT_COMMAND if you want the Korn-shell style `select' command: select word in word_list; do command_list; done */ #define SELECT_COMMAND 1 /* Define COMMAND_TIMING of you want the ksh-style `time' reserved word and the ability to time pipelines, functions, and builtins. */ #define COMMAND_TIMING 1 /* Define ARRAY_VARS if you want ksh-style one-dimensional array variables. */ #define ARRAY_VARS 1 /* Define DPAREN_ARITHMETIC if you want the ksh-style ((...)) arithmetic evaluation command. */ #define DPAREN_ARITHMETIC 1 /* Define EXTENDED_GLOB if you want the ksh-style [*+@?!](patlist) extended pattern matching. */ #define EXTENDED_GLOB 1 /* Define EXTGLOB_DEFAULT to the value you'd like the extglob shell option to have by default */ #define EXTGLOB_DEFAULT 0 /* Define COND_COMMAND if you want the ksh-style [[...]] conditional command. */ #define COND_COMMAND 1 /* Define COND_REGEXP if you want extended regular expression matching and the =~ binary operator in the [[...]] conditional command. */ #define COND_REGEXP 1 /* Define COPROCESS_SUPPORT if you want support for ksh-like coprocesses and the `coproc' reserved word */ #define COPROCESS_SUPPORT 1 /* Define ARITH_FOR_COMMAND if you want the ksh93-style for (( init; test; step )) do list; done arithmetic for command. */ #define ARITH_FOR_COMMAND 1 /* Define NETWORK_REDIRECTIONS if you want /dev/(tcp|udp)/host/port to open socket connections when used in redirections */ #define NETWORK_REDIRECTIONS 1 /* Define PROGRAMMABLE_COMPLETION for the programmable completion features and the complete builtin. */ #define PROGRAMMABLE_COMPLETION 1 /* Define NO_MULTIBYTE_SUPPORT to not compile in support for multibyte characters, even if the OS supports them. */ /* #undef NO_MULTIBYTE_SUPPORT */ /* Define DEBUGGER if you want to compile in some features used only by the bash debugger. */ #define DEBUGGER 1 /* Define STRICT_POSIX if you want bash to be strictly posix.2 conformant by default (except for echo; that is controlled separately). */ /* #undef STRICT_POSIX */ /* Define MEMSCRAMBLE if you want the bash malloc and free to scramble memory contents on malloc() and free(). */ #define MEMSCRAMBLE 1 /* Define for case-modifying variable attributes; variables modified on assignment */ #define CASEMOD_ATTRS 1 /* Define for case-modifying word expansions */ #define CASEMOD_EXPANSIONS 1 /* Define to make the `direxpand' shopt option enabled by default. */ /* #undef DIRCOMPLETE_EXPAND_DEFAULT */ /* Define to make the `globasciiranges' shopt option enabled by default. */ #define GLOBASCII_DEFAULT 1 /* Define to allow functions to be imported from the environment. */ #define FUNCTION_IMPORT 1 /* Define AFS if you are using Transarc's AFS. */ /* #undef AFS */ #define ENABLE_NLS 1 /* End of configuration settings controllable by autoconf. */ /* Other settable options appear in config-top.h. */ #include "config-top.h" /* Beginning of autoconf additions. */ /* Characteristics of the C compiler */ /* #undef const */ /* #undef inline */ #define restrict __restrict /* #undef volatile */ /* Define if cpp supports the ANSI-C stringizing `#' operator */ #define HAVE_STRINGIZE 1 /* Define if the compiler supports `long double' variables. */ #define HAVE_LONG_DOUBLE 1 #define PROTOTYPES 1 #define __PROTOTYPES 1 /* #undef __CHAR_UNSIGNED__ */ /* Define if the compiler supports `long long' variables. */ #define HAVE_LONG_LONG 1 #define HAVE_UNSIGNED_LONG_LONG 1 /* The number of bytes in a int. */ #define SIZEOF_INT 4 /* The number of bytes in a long. */ #define SIZEOF_LONG 8 /* The number of bytes in a pointer to char. */ #define SIZEOF_CHAR_P 8 /* The number of bytes in a double (hopefully 8). */ #define SIZEOF_DOUBLE 8 /* The number of bytes in an `intmax_t'. */ #define SIZEOF_INTMAX_T 8 /* The number of bytes in a `long long', if we have one. */ #define SIZEOF_LONG_LONG 8 /* The number of bytes in a `wchar_t', if supported */ #define SIZEOF_WCHAR_T 4 /* System paths */ #define DEFAULT_MAIL_DIRECTORY "unknown" /* Characteristics of the system's header files and libraries that affect the compilation environment. */ /* Define if the system does not provide POSIX.1 features except with this defined. */ /* #undef _POSIX_1_SOURCE */ /* Define if you need to in order for stat and other things to work. */ /* #undef _POSIX_SOURCE */ /* Define to use GNU libc extensions */ #define _GNU_SOURCE 1 /* Define if you have the ANSI C header files. */ #define STDC_HEADERS 1 /* Memory management functions. */ /* Define if using the bash version of malloc in lib/malloc/malloc.c */ /* #undef USING_BASH_MALLOC */ /* #undef DISABLE_MALLOC_WRAPPERS */ /* Define if using alloca.c. */ /* #undef C_ALLOCA */ /* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. This function is required for alloca.c support on those systems. */ /* #undef CRAY_STACKSEG_END */ /* Define if you have alloca, as a function or macro. */ #define HAVE_ALLOCA 1 /* Define if you have and it should be used (not on Ultrix). */ #define HAVE_ALLOCA_H 1 /* Define if major/minor/makedev is defined in */ /* #undef MAJOR_IN_MAKEDEV */ /* Define if major/minor/makedev is defined in */ #define MAJOR_IN_SYSMACROS 1 /* SYSTEM TYPES */ /* Define to `long' if doesn't define. */ /* #undef off_t */ /* Define to `int' if doesn't define. */ /* #undef mode_t */ /* Define to `int' if doesn't define. */ /* #undef sigset_t */ /* Define to `int' if doesn't define. */ /* #undef pid_t */ /* Define to `short' if doesn't define. */ #define bits16_t short /* Define to `unsigned short' if doesn't define. */ #define u_bits16_t unsigned short /* Define to `int' if doesn't define. */ #define bits32_t int /* Define to `unsigned int' if doesn't define. */ #define u_bits32_t unsigned int /* Define to `double' if doesn't define. */ #define bits64_t char * /* Define to `unsigned int' if doesn't define. */ /* #undef u_int */ /* Define to `unsigned long' if doesn't define. */ /* #undef u_long */ /* Define to `int' if doesn't define. */ /* #undef ptrdiff_t */ /* Define to `unsigned' if doesn't define. */ /* #undef size_t */ /* Define to `int' if doesn't define. */ /* #undef ssize_t */ /* Define to `long' if doesn't define. */ /* #undef intmax_t */ /* Define to `unsigned long' if doesn't define. */ /* #undef uintmax_t */ /* Define to integer type wide enough to hold a pointer if doesn't define. */ /* #undef uintptr_t */ /* Define to `int' if doesn't define. */ /* #undef uid_t */ /* Define to `long' if doesn't define. */ /* #undef clock_t */ /* Define to `long' if doesn't define. */ /* #undef time_t */ /* Define to `int' if doesn't define. */ /* #undef gid_t */ /* Define to `unsigned int' if doesn't define. */ /* #undef socklen_t */ /* Define to `int' if doesn't define. */ /* #undef sig_atomic_t */ #define HAVE_MBSTATE_T 1 /* Define if you have quad_t in . */ #define HAVE_QUAD_T 1 /* Define if you have wchar_t in . */ #define HAVE_WCHAR_T 1 /* Define if you have wctype_t in . */ #define HAVE_WCTYPE_T 1 /* Define if you have wint_t in . */ #define HAVE_WINT_T 1 #define RLIMTYPE rlim_t /* Define to the type of elements in the array set by `getgroups'. Usually this is either `int' or `gid_t'. */ #define GETGROUPS_T gid_t /* Characteristics of the machine archictecture. */ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. STACK_DIRECTION > 0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward lower addresses STACK_DIRECTION = 0 => direction of growth unknown */ /* #undef STACK_DIRECTION */ /* Define if the machine architecture is big-endian. */ /* #undef WORDS_BIGENDIAN */ /* Check for the presence of certain non-function symbols in the system libraries. */ /* Define if `sys_siglist' is declared by or . */ #define HAVE_DECL_SYS_SIGLIST 0 /* #undef SYS_SIGLIST_DECLARED */ /* Define if `_sys_siglist' is declared by or . */ /* #undef UNDER_SYS_SIGLIST_DECLARED */ /* #undef HAVE_SYS_SIGLIST */ /* #undef HAVE_UNDER_SYS_SIGLIST */ #define HAVE_SYS_ERRLIST 1 /* #undef HAVE_TZNAME */ /* #undef HAVE_DECL_TZNAME */ /* Characteristics of some of the system structures. */ #define HAVE_STRUCT_DIRENT_D_INO 1 #define HAVE_STRUCT_DIRENT_D_FILENO 1 /* #undef HAVE_STRUCT_DIRENT_D_NAMLEN */ /* #undef TIOCSTAT_IN_SYS_IOCTL */ #define FIONREAD_IN_SYS_IOCTL 1 #define GWINSZ_IN_SYS_IOCTL 1 #define STRUCT_WINSIZE_IN_SYS_IOCTL 1 /* #undef TM_IN_SYS_TIME */ /* #undef STRUCT_WINSIZE_IN_TERMIOS */ /* #undef SPEED_T_IN_SYS_TYPES */ #define TERMIOS_LDISC 1 #define TERMIO_LDISC 1 #define HAVE_STRUCT_STAT_ST_BLOCKS 1 #define HAVE_STRUCT_TM_TM_ZONE 1 #define HAVE_TM_ZONE 1 #define HAVE_TIMEVAL 1 #define HAVE_STRUCT_TIMEZONE 1 #define WEXITSTATUS_OFFSET 8 #define HAVE_STRUCT_TIMESPEC 1 #define TIME_H_DEFINES_STRUCT_TIMESPEC 1 /* #undef SYS_TIME_H_DEFINES_STRUCT_TIMESPEC */ /* #undef PTHREAD_H_DEFINES_STRUCT_TIMESPEC */ #define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1 #define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1 /* #undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC */ /* #undef HAVE_STRUCT_STAT_ST_ATIMENSEC */ /* #undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC */ /* Characteristics of definitions in the system header files. */ #define HAVE_GETPW_DECLS 1 /* #undef HAVE_RESOURCE */ /* #undef HAVE_LIBC_FNM_EXTMATCH */ /* Define if you have and it defines AUDIT_USER_TTY */ #define HAVE_DECL_AUDIT_USER_TTY 1 #define HAVE_DECL_CONFSTR 1 #define HAVE_DECL_PRINTF 1 #define HAVE_DECL_SBRK 1 #define HAVE_DECL_STRCPY 1 #define HAVE_DECL_STRSIGNAL 1 #define HAVE_DECL_STRTOLD 1 /* #undef PRI_MACROS_BROKEN */ /* #undef STRTOLD_BROKEN */ /* Define if WCONTINUED is defined in system headers, but rejected by waitpid */ /* #undef WCONTINUED_BROKEN */ /* These are checked with BASH_CHECK_DECL */ #define HAVE_DECL_STRTOIMAX 1 #define HAVE_DECL_STRTOL 1 #define HAVE_DECL_STRTOLL 1 #define HAVE_DECL_STRTOUL 1 #define HAVE_DECL_STRTOULL 1 #define HAVE_DECL_STRTOUMAX 1 /* Characteristics of system calls and C library functions. */ /* Define if the `getpgrp' function takes no argument. */ #define GETPGRP_VOID 1 /* #undef NAMED_PIPES_MISSING */ /* #undef OPENDIR_NOT_ROBUST */ #define PGRP_PIPE 1 /* Define if the setvbuf function takes the buffering type as its second argument and the buffer pointer as the third, as on System V before release 3. */ /* #undef SETVBUF_REVERSED */ /* #undef STAT_MACROS_BROKEN */ #define ULIMIT_MAXFDS 1 #define CAN_REDEFINE_GETENV 1 #define HAVE_STD_PUTENV 1 #define HAVE_STD_UNSETENV 1 #define HAVE_PRINTF_A_FORMAT 1 /* #undef CTYPE_NON_ASCII */ /* Define if you have and nl_langinfo(CODESET). */ #define HAVE_LANGINFO_CODESET 1 /* Characteristics of properties exported by the kernel. */ /* Define if the kernel can exec files beginning with #! */ #define HAVE_HASH_BANG_EXEC 1 /* Define if you have the /dev/fd devices to map open files into the file system. */ #define HAVE_DEV_FD 1 /* Defined to /dev/fd or /proc/self/fd (linux). */ #define DEV_FD_PREFIX "/dev/fd/" /* Define if you have the /dev/stdin device. */ #define HAVE_DEV_STDIN 1 /* The type of iconv's `inbuf' argument */ #define ICONV_CONST /* Type and behavior of signal handling functions. */ /* Define as the return type of signal handlers (int or void). */ #define RETSIGTYPE void /* Define if return type of signal handlers is void */ #define VOID_SIGHANDLER 1 /* #undef MUST_REINSTALL_SIGHANDLERS */ /* #undef HAVE_BSD_SIGNALS */ #define HAVE_POSIX_SIGNALS 1 /* #undef HAVE_USG_SIGHOLD */ /* #undef UNUSABLE_RT_SIGNALS */ /* Presence of system and C library functions. */ /* Define if you have the arc4random function. */ #define HAVE_ARC4RANDOM 1 /* Define if you have the asprintf function. */ #define HAVE_ASPRINTF 1 /* Define if you have the bcopy function. */ #define HAVE_BCOPY 1 /* Define if you have the bzero function. */ #define HAVE_BZERO 1 /* Define if you have the chown function. */ #define HAVE_CHOWN 1 /* Define if you have the confstr function. */ #define HAVE_CONFSTR 1 /* Define if you have the dlclose function. */ #define HAVE_DLCLOSE 1 /* Define if you have the dlopen function. */ #define HAVE_DLOPEN 1 /* Define if you have the dlsym function. */ #define HAVE_DLSYM 1 /* Define if you don't have vprintf but do have _doprnt. */ /* #undef HAVE_DOPRNT */ /* Define if you have the dprintf function. */ #define HAVE_DPRINTF 1 /* Define if you have the dup2 function. */ #define HAVE_DUP2 1 /* Define if you have the eaccess function. */ #define HAVE_EACCESS 1 /* Define if you have the faccessat function. */ #define HAVE_FACCESSAT 1 /* Define if you have the fcntl function. */ #define HAVE_FCNTL 1 /* Define if you have the fnmatch function. */ #define HAVE_FNMATCH 1 /* Can fnmatch be used as a fallback to match [=equiv=] with collation weights? */ #define FNMATCH_EQUIV_FALLBACK 0 /* Define if you have the fpurge/__fpurge function. */ /* #undef HAVE_FPURGE */ #define HAVE___FPURGE 1 #define HAVE_DECL_FPURGE 0 /* Define if you have the getaddrinfo function. */ #define HAVE_GETADDRINFO 1 /* Define if you have the getcwd function. */ #define HAVE_GETCWD 1 /* Define if you have the getentropy function. */ #define HAVE_GETENTROPY 1 /* Define if you have the getdtablesize function. */ #define HAVE_GETDTABLESIZE 1 /* Define if you have the getgroups function. */ #define HAVE_GETGROUPS 1 /* Define if you have the gethostbyname function. */ #define HAVE_GETHOSTBYNAME 1 /* Define if you have the gethostname function. */ #define HAVE_GETHOSTNAME 1 /* Define if you have the getpagesize function. */ #define HAVE_GETPAGESIZE 1 /* Define if you have the getpeername function. */ #define HAVE_GETPEERNAME 1 /* Define if you have the getpwent function. */ #define HAVE_GETPWENT 1 /* Define if you have the getpwnam function. */ #define HAVE_GETPWNAM 1 /* Define if you have the getpwuid function. */ #define HAVE_GETPWUID 1 /* Define if you have the getrandom function. */ #define HAVE_GETRANDOM 1 /* Define if you have the getrlimit function. */ #define HAVE_GETRLIMIT 1 /* Define if you have the getrusage function. */ #define HAVE_GETRUSAGE 1 /* Define if you have the getservbyname function. */ #define HAVE_GETSERVBYNAME 1 /* Define if you have the getservent function. */ #define HAVE_GETSERVENT 1 /* Define if you have the gettimeofday function. */ #define HAVE_GETTIMEOFDAY 1 /* Define if you have the getwd function. */ /* #undef HAVE_GETWD */ /* Define if you have the iconv function. */ #define HAVE_ICONV 1 /* Define if you have the imaxdiv function. */ #define HAVE_IMAXDIV 1 /* Define if you have the inet_aton function. */ #define HAVE_INET_ATON 1 /* Define if you have the isascii function. */ #define HAVE_ISASCII 1 /* Define if you have the isblank function. */ #define HAVE_ISBLANK 1 /* Define if you have the isgraph function. */ #define HAVE_ISGRAPH 1 /* Define if you have the isprint function. */ #define HAVE_ISPRINT 1 /* Define if you have the isspace function. */ #define HAVE_ISSPACE 1 /* Define if you have the iswctype function. */ #define HAVE_ISWCTYPE 1 /* Define if you have the iswlower function. */ #define HAVE_ISWLOWER 1 /* Define if you have the iswupper function. */ #define HAVE_ISWUPPER 1 /* Define if you have the isxdigit function. */ #define HAVE_ISXDIGIT 1 /* Define if you have the kill function. */ #define HAVE_KILL 1 /* Define if you have the killpg function. */ #define HAVE_KILLPG 1 /* Define if you have the lstat function. */ #define HAVE_LSTAT 1 /* Define if you have the locale_charset function. */ /* #undef HAVE_LOCALE_CHARSET */ /* Define if you have the mbrlen function. */ #define HAVE_MBRLEN 1 /* Define if you have the mbrtowc function. */ #define HAVE_MBRTOWC 1 /* Define if you have the mbscasecmp function. */ /* #undef HAVE_MBSCASECMP */ /* Define if you have the mbschr function. */ /* #undef HAVE_MBSCHR */ /* Define if you have the mbscmp function. */ /* #undef HAVE_MBSCMP */ /* Define if you have the mbsnrtowcs function. */ #define HAVE_MBSNRTOWCS 1 /* Define if you have the mbsrtowcs function. */ #define HAVE_MBSRTOWCS 1 /* Define if you have the memmove function. */ #define HAVE_MEMMOVE 1 /* Define if you have the memset function. */ #define HAVE_MEMSET 1 /* Define if you have the mkdtemp function. */ #define HAVE_MKDTEMP 1 /* Define if you have the mkfifo function. */ #define HAVE_MKFIFO 1 /* Define if you have the mkstemp function. */ #define HAVE_MKSTEMP 1 /* Define if you have the pathconf function. */ #define HAVE_PATHCONF 1 /* Define if you have the pselect function. */ #define HAVE_PSELECT 1 /* Define if you have the putenv function. */ #define HAVE_PUTENV 1 /* Define if you have the raise function. */ #define HAVE_RAISE 1 /* Define if you have the random function. */ #define HAVE_RANDOM 1 /* Define if you have the readlink function. */ #define HAVE_READLINK 1 /* Define if you have the regcomp function. */ #define HAVE_REGCOMP 1 /* Define if you have the regexec function. */ #define HAVE_REGEXEC 1 /* Define if you have the rename function. */ #define HAVE_RENAME 1 /* Define if you have the sbrk function. */ #define HAVE_SBRK 1 /* Define if you have the select function. */ #define HAVE_SELECT 1 /* Define if you have the setdtablesize function. */ /* #undef HAVE_SETDTABLESIZE */ /* Define if you have the setenv function. */ #define HAVE_SETENV 1 /* Define if you have the setitimer function. */ #define HAVE_SETITIMER 1 /* Define if you have the setlinebuf function. */ #define HAVE_SETLINEBUF 1 /* Define if you have the setlocale function. */ #define HAVE_SETLOCALE 1 /* Define if you have the setostype function. */ /* #undef HAVE_SETOSTYPE */ /* Define if you have the setregid function. */ /* #undef HAVE_SETREGID */ #define HAVE_DECL_SETREGID 1 /* Define if you have the setregid function. */ #define HAVE_SETRESGID 1 /* #undef HAVE_DECL_SETRESGID */ /* Define if you have the setresuid function. */ #define HAVE_SETRESUID 1 /* #undef HAVE_DECL_SETRESUID */ /* Define if you have the setvbuf function. */ #define HAVE_SETVBUF 1 /* Define if you have the siginterrupt function. */ #define HAVE_SIGINTERRUPT 1 /* Define if you have the POSIX.1-style sigsetjmp function. */ #define HAVE_POSIX_SIGSETJMP 1 /* Define if you have the snprintf function. */ #define HAVE_SNPRINTF 1 /* Define if you have the strcasecmp function. */ #define HAVE_STRCASECMP 1 /* Define if you have the strcasestr function. */ #define HAVE_STRCASESTR 1 /* Define if you have the strchr function. */ #define HAVE_STRCHR 1 /* Define if you have the strchrnul function. */ #define HAVE_STRCHRNUL 1 /* Define if you have the strcoll function. */ #define HAVE_STRCOLL 1 /* Define if you have the strerror function. */ #define HAVE_STRERROR 1 /* Define if you have the strftime function. */ #define HAVE_STRFTIME 1 /* Define if you have the strnlen function. */ #define HAVE_STRNLEN 1 /* Define if you have the strpbrk function. */ #define HAVE_STRPBRK 1 /* Define if you have the strstr function. */ #define HAVE_STRSTR 1 /* Define if you have the strtod function. */ #define HAVE_STRTOD 1 /* Define if you have the strtoimax function. */ #define HAVE_STRTOIMAX 1 /* Define if you have the strtol function. */ #define HAVE_STRTOL 1 /* Define if you have the strtoll function. */ #define HAVE_STRTOLL 1 /* Define if you have the strtoul function. */ #define HAVE_STRTOUL 1 /* Define if you have the strtoull function. */ #define HAVE_STRTOULL 1 /* Define if you have the strtoumax function. */ #define HAVE_STRTOUMAX 1 /* Define if you have the strsignal function or macro. */ #define HAVE_STRSIGNAL 1 /* Define if you have the sysconf function. */ #define HAVE_SYSCONF 1 /* Define if you have the syslog function. */ #define HAVE_SYSLOG 1 /* Define if you have the tcgetattr function. */ #define HAVE_TCGETATTR 1 /* Define if you have the tcgetpgrp function. */ #define HAVE_TCGETPGRP 1 /* Define if you have the times function. */ #define HAVE_TIMES 1 /* Define if you have the towlower function. */ #define HAVE_TOWLOWER 1 /* Define if you have the towupper function. */ #define HAVE_TOWUPPER 1 /* Define if you have the ttyname function. */ #define HAVE_TTYNAME 1 /* Define if you have the tzset function. */ #define HAVE_TZSET 1 /* Define if you have the ulimit function. */ #define HAVE_ULIMIT 1 /* Define if you have the uname function. */ #define HAVE_UNAME 1 /* Define if you have the unsetenv function. */ #define HAVE_UNSETENV 1 /* Define if you have the vasprintf function. */ #define HAVE_VASPRINTF 1 /* Define if you have the vprintf function. */ #define HAVE_VPRINTF 1 /* Define if you have the vsnprintf function. */ #define HAVE_VSNPRINTF 1 /* Define if you have the waitpid function. */ #define HAVE_WAITPID 1 /* Define if you have the wait3 function. */ #define HAVE_WAIT3 1 /* Define if you have the wcrtomb function. */ #define HAVE_WCRTOMB 1 /* Define if you have the wcscoll function. */ #define HAVE_WCSCOLL 1 /* Define if you have the wcsdup function. */ #define HAVE_WCSDUP 1 /* Define if you have the wctype function. */ #define HAVE_WCTYPE 1 /* Define if you have the wcswidth function. */ #define HAVE_WCSWIDTH 1 /* Define if you have the wcwidth function. */ #define HAVE_WCWIDTH 1 /* and if it works */ #define WCWIDTH_BROKEN 1 /* Presence of certain system include files. */ /* Define if you have the header file. */ #define HAVE_ARPA_INET_H 1 /* Define if you have the header file. */ #define HAVE_DIRENT_H 1 /* Define if you have the header file. */ #define HAVE_DLFCN_H 1 /* Define if you have the header file. */ #define HAVE_GRP_H 1 /* Define if you have the header file. */ #define HAVE_INTTYPES_H 1 /* Define if you have the header file. */ #define HAVE_LANGINFO_H 1 /* Define if you have the header file. */ /* #undef HAVE_LIBAUDIT_H */ /* Define if you have the header file. */ /* #undef HAVE_LIBINTL_H */ /* Define if you have the header file. */ #define HAVE_LIMITS_H 1 /* Define if you have the header file. */ #define HAVE_LOCALE_H 1 /* Define if you have the header file. */ /* #undef HAVE_MBSTR_H */ /* Define if you have the header file. */ /* #undef HAVE_NDIR_H */ /* Define if you have the header file. */ #define HAVE_NETDB_H 1 /* Define if you have the header file. */ #define HAVE_NETINET_IN_H 1 /* Define if you have the header file. */ #define HAVE_PWD_H 1 /* Define if you have the header file. */ #define HAVE_REGEX_H 1 /* Define if you have the header file. */ #define HAVE_STDLIB_H 1 /* Define if you have the header file. */ #define HAVE_STDARG_H 1 /* Define if you have the header file. */ #define HAVE_STRING_H 1 /* Define if you have the header file. */ #define HAVE_STRINGS_H 1 /* Define if you have the header file. */ #define HAVE_MEMORY_H 1 /* Define if you have the header file. */ #define HAVE_STDBOOL_H 1 /* Define if you have the header file. */ #define HAVE_STDDEF_H 1 /* Define if you have the header file. */ #define HAVE_STDINT_H 1 /* Define if you have the header file. */ #define HAVE_SYSLOG_H 1 /* Define if you have the header file. */ /* #undef HAVE_SYS_DIR_H */ /* Define if you have the header file. */ #define HAVE_SYS_FILE_H 1 /* Define if you have the header file. */ #define HAVE_SYS_IOCTL_H 1 /* Define if you have the header file. */ #define HAVE_SYS_MMAN_H 1 /* Define if you have the header file. */ /* #undef HAVE_SYS_NDIR_H */ /* Define if you have the header file. */ #define HAVE_SYS_PARAM_H 1 /* Define if you have the header file. */ /* #undef HAVE_SYS_PTE_H */ /* Define if you have the header file. */ /* #undef HAVE_SYS_PTEM_H */ /* Define if you have the header file. */ #define HAVE_SYS_RANDOM_H 1 /* Define if you have the header file. */ #define HAVE_SYS_RESOURCE_H 1 /* Define if you have the header file. */ #define HAVE_SYS_SELECT_H 1 /* Define if you have the header file. */ #define HAVE_SYS_SOCKET_H 1 /* Define if you have the header file. */ #define HAVE_SYS_STAT_H 1 /* Define if you have the header file. */ /* #undef HAVE_SYS_STREAM_H */ /* Define if you have */ #define HAVE_SYS_TIME_H 1 #define TIME_WITH_SYS_TIME 1 /* Define if you have */ #define HAVE_SYS_TIMES_H 1 /* Define if you have the header file. */ #define HAVE_SYS_TYPES_H 1 /* Define if you have that is POSIX.1 compatible. */ #define HAVE_SYS_WAIT_H 1 /* Define if you have the header file. */ #define HAVE_TERMCAP_H 1 /* Define if you have the header file. */ #define HAVE_TERMIO_H 1 /* Define if you have the header file. */ #define HAVE_TERMIOS_H 1 /* Define if you have the header file. */ #define HAVE_ULIMIT_H 1 /* Define if you have the header file. */ #define HAVE_UNISTD_H 1 /* Define if you have the header file. */ /* #undef HAVE_VARARGS_H */ /* Define if you have the header file. */ #define HAVE_WCHAR_H 1 /* Define if you have the header file. */ #define HAVE_WCTYPE_H 1 /* Presence of certain system libraries. */ #define HAVE_LIBDL 1 /* #undef HAVE_LIBSUN */ /* #undef HAVE_LIBSOCKET */ /* Are we running the GNU C library, version 2.1 or later? */ /* #undef GLIBC21 */ /* Are we running SVR5 (UnixWare 7)? */ /* #undef SVR5 */ /* Are we running SVR4.2? */ /* #undef SVR4_2 */ /* Are we running some version of SVR4? */ /* #undef SVR4 */ /* Define if job control is unusable or unsupported. */ /* #undef JOB_CONTROL_MISSING */ /* Do we need to define _KERNEL to get the RLIMIT_* defines from ? */ /* #undef RLIMIT_NEEDS_KERNEL */ /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ /* Define for large files on AIX-style hosts. */ /* #undef _LARGE_FILES */ /* Do strcoll(3) and strcmp(3) give different results in the default locale? */ /* #undef STRCOLL_BROKEN */ /* #undef DUP2_BROKEN */ /* #undef GETCWD_BROKEN */ /* #undef DEV_FD_STAT_BROKEN */ /* Additional defines for configuring lib/intl, maintained by autoscan/autoheader */ /* Define if you have the header file. */ #define HAVE_ARGZ_H 1 /* Define if you have the header file. */ #define HAVE_ERRNO_H 1 /* Define if you have the header file. */ #define HAVE_FCNTL_H 1 /* Define if you have the header file. */ #define HAVE_MALLOC_H 1 /* Define if you have the header file. */ #define HAVE_STDIO_EXT_H 1 /* Define if you have the `dcgettext' function. */ #define HAVE_DCGETTEXT 1 /* Define if you have the `localeconv' function. */ #define HAVE_LOCALECONV 1 /* Define if your system has a working `malloc' function. */ /* #undef HAVE_MALLOC */ /* Define if you have the `mempcpy' function. */ #define HAVE_MEMPCPY 1 /* Define if you have a working `mmap' system call. */ #define HAVE_MMAP 1 /* Define if you have the `mremap' function. */ #define HAVE_MREMAP 1 /* Define if you have the `munmap' function. */ #define HAVE_MUNMAP 1 /* Define if you have the `nl_langinfo' function. */ /* #undef HAVE_NL_LANGINFO */ /* Define if you have the `stpcpy' function. */ #define HAVE_STPCPY 1 /* Define if you have the `strcspn' function. */ #define HAVE_STRCSPN 1 /* Define if you have the `strdup' function. */ #define HAVE_STRDUP 1 /* Define if you have the `__argz_count' function. */ #define HAVE___ARGZ_COUNT 1 /* Define if you have the `__argz_next' function. */ #define HAVE___ARGZ_NEXT 1 /* Define if you have the `__argz_stringify' function. */ #define HAVE___ARGZ_STRINGIFY 1 /* End additions for lib/intl */ #include "config-bot.h" #endif /* _CONFIG_H_ */ ))entry(name conftypes.hnode(typeregularcontents­/* conftypes.h -- defines for build and host system. */ /* Copyright (C) 2001, 2005, 2008,2009 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_CONFTYPES_H_) #define _CONFTYPES_H_ /* Placeholder for future modifications if cross-compiling or building a `fat' binary, e.g. on Apple Rhapsody. These values are used in multiple files, so they appear here. */ #if !defined (RHAPSODY) && !defined (MACOSX) # define HOSTTYPE CONF_HOSTTYPE # define OSTYPE CONF_OSTYPE # define MACHTYPE CONF_MACHTYPE #else /* RHAPSODY */ # if defined(__powerpc__) || defined(__ppc__) # define HOSTTYPE "powerpc" # elif defined(__i386__) # define HOSTTYPE "i386" # else # define HOSTTYPE CONF_HOSTTYPE # endif # define OSTYPE CONF_OSTYPE # define VENDOR CONF_VENDOR # define MACHTYPE HOSTTYPE "-" VENDOR "-" OSTYPE #endif /* RHAPSODY */ #ifndef HOSTTYPE # define HOSTTYPE "unknown" #endif #ifndef OSTYPE # define OSTYPE "unknown" #endif #ifndef MACHTYPE # define MACHTYPE "unknown" #endif #endif /* _CONFTYPES_H_ */ ))entry(name dispose_cmd.hnode(typeregularcontents/* dispose_cmd.h -- Functions appearing in dispose_cmd.c. */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_DISPOSE_CMD_H_) #define _DISPOSE_CMD_H_ #include "stdc.h" extern void dispose_command PARAMS((COMMAND *)); extern void dispose_word_desc PARAMS((WORD_DESC *)); extern void dispose_word PARAMS((WORD_DESC *)); extern void dispose_words PARAMS((WORD_LIST *)); extern void dispose_word_array PARAMS((char **)); extern void dispose_redirects PARAMS((REDIRECT *)); #if defined (COND_COMMAND) extern void dispose_cond_node PARAMS((COND_COM *)); #endif extern void dispose_function_def_contents PARAMS((FUNCTION_DEF *)); extern void dispose_function_def PARAMS((FUNCTION_DEF *)); #endif /* !_DISPOSE_CMD_H_ */ ))entry(nameerror.hnode(typeregularcontents# /* error.h -- External declarations of functions appearing in error.c. */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_ERROR_H_) #define _ERROR_H_ #include "stdc.h" /* Get the name of the shell or shell script for an error message. */ extern char *get_name_for_error PARAMS((void)); /* Report an error having to do with FILENAME. */ extern void file_error PARAMS((const char *)); /* Report a programmer's error, and abort. Pass REASON, and ARG1 ... ARG5. */ extern void programming_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); /* General error reporting. Pass FORMAT and ARG1 ... ARG5. */ extern void report_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); /* Error messages for parts of the parser that don't call report_syntax_error */ extern void parser_error PARAMS((int, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); /* Report an unrecoverable error and exit. Pass FORMAT and ARG1 ... ARG5. */ extern void fatal_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); /* Report a system error, like BSD warn(3). */ extern void sys_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); /* Report an internal error. */ extern void internal_error PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); /* Report an internal warning. */ extern void internal_warning PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); /* Report an internal informational notice. */ extern void internal_inform PARAMS((const char *, ...)) __attribute__((__format__ (printf, 1, 2))); /* Debugging functions, not enabled in released version. */ extern char *strescape PARAMS((const char *)); extern void itrace PARAMS((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2))); extern void trace PARAMS((const char *, ...)) __attribute__ ((__format__ (printf, 1, 2))); /* Report an error having to do with command parsing or execution. */ extern void command_error PARAMS((const char *, int, int, int)); extern char *command_errstr PARAMS((int)); /* Specific error message functions that eventually call report_error or internal_error. */ extern void err_badarraysub PARAMS((const char *)); extern void err_unboundvar PARAMS((const char *)); extern void err_readonly PARAMS((const char *)); #endif /* !_ERROR_H_ */ ))entry(name externs.hnode(typeregularcontentsÎN/* externs.h -- extern function declarations which do not appear in their own header file. */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* Make sure that this is included *after* config.h! */ #if !defined (_EXTERNS_H_) # define _EXTERNS_H_ #include "stdc.h" /* Functions from expr.c. */ #define EXP_EXPANDED 0x01 extern intmax_t evalexp PARAMS((char *, int, int *)); /* Functions from print_cmd.c. */ #define FUNC_MULTILINE 0x01 #define FUNC_EXTERNAL 0x02 extern char *make_command_string PARAMS((COMMAND *)); extern char *named_function_string PARAMS((char *, COMMAND *, int)); extern void print_command PARAMS((COMMAND *)); extern void print_simple_command PARAMS((SIMPLE_COM *)); extern void print_word_list PARAMS((WORD_LIST *, char *)); /* debugger support */ extern void print_for_command_head PARAMS((FOR_COM *)); #if defined (SELECT_COMMAND) extern void print_select_command_head PARAMS((SELECT_COM *)); #endif extern void print_case_command_head PARAMS((CASE_COM *)); #if defined (DPAREN_ARITHMETIC) extern void print_arith_command PARAMS((WORD_LIST *)); #endif #if defined (COND_COMMAND) extern void print_cond_command PARAMS((COND_COM *)); #endif /* set -x support */ extern void xtrace_init PARAMS((void)); #ifdef NEED_XTRACE_SET_DECL extern void xtrace_set PARAMS((int, FILE *)); #endif extern void xtrace_fdchk PARAMS((int)); extern void xtrace_reset PARAMS((void)); extern char *indirection_level_string PARAMS((void)); extern void xtrace_print_assignment PARAMS((char *, char *, int, int)); extern void xtrace_print_word_list PARAMS((WORD_LIST *, int)); extern void xtrace_print_for_command_head PARAMS((FOR_COM *)); #if defined (SELECT_COMMAND) extern void xtrace_print_select_command_head PARAMS((SELECT_COM *)); #endif extern void xtrace_print_case_command_head PARAMS((CASE_COM *)); #if defined (DPAREN_ARITHMETIC) extern void xtrace_print_arith_cmd PARAMS((WORD_LIST *)); #endif #if defined (COND_COMMAND) extern void xtrace_print_cond_term PARAMS((int, int, WORD_DESC *, char *, char *)); #endif /* Functions from shell.c. */ extern void exit_shell PARAMS((int)) __attribute__((__noreturn__)); extern void sh_exit PARAMS((int)) __attribute__((__noreturn__)); extern void subshell_exit PARAMS((int)) __attribute__((__noreturn__)); extern void set_exit_status PARAMS((int)); extern void disable_priv_mode PARAMS((void)); extern void unbind_args PARAMS((void)); #if defined (RESTRICTED_SHELL) extern int shell_is_restricted PARAMS((char *)); extern int maybe_make_restricted PARAMS((char *)); #endif extern void unset_bash_input PARAMS((int)); extern void get_current_user_info PARAMS((void)); /* Functions from eval.c. */ extern int reader_loop PARAMS((void)); extern int pretty_print_loop PARAMS((void)); extern int parse_command PARAMS((void)); extern int read_command PARAMS((void)); /* Functions from braces.c. */ #if defined (BRACE_EXPANSION) extern char **brace_expand PARAMS((char *)); #endif /* Miscellaneous functions from parse.y */ extern int yyparse PARAMS((void)); extern int return_EOF PARAMS((void)); extern void push_token PARAMS((int)); extern char *xparse_dolparen PARAMS((char *, char *, int *, int)); extern void reset_parser PARAMS((void)); extern void reset_readahead_token PARAMS((void)); extern WORD_LIST *parse_string_to_word_list PARAMS((char *, int, const char *)); extern int parser_will_prompt PARAMS((void)); extern int parser_in_command_position PARAMS((void)); extern void free_pushed_string_input PARAMS((void)); extern int parser_expanding_alias PARAMS((void)); extern void parser_save_alias PARAMS((void)); extern void parser_restore_alias PARAMS((void)); extern void clear_shell_input_line PARAMS((void)); extern char *decode_prompt_string PARAMS((char *)); extern int get_current_prompt_level PARAMS((void)); extern void set_current_prompt_level PARAMS((int)); #if defined (HISTORY) extern char *history_delimiting_chars PARAMS((const char *)); #endif /* Declarations for functions defined in locale.c */ extern void set_default_locale PARAMS((void)); extern void set_default_locale_vars PARAMS((void)); extern int set_locale_var PARAMS((char *, char *)); extern int set_lang PARAMS((char *, char *)); extern void set_default_lang PARAMS((void)); extern char *get_locale_var PARAMS((char *)); extern char *localetrans PARAMS((char *, int, int *)); extern char *mk_msgstr PARAMS((char *, int *)); extern char *localeexpand PARAMS((char *, int, int, int, int *)); #ifndef locale_decpoint extern int locale_decpoint PARAMS((void)); #endif /* Declarations for functions defined in list.c. */ extern void list_walk PARAMS((GENERIC_LIST *, sh_glist_func_t *)); extern void wlist_walk PARAMS((WORD_LIST *, sh_icpfunc_t *)); extern GENERIC_LIST *list_reverse (); extern int list_length (); extern GENERIC_LIST *list_append (); extern GENERIC_LIST *list_remove (); /* Declarations for functions defined in stringlib.c */ extern int find_string_in_alist PARAMS((char *, STRING_INT_ALIST *, int)); extern char *find_token_in_alist PARAMS((int, STRING_INT_ALIST *, int)); extern int find_index_in_alist PARAMS((char *, STRING_INT_ALIST *, int)); extern char *substring PARAMS((const char *, int, int)); extern char *strsub PARAMS((char *, char *, char *, int)); extern char *strcreplace PARAMS((char *, int, const char *, int)); extern void strip_leading PARAMS((char *)); extern void strip_trailing PARAMS((char *, int, int)); extern void xbcopy PARAMS((char *, char *, int)); /* Functions from version.c. */ extern char *shell_version_string PARAMS((void)); extern void show_shell_version PARAMS((int)); /* Functions from the bash library, lib/sh/libsh.a. These should really go into a separate include file. */ /* declarations for functions defined in lib/sh/casemod.c */ extern char *sh_modcase PARAMS((const char *, char *, int)); /* Defines for flags argument to sh_modcase. These need to agree with what's in lib/sh/casemode.c */ #define CASE_LOWER 0x0001 #define CASE_UPPER 0x0002 #define CASE_CAPITALIZE 0x0004 #define CASE_UNCAP 0x0008 #define CASE_TOGGLE 0x0010 #define CASE_TOGGLEALL 0x0020 #define CASE_UPFIRST 0x0040 #define CASE_LOWFIRST 0x0080 #define CASE_USEWORDS 0x1000 /* declarations for functions defined in lib/sh/clktck.c */ extern long get_clk_tck PARAMS((void)); /* declarations for functions defined in lib/sh/clock.c */ extern void clock_t_to_secs (); extern void print_clock_t (); /* Declarations for functions defined in lib/sh/dprintf.c */ #if !defined (HAVE_DPRINTF) extern void dprintf PARAMS((int, const char *, ...)) __attribute__((__format__ (printf, 2, 3))); #endif /* Declarations for functions defined in lib/sh/fmtulong.c */ #define FL_PREFIX 0x01 /* add 0x, 0X, or 0 prefix as appropriate */ #define FL_ADDBASE 0x02 /* add base# prefix to converted value */ #define FL_HEXUPPER 0x04 /* use uppercase when converting to hex */ #define FL_UNSIGNED 0x08 /* don't add any sign */ extern char *fmtulong PARAMS((unsigned long int, int, char *, size_t, int)); /* Declarations for functions defined in lib/sh/fmtulong.c */ #if defined (HAVE_LONG_LONG) extern char *fmtullong PARAMS((unsigned long long int, int, char *, size_t, int)); #endif /* Declarations for functions defined in lib/sh/fmtumax.c */ extern char *fmtumax PARAMS((uintmax_t, int, char *, size_t, int)); /* Declarations for functions defined in lib/sh/fnxform.c */ extern char *fnx_fromfs PARAMS((char *, size_t)); extern char *fnx_tofs PARAMS((char *, size_t)); /* Declarations for functions defined in lib/sh/fpurge.c */ #if defined NEED_FPURGE_DECL #if !HAVE_DECL_FPURGE #if HAVE_FPURGE # define fpurge _bash_fpurge #endif extern int fpurge PARAMS((FILE *stream)); #endif /* HAVE_DECL_FPURGE */ #endif /* NEED_FPURGE_DECL */ /* Declarations for functions defined in lib/sh/getcwd.c */ #if !defined (HAVE_GETCWD) extern char *getcwd PARAMS((char *, size_t)); #endif /* Declarations for functions defined in lib/sh/input_avail.c */ extern int input_avail PARAMS((int)); /* Declarations for functions defined in lib/sh/itos.c */ extern char *inttostr PARAMS((intmax_t, char *, size_t)); extern char *itos PARAMS((intmax_t)); extern char *mitos PARAMS((intmax_t)); extern char *uinttostr PARAMS((uintmax_t, char *, size_t)); extern char *uitos PARAMS((uintmax_t)); /* declarations for functions defined in lib/sh/makepath.c */ #define MP_DOTILDE 0x01 #define MP_DOCWD 0x02 #define MP_RMDOT 0x04 #define MP_IGNDOT 0x08 extern char *sh_makepath PARAMS((const char *, const char *, int)); /* declarations for functions defined in lib/sh/mbscasecmp.c */ #if !defined (HAVE_MBSCASECMP) extern char *mbscasecmp PARAMS((const char *, const char *)); #endif /* declarations for functions defined in lib/sh/mbschr.c */ #if !defined (HAVE_MBSCHR) extern char *mbschr PARAMS((const char *, int)); #endif /* declarations for functions defined in lib/sh/mbscmp.c */ #if !defined (HAVE_MBSCMP) extern char *mbscmp PARAMS((const char *, const char *)); #endif /* declarations for functions defined in lib/sh/netconn.c */ extern int isnetconn PARAMS((int)); /* declarations for functions defined in lib/sh/netopen.c */ extern int netopen PARAMS((char *)); /* Declarations for functions defined in lib/sh/oslib.c */ #if !defined (HAVE_DUP2) || defined (DUP2_BROKEN) extern int dup2 PARAMS((int, int)); #endif #if !defined (HAVE_GETDTABLESIZE) extern int getdtablesize PARAMS((void)); #endif /* !HAVE_GETDTABLESIZE */ #if !defined (HAVE_GETHOSTNAME) extern int gethostname PARAMS((char *, int)); #endif /* !HAVE_GETHOSTNAME */ extern int getmaxgroups PARAMS((void)); extern long getmaxchild PARAMS((void)); /* declarations for functions defined in lib/sh/pathcanon.c */ #define PATH_CHECKDOTDOT 0x0001 #define PATH_CHECKEXISTS 0x0002 #define PATH_HARDPATH 0x0004 #define PATH_NOALLOC 0x0008 extern char *sh_canonpath PARAMS((char *, int)); /* declarations for functions defined in lib/sh/pathphys.c */ extern char *sh_physpath PARAMS((char *, int)); extern char *sh_realpath PARAMS((const char *, char *)); /* declarations for functions defined in lib/sh/random.c */ extern int brand PARAMS((void)); extern void sbrand PARAMS((unsigned long)); /* set bash random number generator. */ extern void seedrand PARAMS((void)); /* seed generator randomly */ extern void seedrand32 PARAMS((void)); extern u_bits32_t get_urandom32 PARAMS((void)); /* declarations for functions defined in lib/sh/setlinebuf.c */ #ifdef NEED_SH_SETLINEBUF_DECL extern int sh_setlinebuf PARAMS((FILE *)); #endif /* declarations for functions defined in lib/sh/shaccess.c */ extern int sh_eaccess PARAMS((const char *, int)); /* declarations for functions defined in lib/sh/shmatch.c */ extern int sh_regmatch PARAMS((const char *, const char *, int)); /* defines for flags argument to sh_regmatch. */ #define SHMAT_SUBEXP 0x001 /* save subexpressions in SH_REMATCH */ #define SHMAT_PWARN 0x002 /* print a warning message on invalid regexp */ /* declarations for functions defined in lib/sh/shmbchar.c */ extern size_t mbstrlen PARAMS((const char *)); extern char *mbsmbchar PARAMS((const char *)); extern int sh_mbsnlen PARAMS((const char *, size_t, int)); /* declarations for functions defined in lib/sh/shquote.c */ extern char *sh_single_quote PARAMS((const char *)); extern char *sh_double_quote PARAMS((const char *)); extern char *sh_mkdoublequoted PARAMS((const char *, int, int)); extern char *sh_un_double_quote PARAMS((char *)); extern char *sh_backslash_quote PARAMS((char *, const char *, int)); extern char *sh_backslash_quote_for_double_quotes PARAMS((char *)); extern char *sh_quote_reusable PARAMS((char *, int)); extern int sh_contains_shell_metas PARAMS((const char *)); extern int sh_contains_quotes PARAMS((const char *)); /* declarations for functions defined in lib/sh/spell.c */ extern int spname PARAMS((char *, char *)); extern char *dirspell PARAMS((char *)); /* declarations for functions defined in lib/sh/strcasecmp.c */ #if !defined (HAVE_STRCASECMP) extern int strncasecmp PARAMS((const char *, const char *, size_t)); extern int strcasecmp PARAMS((const char *, const char *)); #endif /* HAVE_STRCASECMP */ /* declarations for functions defined in lib/sh/strcasestr.c */ #if ! HAVE_STRCASESTR extern char *strcasestr PARAMS((const char *, const char *)); #endif /* declarations for functions defined in lib/sh/strchrnul.c */ #if ! HAVE_STRCHRNUL extern char *strchrnul PARAMS((const char *, int)); #endif /* declarations for functions defined in lib/sh/strerror.c */ #if !defined (HAVE_STRERROR) && !defined (strerror) extern char *strerror PARAMS((int)); #endif /* declarations for functions defined in lib/sh/strftime.c */ #if !defined (HAVE_STRFTIME) && defined (NEED_STRFTIME_DECL) extern size_t strftime PARAMS((char *, size_t, const char *, const struct tm *)); #endif /* declarations for functions and structures defined in lib/sh/stringlist.c */ /* This is a general-purpose argv-style array struct. */ typedef struct _list_of_strings { char **list; int list_size; int list_len; } STRINGLIST; typedef int sh_strlist_map_func_t PARAMS((char *)); extern STRINGLIST *strlist_create PARAMS((int)); extern STRINGLIST *strlist_resize PARAMS((STRINGLIST *, int)); extern void strlist_flush PARAMS((STRINGLIST *)); extern void strlist_dispose PARAMS((STRINGLIST *)); extern int strlist_remove PARAMS((STRINGLIST *, char *)); extern STRINGLIST *strlist_copy PARAMS((STRINGLIST *)); extern STRINGLIST *strlist_merge PARAMS((STRINGLIST *, STRINGLIST *)); extern STRINGLIST *strlist_append PARAMS((STRINGLIST *, STRINGLIST *)); extern STRINGLIST *strlist_prefix_suffix PARAMS((STRINGLIST *, char *, char *)); extern void strlist_print PARAMS((STRINGLIST *, char *)); extern void strlist_walk PARAMS((STRINGLIST *, sh_strlist_map_func_t *)); extern void strlist_sort PARAMS((STRINGLIST *)); /* declarations for functions defined in lib/sh/stringvec.c */ extern char **strvec_create PARAMS((int)); extern char **strvec_resize PARAMS((char **, int)); extern char **strvec_mcreate PARAMS((int)); extern char **strvec_mresize PARAMS((char **, int)); extern void strvec_flush PARAMS((char **)); extern void strvec_dispose PARAMS((char **)); extern int strvec_remove PARAMS((char **, char *)); extern int strvec_len PARAMS((char **)); extern int strvec_search PARAMS((char **, char *)); extern char **strvec_copy PARAMS((char **)); extern int strvec_posixcmp PARAMS((char **, char **)); extern int strvec_strcmp PARAMS((char **, char **)); extern void strvec_sort PARAMS((char **, int)); extern char **strvec_from_word_list PARAMS((WORD_LIST *, int, int, int *)); extern WORD_LIST *strvec_to_word_list PARAMS((char **, int, int)); /* declarations for functions defined in lib/sh/strnlen.c */ #if !defined (HAVE_STRNLEN) extern size_t strnlen PARAMS((const char *, size_t)); #endif /* declarations for functions defined in lib/sh/strpbrk.c */ #if !defined (HAVE_STRPBRK) extern char *strpbrk PARAMS((const char *, const char *)); #endif /* declarations for functions defined in lib/sh/strtod.c */ #if !defined (HAVE_STRTOD) extern double strtod PARAMS((const char *, char **)); #endif /* declarations for functions defined in lib/sh/strtol.c */ #if !HAVE_DECL_STRTOL extern long strtol PARAMS((const char *, char **, int)); #endif /* declarations for functions defined in lib/sh/strtoll.c */ #if defined (HAVE_LONG_LONG) && !HAVE_DECL_STRTOLL extern long long strtoll PARAMS((const char *, char **, int)); #endif /* declarations for functions defined in lib/sh/strtoul.c */ #if !HAVE_DECL_STRTOUL extern unsigned long strtoul PARAMS((const char *, char **, int)); #endif /* declarations for functions defined in lib/sh/strtoull.c */ #if defined (HAVE_LONG_LONG) && !HAVE_DECL_STRTOULL extern unsigned long long strtoull PARAMS((const char *, char **, int)); #endif /* declarations for functions defined in lib/sh/strimax.c */ #if !HAVE_DECL_STRTOIMAX extern intmax_t strtoimax PARAMS((const char *, char **, int)); #endif /* declarations for functions defined in lib/sh/strumax.c */ #if !HAVE_DECL_STRTOUMAX extern uintmax_t strtoumax PARAMS((const char *, char **, int)); #endif /* declarations for functions defined in lib/sh/strtrans.c */ extern char *ansicstr PARAMS((char *, int, int, int *, int *)); extern char *ansic_quote PARAMS((char *, int, int *)); extern int ansic_shouldquote PARAMS((const char *)); extern char *ansiexpand PARAMS((char *, int, int, int *)); /* declarations for functions defined in lib/sh/timeval.c. No prototypes so we don't have to count on having a definition of struct timeval in scope when this file is included. */ extern void timeval_to_secs (); extern void print_timeval (); /* declarations for functions defined in lib/sh/tmpfile.c */ #define MT_USETMPDIR 0x0001 #define MT_READWRITE 0x0002 #define MT_USERANDOM 0x0004 #define MT_TEMPLATE 0x0008 extern char *sh_mktmpname PARAMS((char *, int)); extern int sh_mktmpfd PARAMS((char *, int, char **)); /* extern FILE *sh_mktmpfp PARAMS((char *, int, char **)); */ extern char *sh_mktmpdir PARAMS((char *, int)); /* declarations for functions defined in lib/sh/uconvert.c */ extern int uconvert PARAMS((char *, long *, long *, char **)); /* declarations for functions defined in lib/sh/ufuncs.c */ extern unsigned int falarm PARAMS((unsigned int, unsigned int)); extern unsigned int fsleep PARAMS((unsigned int, unsigned int)); /* declarations for functions defined in lib/sh/unicode.c */ extern int u32cconv PARAMS((unsigned long, char *)); extern void u32reset PARAMS((void)); /* declarations for functions defined in lib/sh/utf8.c */ extern char *utf8_mbschr PARAMS((const char *, int)); extern int utf8_mbscmp PARAMS((const char *, const char *)); extern char *utf8_mbsmbchar PARAMS((const char *)); extern int utf8_mbsnlen PARAMS((const char *, size_t, int)); extern int utf8_mblen PARAMS((const char *, size_t)); extern size_t utf8_mbstrlen PARAMS((const char *)); /* declarations for functions defined in lib/sh/wcsnwidth.c */ #if defined (HANDLE_MULTIBYTE) extern int wcsnwidth PARAMS((const wchar_t *, size_t, int)); #endif /* declarations for functions defined in lib/sh/winsize.c */ extern void get_new_window_size PARAMS((int, int *, int *)); /* declarations for functions defined in lib/sh/zcatfd.c */ extern int zcatfd PARAMS((int, int, char *)); /* declarations for functions defined in lib/sh/zgetline.c */ extern ssize_t zgetline PARAMS((int, char **, size_t *, int, int)); /* declarations for functions defined in lib/sh/zmapfd.c */ extern int zmapfd PARAMS((int, char **, char *)); /* declarations for functions defined in lib/sh/zread.c */ extern ssize_t zread PARAMS((int, char *, size_t)); extern ssize_t zreadretry PARAMS((int, char *, size_t)); extern ssize_t zreadintr PARAMS((int, char *, size_t)); extern ssize_t zreadc PARAMS((int, char *)); extern ssize_t zreadcintr PARAMS((int, char *)); extern ssize_t zreadn PARAMS((int, char *, size_t)); extern void zreset PARAMS((void)); extern void zsyncfd PARAMS((int)); /* declarations for functions defined in lib/sh/zwrite.c */ extern int zwrite PARAMS((int, char *, size_t)); /* declarations for functions defined in lib/glob/gmisc.c */ extern int match_pattern_char PARAMS((char *, char *, int)); extern int umatchlen PARAMS((char *, size_t)); #if defined (HANDLE_MULTIBYTE) extern int match_pattern_wchar PARAMS((wchar_t *, wchar_t *, int)); extern int wmatchlen PARAMS((wchar_t *, size_t)); #endif #endif /* _EXTERNS_H_ */ ))entry(name general.hnode(typeregularcontentsS0/* general.h -- defines that everybody likes to use. */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_GENERAL_H_) #define _GENERAL_H_ #include "stdc.h" #include "bashtypes.h" #include "chartypes.h" #if defined (HAVE_SYS_RESOURCE_H) && defined (RLIMTYPE) # if defined (HAVE_SYS_TIME_H) # include # endif # include #endif #if defined (HAVE_STRING_H) # include #else # include #endif /* !HAVE_STRING_H */ #if defined (HAVE_LIMITS_H) # include #endif #include "xmalloc.h" /* NULL pointer type. */ #if !defined (NULL) # if defined (__STDC__) # define NULL ((void *) 0) # else # define NULL 0x0 # endif /* !__STDC__ */ #endif /* !NULL */ /* Hardly used anymore */ #define pointer_to_int(x) (int)((char *)x - (char *)0) #if defined (alpha) && defined (__GNUC__) && !defined (strchr) && !defined (__STDC__) extern char *strchr (), *strrchr (); #endif #if !defined (strcpy) && (defined (HAVE_DECL_STRCPY) && !HAVE_DECL_STRCPY) extern char *strcpy PARAMS((char *, const char *)); #endif #if !defined (savestring) # define savestring(x) (char *)strcpy (xmalloc (1 + strlen (x)), (x)) #endif #ifndef member # define member(c, s) ((c) ? ((char *)mbschr ((s), (c)) != (char *)NULL) : 0) #endif #ifndef whitespace #define whitespace(c) (((c) == ' ') || ((c) == '\t')) #endif #ifndef CHAR_MAX # ifdef __CHAR_UNSIGNED__ # define CHAR_MAX 0xff # else # define CHAR_MAX 0x7f # endif #endif #ifndef CHAR_BIT # define CHAR_BIT 8 #endif /* Nonzero if the integer type T is signed. */ #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) /* The width in bits of the integer type or expression T. Padding bits are not supported; this is checked at compile-time below. */ #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) /* Bound on length of the string representing an unsigned integer value representable in B bits. log10 (2.0) < 146/485. The smallest value of B where this bound is not tight is 2621. */ #define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485) /* Bound on length of the string representing an integer value of type T. Subtract one for the sign bit if T is signed; 302 / 1000 is log10 (2) rounded up; add one for integer division truncation; add one more for a minus sign if t is signed. */ #define INT_STRLEN_BOUND(t) \ ((TYPE_WIDTH (t) - TYPE_SIGNED (t)) * 302 / 1000 \ + 1 + TYPE_SIGNED (t)) /* Updated version adapted from gnulib/intprops.h, not used right now. Changes the approximation of log10(2) from 302/1000 to 146/485. */ #if 0 #define INT_STRLEN_BOUND(t) \ (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - TYPE_SIGNED (t)) + TYPE_SIGNED(t)) #endif /* Bound on buffer size needed to represent an integer type or expression T, including the terminating null. */ #define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1) /* Define exactly what a legal shell identifier consists of. */ #define legal_variable_starter(c) (ISALPHA(c) || (c == '_')) #define legal_variable_char(c) (ISALNUM(c) || c == '_') /* Definitions used in subst.c and by the `read' builtin for field splitting. */ #define spctabnl(c) ((c) == ' ' || (c) == '\t' || (c) == '\n') /* All structs which contain a `next' field should have that field as the first field in the struct. This means that functions can be written to handle the general case for linked lists. */ typedef struct g_list { struct g_list *next; } GENERIC_LIST; /* Here is a generic structure for associating character strings with integers. It is used in the parser for shell tokenization. */ typedef struct { char *word; int token; } STRING_INT_ALIST; /* A macro to avoid making an unnecessary function call. */ #define REVERSE_LIST(list, type) \ ((list && list->next) ? (type)list_reverse ((GENERIC_LIST *)list) \ : (type)(list)) #if __GNUC__ > 1 # define FASTCOPY(s, d, n) __builtin_memcpy ((d), (s), (n)) #else /* !__GNUC__ */ # if !defined (HAVE_BCOPY) # if !defined (HAVE_MEMMOVE) # define FASTCOPY(s, d, n) memcpy ((d), (s), (n)) # else # define FASTCOPY(s, d, n) memmove ((d), (s), (n)) # endif /* !HAVE_MEMMOVE */ # else /* HAVE_BCOPY */ # define FASTCOPY(s, d, n) bcopy ((s), (d), (n)) # endif /* HAVE_BCOPY */ #endif /* !__GNUC__ */ /* String comparisons that possibly save a function call each. */ #define STREQ(a, b) ((a)[0] == (b)[0] && strcmp(a, b) == 0) #define STREQN(a, b, n) ((n == 0) ? (1) \ : ((a)[0] == (b)[0] && strncmp(a, b, n) == 0)) /* More convenience definitions that possibly save system or libc calls. */ #define STRLEN(s) (((s) && (s)[0]) ? ((s)[1] ? ((s)[2] ? strlen(s) : 2) : 1) : 0) #define FREE(s) do { if (s) free (s); } while (0) #define MEMBER(c, s) (((c) && c == (s)[0] && !(s)[1]) || (member(c, s))) /* A fairly hairy macro to check whether an allocated string has more room, and to resize it using xrealloc if it does not. STR is the string (char *) CIND is the current index into the string (int) ROOM is the amount of additional room we need in the string (int) CSIZE is the currently-allocated size of STR (int) SINCR is how much to increment CSIZE before calling xrealloc (int) */ #define RESIZE_MALLOCED_BUFFER(str, cind, room, csize, sincr) \ do { \ if ((cind) + (room) >= csize) \ { \ while ((cind) + (room) >= csize) \ csize += (sincr); \ str = xrealloc (str, csize); \ } \ } while (0) /* Function pointers can be declared as (Function *)foo. */ #if !defined (_FUNCTION_DEF) # define _FUNCTION_DEF typedef int Function (); typedef void VFunction (); typedef char *CPFunction (); /* no longer used */ typedef char **CPPFunction (); /* no longer used */ #endif /* _FUNCTION_DEF */ #ifndef SH_FUNCTION_TYPEDEF # define SH_FUNCTION_TYPEDEF /* Shell function typedefs with prototypes */ /* `Generic' function pointer typedefs */ typedef int sh_intfunc_t PARAMS((int)); typedef int sh_ivoidfunc_t PARAMS((void)); typedef int sh_icpfunc_t PARAMS((char *)); typedef int sh_icppfunc_t PARAMS((char **)); typedef int sh_iptrfunc_t PARAMS((PTR_T)); typedef void sh_voidfunc_t PARAMS((void)); typedef void sh_vintfunc_t PARAMS((int)); typedef void sh_vcpfunc_t PARAMS((char *)); typedef void sh_vcppfunc_t PARAMS((char **)); typedef void sh_vptrfunc_t PARAMS((PTR_T)); typedef int sh_wdesc_func_t PARAMS((WORD_DESC *)); typedef int sh_wlist_func_t PARAMS((WORD_LIST *)); typedef int sh_glist_func_t PARAMS((GENERIC_LIST *)); typedef char *sh_string_func_t PARAMS((char *)); /* like savestring, et al. */ typedef int sh_msg_func_t PARAMS((const char *, ...)); /* printf(3)-like */ typedef void sh_vmsg_func_t PARAMS((const char *, ...)); /* printf(3)-like */ /* Specific function pointer typedefs. Most of these could be done with #defines. */ typedef void sh_sv_func_t PARAMS((char *)); /* sh_vcpfunc_t */ typedef void sh_free_func_t PARAMS((PTR_T)); /* sh_vptrfunc_t */ typedef void sh_resetsig_func_t PARAMS((int)); /* sh_vintfunc_t */ typedef int sh_ignore_func_t PARAMS((const char *)); /* sh_icpfunc_t */ typedef int sh_assign_func_t PARAMS((const char *)); typedef int sh_wassign_func_t PARAMS((WORD_DESC *, int)); typedef int sh_load_func_t PARAMS((char *)); typedef void sh_unload_func_t PARAMS((char *)); typedef int sh_builtin_func_t PARAMS((WORD_LIST *)); /* sh_wlist_func_t */ #endif /* SH_FUNCTION_TYPEDEF */ #define NOW ((time_t) time ((time_t *) 0)) #define GETTIME(tv) gettimeofday(&(tv), NULL) /* Some defines for calling file status functions. */ #define FS_EXISTS 0x1 #define FS_EXECABLE 0x2 #define FS_EXEC_PREFERRED 0x4 #define FS_EXEC_ONLY 0x8 #define FS_DIRECTORY 0x10 #define FS_NODIRS 0x20 #define FS_READABLE 0x40 /* Default maximum for move_to_high_fd */ #define HIGH_FD_MAX 256 /* The type of function passed as the fourth argument to qsort(3). */ #ifdef __STDC__ typedef int QSFUNC (const void *, const void *); #else typedef int QSFUNC (); #endif /* Some useful definitions for Unix pathnames. Argument convention: x == string, c == character */ #if !defined (__CYGWIN__) # define ABSPATH(x) ((x)[0] == '/') # define RELPATH(x) ((x)[0] != '/') #else /* __CYGWIN__ */ # define ABSPATH(x) (((x)[0] && ISALPHA((unsigned char)(x)[0]) && (x)[1] == ':') || ISDIRSEP((x)[0])) # define RELPATH(x) (ABSPATH(x) == 0) #endif /* __CYGWIN__ */ #define ROOTEDPATH(x) (ABSPATH(x)) #define DIRSEP '/' #if !defined (__CYGWIN__) # define ISDIRSEP(c) ((c) == '/') #else # define ISDIRSEP(c) ((c) == '/' || (c) == '\\') #endif /* __CYGWIN__ */ #define PATHSEP(c) (ISDIRSEP(c) || (c) == 0) #define DOT_OR_DOTDOT(s) (s[0] == '.' && (s[1] == 0 || (s[1] == '.' && s[2] == 0))) #if defined (HANDLE_MULTIBYTE) #define WDOT_OR_DOTDOT(w) (w[0] == L'.' && (w[1] == L'\0' || (w[1] == L'.' && w[2] == L'\0'))) #endif #if 0 /* Declarations for functions defined in xmalloc.c */ extern PTR_T xmalloc PARAMS((size_t)); extern PTR_T xrealloc PARAMS((void *, size_t)); extern void xfree PARAMS((void *)); #endif /* Declarations for functions defined in general.c */ extern void posix_initialize PARAMS((int)); extern int num_posix_options PARAMS((void)); extern char *get_posix_options PARAMS((char *)); extern void set_posix_options PARAMS((const char *)); extern void save_posix_options PARAMS((void)); #if defined (RLIMTYPE) extern RLIMTYPE string_to_rlimtype PARAMS((char *)); extern void print_rlimtype PARAMS((RLIMTYPE, int)); #endif extern int all_digits PARAMS((const char *)); extern int legal_number PARAMS((const char *, intmax_t *)); extern int legal_identifier PARAMS((const char *)); extern int importable_function_name PARAMS((const char *, size_t)); extern int exportable_function_name PARAMS((const char *)); extern int check_identifier PARAMS((WORD_DESC *, int)); extern int valid_nameref_value PARAMS((const char *, int)); extern int check_selfref PARAMS((const char *, char *, int)); extern int legal_alias_name PARAMS((const char *, int)); extern int line_isblank PARAMS((const char *)); extern int assignment PARAMS((const char *, int)); extern int sh_unset_nodelay_mode PARAMS((int)); extern int sh_setclexec PARAMS((int)); extern int sh_validfd PARAMS((int)); extern int fd_ispipe PARAMS((int)); extern void check_dev_tty PARAMS((void)); extern int move_to_high_fd PARAMS((int, int, int)); extern int check_binary_file PARAMS((const char *, int)); #ifdef _POSIXSTAT_H_ extern int same_file PARAMS((const char *, const char *, struct stat *, struct stat *)); #endif extern int sh_openpipe PARAMS((int *)); extern int sh_closepipe PARAMS((int *)); extern int file_exists PARAMS((const char *)); extern int file_isdir PARAMS((const char *)); extern int file_iswdir PARAMS((const char *)); extern int path_dot_or_dotdot PARAMS((const char *)); extern int absolute_pathname PARAMS((const char *)); extern int absolute_program PARAMS((const char *)); extern char *make_absolute PARAMS((const char *, const char *)); extern char *base_pathname PARAMS((char *)); extern char *full_pathname PARAMS((char *)); extern char *polite_directory_format PARAMS((char *)); extern char *trim_pathname PARAMS((char *, int)); extern char *printable_filename PARAMS((char *, int)); extern char *extract_colon_unit PARAMS((char *, int *)); extern void tilde_initialize PARAMS((void)); extern char *bash_tilde_find_word PARAMS((const char *, int, int *)); extern char *bash_tilde_expand PARAMS((const char *, int)); extern int group_member PARAMS((gid_t)); extern char **get_group_list PARAMS((int *)); extern int *get_group_array PARAMS((int *)); extern char *conf_standard_path PARAMS((void)); extern int default_columns PARAMS((void)); #endif /* _GENERAL_H_ */ ))entry(name hashlib.hnode(typeregularcontents /* hashlib.h -- the data structures used in hashing in Bash. */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_HASHLIB_H_) #define _HASHLIB_H_ #include "stdc.h" #ifndef PTR_T # ifdef __STDC__ # define PTR_T void * # else # define PTR_T char * # endif #endif typedef struct bucket_contents { struct bucket_contents *next; /* Link to next hashed key in this bucket. */ char *key; /* What we look up. */ PTR_T data; /* What we really want. */ unsigned int khash; /* What key hashes to */ int times_found; /* Number of times this item has been found. */ } BUCKET_CONTENTS; typedef struct hash_table { BUCKET_CONTENTS **bucket_array; /* Where the data is kept. */ int nbuckets; /* How many buckets does this table have. */ int nentries; /* How many entries does this table have. */ } HASH_TABLE; typedef int hash_wfunc PARAMS((BUCKET_CONTENTS *)); /* Operations on tables as a whole */ extern HASH_TABLE *hash_create PARAMS((int)); extern HASH_TABLE *hash_copy PARAMS((HASH_TABLE *, sh_string_func_t *)); extern void hash_flush PARAMS((HASH_TABLE *, sh_free_func_t *)); extern void hash_dispose PARAMS((HASH_TABLE *)); extern void hash_walk PARAMS((HASH_TABLE *, hash_wfunc *)); /* Operations to extract information from or pieces of tables */ extern int hash_bucket PARAMS((const char *, HASH_TABLE *)); extern int hash_size PARAMS((HASH_TABLE *)); /* Operations on hash table entries */ extern BUCKET_CONTENTS *hash_search PARAMS((const char *, HASH_TABLE *, int)); extern BUCKET_CONTENTS *hash_insert PARAMS((char *, HASH_TABLE *, int)); extern BUCKET_CONTENTS *hash_remove PARAMS((const char *, HASH_TABLE *, int)); /* Miscellaneous */ extern unsigned int hash_string PARAMS((const char *)); /* Redefine the function as a macro for speed. */ #define hash_items(bucket, table) \ ((table && (bucket < table->nbuckets)) ? \ table->bucket_array[bucket] : \ (BUCKET_CONTENTS *)NULL) /* Default number of buckets in the hash table. */ #define DEFAULT_HASH_BUCKETS 128 /* must be power of two */ #define HASH_ENTRIES(ht) ((ht) ? (ht)->nentries : 0) /* flags for hash_search and hash_insert */ #define HASH_NOSRCH 0x01 #define HASH_CREATE 0x02 #if !defined (NULL) # if defined (__STDC__) # define NULL ((void *) 0) # else # define NULL 0x0 # endif /* !__STDC__ */ #endif /* !NULL */ #endif /* _HASHLIB_H */ ))entry(nameincludenode(type directoryentry(name ansi_stdlib.hnode(typeregularcontents/* ansi_stdlib.h -- An ANSI Standard stdlib.h. */ /* A minimal stdlib.h containing extern declarations for those functions that bash uses. */ /* Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_STDLIB_H_) #define _STDLIB_H_ 1 /* String conversion functions. */ extern int atoi (); extern double atof (); extern double strtod (); /* Memory allocation functions. */ /* Generic pointer type. */ #ifndef PTR_T #if defined (__STDC__) # define PTR_T void * #else # define PTR_T char * #endif #endif /* PTR_T */ extern PTR_T malloc (); extern PTR_T realloc (); extern void free (); /* Other miscellaneous functions. */ extern void abort (); extern void exit (); extern char *getenv (); extern void qsort (); #endif /* _STDLIB_H */ ))entry(name chartypes.hnode(typeregularcontents/* chartypes.h -- extend ctype.h */ /* Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _SH_CHARTYPES_H #define _SH_CHARTYPES_H #include /* Jim Meyering writes: "... Some ctype macros are valid only for character codes that isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when using /bin/cc or gcc but without giving an ansi option). So, all ctype uses should be through macros like ISPRINT... If STDC_HEADERS is defined, then autoconf has verified that the ctype macros don't need to be guarded with references to isascii. ... Defining IN_CTYPE_DOMAIN to 1 should let any compiler worth its salt eliminate the && through constant folding." Solaris defines some of these symbols so we must undefine them first. */ #if STDC_HEADERS || (!defined (isascii) && !HAVE_ISASCII) # define IN_CTYPE_DOMAIN(c) 1 #else # define IN_CTYPE_DOMAIN(c) isascii(c) #endif #if !defined (isspace) && !defined (HAVE_ISSPACE) # define isspace(c) ((c) == ' ' || (c) == '\t' || (c) == '\n' || (c) == '\f') #endif #if !defined (isprint) && !defined (HAVE_ISPRINT) # define isprint(c) (isalpha((unsigned char)c) || isdigit((unsigned char)c) || ispunct((unsigned char)c)) #endif #if defined (isblank) || defined (HAVE_ISBLANK) # define ISBLANK(c) (IN_CTYPE_DOMAIN (c) && isblank ((unsigned char)c)) #else # define ISBLANK(c) ((c) == ' ' || (c) == '\t') #endif #if defined (isgraph) || defined (HAVE_ISGRAPH) # define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isgraph (c)) #else # define ISGRAPH(c) (IN_CTYPE_DOMAIN (c) && isprint ((unsigned char)c) && !isspace ((unsigned char)c)) #endif #if !defined (isxdigit) && !defined (HAVE_ISXDIGIT) # define isxdigit(c) (((c) >= '0' && (c) <= '9') || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) #endif #undef ISPRINT #define ISPRINT(c) (IN_CTYPE_DOMAIN (c) && isprint ((unsigned char)c)) #define ISDIGIT(c) (IN_CTYPE_DOMAIN (c) && isdigit ((unsigned char)c)) #define ISALNUM(c) (IN_CTYPE_DOMAIN (c) && isalnum ((unsigned char)c)) #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha ((unsigned char)c)) #define ISCNTRL(c) (IN_CTYPE_DOMAIN (c) && iscntrl ((unsigned char)c)) #define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower ((unsigned char)c)) #define ISPUNCT(c) (IN_CTYPE_DOMAIN (c) && ispunct ((unsigned char)c)) #define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace ((unsigned char)c)) #define ISUPPER(c) (IN_CTYPE_DOMAIN (c) && isupper ((unsigned char)c)) #define ISXDIGIT(c) (IN_CTYPE_DOMAIN (c) && isxdigit ((unsigned char)c)) #define ISLETTER(c) (ISALPHA(c)) #define DIGIT(c) ((c) >= '0' && (c) <= '9') #define ISWORD(c) (ISLETTER(c) || DIGIT(c) || ((c) == '_')) #define HEXVALUE(c) \ (((c) >= 'a' && (c) <= 'f') \ ? (c)-'a'+10 \ : (c) >= 'A' && (c) <= 'F' ? (c)-'A'+10 : (c)-'0') #ifndef ISOCTAL # define ISOCTAL(c) ((c) >= '0' && (c) <= '7') #endif #define OCTVALUE(c) ((c) - '0') #define TODIGIT(c) ((c) - '0') #define TOCHAR(c) ((c) + '0') #define TOLOWER(c) (ISUPPER(c) ? tolower(c) : (c)) #define TOUPPER(c) (ISLOWER(c) ? toupper(c) : (c)) #ifndef TOCTRL /* letter to control char -- ASCII. The TOUPPER is in there so \ce and \cE will map to the same character in $'...' expansions. */ # define TOCTRL(x) ((x) == '?' ? 0x7f : (TOUPPER(x) & 0x1f)) #endif #ifndef UNCTRL /* control char to letter -- ASCII */ # define UNCTRL(x) (TOUPPER(x) ^ 0x40) #endif #endif /* _SH_CHARTYPES_H */ ))entry(name filecntl.hnode(typeregularcontents-/* filecntl.h - Definitions to set file descriptors to close-on-exec. */ /* Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_FILECNTL_H_) #define _FILECNTL_H_ #include /* Definitions to set file descriptors to close-on-exec, the Posix way. */ #if !defined (FD_CLOEXEC) #define FD_CLOEXEC 1 #endif #define FD_NCLOEXEC 0 #define SET_CLOSE_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_CLOEXEC)) #define SET_OPEN_ON_EXEC(fd) (fcntl ((fd), F_SETFD, FD_NCLOEXEC)) /* How to open a file in non-blocking mode, the Posix.1 way. */ #if !defined (O_NONBLOCK) # if defined (O_NDELAY) # define O_NONBLOCK O_NDELAY # else # define O_NONBLOCK 0 # endif #endif /* Make sure O_BINARY and O_TEXT are defined to avoid Windows-specific code. */ #if !defined (O_BINARY) # define O_BINARY 0 #endif #if !defined (O_TEXT) # define O_TEXT 0 #endif #endif /* ! _FILECNTL_H_ */ ))entry(name gettext.hnode(typeregularcontentsÆ /* Convenience header for conditional use of GNU . Copyright (C) 1995-1998, 2000-2002, 2008,2009 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne-Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _LIBGETTEXT_H #define _LIBGETTEXT_H 1 /* NLS can be disabled through the configure --disable-nls option. */ #if ENABLE_NLS /* Get declarations of GNU message catalog functions. */ # include #else /* Solaris /usr/include/locale.h includes /usr/include/libintl.h, which chokes if dcgettext is defined as a macro. So include it now, to make later inclusions of a NOP. We don't include as well because people using "gettext.h" will not include , and also including would fail on SunOS 4, whereas is OK. */ #if defined(__sun) # include #endif /* Disabled NLS. The casts to 'const char *' serve the purpose of producing warnings for invalid uses of the value returned from these functions. On pre-ANSI systems without 'const', the config.h file is supposed to contain "#define const". */ # define gettext(Msgid) ((const char *) (Msgid)) # define dgettext(Domainname, Msgid) ((const char *) (Msgid)) # define dcgettext(Domainname, Msgid, Category) ((const char *) (Msgid)) # define ngettext(Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dngettext(Domainname, Msgid1, Msgid2, N) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define dcngettext(Domainname, Msgid1, Msgid2, N, Category) \ ((N) == 1 ? (const char *) (Msgid1) : (const char *) (Msgid2)) # define textdomain(Domainname) ((const char *) (Domainname)) # define bindtextdomain(Domainname, Dirname) ((const char *) (Dirname)) # define bind_textdomain_codeset(Domainname, Codeset) ((const char *) (Codeset)) #endif /* A pseudo function call that serves as a marker for the automated extraction of messages, but does not call gettext(). The run-time translation is done at a different place in the code. The argument, String, should be a literal string. Concatenated strings and other string expressions won't work. The macro's expansion is not parenthesized, so that it is suitable as initializer for static 'char[]' or 'const char[]' variables. */ #define gettext_noop(String) String #endif /* _LIBGETTEXT_H */ ))entry(name maxpath.hnode(typeregularcontentsA/* maxpath.h - Find out what this system thinks PATH_MAX and NAME_MAX are. */ /* Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_MAXPATH_H_) #define _MAXPATH_H_ /* These values are supposed to be in or one of the files it includes. */ #if defined (HAVE_LIMITS_H) # include #endif /* !HAVE_LIMITS_H */ /* If PATH_MAX is not defined, look for MAXPATHLEN */ #if !defined (PATH_MAX) # if defined (HAVE_SYS_PARAM_H) # include # define maxpath_param_h # endif # if defined (MAXPATHLEN) && !defined (PATH_MAX) # define PATH_MAX MAXPATHLEN # endif /* MAXPATHLEN && !PATH_MAX */ #endif /* !PATH_MAX */ /* If NAME_MAX is not defined, look for MAXNAMLEN */ #if !defined (NAME_MAX) # if defined (HAVE_SYS_PARAM_H) && !defined (maxpath_param_h) # include # endif # if defined (MAXNAMLEN) && !defined (NAME_MAX) # define NAME_MAX MAXNAMLEN # endif /* MAXNAMLEN && !NAME_MAX */ #endif /* !NAME_MAX */ /* Default POSIX values */ #if !defined (PATH_MAX) && defined (_POSIX_PATH_MAX) # define PATH_MAX _POSIX_PATH_MAX #endif #if !defined (NAME_MAX) && defined (_POSIX_NAME_MAX) # define NAME_MAX _POSIX_NAME_MAX #endif /* Default values */ #if !defined (PATH_MAX) # define PATH_MAX 1024 #endif #if !defined (NAME_MAX) # define NAME_MAX 14 #endif #if PATH_MAX < 1024 # undef PATH_MAX # define PATH_MAX 1024 #endif #endif /* _MAXPATH_H_ */ ))entry(name memalloc.hnode(typeregularcontentsÊ/* memalloc.h -- consolidate code for including alloca.h or malloc.h and defining alloca. */ /* Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_MEMALLOC_H_) # define _MEMALLOC_H_ #if defined (sparc) && defined (sun) && !defined (HAVE_ALLOCA_H) # define HAVE_ALLOCA_H #endif #if defined (__GNUC__) && !defined (HAVE_ALLOCA) # define HAVE_ALLOCA #endif #if defined (HAVE_ALLOCA_H) && !defined (HAVE_ALLOCA) && !defined (C_ALLOCA) # define HAVE_ALLOCA #endif /* HAVE_ALLOCA_H && !HAVE_ALLOCA */ #if defined (__GNUC__) && !defined (C_ALLOCA) # undef alloca # define alloca __builtin_alloca #else /* !__GNUC__ || C_ALLOCA */ # if defined (HAVE_ALLOCA_H) && !defined (C_ALLOCA) # if defined (IBMESA) # include # else /* !IBMESA */ # include # endif /* !IBMESA */ # else /* !HAVE_ALLOCA_H || C_ALLOCA */ # if defined (__hpux) && defined (__STDC__) && !defined (alloca) extern void *alloca (); # else # if !defined (alloca) # if defined (__STDC__) extern void *alloca (size_t); # else extern char *alloca (); # endif /* !__STDC__ */ # endif /* !alloca */ # endif /* !__hpux || !__STDC__ && !alloca */ # endif /* !HAVE_ALLOCA_H || C_ALLOCA */ #endif /* !__GNUC__ || C_ALLOCA */ #endif /* _MEMALLOC_H_ */ ))entry(nameocache.hnode(typeregularcontentsU/* ocache.h -- a minimal object caching implementation. */ /* Copyright (C) 2002 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_OCACHE_H_) #define _OCACHE_H_ 1 #ifndef PTR_T #if defined (__STDC__) # define PTR_T void * #else # define PTR_T char * #endif #endif /* PTR_T */ #define OC_MEMSET(memp, xch, nbytes) \ do { \ if ((nbytes) <= 32) { \ register char * mzp = (char *)(memp); \ unsigned long mctmp = (nbytes); \ register long mcn; \ if (mctmp < 8) mcn = 0; else { mcn = (mctmp-1)/8; mctmp &= 7; } \ switch (mctmp) { \ case 0: for(;;) { *mzp++ = xch; \ case 7: *mzp++ = xch; \ case 6: *mzp++ = xch; \ case 5: *mzp++ = xch; \ case 4: *mzp++ = xch; \ case 3: *mzp++ = xch; \ case 2: *mzp++ = xch; \ case 1: *mzp++ = xch; if(mcn <= 0) break; mcn--; } \ } \ } else \ memset ((memp), (xch), (nbytes)); \ } while(0) typedef struct objcache { PTR_T data; int cs; /* cache size, number of objects */ int nc; /* number of cache entries */ } sh_obj_cache_t; /* Create an object cache C of N pointers to OTYPE. */ #define ocache_create(c, otype, n) \ do { \ (c).data = xmalloc((n) * sizeof (otype *)); \ (c).cs = (n); \ (c).nc = 0; \ } while (0) /* Destroy an object cache C. */ #define ocache_destroy(c) \ do { \ if ((c).data) \ xfree ((c).data); \ (c).data = 0; \ (c).cs = (c).nc = 0; \ } while (0) /* Free all cached items, which are pointers to OTYPE, in object cache C. */ #define ocache_flush(c, otype) \ do { \ while ((c).nc > 0) \ xfree (((otype **)((c).data))[--(c).nc]); \ } while (0) /* * Allocate a new item of type pointer to OTYPE, using data from object * cache C if any cached items exist, otherwise calling xmalloc. Return * the object in R. */ #define ocache_alloc(c, otype, r) \ do { \ if ((c).nc > 0) { \ (r) = (otype *)((otype **)((c).data))[--(c).nc]; \ } else \ (r) = (otype *)xmalloc (sizeof (otype)); \ } while (0) /* * Free an item R of type pointer to OTYPE, adding to object cache C if * there is room and calling xfree if the cache is full. If R is added * to the object cache, the contents are scrambled. */ #define ocache_free(c, otype, r) \ do { \ if ((c).nc < (c).cs) { \ OC_MEMSET ((r), 0xdf, sizeof(otype)); \ ((otype **)((c).data))[(c).nc++] = (r); \ } else \ xfree (r); \ } while (0) /* * One may declare and use an object cache as (for instance): * * sh_obj_cache_t wdcache = {0, 0, 0}; * sh_obj_cache_t wlcache = {0, 0, 0}; * * ocache_create(wdcache, WORD_DESC, 30); * ocache_create(wlcache, WORD_LIST, 30); * * WORD_DESC *wd; * ocache_alloc (wdcache, WORD_DESC, wd); * * WORD_LIST *wl; * ocache_alloc (wlcache, WORD_LIST, wl); * * ocache_free(wdcache, WORD_DESC, wd); * ocache_free(wlcache, WORD_LIST, wl); * * The use is almost arbitrary. */ #endif /* _OCACHE_H */ ))entry(name posixdir.hnode(typeregularcontents /* posixdir.h -- Posix directory reading includes and defines. */ /* Copyright (C) 1987,1991,2012 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* This file should be included instead of or . */ #if !defined (_POSIXDIR_H_) #define _POSIXDIR_H_ #if defined (HAVE_DIRENT_H) # include # if defined (HAVE_STRUCT_DIRENT_D_NAMLEN) # define D_NAMLEN(d) ((d)->d_namlen) # else # define D_NAMLEN(d) (strlen ((d)->d_name)) # endif /* !HAVE_STRUCT_DIRENT_D_NAMLEN */ #else # if defined (HAVE_SYS_NDIR_H) # include # endif # if defined (HAVE_SYS_DIR_H) # include # endif # if defined (HAVE_NDIR_H) # include # endif # if !defined (dirent) # define dirent direct # endif /* !dirent */ # define D_NAMLEN(d) ((d)->d_namlen) #endif /* !HAVE_DIRENT_H */ /* The bash code fairly consistently uses d_fileno; make sure it's available */ #if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (HAVE_STRUCT_DIRENT_D_FILENO) # define d_fileno d_ino #endif /* Posix does not require that the d_ino field be present, and some systems do not provide it. */ #if !defined (HAVE_STRUCT_DIRENT_D_INO) || defined (BROKEN_DIRENT_D_INO) # define REAL_DIR_ENTRY(dp) 1 #else # define REAL_DIR_ENTRY(dp) (dp->d_ino != 0) #endif /* _POSIX_SOURCE */ #if defined (HAVE_STRUCT_DIRENT_D_INO) && !defined (BROKEN_DIRENT_D_INO) # define D_INO_AVAILABLE #endif /* Signal the rest of the code that it can safely use dirent.d_fileno */ #if defined (D_INO_AVAILABLE) || defined (HAVE_STRUCT_DIRENT_D_FILENO) # define D_FILENO_AVAILABLE 1 #endif #endif /* !_POSIXDIR_H_ */ ))entry(name posixjmp.hnode(typeregularcontents/* posixjmp.h -- wrapper for setjmp.h with changes for POSIX systems. */ /* Copyright (C) 1987,1991-2015 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _POSIXJMP_H_ #define _POSIXJMP_H_ #include /* This *must* be included *after* config.h */ #if defined (HAVE_POSIX_SIGSETJMP) # define procenv_t sigjmp_buf # define setjmp_nosigs(x) sigsetjmp((x), 0) # define setjmp_sigs(x) sigsetjmp((x), 1) # define _rl_longjmp(x, n) siglongjmp((x), (n)) # define sh_longjmp(x, n) siglongjmp((x), (n)) #else # define procenv_t jmp_buf # define setjmp_nosigs setjmp # define setjmp_sigs setjmp # define _rl_longjmp(x, n) longjmp((x), (n)) # define sh_longjmp(x, n) longjmp((x), (n)) #endif #endif /* _POSIXJMP_H_ */ ))entry(name posixstat.hnode(typeregularcontentsÄ/* posixstat.h -- Posix stat(2) definitions for systems that don't have them. */ /* Copyright (C) 1987-2019 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* This file should be included instead of . It relies on the local sys/stat.h to work though. */ #if !defined (_POSIXSTAT_H_) #define _POSIXSTAT_H_ #include #if defined (STAT_MACROS_BROKEN) # undef S_ISBLK # undef S_ISCHR # undef S_ISDIR # undef S_ISFIFO # undef S_ISREG # undef S_ISLNK #endif /* STAT_MACROS_BROKEN */ /* These are guaranteed to work only on isc386 */ #if !defined (S_IFDIR) && !defined (S_ISDIR) # define S_IFDIR 0040000 #endif /* !S_IFDIR && !S_ISDIR */ #if !defined (S_IFMT) # define S_IFMT 0170000 #endif /* !S_IFMT */ /* Posix 1003.1 5.6.1.1 file types */ /* Some Posix-wannabe systems define _S_IF* macros instead of S_IF*, but do not provide the S_IS* macros that Posix requires. */ #if defined (_S_IFMT) && !defined (S_IFMT) #define S_IFMT _S_IFMT #endif #if defined (_S_IFIFO) && !defined (S_IFIFO) #define S_IFIFO _S_IFIFO #endif #if defined (_S_IFCHR) && !defined (S_IFCHR) #define S_IFCHR _S_IFCHR #endif #if defined (_S_IFDIR) && !defined (S_IFDIR) #define S_IFDIR _S_IFDIR #endif #if defined (_S_IFBLK) && !defined (S_IFBLK) #define S_IFBLK _S_IFBLK #endif #if defined (_S_IFREG) && !defined (S_IFREG) #define S_IFREG _S_IFREG #endif #if defined (_S_IFLNK) && !defined (S_IFLNK) #define S_IFLNK _S_IFLNK #endif #if defined (_S_IFSOCK) && !defined (S_IFSOCK) #define S_IFSOCK _S_IFSOCK #endif /* Test for each symbol individually and define the ones necessary (some systems claiming Posix compatibility define some but not all). */ #if defined (S_IFBLK) && !defined (S_ISBLK) #define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK) /* block device */ #endif #if defined (S_IFCHR) && !defined (S_ISCHR) #define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR) /* character device */ #endif #if defined (S_IFDIR) && !defined (S_ISDIR) #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR) /* directory */ #endif #if defined (S_IFREG) && !defined (S_ISREG) #define S_ISREG(m) (((m)&S_IFMT) == S_IFREG) /* file */ #endif #if defined (S_IFIFO) && !defined (S_ISFIFO) #define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO) /* fifo - named pipe */ #endif #if defined (S_IFLNK) && !defined (S_ISLNK) #define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK) /* symbolic link */ #endif #if defined (S_IFSOCK) && !defined (S_ISSOCK) #define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK) /* socket */ #endif /* * POSIX 1003.1 5.6.1.2 File Modes */ #if !defined (S_IRWXU) # if !defined (S_IREAD) # define S_IREAD 00400 # define S_IWRITE 00200 # define S_IEXEC 00100 # endif /* S_IREAD */ # if !defined (S_IRUSR) # define S_IRUSR S_IREAD /* read, owner */ # define S_IWUSR S_IWRITE /* write, owner */ # define S_IXUSR S_IEXEC /* execute, owner */ # define S_IRGRP (S_IREAD >> 3) /* read, group */ # define S_IWGRP (S_IWRITE >> 3) /* write, group */ # define S_IXGRP (S_IEXEC >> 3) /* execute, group */ # define S_IROTH (S_IREAD >> 6) /* read, other */ # define S_IWOTH (S_IWRITE >> 6) /* write, other */ # define S_IXOTH (S_IEXEC >> 6) /* execute, other */ # endif /* !S_IRUSR */ # define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) #else /* !S_IRWXU */ /* S_IRWXU is defined, but "group" and "other" bits might not be (happens in certain versions of MinGW). */ # if !defined (S_IRGRP) # define S_IRGRP (S_IREAD >> 3) /* read, group */ # define S_IWGRP (S_IWRITE >> 3) /* write, group */ # define S_IXGRP (S_IEXEC >> 3) /* execute, group */ # endif /* !S_IRGRP */ # if !defined (S_IROTH) # define S_IROTH (S_IREAD >> 6) /* read, other */ # define S_IWOTH (S_IWRITE >> 6) /* write, other */ # define S_IXOTH (S_IEXEC >> 6) /* execute, other */ # endif /* !S_IROTH */ # if !defined (S_IRWXG) # define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) # endif # if !defined (S_IRWXO) # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) # endif #endif /* !S_IRWXU */ /* These are non-standard, but are used in builtins.c$symbolic_umask() */ #define S_IRUGO (S_IRUSR | S_IRGRP | S_IROTH) #define S_IWUGO (S_IWUSR | S_IWGRP | S_IWOTH) #define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH) #endif /* _POSIXSTAT_H_ */ ))entry(name posixtime.hnode(typeregularcontents“/* posixtime.h -- wrapper for time.h, sys/times.h mess. */ /* Copyright (C) 1999 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _POSIXTIME_H_ #define _POSIXTIME_H_ /* include this after config.h */ /* Some systems require this, mostly for the definition of `struct timezone'. For example, Dynix/ptx has that definition in rather than sys/time.h */ #if defined (TIME_WITH_SYS_TIME) # include # include #else # if defined (HAVE_SYS_TIME_H) # include # else # include # endif #endif #if !defined (HAVE_SYSCONF) || !defined (_SC_CLK_TCK) # if !defined (CLK_TCK) # if defined (HZ) # define CLK_TCK HZ # else # define CLK_TCK 60 /* 60HZ */ # endif # endif /* !CLK_TCK */ #endif /* !HAVE_SYSCONF && !_SC_CLK_TCK */ #if !HAVE_TIMEVAL struct timeval { time_t tv_sec; long int tv_usec; }; #endif #if !HAVE_GETTIMEOFDAY extern int gettimeofday PARAMS((struct timeval *, void *)); #endif #endif /* _POSIXTIME_H_ */ ))entry(name posixwait.hnode(typeregularcontentsX /* posixwait.h -- job control definitions from POSIX 1003.1 */ /* Copyright (C) 1997 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_POSIXWAIT_H_) # define _POSIXWAIT_H_ /* If _POSIX_VERSION is not defined, we assume that defines a `union wait' and various macros used to manipulate it. Look in unionwait.h for the things we expect to find. */ #if defined (HAVE_SYS_WAIT_H) # include #else /* !HAVE_SYS_WAIT_H */ # if !defined (_POSIX_VERSION) # include "unionwait.h" # endif #endif /* !HAVE_SYS_WAIT_H */ /* How to get the status of a job. For Posix, this is just an int, but for other systems we have to crack the union wait. */ #if !defined (_POSIX_VERSION) typedef union wait WAIT; # define WSTATUS(t) (t.w_status) #else /* _POSIX_VERSION */ typedef int WAIT; # define WSTATUS(t) (t) #endif /* _POSIX_VERSION */ /* Make sure that parameters to wait3 are defined. */ #if !defined (WNOHANG) # define WNOHANG 1 # define WUNTRACED 2 #endif /* WNOHANG */ /* More Posix P1003.1 definitions. In the POSIX versions, the parameter is passed as an `int', in the non-POSIX version, as `union wait'. */ #if defined (_POSIX_VERSION) # if !defined (WSTOPSIG) # define WSTOPSIG(s) ((s) >> 8) # endif /* !WSTOPSIG */ # if !defined (WTERMSIG) # define WTERMSIG(s) ((s) & 0177) # endif /* !WTERMSIG */ # if !defined (WEXITSTATUS) # define WEXITSTATUS(s) ((s) >> 8) # endif /* !WEXITSTATUS */ # if !defined (WIFSTOPPED) # define WIFSTOPPED(s) (((s) & 0177) == 0177) # endif /* !WIFSTOPPED */ # if !defined (WIFEXITED) # define WIFEXITED(s) (((s) & 0377) == 0) # endif /* !WIFEXITED */ # if !defined (WIFSIGNALED) # define WIFSIGNALED(s) (!WIFSTOPPED(s) && !WIFEXITED(s)) # endif /* !WIFSIGNALED */ # if !defined (WIFCORED) # if defined (WCOREDUMP) # define WIFCORED(s) (WCOREDUMP(s)) # else # define WIFCORED(s) ((s) & 0200) # endif # endif /* !WIFCORED */ #else /* !_POSIX_VERSION */ # if !defined (WSTOPSIG) # define WSTOPSIG(s) ((s).w_stopsig) # endif /* !WSTOPSIG */ # if !defined (WTERMSIG) # define WTERMSIG(s) ((s).w_termsig) # endif /* !WTERMSIG */ # if !defined (WEXITSTATUS) # define WEXITSTATUS(s) ((s).w_retcode) # endif /* !WEXITSTATUS */ # if !defined (WIFCORED) # define WIFCORED(s) ((s).w_coredump) # endif /* !WIFCORED */ #endif /* !_POSIX_VERSION */ #endif /* !_POSIXWAIT_H_ */ ))entry(name shmbchar.hnode(typeregularcontentsß/* Multibyte character data type. Copyright (C) 2001, 2005-2007, 2009-2010 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by Bruno Haible . */ #ifndef _SHMBCHAR_H #define _SHMBCHAR_H 1 #if defined (HANDLE_MULTIBYTE) #include /* Tru64 with Desktop Toolkit C has a bug: must be included before . BSD/OS 4.1 has a bug: and must be included before . */ #include #include #include #include /* is_basic(c) tests whether the single-byte character c is in the ISO C "basic character set". */ #if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126) /* The character set is ISO-646, not EBCDIC. */ # define IS_BASIC_ASCII 1 extern const unsigned int is_basic_table[]; static inline int is_basic (char c) { return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) & 1; } #else static inline int is_basic (char c) { switch (c) { case '\b': case '\r': case '\n': case '\t': case '\v': case '\f': case ' ': case '!': case '"': case '#': case '%': case '&': case '\'': case '(': case ')': case '*': case '+': case ',': case '-': case '.': case '/': case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': case ':': case ';': case '<': case '=': case '>': case '?': case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': case '[': case '\\': case ']': case '^': case '_': case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g': case 'h': case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': case 'o': case 'p': case 'q': case 'r': case 's': case 't': case 'u': case 'v': case 'w': case 'x': case 'y': case 'z': case '{': case '|': case '}': case '~': return 1; default: return 0; } } #endif #endif /* HANDLE_MULTIBYTE */ #endif /* _SHMBCHAR_H */ ))entry(name shmbutil.hnode(typeregularcontentsu6/* shmbutil.h -- utility functions for multibyte characters. */ /* Copyright (C) 2002-2019 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_SH_MBUTIL_H_) #define _SH_MBUTIL_H_ #include "stdc.h" /* Include config.h for HANDLE_MULTIBYTE */ #include #if defined (HANDLE_MULTIBYTE) #include "shmbchar.h" extern size_t xwcsrtombs PARAMS((char *, const wchar_t **, size_t, mbstate_t *)); extern size_t xmbsrtowcs PARAMS((wchar_t *, const char **, size_t, mbstate_t *)); extern size_t xdupmbstowcs PARAMS((wchar_t **, char ***, const char *)); extern size_t mbstrlen PARAMS((const char *)); extern char *xstrchr PARAMS((const char *, int)); extern int locale_mb_cur_max; /* XXX */ extern int locale_utf8locale; /* XXX */ #ifndef MB_INVALIDCH #define MB_INVALIDCH(x) ((x) == (size_t)-1 || (x) == (size_t)-2) #define MB_NULLWCH(x) ((x) == 0) #endif #define MBSLEN(s) (((s) && (s)[0]) ? ((s)[1] ? mbstrlen (s) : 1) : 0) #define MB_STRLEN(s) ((MB_CUR_MAX > 1) ? MBSLEN (s) : STRLEN (s)) #define MBLEN(s, n) ((MB_CUR_MAX > 1) ? mblen ((s), (n)) : 1) #define MBRLEN(s, n, p) ((MB_CUR_MAX > 1) ? mbrlen ((s), (n), (p)) : 1) #define UTF8_SINGLEBYTE(c) (((c) & 0x80) == 0) #define UTF8_MBFIRSTCHAR(c) (((c) & 0xc0) == 0xc0) #define UTF8_MBCHAR(c) (((c) & 0xc0) == 0x80) #else /* !HANDLE_MULTIBYTE */ #undef MB_LEN_MAX #undef MB_CUR_MAX #define MB_LEN_MAX 1 #define MB_CUR_MAX 1 #undef xstrchr #define xstrchr(s, c) strchr(s, c) #ifndef MB_INVALIDCH #define MB_INVALIDCH(x) (0) #define MB_NULLWCH(x) (0) #endif #define MB_STRLEN(s) (STRLEN(s)) #define MBLEN(s, n) 1 #define MBRLEN(s, n, p) 1 #ifndef wchar_t # define wchar_t int #endif #define UTF8_SINGLEBYTE(c) (1) #define UTF8_MBFIRSTCHAR(c) (0) #endif /* !HANDLE_MULTIBYTE */ /* Declare and initialize a multibyte state. Call must be terminated with `;'. */ #if defined (HANDLE_MULTIBYTE) # define DECLARE_MBSTATE \ mbstate_t state; \ memset (&state, '\0', sizeof (mbstate_t)) #else # define DECLARE_MBSTATE #endif /* !HANDLE_MULTIBYTE */ /* Initialize or reinitialize a multibyte state named `state'. Call must be terminated with `;'. */ #if defined (HANDLE_MULTIBYTE) # define INITIALIZE_MBSTATE memset (&state, '\0', sizeof (mbstate_t)) #else # define INITIALIZE_MBSTATE #endif /* !HANDLE_MULTIBYTE */ /* Advance one (possibly multi-byte) character in string _STR of length _STRSIZE, starting at index _I. STATE must have already been declared. */ #if defined (HANDLE_MULTIBYTE) # define ADVANCE_CHAR(_str, _strsize, _i) \ do \ { \ if (locale_mb_cur_max > 1) \ { \ mbstate_t state_bak; \ size_t mblength; \ int _f; \ \ _f = is_basic ((_str)[_i]); \ if (_f) \ mblength = 1; \ else if (locale_utf8locale && (((_str)[_i] & 0x80) == 0)) \ mblength = (_str)[_i] != 0; \ else \ { \ state_bak = state; \ mblength = mbrlen ((_str) + (_i), (_strsize) - (_i), &state); \ } \ \ if (mblength == (size_t)-2 || mblength == (size_t)-1) \ { \ state = state_bak; \ (_i)++; \ } \ else if (mblength == 0) \ (_i)++; \ else \ (_i) += mblength; \ } \ else \ (_i)++; \ } \ while (0) #else # define ADVANCE_CHAR(_str, _strsize, _i) (_i)++ #endif /* !HANDLE_MULTIBYTE */ /* Advance one (possibly multibyte) character in the string _STR of length _STRSIZE. SPECIAL: assume that _STR will be incremented by 1 after this call. */ #if defined (HANDLE_MULTIBYTE) # define ADVANCE_CHAR_P(_str, _strsize) \ do \ { \ if (locale_mb_cur_max > 1) \ { \ mbstate_t state_bak; \ size_t mblength; \ int _f; \ \ _f = is_basic (*(_str)); \ if (_f) \ mblength = 1; \ else if (locale_utf8locale && ((*(_str) & 0x80) == 0)) \ mblength = *(_str) != 0; \ else \ { \ state_bak = state; \ mblength = mbrlen ((_str), (_strsize), &state); \ } \ \ if (mblength == (size_t)-2 || mblength == (size_t)-1) \ { \ state = state_bak; \ mblength = 1; \ } \ else \ (_str) += (mblength < 1) ? 0 : (mblength - 1); \ } \ } \ while (0) #else # define ADVANCE_CHAR_P(_str, _strsize) #endif /* !HANDLE_MULTIBYTE */ /* Back up one (possibly multi-byte) character in string _STR of length _STRSIZE, starting at index _I. STATE must have already been declared. */ #if defined (HANDLE_MULTIBYTE) # define BACKUP_CHAR(_str, _strsize, _i) \ do \ { \ if (locale_mb_cur_max > 1) \ { \ mbstate_t state_bak; \ size_t mblength; \ int _x, _p; /* _x == temp index into string, _p == prev index */ \ \ _x = _p = 0; \ while (_x < (_i)) \ { \ state_bak = state; \ mblength = mbrlen ((_str) + (_x), (_strsize) - (_x), &state); \ \ if (mblength == (size_t)-2 || mblength == (size_t)-1) \ { \ state = state_bak; \ _x++; \ } \ else if (mblength == 0) \ _x++; \ else \ { \ _p = _x; /* _p == start of prev mbchar */ \ _x += mblength; \ } \ } \ (_i) = _p; \ } \ else \ (_i)--; \ } \ while (0) #else # define BACKUP_CHAR(_str, _strsize, _i) (_i)-- #endif /* !HANDLE_MULTIBYTE */ /* Back up one (possibly multibyte) character in the string _BASE of length _STRSIZE starting at _STR (_BASE <= _STR <= (_BASE + _STRSIZE) ). SPECIAL: DO NOT assume that _STR will be decremented by 1 after this call. */ #if defined (HANDLE_MULTIBYTE) # define BACKUP_CHAR_P(_base, _strsize, _str) \ do \ { \ if (locale_mb_cur_max > 1) \ { \ mbstate_t state_bak; \ size_t mblength; \ char *_x, _p; /* _x == temp pointer into string, _p == prev pointer */ \ \ _x = _p = _base; \ while (_x < (_str)) \ { \ state_bak = state; \ mblength = mbrlen (_x, (_strsize) - _x, &state); \ \ if (mblength == (size_t)-2 || mblength == (size_t)-1) \ { \ state = state_bak; \ _x++; \ } \ else if (mblength == 0) \ _x++; \ else \ { \ _p = _x; /* _p == start of prev mbchar */ \ _x += mblength; \ } \ } \ (_str) = _p; \ } \ else \ (_str)--; \ } \ while (0) #else # define BACKUP_CHAR_P(_base, _strsize, _str) (_str)-- #endif /* !HANDLE_MULTIBYTE */ /* Copy a single character from the string _SRC to the string _DST. _SRCEND is a pointer to the end of _SRC. */ #if defined (HANDLE_MULTIBYTE) # define COPY_CHAR_P(_dst, _src, _srcend) \ do \ { \ if (locale_mb_cur_max > 1) \ { \ mbstate_t state_bak; \ size_t mblength; \ int _k; \ \ _k = is_basic (*(_src)); \ if (_k) \ mblength = 1; \ else if (locale_utf8locale && ((*(_src) & 0x80) == 0)) \ mblength = *(_src) != 0; \ else \ { \ state_bak = state; \ mblength = mbrlen ((_src), (_srcend) - (_src), &state); \ } \ if (mblength == (size_t)-2 || mblength == (size_t)-1) \ { \ state = state_bak; \ mblength = 1; \ } \ else \ mblength = (mblength < 1) ? 1 : mblength; \ \ for (_k = 0; _k < mblength; _k++) \ *(_dst)++ = *(_src)++; \ } \ else \ *(_dst)++ = *(_src)++; \ } \ while (0) #else # define COPY_CHAR_P(_dst, _src, _srcend) *(_dst)++ = *(_src)++ #endif /* !HANDLE_MULTIBYTE */ /* Copy a single character from the string _SRC at index _SI to the string _DST at index _DI. _SRCEND is a pointer to the end of _SRC. */ #if defined (HANDLE_MULTIBYTE) # define COPY_CHAR_I(_dst, _di, _src, _srcend, _si) \ do \ { \ if (locale_mb_cur_max > 1) \ { \ mbstate_t state_bak; \ size_t mblength; \ int _k; \ \ _k = is_basic (*((_src) + (_si))); \ if (_k) \ mblength = 1; \ else \ {\ state_bak = state; \ mblength = mbrlen ((_src) + (_si), (_srcend) - ((_src)+(_si)), &state); \ } \ if (mblength == (size_t)-2 || mblength == (size_t)-1) \ { \ state = state_bak; \ mblength = 1; \ } \ else \ mblength = (mblength < 1) ? 1 : mblength; \ \ for (_k = 0; _k < mblength; _k++) \ _dst[_di++] = _src[_si++]; \ } \ else \ _dst[_di++] = _src[_si++]; \ } \ while (0) #else # define COPY_CHAR_I(_dst, _di, _src, _srcend, _si) _dst[_di++] = _src[_si++] #endif /* !HANDLE_MULTIBYTE */ /**************************************************************** * * * The following are only guaranteed to work in subst.c * * * ****************************************************************/ #if defined (HANDLE_MULTIBYTE) # define SCOPY_CHAR_I(_dst, _escchar, _sc, _src, _si, _slen) \ do \ { \ if (locale_mb_cur_max > 1) \ { \ mbstate_t state_bak; \ size_t mblength; \ int _i; \ \ _i = is_basic (*((_src) + (_si))); \ if (_i) \ mblength = 1; \ else \ { \ state_bak = state; \ mblength = mbrlen ((_src) + (_si), (_slen) - (_si), &state); \ } \ if (mblength == (size_t)-2 || mblength == (size_t)-1) \ { \ state = state_bak; \ mblength = 1; \ } \ else \ mblength = (mblength < 1) ? 1 : mblength; \ \ temp = xmalloc (mblength + 2); \ temp[0] = _escchar; \ for (_i = 0; _i < mblength; _i++) \ temp[_i + 1] = _src[_si++]; \ temp[mblength + 1] = '\0'; \ \ goto add_string; \ } \ else \ { \ _dst[0] = _escchar; \ _dst[1] = _sc; \ } \ } \ while (0) #else # define SCOPY_CHAR_I(_dst, _escchar, _sc, _src, _si, _slen) \ _dst[0] = _escchar; \ _dst[1] = _sc #endif /* !HANDLE_MULTIBYTE */ #if defined (HANDLE_MULTIBYTE) # define SCOPY_CHAR_M(_dst, _src, _srcend, _si) \ do \ { \ if (locale_mb_cur_max > 1) \ { \ mbstate_t state_bak; \ size_t mblength; \ int _i; \ \ _i = is_basic (*((_src) + (_si))); \ if (_i) \ mblength = 1; \ else \ { \ state_bak = state; \ mblength = mbrlen ((_src) + (_si), (_srcend) - ((_src) + (_si)), &state); \ } \ if (mblength == (size_t)-2 || mblength == (size_t)-1) \ { \ state = state_bak; \ mblength = 1; \ } \ else \ mblength = (mblength < 1) ? 1 : mblength; \ \ FASTCOPY(((_src) + (_si)), (_dst), mblength); \ \ (_dst) += mblength; \ (_si) += mblength; \ } \ else \ { \ *(_dst)++ = _src[(_si)]; \ (_si)++; \ } \ } \ while (0) #else # define SCOPY_CHAR_M(_dst, _src, _srcend, _si) \ *(_dst)++ = _src[(_si)]; \ (_si)++ #endif /* !HANDLE_MULTIBYTE */ #if HANDLE_MULTIBYTE # define SADD_MBCHAR(_dst, _src, _si, _srcsize) \ do \ { \ if (locale_mb_cur_max > 1) \ { \ int i; \ mbstate_t state_bak; \ size_t mblength; \ \ i = is_basic (*((_src) + (_si))); \ if (i) \ mblength = 1; \ else if (locale_utf8locale && (((_src)[_si] & 0x80) == 0)) \ mblength = (_src)[_si] != 0; \ else \ { \ state_bak = state; \ mblength = mbrlen ((_src) + (_si), (_srcsize) - (_si), &state); \ } \ if (mblength == (size_t)-1 || mblength == (size_t)-2) \ { \ state = state_bak; \ mblength = 1; \ } \ if (mblength < 1) \ mblength = 1; \ \ _dst = (char *)xmalloc (mblength + 1); \ for (i = 0; i < mblength; i++) \ (_dst)[i] = (_src)[(_si)++]; \ (_dst)[mblength] = '\0'; \ \ goto add_string; \ } \ } \ while (0) #else # define SADD_MBCHAR(_dst, _src, _si, _srcsize) #endif /* Watch out when using this -- it's just straight textual substitution */ #if defined (HANDLE_MULTIBYTE) # define SADD_MBQCHAR_BODY(_dst, _src, _si, _srcsize) \ \ int i; \ mbstate_t state_bak; \ size_t mblength; \ \ i = is_basic (*((_src) + (_si))); \ if (i) \ mblength = 1; \ else if (locale_utf8locale && (((_src)[_si] & 0x80) == 0)) \ mblength = (_src)[_si] != 0; \ else \ { \ state_bak = state; \ mblength = mbrlen ((_src) + (_si), (_srcsize) - (_si), &state); \ } \ if (mblength == (size_t)-1 || mblength == (size_t)-2) \ { \ state = state_bak; \ mblength = 1; \ } \ if (mblength < 1) \ mblength = 1; \ \ (_dst) = (char *)xmalloc (mblength + 2); \ (_dst)[0] = CTLESC; \ for (i = 0; i < mblength; i++) \ (_dst)[i+1] = (_src)[(_si)++]; \ (_dst)[mblength+1] = '\0'; \ \ goto add_string # define SADD_MBCHAR_BODY(_dst, _src, _si, _srcsize) \ \ int i; \ mbstate_t state_bak; \ size_t mblength; \ \ i = is_basic (*((_src) + (_si))); \ if (i) \ mblength = 1; \ else \ { \ state_bak = state; \ mblength = mbrlen ((_src) + (_si), (_srcsize) - (_si), &state); \ } \ if (mblength == (size_t)-1 || mblength == (size_t)-2) \ { \ state = state_bak; \ mblength = 1; \ } \ if (mblength < 1) \ mblength = 1; \ \ (_dst) = (char *)xmalloc (mblength + 1); \ for (i = 0; i < mblength; i++) \ (_dst)[i+1] = (_src)[(_si)++]; \ (_dst)[mblength+1] = '\0'; \ \ goto add_string #endif /* HANDLE_MULTIBYTE */ #endif /* _SH_MBUTIL_H_ */ ))entry(nameshtty.hnode(typeregularcontentsu/* Copyright (C) 1999-2020 Free Software Foundation, Inc. */ /* This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* * shtty.h -- include the correct system-dependent files to manipulate the * tty */ #ifndef __SH_TTY_H_ #define __SH_TTY_H_ #include "stdc.h" #if defined (_POSIX_VERSION) && defined (HAVE_TERMIOS_H) && defined (HAVE_TCGETATTR) && !defined (TERMIOS_MISSING) # define TERMIOS_TTY_DRIVER #else # if defined (HAVE_TERMIO_H) # define TERMIO_TTY_DRIVER # else # define NEW_TTY_DRIVER # endif #endif /* * The _POSIX_SOURCE define is to avoid multiple symbol definitions * between sys/ioctl.h and termios.h. Ditto for the test against SunOS4 * and the undefining of several symbols. */ #ifdef TERMIOS_TTY_DRIVER # if (defined (SunOS4) || defined (SunOS5)) && !defined (_POSIX_SOURCE) # define _POSIX_SOURCE # endif # if defined (SunOS4) # undef ECHO # undef NOFLSH # undef TOSTOP # endif /* SunOS4 */ # include # define TTYSTRUCT struct termios #else # ifdef TERMIO_TTY_DRIVER # include # define TTYSTRUCT struct termio # else /* NEW_TTY_DRIVER */ # include # define TTYSTRUCT struct sgttyb # endif #endif /* Functions imported from lib/sh/shtty.c */ /* Get and set terminal attributes for the file descriptor passed as an argument. */ extern int ttgetattr PARAMS((int, TTYSTRUCT *)); extern int ttsetattr PARAMS((int, TTYSTRUCT *)); /* Save and restore the terminal's attributes from static storage. */ extern void ttsave PARAMS((void)); extern void ttrestore PARAMS((void)); /* Return the attributes corresponding to the file descriptor (0 or 1) passed as an argument. */ extern TTYSTRUCT *ttattr PARAMS((int)); /* These functions only operate on the passed TTYSTRUCT; they don't actually change anything with the kernel's current tty settings. */ extern int tt_setonechar PARAMS((TTYSTRUCT *)); extern int tt_setnoecho PARAMS((TTYSTRUCT *)); extern int tt_seteightbit PARAMS((TTYSTRUCT *)); extern int tt_setnocanon PARAMS((TTYSTRUCT *)); extern int tt_setcbreak PARAMS((TTYSTRUCT *)); /* These functions are all generally mutually exclusive. If you call more than one (bracketed with calls to ttsave and ttrestore, of course), the right thing will happen, but more system calls will be executed than absolutely necessary. You can do all of this yourself with the other functions; these are only conveniences. */ /* These functions work with a given file descriptor and set terminal attributes */ extern int ttfd_onechar PARAMS((int, TTYSTRUCT *)); extern int ttfd_noecho PARAMS((int, TTYSTRUCT *)); extern int ttfd_eightbit PARAMS((int, TTYSTRUCT *)); extern int ttfd_nocanon PARAMS((int, TTYSTRUCT *)); extern int ttfd_cbreak PARAMS((int, TTYSTRUCT *)); /* These functions work with fd 0 and the TTYSTRUCT saved with ttsave () */ extern int ttonechar PARAMS((void)); extern int ttnoecho PARAMS((void)); extern int tteightbit PARAMS((void)); extern int ttnocanon PARAMS((void)); extern int ttcbreak PARAMS((void)); #endif ))entry(name stat-time.hnode(typeregularcontentsÈ/* stat-related time functions. Copyright (C) 2005, 2007, 2009-2012 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* Written by Paul Eggert. */ #ifndef STAT_TIME_H #define STAT_TIME_H 1 #include #if defined (TIME_H_DEFINES_STRUCT_TIMESPEC) # include #elif defined (SYS_TIME_H_DEFINES_STRUCT_TIMESPEC) # include #elif defined (PTHREAD_H_DEFINES_STRUCT_TIMESPEC) # include #endif #ifndef HAVE_STRUCT_TIMESPEC struct timespec { time_t tv_sec; long int tv_nsec; }; #endif /* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type struct timespec, if available. If not, then STAT_TIMESPEC_NS (ST, ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST, if available. ST_XTIM can be st_atim, st_ctim, st_mtim, or st_birthtim for access, status change, data modification, or birth (creation) time respectively. These macros are private to stat-time.h. */ #if defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC # ifdef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim) # else # define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec) # endif #elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC # define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec) #elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC # define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim##ensec) #elif defined HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC # define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.st__tim.tv_nsec) #endif /* Return the nanosecond component of *ST's access time. */ static inline long int get_stat_atime_ns (struct stat const *st) { # if defined STAT_TIMESPEC return STAT_TIMESPEC (st, st_atim).tv_nsec; # elif defined STAT_TIMESPEC_NS return STAT_TIMESPEC_NS (st, st_atim); # else return 0; # endif } /* Return the nanosecond component of *ST's status change time. */ static inline long int get_stat_ctime_ns (struct stat const *st) { # if defined STAT_TIMESPEC return STAT_TIMESPEC (st, st_ctim).tv_nsec; # elif defined STAT_TIMESPEC_NS return STAT_TIMESPEC_NS (st, st_ctim); # else return 0; # endif } /* Return the nanosecond component of *ST's data modification time. */ static inline long int get_stat_mtime_ns (struct stat const *st) { # if defined STAT_TIMESPEC return STAT_TIMESPEC (st, st_mtim).tv_nsec; # elif defined STAT_TIMESPEC_NS return STAT_TIMESPEC_NS (st, st_mtim); # else return 0; # endif } /* Return the nanosecond component of *ST's birth time. */ static inline long int get_stat_birthtime_ns (struct stat const *st) { # if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC return STAT_TIMESPEC (st, st_birthtim).tv_nsec; # elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC return STAT_TIMESPEC_NS (st, st_birthtim); # else /* Avoid a "parameter unused" warning. */ (void) st; return 0; # endif } /* Return *ST's access time. */ static inline struct timespec get_stat_atime (struct stat const *st) { #ifdef STAT_TIMESPEC return STAT_TIMESPEC (st, st_atim); #else struct timespec t; t.tv_sec = st->st_atime; t.tv_nsec = get_stat_atime_ns (st); return t; #endif } /* Return *ST's status change time. */ static inline struct timespec get_stat_ctime (struct stat const *st) { #ifdef STAT_TIMESPEC return STAT_TIMESPEC (st, st_ctim); #else struct timespec t; t.tv_sec = st->st_ctime; t.tv_nsec = get_stat_ctime_ns (st); return t; #endif } /* Return *ST's data modification time. */ static inline struct timespec get_stat_mtime (struct stat const *st) { #ifdef STAT_TIMESPEC return STAT_TIMESPEC (st, st_mtim); #else struct timespec t; t.tv_sec = st->st_mtime; t.tv_nsec = get_stat_mtime_ns (st); return t; #endif } static inline int timespec_cmp (struct timespec a, struct timespec b) { return (a.tv_sec < b.tv_sec ? -1 : (a.tv_sec > b.tv_sec ? 1 : (int) (a.tv_nsec - b.tv_nsec))); } /* Return *ST's birth time, if available; otherwise return a value with tv_sec and tv_nsec both equal to -1. */ static inline struct timespec get_stat_birthtime (struct stat const *st) { struct timespec t; #if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC) t = STAT_TIMESPEC (st, st_birthtim); #elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC t.tv_sec = st->st_birthtime; t.tv_nsec = st->st_birthtimensec; #elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* Native Windows platforms (but not Cygwin) put the "file creation time" in st_ctime (!). See . */ t.tv_sec = st->st_ctime; t.tv_nsec = 0; #else /* Birth time is not supported. */ t.tv_sec = -1; t.tv_nsec = -1; /* Avoid a "parameter unused" warning. */ (void) st; #endif #if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \ || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \ || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC) /* FreeBSD and NetBSD sometimes signal the absence of knowledge by using zero. Attempt to work around this problem. Alas, this can report failure even for valid time stamps. Also, NetBSD sometimes returns junk in the birth time fields; work around this bug if it is detected. */ if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000)) { t.tv_sec = -1; t.tv_nsec = -1; } #endif return t; } #endif ))entry(namestdc.hnode(typeregularcontents; /* stdc.h -- macros to make source compile on both ANSI C and K&R C compilers. */ /* Copyright (C) 1993 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_STDC_H_) #define _STDC_H_ /* Adapted from BSD /usr/include/sys/cdefs.h. */ /* A function can be defined using prototypes and compile on both ANSI C and traditional C compilers with something like this: extern char *func PARAMS((char *, char *, int)); */ #if !defined (PARAMS) # if defined (__STDC__) || defined (__GNUC__) || defined (__cplusplus) || defined (PROTOTYPES) # define PARAMS(protos) protos # else # define PARAMS(protos) () # endif #endif /* Fortify, at least, has trouble with this definition */ #if defined (HAVE_STRINGIZE) # define CPP_STRING(x) #x #else # define CPP_STRING(x) "x" #endif #if !defined (__STDC__) #if defined (__GNUC__) /* gcc with -traditional */ # if !defined (signed) # define signed __signed # endif # if !defined (volatile) # define volatile __volatile # endif #else /* !__GNUC__ */ # if !defined (inline) # define inline # endif # if !defined (signed) # define signed # endif # if !defined (volatile) # define volatile # endif #endif /* !__GNUC__ */ #endif /* !__STDC__ */ #ifndef __attribute__ # if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) # define __attribute__(x) # endif #endif /* For those situations when gcc handles inlining a particular function but other compilers complain. */ #ifdef __GNUC__ # define INLINE inline #else # define INLINE #endif #if defined (PREFER_STDARG) # define SH_VA_START(va, arg) va_start(va, arg) #else # define SH_VA_START(va, arg) va_start(va) #endif #endif /* !_STDC_H_ */ ))entry(name systimes.hnode(typeregularcontentsã/* Copyright (C) 1991-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* * POSIX Standard: 4.5.2 Process Times */ /* * If we don't have a standard system clock_t type, this must be included * after config.h */ #ifndef _BASH_SYSTIMES_H #define _BASH_SYSTIMES_H 1 #if defined (HAVE_SYS_TIMES_H) # include #else /* !HAVE_SYS_TIMES_H */ #include /* Structure describing CPU time used by a process and its children. */ struct tms { clock_t tms_utime; /* User CPU time. */ clock_t tms_stime; /* System CPU time. */ clock_t tms_cutime; /* User CPU time of dead children. */ clock_t tms_cstime; /* System CPU time of dead children. */ }; /* Store the CPU time used by this process and all its dead descendants in BUFFER. Return the elapsed real time from an arbitrary point in the past (the bash emulation uses the epoch), or (clock_t) -1 for errors. All times are in CLK_TCKths of a second. */ extern clock_t times PARAMS((struct tms *buffer)); #endif /* !HAVE_SYS_TIMES_H */ #endif /* _BASH_SYSTIMES_H */ ))entry(name typemax.hnode(typeregularcontents!/* typemax.h -- encapsulate max values for long, long long, etc. */ /* Copyright (C) 2001 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* * NOTE: This should be included after config.h, limits.h, stdint.h, and * inttypes.h */ #ifndef _SH_TYPEMAX_H #define _SH_TYPEMAX_H #ifndef CHAR_BIT # define CHAR_BIT 8 #endif /* Nonzero if the integer type T is signed. */ #ifndef TYPE_SIGNED # define TYPE_SIGNED(t) (! ((t) 0 < (t) -1)) #endif #ifndef TYPE_SIGNED_MAGNITUDE # define TYPE_SIGNED_MAGNITUDE(t) ((t) ~ (t) 0 < (t) -1) #endif #ifndef TYPE_WIDTH # define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) #endif #ifndef TYPE_MINIMUM # define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) #endif #ifndef TYPE_MAXIMUM # define TYPE_MAXIMUM(t) \ ((t) (! TYPE_SIGNED (t) \ ? (t) -1 \ : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) #endif #ifdef HAVE_LONG_LONG # ifndef LLONG_MAX # define LLONG_MAX TYPE_MAXIMUM(long long int) # define LLONG_MIN TYPE_MINIMUM(long long int) # endif # ifndef ULLONG_MAX # define ULLONG_MAX TYPE_MAXIMUM(unsigned long long int) # endif #endif #ifndef ULONG_MAX # define ULONG_MAX ((unsigned long) ~(unsigned long) 0) #endif #ifndef LONG_MAX # define LONG_MAX ((long int) (ULONG_MAX >> 1)) # define LONG_MIN ((long int) (-LONG_MAX - 1L)) #endif #ifndef INT_MAX /* ouch */ # define INT_MAX TYPE_MAXIMUM(int) # define INT_MIN TYPE_MINIMUM(int) # define UINT_MAX ((unsigned int) ~(unsigned int)0) #endif /* workaround for gcc bug in versions < 2.7 */ #if defined (HAVE_LONG_LONG) && __GNUC__ == 2 && __GNUC_MINOR__ < 7 static const unsigned long long int maxquad = ULLONG_MAX; # undef ULLONG_MAX # define ULLONG_MAX maxquad #endif #if !defined (INTMAX_MAX) || !defined (INTMAX_MIN) #if SIZEOF_INTMAX_T == SIZEOF_LONG_LONG # define INTMAX_MAX LLONG_MAX # define INTMAX_MIN LLONG_MIN #elif SIZEOF_INTMAX_T == SIZEOF_LONG # define INTMAX_MAX LONG_MAX # define INTMAX_MIN LONG_MIN #else # define INTMAX_MAX INT_MAX # define INTMAX_MIN INT_MIN #endif #endif #ifndef SSIZE_MAX # define SSIZE_MAX 32767 /* POSIX minimum max */ #endif #ifndef SIZE_MAX # define SIZE_MAX 65535 /* POSIX minimum max */ #endif #ifndef sh_imaxabs # define sh_imaxabs(x) (((x) >= 0) ? (x) : -(x)) #endif /* Handle signed arithmetic overflow and underflow. Have to do it this way to avoid compilers optimizing out simpler overflow checks. */ /* Make sure that a+b does not exceed MAXV or is smaller than MINV (if b < 0). Assumes that b > 0 if a > 0 and b < 0 if a < 0 */ #define ADDOVERFLOW(a,b,minv,maxv) \ ((((a) > 0) && ((b) > ((maxv) - (a)))) || \ (((a) < 0) && ((b) < ((minv) - (a))))) /* Make sure that a-b is not smaller than MINV or exceeds MAXV (if b < 0). Assumes that b > 0 if a > 0 and b < 0 if a < 0 */ #define SUBOVERFLOW(a,b,minv,maxv) \ ((((b) > 0) && ((a) < ((minv) + (b)))) || \ (((b) < 0) && ((a) > ((maxv) + (b))))) #endif /* _SH_TYPEMAX_H */ ))entry(name unionwait.hnode(typeregularcontents /* unionwait.h -- definitions for using a `union wait' on systems without one. */ /* Copyright (C) 1996 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _UNIONWAIT_H #define _UNIONWAIT_H #if !defined (WORDS_BIGENDIAN) union wait { int w_status; /* used in syscall */ /* Terminated process status. */ struct { unsigned short w_Termsig : 7, /* termination signal */ w_Coredump : 1, /* core dump indicator */ w_Retcode : 8, /* exit code if w_termsig==0 */ w_Fill1 : 16; /* high 16 bits unused */ } w_T; /* Stopped process status. Returned only for traced children unless requested with the WUNTRACED option bit. */ struct { unsigned short w_Stopval : 8, /* == W_STOPPED if stopped */ w_Stopsig : 8, /* actually zero on XENIX */ w_Fill2 : 16; /* high 16 bits unused */ } w_S; }; #else /* WORDS_BIGENDIAN */ /* This is for big-endian machines like the IBM RT, HP 9000, or Sun-3 */ union wait { int w_status; /* used in syscall */ /* Terminated process status. */ struct { unsigned short w_Fill1 : 16; /* high 16 bits unused */ unsigned w_Retcode : 8; /* exit code if w_termsig==0 */ unsigned w_Coredump : 1; /* core dump indicator */ unsigned w_Termsig : 7; /* termination signal */ } w_T; /* Stopped process status. Returned only for traced children unless requested with the WUNTRACED option bit. */ struct { unsigned short w_Fill2 : 16; /* high 16 bits unused */ unsigned w_Stopsig : 8; /* signal that stopped us */ unsigned w_Stopval : 8; /* == W_STOPPED if stopped */ } w_S; }; #endif /* WORDS_BIGENDIAN */ #define w_termsig w_T.w_Termsig #define w_coredump w_T.w_Coredump #define w_retcode w_T.w_Retcode #define w_stopval w_S.w_Stopval #define w_stopsig w_S.w_Stopsig #define WSTOPPED 0177 #define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED) #define WIFEXITED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig == 0) #define WIFSIGNALED(x) ((x).w_stopval != WSTOPPED && (x).w_termsig != 0) #define WTERMSIG(x) ((x).w_termsig) #define WSTOPSIG(x) ((x).w_stopsig) #define WEXITSTATUS(x) ((x).w_retcode) #define WIFCORED(x) ((x).w_coredump) #endif /* _UNIONWAIT_H */ ))))entry(namejobs.hnode(typeregularcontentsö+/* jobs.h -- structures and definitions used by the jobs.c file. */ /* Copyright (C) 1993-2019 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_JOBS_H_) # define _JOBS_H_ #include "quit.h" #include "siglist.h" #include "stdc.h" #include "posixwait.h" /* Defines controlling the fashion in which jobs are listed. */ #define JLIST_STANDARD 0 #define JLIST_LONG 1 #define JLIST_PID_ONLY 2 #define JLIST_CHANGED_ONLY 3 #define JLIST_NONINTERACTIVE 4 /* I looked it up. For pretty_print_job (). The real answer is 24. */ #define LONGEST_SIGNAL_DESC 24 /* Defines for the wait_for_* functions and for the wait builtin to use */ #define JWAIT_PERROR (1 << 0) #define JWAIT_FORCE (1 << 1) #define JWAIT_NOWAIT (1 << 2) /* don't waitpid(), just return status if already exited */ #define JWAIT_WAITING (1 << 3) /* wait for jobs marked J_WAITING only */ /* flags for wait_for */ #define JWAIT_NOTERM (1 << 8) /* wait_for doesn't give terminal away */ /* The max time to sleep while retrying fork() on EAGAIN failure */ #define FORKSLEEP_MAX 16 /* We keep an array of jobs. Each entry in the array is a linked list of processes that are piped together. The first process encountered is the group leader. */ /* Values for the `running' field of a struct process. */ #define PS_DONE 0 #define PS_RUNNING 1 #define PS_STOPPED 2 #define PS_RECYCLED 4 /* Each child of the shell is remembered in a STRUCT PROCESS. A circular chain of such structures is a pipeline. */ typedef struct process { struct process *next; /* Next process in the pipeline. A circular chain. */ pid_t pid; /* Process ID. */ WAIT status; /* The status of this command as returned by wait. */ int running; /* Non-zero if this process is running. */ char *command; /* The particular program that is running. */ } PROCESS; struct pipeline_saver { struct process *pipeline; struct pipeline_saver *next; }; /* PALIVE really means `not exited' */ #define PSTOPPED(p) (WIFSTOPPED((p)->status)) #define PRUNNING(p) ((p)->running == PS_RUNNING) #define PALIVE(p) (PRUNNING(p) || PSTOPPED(p)) #define PEXITED(p) ((p)->running == PS_DONE) #if defined (RECYCLES_PIDS) # define PRECYCLED(p) ((p)->running == PS_RECYCLED) #else # define PRECYCLED(p) (0) #endif #define PDEADPROC(p) (PEXITED(p) || PRECYCLED(p)) #define get_job_by_jid(ind) (jobs[(ind)]) /* A description of a pipeline's state. */ typedef enum { JNONE = -1, JRUNNING = 1, JSTOPPED = 2, JDEAD = 4, JMIXED = 8 } JOB_STATE; #define JOBSTATE(job) (jobs[(job)]->state) #define J_JOBSTATE(j) ((j)->state) #define STOPPED(j) (jobs[(j)]->state == JSTOPPED) #define RUNNING(j) (jobs[(j)]->state == JRUNNING) #define DEADJOB(j) (jobs[(j)]->state == JDEAD) #define INVALID_JOB(j) ((j) < 0 || (j) >= js.j_jobslots || get_job_by_jid(j) == 0) /* Values for the FLAGS field in the JOB struct below. */ #define J_FOREGROUND 0x01 /* Non-zero if this is running in the foreground. */ #define J_NOTIFIED 0x02 /* Non-zero if already notified about job state. */ #define J_JOBCONTROL 0x04 /* Non-zero if this job started under job control. */ #define J_NOHUP 0x08 /* Don't send SIGHUP to job if shell gets SIGHUP. */ #define J_STATSAVED 0x10 /* A process in this job had status saved via $! */ #define J_ASYNC 0x20 /* Job was started asynchronously */ #define J_PIPEFAIL 0x40 /* pipefail set when job was started */ #define J_WAITING 0x80 /* one of a list of jobs for which we are waiting */ #define IS_FOREGROUND(j) ((jobs[j]->flags & J_FOREGROUND) != 0) #define IS_NOTIFIED(j) ((jobs[j]->flags & J_NOTIFIED) != 0) #define IS_JOBCONTROL(j) ((jobs[j]->flags & J_JOBCONTROL) != 0) #define IS_ASYNC(j) ((jobs[j]->flags & J_ASYNC) != 0) #define IS_WAITING(j) ((jobs[j]->flags & J_WAITING) != 0) typedef struct job { char *wd; /* The working directory at time of invocation. */ PROCESS *pipe; /* The pipeline of processes that make up this job. */ pid_t pgrp; /* The process ID of the process group (necessary). */ JOB_STATE state; /* The state that this job is in. */ int flags; /* Flags word: J_NOTIFIED, J_FOREGROUND, or J_JOBCONTROL. */ #if defined (JOB_CONTROL) COMMAND *deferred; /* Commands that will execute when this job is done. */ sh_vptrfunc_t *j_cleanup; /* Cleanup function to call when job marked JDEAD */ PTR_T cleanarg; /* Argument passed to (*j_cleanup)() */ #endif /* JOB_CONTROL */ } JOB; struct jobstats { /* limits */ long c_childmax; /* child process statistics */ int c_living; /* running or stopped child processes */ int c_reaped; /* exited child processes still in jobs list */ int c_injobs; /* total number of child processes in jobs list */ /* child process totals */ int c_totforked; /* total number of children this shell has forked */ int c_totreaped; /* total number of children this shell has reaped */ /* job counters and indices */ int j_jobslots; /* total size of jobs array */ int j_lastj; /* last (newest) job allocated */ int j_firstj; /* first (oldest) job allocated */ int j_njobs; /* number of non-NULL jobs in jobs array */ int j_ndead; /* number of JDEAD jobs in jobs array */ /* */ int j_current; /* current job */ int j_previous; /* previous job */ /* */ JOB *j_lastmade; /* last job allocated by stop_pipeline */ JOB *j_lastasync; /* last async job allocated by stop_pipeline */ }; /* Revised to accommodate new hash table bgpids implementation. */ typedef pid_t ps_index_t; struct pidstat { ps_index_t bucket_next; ps_index_t bucket_prev; pid_t pid; bits16_t status; /* only 8 bits really needed */ }; struct bgpids { struct pidstat *storage; /* storage arena */ ps_index_t head; ps_index_t nalloc; int npid; }; #define NO_PIDSTAT (ps_index_t)-1 /* standalone process status struct, without bgpids indexes */ struct procstat { pid_t pid; bits16_t status; }; /* A standalone singly-linked list of PROCESS *, used in various places including keeping track of process substitutions. */ struct procchain { PROCESS *head; PROCESS *end; int nproc; }; #define NO_JOB -1 /* An impossible job array index. */ #define DUP_JOB -2 /* A possible return value for get_job_spec (). */ #define BAD_JOBSPEC -3 /* Bad syntax for job spec. */ /* A value which cannot be a process ID. */ #define NO_PID (pid_t)-1 #define ANY_PID (pid_t)-1 /* flags for make_child () */ #define FORK_SYNC 0 /* normal synchronous process */ #define FORK_ASYNC 1 /* background process */ #define FORK_NOJOB 2 /* don't put process in separate pgrp */ #define FORK_NOTERM 4 /* don't give terminal to any pgrp */ /* System calls. */ #if !defined (HAVE_UNISTD_H) extern pid_t fork (), getpid (), getpgrp (); #endif /* !HAVE_UNISTD_H */ /* Stuff from the jobs.c file. */ extern struct jobstats js; extern pid_t original_pgrp, shell_pgrp, pipeline_pgrp; extern volatile pid_t last_made_pid, last_asynchronous_pid; extern int asynchronous_notification; extern int already_making_children; extern int running_in_background; extern PROCESS *last_procsub_child; extern JOB **jobs; extern void making_children PARAMS((void)); extern void stop_making_children PARAMS((void)); extern void cleanup_the_pipeline PARAMS((void)); extern void discard_last_procsub_child PARAMS((void)); extern void save_pipeline PARAMS((int)); extern PROCESS *restore_pipeline PARAMS((int)); extern void start_pipeline PARAMS((void)); extern int stop_pipeline PARAMS((int, COMMAND *)); extern int discard_pipeline PARAMS((PROCESS *)); extern void append_process PARAMS((char *, pid_t, int, int)); extern void save_proc_status PARAMS((pid_t, int)); extern PROCESS *procsub_add PARAMS((PROCESS *)); extern PROCESS *procsub_search PARAMS((pid_t)); extern PROCESS *procsub_delete PARAMS((pid_t)); extern int procsub_waitpid PARAMS((pid_t)); extern void procsub_waitall PARAMS((void)); extern void procsub_clear PARAMS((void)); extern void procsub_prune PARAMS((void)); extern void delete_job PARAMS((int, int)); extern void nohup_job PARAMS((int)); extern void delete_all_jobs PARAMS((int)); extern void nohup_all_jobs PARAMS((int)); extern int count_all_jobs PARAMS((void)); extern void terminate_current_pipeline PARAMS((void)); extern void terminate_stopped_jobs PARAMS((void)); extern void hangup_all_jobs PARAMS((void)); extern void kill_current_pipeline PARAMS((void)); #if defined (__STDC__) && defined (pid_t) extern int get_job_by_pid PARAMS((int, int, PROCESS **)); extern void describe_pid PARAMS((int)); #else extern int get_job_by_pid PARAMS((pid_t, int, PROCESS **)); extern void describe_pid PARAMS((pid_t)); #endif extern void list_one_job PARAMS((JOB *, int, int, int)); extern void list_all_jobs PARAMS((int)); extern void list_stopped_jobs PARAMS((int)); extern void list_running_jobs PARAMS((int)); extern pid_t make_child PARAMS((char *, int)); extern int get_tty_state PARAMS((void)); extern int set_tty_state PARAMS((void)); extern int job_exit_status PARAMS((int)); extern int job_exit_signal PARAMS((int)); extern int wait_for_single_pid PARAMS((pid_t, int)); extern void wait_for_background_pids PARAMS((struct procstat *)); extern int wait_for PARAMS((pid_t, int)); extern int wait_for_job PARAMS((int, int, struct procstat *)); extern int wait_for_any_job PARAMS((int, struct procstat *)); extern void wait_sigint_cleanup PARAMS((void)); extern void notify_and_cleanup PARAMS((void)); extern void reap_dead_jobs PARAMS((void)); extern int start_job PARAMS((int, int)); extern int kill_pid PARAMS((pid_t, int, int)); extern int initialize_job_control PARAMS((int)); extern void initialize_job_signals PARAMS((void)); extern int give_terminal_to PARAMS((pid_t, int)); extern void run_sigchld_trap PARAMS((int)); extern int freeze_jobs_list PARAMS((void)); extern void unfreeze_jobs_list PARAMS((void)); extern void set_jobs_list_frozen PARAMS((int)); extern int set_job_control PARAMS((int)); extern void without_job_control PARAMS((void)); extern void end_job_control PARAMS((void)); extern void restart_job_control PARAMS((void)); extern void set_sigchld_handler PARAMS((void)); extern void ignore_tty_job_signals PARAMS((void)); extern void default_tty_job_signals PARAMS((void)); extern void get_original_tty_job_signals PARAMS((void)); extern void init_job_stats PARAMS((void)); extern void close_pgrp_pipe PARAMS((void)); extern void save_pgrp_pipe PARAMS((int *, int)); extern void restore_pgrp_pipe PARAMS((int *)); extern void set_maxchild PARAMS((int)); extern int job_control; /* set to 0 in nojobs.c */ #endif /* _JOBS_H_ */ ))entry(name make_cmd.hnode(typeregularcontentsð /* make_cmd.h -- Declarations of functions found in make_cmd.c */ /* Copyright (C) 1993-2009,2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_MAKE_CMD_H_) #define _MAKE_CMD_H_ #include "stdc.h" extern int here_doc_first_line; extern void cmd_init PARAMS((void)); extern WORD_DESC *alloc_word_desc PARAMS((void)); extern WORD_DESC *make_bare_word PARAMS((const char *)); extern WORD_DESC *make_word_flags PARAMS((WORD_DESC *, const char *)); extern WORD_DESC *make_word PARAMS((const char *)); extern WORD_DESC *make_word_from_token PARAMS((int)); extern WORD_LIST *make_word_list PARAMS((WORD_DESC *, WORD_LIST *)); #define add_string_to_list(s, l) make_word_list (make_word(s), (l)) extern COMMAND *make_command PARAMS((enum command_type, SIMPLE_COM *)); extern COMMAND *command_connect PARAMS((COMMAND *, COMMAND *, int)); extern COMMAND *make_for_command PARAMS((WORD_DESC *, WORD_LIST *, COMMAND *, int)); extern COMMAND *make_group_command PARAMS((COMMAND *)); extern COMMAND *make_case_command PARAMS((WORD_DESC *, PATTERN_LIST *, int)); extern PATTERN_LIST *make_pattern_list PARAMS((WORD_LIST *, COMMAND *)); extern COMMAND *make_if_command PARAMS((COMMAND *, COMMAND *, COMMAND *)); extern COMMAND *make_while_command PARAMS((COMMAND *, COMMAND *)); extern COMMAND *make_until_command PARAMS((COMMAND *, COMMAND *)); extern COMMAND *make_bare_simple_command PARAMS((void)); extern COMMAND *make_simple_command PARAMS((ELEMENT, COMMAND *)); extern void make_here_document PARAMS((REDIRECT *, int)); extern REDIRECT *make_redirection PARAMS((REDIRECTEE, enum r_instruction, REDIRECTEE, int)); extern COMMAND *make_function_def PARAMS((WORD_DESC *, COMMAND *, int, int)); extern COMMAND *clean_simple_command PARAMS((COMMAND *)); extern COMMAND *make_arith_command PARAMS((WORD_LIST *)); extern COMMAND *make_select_command PARAMS((WORD_DESC *, WORD_LIST *, COMMAND *, int)); #if defined (COND_COMMAND) extern COND_COM *make_cond_node PARAMS((int, WORD_DESC *, COND_COM *, COND_COM *)); extern COMMAND *make_cond_command PARAMS((COND_COM *)); #endif extern COMMAND *make_arith_for_command PARAMS((WORD_LIST *, COMMAND *, int)); extern COMMAND *make_subshell_command PARAMS((COMMAND *)); extern COMMAND *make_coproc_command PARAMS((char *, COMMAND *)); extern COMMAND *connect_async_list PARAMS((COMMAND *, COMMAND *, int)); #endif /* !_MAKE_CMD_H */ ))entry(name pathnames.hnode(typeregularcontentsë/* pathnames.h -- absolute filenames that bash wants for various defaults. */ /* Copyright (C) 1987-2009 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_PATHNAMES_H_) #define _PATHNAMES_H_ /* The default file for hostname completion. */ #define DEFAULT_HOSTS_FILE "/etc/hosts" /* The default login shell startup file. */ #define SYS_PROFILE "/etc/profile" /* The default location of the bash debugger initialization/startup file. */ #define DEBUGGER_START_FILE "/gnu/store/y0h72nn5qgdm51bgsira103bwsdh89dc-bash-5.1.16/share/bashdb/bashdb-main.inc" #endif /* _PATHNAMES_H */ ))entry(namequit.hnode(typeregularcontentsí /* quit.h -- How to handle SIGINT gracefully. */ /* Copyright (C) 1993-2013 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_QUIT_H_) #define _QUIT_H_ #include "sig.h" /* for sig_atomic_t */ /* Non-zero means SIGINT has already occurred. */ extern volatile sig_atomic_t interrupt_state; extern volatile sig_atomic_t terminating_signal; /* Macro to call a great deal. SIGINT just sets the interrupt_state variable. When it is safe, put QUIT in the code, and the "interrupt" will take place. The same scheme is used for terminating signals (e.g., SIGHUP) and the terminating_signal variable. That calls a function which will end up exiting the shell. */ #define QUIT \ do { \ if (terminating_signal) termsig_handler (terminating_signal); \ if (interrupt_state) throw_to_top_level (); \ } while (0) #define CHECK_ALRM \ do { \ if (sigalrm_seen) \ sh_longjmp (alrmbuf, 1); \ } while (0) #define SETINTERRUPT interrupt_state = 1 #define CLRINTERRUPT interrupt_state = 0 #define ADDINTERRUPT interrupt_state++ #define DELINTERRUPT interrupt_state-- #define ISINTERRUPT interrupt_state != 0 /* The same sort of thing, this time just for signals that would ordinarily cause the shell to terminate. */ #define CHECK_TERMSIG \ do { \ if (terminating_signal) termsig_handler (terminating_signal); \ } while (0) #define LASTSIG() \ (terminating_signal ? terminating_signal : (interrupt_state ? SIGINT : 0)) #define CHECK_WAIT_INTR \ do { \ if (wait_intr_flag && wait_signal_received && this_shell_builtin && (this_shell_builtin == wait_builtin)) \ sh_longjmp (wait_intr_buf, 1); \ } while (0) #define RESET_SIGTERM \ do { \ sigterm_received = 0; \ } while (0) #define CHECK_SIGTERM \ do { \ if (sigterm_received) termsig_handler (SIGTERM); \ } while (0) #endif /* _QUIT_H_ */ ))entry(nameshell.hnode(typeregularcontents«/* shell.h -- The data structures used by the shell */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "bashjmp.h" #include "command.h" #include "syntax.h" #include "general.h" #include "error.h" #include "variables.h" #include "arrayfunc.h" #include "quit.h" #include "maxpath.h" #include "unwind_prot.h" #include "dispose_cmd.h" #include "make_cmd.h" #include "ocache.h" #include "subst.h" #include "sig.h" #include "pathnames.h" #include "externs.h" extern int EOF_Reached; #define NO_PIPE -1 #define REDIRECT_BOTH -2 #define NO_VARIABLE -1 /* Values that can be returned by execute_command (). */ #define EXECUTION_FAILURE 1 #define EXECUTION_SUCCESS 0 /* Usage messages by builtins result in a return status of 2. */ #define EX_BADUSAGE 2 #define EX_MISCERROR 2 /* Special exit statuses used by the shell, internally and externally. */ #define EX_RETRYFAIL 124 #define EX_WEXPCOMSUB 125 #define EX_BINARY_FILE 126 #define EX_NOEXEC 126 #define EX_NOINPUT 126 #define EX_NOTFOUND 127 #define EX_SHERRBASE 256 /* all special error values are > this. */ #define EX_BADSYNTAX 257 /* shell syntax error */ #define EX_USAGE 258 /* syntax error in usage */ #define EX_REDIRFAIL 259 /* redirection failed */ #define EX_BADASSIGN 260 /* variable assignment error */ #define EX_EXPFAIL 261 /* word expansion failed */ #define EX_DISKFALLBACK 262 /* fall back to disk command from builtin */ /* Flag values that control parameter pattern substitution. */ #define MATCH_ANY 0x000 #define MATCH_BEG 0x001 #define MATCH_END 0x002 #define MATCH_TYPEMASK 0x003 #define MATCH_GLOBREP 0x010 #define MATCH_QUOTED 0x020 #define MATCH_ASSIGNRHS 0x040 #define MATCH_STARSUB 0x080 /* Some needed external declarations. */ extern char **shell_environment; extern WORD_LIST *rest_of_args; /* Generalized global variables. */ extern char *command_execution_string; extern int debugging_mode; extern int executing, login_shell; extern int interactive, interactive_shell; extern int startup_state; extern int reading_shell_script; extern int shell_initialized; extern int bash_argv_initialized; extern int subshell_environment; extern int current_command_number; extern int indirection_level; extern int shell_compatibility_level; extern int running_under_emacs; extern int posixly_correct; extern int no_line_editing; extern char *shell_name; extern char *current_host_name; extern int subshell_argc; extern char **subshell_argv; extern char **subshell_envp; /* variables managed using shopt */ extern int hup_on_exit; extern int check_jobs_at_exit; extern int autocd; extern int check_window_size; /* from version.c */ extern int build_version, patch_level; extern char *dist_version, *release_status; extern int locale_mb_cur_max; extern int locale_utf8locale; /* Structure to pass around that holds a bitmap of file descriptors to close, and the size of that structure. Used in execute_cmd.c. */ struct fd_bitmap { int size; char *bitmap; }; #define FD_BITMAP_SIZE 32 #define CTLESC '\001' #define CTLNUL '\177' /* Information about the current user. */ struct user_info { uid_t uid, euid; gid_t gid, egid; char *user_name; char *shell; /* shell from the password file */ char *home_dir; }; extern struct user_info current_user; /* Force gcc to not clobber X on a longjmp(). Old versions of gcc mangle this badly. */ #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ > 8) # define USE_VAR(x) ((void) &(x)) #else # define USE_VAR(x) #endif #define HEREDOC_MAX 16 /* Structure in which to save partial parsing state when doing things like PROMPT_COMMAND and bash_execute_unix_command execution. */ typedef struct _sh_parser_state_t { /* parsing state */ int parser_state; int *token_state; char *token; int token_buffer_size; /* input line state -- line number saved elsewhere */ int input_line_terminator; int eof_encountered; #if defined (HANDLE_MULTIBYTE) /* Nothing right now for multibyte state, but might want something later. */ #endif char **prompt_string_pointer; /* history state affecting or modified by the parser */ int current_command_line_count; #if defined (HISTORY) int remember_on_history; int history_expansion_inhibited; #endif /* execution state possibly modified by the parser */ int last_command_exit_value; #if defined (ARRAY_VARS) ARRAY *pipestatus; #endif sh_builtin_func_t *last_shell_builtin, *this_shell_builtin; /* flags state affecting the parser */ int expand_aliases; int echo_input_at_read; int need_here_doc; int here_doc_first_line; /* structures affecting the parser */ REDIRECT *redir_stack[HEREDOC_MAX]; } sh_parser_state_t; typedef struct _sh_input_line_state_t { char *input_line; size_t input_line_index; size_t input_line_size; size_t input_line_len; #if defined (HANDLE_MULTIBYTE) char *input_property; size_t input_propsize; #endif } sh_input_line_state_t; /* Let's try declaring these here. */ extern char *parser_remaining_input PARAMS((void)); extern sh_parser_state_t *save_parser_state PARAMS((sh_parser_state_t *)); extern void restore_parser_state PARAMS((sh_parser_state_t *)); extern sh_input_line_state_t *save_input_line_state PARAMS((sh_input_line_state_t *)); extern void restore_input_line_state PARAMS((sh_input_line_state_t *)); ))entry(namesig.hnode(typeregularcontentsc/* sig.h -- header file for signal handler definitions. */ /* Copyright (C) 1994-2013 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ /* Make sure that this is included *after* config.h! */ #if !defined (_SIG_H_) # define _SIG_H_ #include "stdc.h" #include /* for sig_atomic_t */ #if !defined (SIGABRT) && defined (SIGIOT) # define SIGABRT SIGIOT #endif #define sighandler RETSIGTYPE typedef RETSIGTYPE SigHandler PARAMS((int)); #if defined (VOID_SIGHANDLER) # define SIGRETURN(n) return #else # define SIGRETURN(n) return(n) #endif /* !VOID_SIGHANDLER */ /* Here is a definition for set_signal_handler () which simply expands to a call to signal () for non-Posix systems. The code for set_signal_handler in the Posix case resides in general.c. */ #if !defined (HAVE_POSIX_SIGNALS) # define set_signal_handler(sig, handler) (SigHandler *)signal (sig, handler) #else extern SigHandler *set_signal_handler PARAMS((int, SigHandler *)); /* in sig.c */ #endif /* _POSIX_VERSION */ #if !defined (SIGCHLD) && defined (SIGCLD) # define SIGCHLD SIGCLD #endif #if !defined (HAVE_POSIX_SIGNALS) && !defined (sigmask) # define sigmask(x) (1 << ((x)-1)) #endif /* !HAVE_POSIX_SIGNALS && !sigmask */ #if !defined (HAVE_POSIX_SIGNALS) # if !defined (SIG_BLOCK) # define SIG_BLOCK 2 # define SIG_SETMASK 3 # endif /* SIG_BLOCK */ /* sigset_t defined in config.h */ /* Make sure there is nothing inside the signal set. */ # define sigemptyset(set) (*(set) = 0) /* Initialize the signal set to hold all signals. */ # define sigfillset(set) (*set) = sigmask (NSIG) - 1 /* Add SIG to the contents of SET. */ # define sigaddset(set, sig) *(set) |= sigmask (sig) /* Delete SIG from signal set SET. */ # define sigdelset(set, sig) *(set) &= ~sigmask (sig) /* Is SIG a member of the signal set SET? */ # define sigismember(set, sig) ((*(set) & sigmask (sig)) != 0) /* Suspend the process until the reception of one of the signals not present in SET. */ # define sigsuspend(set) sigpause (*(set)) #endif /* !HAVE_POSIX_SIGNALS */ /* These definitions are used both in POSIX and non-POSIX implementations. */ #define BLOCK_SIGNAL(sig, nvar, ovar) \ do { \ sigemptyset (&nvar); \ sigaddset (&nvar, sig); \ sigemptyset (&ovar); \ sigprocmask (SIG_BLOCK, &nvar, &ovar); \ } while (0) #define UNBLOCK_SIGNAL(ovar) sigprocmask (SIG_SETMASK, &ovar, (sigset_t *) NULL) #if defined (HAVE_POSIX_SIGNALS) # define BLOCK_CHILD(nvar, ovar) BLOCK_SIGNAL (SIGCHLD, nvar, ovar) # define UNBLOCK_CHILD(ovar) UNBLOCK_SIGNAL(ovar) #else /* !HAVE_POSIX_SIGNALS */ # define BLOCK_CHILD(nvar, ovar) ovar = sigblock (sigmask (SIGCHLD)) # define UNBLOCK_CHILD(ovar) sigsetmask (ovar) #endif /* !HAVE_POSIX_SIGNALS */ /* Extern variables */ extern volatile sig_atomic_t sigwinch_received; extern volatile sig_atomic_t sigterm_received; extern int interrupt_immediately; /* no longer used */ extern int terminate_immediately; /* Functions from sig.c. */ extern sighandler termsig_sighandler PARAMS((int)); extern void termsig_handler PARAMS((int)); extern sighandler sigint_sighandler PARAMS((int)); extern void initialize_signals PARAMS((int)); extern void initialize_terminating_signals PARAMS((void)); extern void reset_terminating_signals PARAMS((void)); extern void top_level_cleanup PARAMS((void)); extern void throw_to_top_level PARAMS((void)); extern void jump_to_top_level PARAMS((int)) __attribute__((__noreturn__)); extern void restore_sigmask PARAMS((void)); extern sighandler sigwinch_sighandler PARAMS((int)); extern void set_sigwinch_handler PARAMS((void)); extern void unset_sigwinch_handler PARAMS((void)); extern sighandler sigterm_sighandler PARAMS((int)); /* Functions defined in trap.c. */ extern SigHandler *set_sigint_handler PARAMS((void)); extern SigHandler *trap_to_sighandler PARAMS((int)); extern sighandler trap_handler PARAMS((int)); extern int block_trapped_signals PARAMS((sigset_t *, sigset_t *)); extern int unblock_trapped_signals PARAMS((sigset_t *)); #endif /* _SIG_H_ */ ))entry(name siglist.hnode(typeregularcontents /* siglist.h -- encapsulate various definitions for sys_siglist */ /* Copyright (C) 1993, 2001, 2005, 2008-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_SIGLIST_H_) #define _SIGLIST_H_ #if !defined (SYS_SIGLIST_DECLARED) && !defined (HAVE_STRSIGNAL) #if defined (HAVE_UNDER_SYS_SIGLIST) && !defined (HAVE_SYS_SIGLIST) && !defined (sys_siglist) # define sys_siglist _sys_siglist #endif /* HAVE_UNDER_SYS_SIGLIST && !HAVE_SYS_SIGLIST && !sys_siglist */ #if !defined (sys_siglist) extern char *sys_siglist[]; #endif /* !sys_siglist */ #endif /* !SYS_SIGLIST_DECLARED && !HAVE_STRSIGNAL */ #if !defined (strsignal) && !defined (HAVE_STRSIGNAL) # define strsignal(sig) (char *)sys_siglist[sig] #endif /* !strsignal && !HAVE_STRSIGNAL */ #if !defined (strsignal) && !HAVE_DECL_STRSIGNAL extern char *strsignal PARAMS((int)); #endif #endif /* _SIGLIST_H */ ))entry(name signames.hnode(typeregularcontentsX/* This file was automatically created by ./mksignames. Do not edit. Edit support/mksignames.c instead. */ /* A translation list so we can be polite to our users. */ char *signal_names[NSIG + 4] = { "EXIT", "SIGHUP", "SIGINT", "SIGQUIT", "SIGILL", "SIGTRAP", "SIGABRT", "SIGBUS", "SIGFPE", "SIGKILL", "SIGUSR1", "SIGSEGV", "SIGUSR2", "SIGPIPE", "SIGALRM", "SIGTERM", "SIGSTKFLT", "SIGCHLD", "SIGCONT", "SIGSTOP", "SIGTSTP", "SIGTTIN", "SIGTTOU", "SIGURG", "SIGXCPU", "SIGXFSZ", "SIGVTALRM", "SIGPROF", "SIGWINCH", "SIGIO", "SIGPWR", "SIGSYS", "SIGJUNK(32)", "SIGJUNK(33)", "SIGRTMIN", "SIGRTMIN+1", "SIGRTMIN+2", "SIGRTMIN+3", "SIGRTMIN+4", "SIGRTMIN+5", "SIGRTMIN+6", "SIGRTMIN+7", "SIGRTMIN+8", "SIGRTMIN+9", "SIGRTMIN+10", "SIGRTMIN+11", "SIGRTMIN+12", "SIGRTMIN+13", "SIGRTMIN+14", "SIGRTMIN+15", "SIGRTMAX-14", "SIGRTMAX-13", "SIGRTMAX-12", "SIGRTMAX-11", "SIGRTMAX-10", "SIGRTMAX-9", "SIGRTMAX-8", "SIGRTMAX-7", "SIGRTMAX-6", "SIGRTMAX-5", "SIGRTMAX-4", "SIGRTMAX-3", "SIGRTMAX-2", "SIGRTMAX-1", "SIGRTMAX", "DEBUG", "ERR", "RETURN", (char *)0x0 }; #define initialize_signames() ))entry(namesubst.hnode(typeregularcontentsU</* subst.h -- Names of externally visible functions in subst.c. */ /* Copyright (C) 1993-2017 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_SUBST_H_) #define _SUBST_H_ #include "stdc.h" /* Constants which specify how to handle backslashes and quoting in expand_word_internal (). Q_DOUBLE_QUOTES means to use the function slashify_in_quotes () to decide whether the backslash should be retained. Q_HERE_DOCUMENT means slashify_in_here_document () to decide whether to retain the backslash. Q_KEEP_BACKSLASH means to unconditionally retain the backslash. Q_PATQUOTE means that we're expanding a pattern ${var%#[#%]pattern} in an expansion surrounded by double quotes. Q_DOLBRACE means we are expanding a ${...} word, so backslashes should also escape { and } and be removed. */ #define Q_DOUBLE_QUOTES 0x001 #define Q_HERE_DOCUMENT 0x002 #define Q_KEEP_BACKSLASH 0x004 #define Q_PATQUOTE 0x008 #define Q_QUOTED 0x010 #define Q_ADDEDQUOTES 0x020 #define Q_QUOTEDNULL 0x040 #define Q_DOLBRACE 0x080 #define Q_ARITH 0x100 /* expanding string for arithmetic evaluation */ #define Q_ARRAYSUB 0x200 /* expanding indexed array subscript */ /* Flag values controlling how assignment statements are treated. */ #define ASS_APPEND 0x0001 #define ASS_MKLOCAL 0x0002 #define ASS_MKASSOC 0x0004 #define ASS_MKGLOBAL 0x0008 /* force global assignment */ #define ASS_NAMEREF 0x0010 /* assigning to nameref variable */ #define ASS_FORCE 0x0020 /* force assignment even to readonly variable */ #define ASS_CHKLOCAL 0x0040 /* check local variable before assignment */ #define ASS_NOEXPAND 0x0080 /* don't expand associative array subscripts */ #define ASS_NOEVAL 0x0100 /* don't evaluate value as expression */ #define ASS_NOLONGJMP 0x0200 /* don't longjmp on fatal assignment error */ #define ASS_NOINVIS 0x0400 /* don't resolve local invisible variables */ /* Flags for the string extraction functions. */ #define SX_NOALLOC 0x0001 /* just skip; don't return substring */ #define SX_VARNAME 0x0002 /* variable name; for string_extract () */ #define SX_REQMATCH 0x0004 /* closing/matching delimiter required */ #define SX_COMMAND 0x0008 /* extracting a shell script/command */ #define SX_NOCTLESC 0x0010 /* don't honor CTLESC quoting */ #define SX_NOESCCTLNUL 0x0020 /* don't let CTLESC quote CTLNUL */ #define SX_NOLONGJMP 0x0040 /* don't longjmp on fatal error */ #define SX_ARITHSUB 0x0080 /* extracting $(( ... )) (currently unused) */ #define SX_POSIXEXP 0x0100 /* extracting new Posix pattern removal expansions in extract_dollar_brace_string */ #define SX_WORD 0x0200 /* extracting word in ${param op word} */ #define SX_COMPLETE 0x0400 /* extracting word for completion */ #define SX_STRIPDQ 0x0800 /* strip double quotes when extracting double-quoted string */ /* Remove backslashes which are quoting backquotes from STRING. Modifies STRING, and returns a pointer to it. */ extern char * de_backslash PARAMS((char *)); /* Replace instances of \! in a string with !. */ extern void unquote_bang PARAMS((char *)); /* Extract the $( construct in STRING, and return a new string. Start extracting at (SINDEX) as if we had just seen "$(". Make (SINDEX) get the position just after the matching ")". XFLAGS is additional flags to pass to other extraction functions, */ extern char *extract_command_subst PARAMS((char *, int *, int)); /* Extract the $[ construct in STRING, and return a new string. Start extracting at (SINDEX) as if we had just seen "$[". Make (SINDEX) get the position just after the matching "]". */ extern char *extract_arithmetic_subst PARAMS((char *, int *)); #if defined (PROCESS_SUBSTITUTION) /* Extract the <( or >( construct in STRING, and return a new string. Start extracting at (SINDEX) as if we had just seen "<(". Make (SINDEX) get the position just after the matching ")". */ extern char *extract_process_subst PARAMS((char *, char *, int *, int)); #endif /* PROCESS_SUBSTITUTION */ /* Extract the name of the variable to bind to from the assignment string. */ extern char *assignment_name PARAMS((char *)); /* Return a single string of all the words present in LIST, separating each word with SEP. */ extern char *string_list_internal PARAMS((WORD_LIST *, char *)); /* Return a single string of all the words present in LIST, separating each word with a space. */ extern char *string_list PARAMS((WORD_LIST *)); /* Turn $* into a single string, obeying POSIX rules. */ extern char *string_list_dollar_star PARAMS((WORD_LIST *, int, int)); /* Expand $@ into a single string, obeying POSIX rules. */ extern char *string_list_dollar_at PARAMS((WORD_LIST *, int, int)); /* Turn the positional parameters into a string, understanding quoting and the various subtleties of using the first character of $IFS as the separator. Calls string_list_dollar_at, string_list_dollar_star, and string_list as appropriate. */ extern char *string_list_pos_params PARAMS((int, WORD_LIST *, int, int)); /* Perform quoted null character removal on each element of LIST. This modifies LIST. */ extern void word_list_remove_quoted_nulls PARAMS((WORD_LIST *)); /* This performs word splitting and quoted null character removal on STRING. */ extern WORD_LIST *list_string PARAMS((char *, char *, int)); extern char *ifs_firstchar PARAMS((int *)); extern char *get_word_from_string PARAMS((char **, char *, char **)); extern char *strip_trailing_ifs_whitespace PARAMS((char *, char *, int)); /* Given STRING, an assignment string, get the value of the right side of the `=', and bind it to the left side. If EXPAND is true, then perform tilde expansion, parameter expansion, command substitution, and arithmetic expansion on the right-hand side. Do not perform word splitting on the result of expansion. */ extern int do_assignment PARAMS((char *)); extern int do_assignment_no_expand PARAMS((char *)); extern int do_word_assignment PARAMS((WORD_DESC *, int)); /* Append SOURCE to TARGET at INDEX. SIZE is the current amount of space allocated to TARGET. SOURCE can be NULL, in which case nothing happens. Gets rid of SOURCE by free ()ing it. Returns TARGET in case the location has changed. */ extern char *sub_append_string PARAMS((char *, char *, int *, size_t *)); /* Append the textual representation of NUMBER to TARGET. INDEX and SIZE are as in SUB_APPEND_STRING. */ extern char *sub_append_number PARAMS((intmax_t, char *, int *, int *)); /* Return the word list that corresponds to `$*'. */ extern WORD_LIST *list_rest_of_args PARAMS((void)); /* Make a single large string out of the dollar digit variables, and the rest_of_args. If DOLLAR_STAR is 1, then obey the special case of "$*" with respect to IFS. */ extern char *string_rest_of_args PARAMS((int)); /* Expand STRING by performing parameter expansion, command substitution, and arithmetic expansion. Dequote the resulting WORD_LIST before returning it, but do not perform word splitting. The call to remove_quoted_nulls () is made here because word splitting normally takes care of quote removal. */ extern WORD_LIST *expand_string_unsplit PARAMS((char *, int)); /* Expand the rhs of an assignment statement. */ extern WORD_LIST *expand_string_assignment PARAMS((char *, int)); /* Expand a prompt string. */ extern WORD_LIST *expand_prompt_string PARAMS((char *, int, int)); /* Expand STRING just as if you were expanding a word. This also returns a list of words. Note that filename globbing is *NOT* done for word or string expansion, just when the shell is expanding a command. This does parameter expansion, command substitution, arithmetic expansion, and word splitting. Dequote the resultant WORD_LIST before returning. */ extern WORD_LIST *expand_string PARAMS((char *, int)); /* Convenience functions that expand strings to strings, taking care of converting the WORD_LIST * returned by the expand_string* functions to a string and deallocating the WORD_LIST *. */ extern char *expand_string_to_string PARAMS((char *, int)); extern char *expand_string_unsplit_to_string PARAMS((char *, int)); extern char *expand_assignment_string_to_string PARAMS((char *, int)); /* Expand an arithmetic expression string */ extern char *expand_arith_string PARAMS((char *, int)); /* De-quote quoted characters in STRING. */ extern char *dequote_string PARAMS((char *)); /* De-quote CTLESC-escaped CTLESC or CTLNUL characters in STRING. */ extern char *dequote_escapes PARAMS((const char *)); extern WORD_DESC *dequote_word PARAMS((WORD_DESC *)); /* De-quote quoted characters in each word in LIST. */ extern WORD_LIST *dequote_list PARAMS((WORD_LIST *)); /* Expand WORD, performing word splitting on the result. This does parameter expansion, command substitution, arithmetic expansion, word splitting, and quote removal. */ extern WORD_LIST *expand_word PARAMS((WORD_DESC *, int)); /* Expand WORD, but do not perform word splitting on the result. This does parameter expansion, command substitution, arithmetic expansion, and quote removal. */ extern WORD_LIST *expand_word_unsplit PARAMS((WORD_DESC *, int)); extern WORD_LIST *expand_word_leave_quoted PARAMS((WORD_DESC *, int)); /* Return the value of a positional parameter. This handles values > 10. */ extern char *get_dollar_var_value PARAMS((intmax_t)); /* Quote a string to protect it from word splitting. */ extern char *quote_string PARAMS((char *)); /* Quote escape characters (characters special to internals of expansion) in a string. */ extern char *quote_escapes PARAMS((const char *)); /* And remove such quoted special characters. */ extern char *remove_quoted_escapes PARAMS((char *)); /* Remove CTLNUL characters from STRING unless they are quoted with CTLESC. */ extern char *remove_quoted_nulls PARAMS((char *)); /* Perform quote removal on STRING. If QUOTED > 0, assume we are obeying the backslash quoting rules for within double quotes. */ extern char *string_quote_removal PARAMS((char *, int)); /* Perform quote removal on word WORD. This allocates and returns a new WORD_DESC *. */ extern WORD_DESC *word_quote_removal PARAMS((WORD_DESC *, int)); /* Perform quote removal on all words in LIST. If QUOTED is non-zero, the members of the list are treated as if they are surrounded by double quotes. Return a new list, or NULL if LIST is NULL. */ extern WORD_LIST *word_list_quote_removal PARAMS((WORD_LIST *, int)); /* Called when IFS is changed to maintain some private variables. */ extern void setifs PARAMS((SHELL_VAR *)); /* Return the value of $IFS, or " \t\n" if IFS is unset. */ extern char *getifs PARAMS((void)); /* This splits a single word into a WORD LIST on $IFS, but only if the word is not quoted. list_string () performs quote removal for us, even if we don't do any splitting. */ extern WORD_LIST *word_split PARAMS((WORD_DESC *, char *)); /* Take the list of words in LIST and do the various substitutions. Return a new list of words which is the expanded list, and without things like variable assignments. */ extern WORD_LIST *expand_words PARAMS((WORD_LIST *)); /* Same as expand_words (), but doesn't hack variable or environment variables. */ extern WORD_LIST *expand_words_no_vars PARAMS((WORD_LIST *)); /* Perform the `normal shell expansions' on a WORD_LIST. These are brace expansion, tilde expansion, parameter and variable substitution, command substitution, arithmetic expansion, and word splitting. */ extern WORD_LIST *expand_words_shellexp PARAMS((WORD_LIST *)); extern WORD_DESC *command_substitute PARAMS((char *, int, int)); extern char *pat_subst PARAMS((char *, char *, char *, int)); #if defined (PROCESS_SUBSTITUTION) extern int fifos_pending PARAMS((void)); extern int num_fifos PARAMS((void)); extern void unlink_fifo_list PARAMS((void)); extern void unlink_all_fifos PARAMS((void)); extern void unlink_fifo PARAMS((int)); extern void *copy_fifo_list PARAMS((int *)); extern void close_new_fifos PARAMS((void *, int)); extern void clear_fifo_list PARAMS((void)); extern int find_procsub_child PARAMS((pid_t)); extern void set_procsub_status PARAMS((int, pid_t, int)); extern void wait_procsubs PARAMS((void)); extern void reap_procsubs PARAMS((void)); #endif extern WORD_LIST *list_string_with_quotes PARAMS((char *)); #if defined (ARRAY_VARS) extern char *extract_array_assignment_list PARAMS((char *, int *)); #endif #if defined (COND_COMMAND) extern char *remove_backslashes PARAMS((char *)); extern char *cond_expand_word PARAMS((WORD_DESC *, int)); #endif /* Flags for skip_to_delim */ #define SD_NOJMP 0x001 /* don't longjmp on fatal error. */ #define SD_INVERT 0x002 /* look for chars NOT in passed set */ #define SD_NOQUOTEDELIM 0x004 /* don't let single or double quotes act as delimiters */ #define SD_NOSKIPCMD 0x008 /* don't skip over $(, <(, or >( command/process substitution; parse them as commands */ #define SD_EXTGLOB 0x010 /* skip over extended globbing patterns if appropriate */ #define SD_IGNOREQUOTE 0x020 /* single and double quotes are not special */ #define SD_GLOB 0x040 /* skip over glob patterns like bracket expressions */ #define SD_NOPROCSUB 0x080 /* don't parse process substitutions as commands */ #define SD_COMPLETE 0x100 /* skip_to_delim during completion */ #define SD_HISTEXP 0x200 /* skip_to_delim during history expansion */ #define SD_ARITHEXP 0x400 /* skip_to_delim during arithmetic expansion */ extern int skip_to_delim PARAMS((char *, int, char *, int)); #if defined (BANG_HISTORY) extern int skip_to_histexp PARAMS((char *, int, char *, int)); #endif #if defined (READLINE) extern int char_is_quoted PARAMS((char *, int)); extern int unclosed_pair PARAMS((char *, int, char *)); extern WORD_LIST *split_at_delims PARAMS((char *, int, char *, int, int, int *, int *)); #endif /* Variables used to keep track of the characters in IFS. */ extern SHELL_VAR *ifs_var; extern char *ifs_value; extern unsigned char ifs_cmap[]; extern int ifs_is_set, ifs_is_null; #if defined (HANDLE_MULTIBYTE) extern unsigned char ifs_firstc[]; extern size_t ifs_firstc_len; #else extern unsigned char ifs_firstc; #endif extern int assigning_in_environment; extern int expanding_redir; extern int inherit_errexit; extern pid_t last_command_subst_pid; /* Evaluates to 1 if C is a character in $IFS. */ #define isifs(c) (ifs_cmap[(unsigned char)(c)] != 0) /* How to determine the quoted state of the character C. */ #define QUOTED_CHAR(c) ((c) == CTLESC) /* Is the first character of STRING a quoted NULL character? */ #define QUOTED_NULL(string) ((string)[0] == CTLNUL && (string)[1] == '\0') extern void invalidate_cached_quoted_dollar_at PARAMS((void)); #endif /* !_SUBST_H_ */ ))entry(namesyntax.hnode(typeregularcontentsÞ /* syntax.h -- Syntax definitions for the shell */ /* Copyright (C) 2000, 2001, 2005, 2008, 2009-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #ifndef _SYNTAX_H_ #define _SYNTAX_H_ /* Defines for use by mksyntax.c */ #define slashify_in_quotes "\\`$\"\n" #define slashify_in_here_document "\\`$" #define shell_meta_chars "()<>;&|" #define shell_break_chars "()<>;&| \t\n" #define shell_quote_chars "\"`'" #if defined (PROCESS_SUBSTITUTION) # define shell_exp_chars "$<>" #else # define shell_exp_chars "$" #endif #if defined (EXTENDED_GLOB) # define ext_glob_chars "@*+?!" #else # define ext_glob_chars "" #endif #define shell_glob_chars "*?[]^" /* Defines shared by mksyntax.c and the rest of the shell code. */ /* Values for character flags in syntax tables */ #define CWORD 0x0000 /* nothing special; an ordinary character */ #define CSHMETA 0x0001 /* shell meta character */ #define CSHBRK 0x0002 /* shell break character */ #define CBACKQ 0x0004 /* back quote */ #define CQUOTE 0x0008 /* shell quote character */ #define CSPECL 0x0010 /* special character that needs quoting */ #define CEXP 0x0020 /* shell expansion character */ #define CBSDQUOTE 0x0040 /* characters escaped by backslash in double quotes */ #define CBSHDOC 0x0080 /* characters escaped by backslash in here doc */ #define CGLOB 0x0100 /* globbing characters */ #define CXGLOB 0x0200 /* extended globbing characters */ #define CXQUOTE 0x0400 /* cquote + backslash */ #define CSPECVAR 0x0800 /* single-character shell variable name */ #define CSUBSTOP 0x1000 /* values of OP for ${word[:]OPstuff} */ #define CBLANK 0x2000 /* whitespace (blank) character */ /* Defines for use by the rest of the shell. */ extern int sh_syntaxtab[]; extern int sh_syntabsiz; #define shellmeta(c) (sh_syntaxtab[(unsigned char)(c)] & CSHMETA) #define shellbreak(c) (sh_syntaxtab[(unsigned char)(c)] & CSHBRK) #define shellquote(c) (sh_syntaxtab[(unsigned char)(c)] & CQUOTE) #define shellxquote(c) (sh_syntaxtab[(unsigned char)(c)] & CXQUOTE) #define shellblank(c) (sh_syntaxtab[(unsigned char)(c)] & CBLANK) #define parserblank(c) ((c) == ' ' || (c) == '\t') #define issyntype(c, t) ((sh_syntaxtab[(unsigned char)(c)] & (t)) != 0) #define notsyntype(c,t) ((sh_syntaxtab[(unsigned char)(c)] & (t)) == 0) #if defined (PROCESS_SUBSTITUTION) # define shellexp(c) ((c) == '$' || (c) == '<' || (c) == '>') #else # define shellexp(c) ((c) == '$') #endif #if defined (EXTENDED_GLOB) # define PATTERN_CHAR(c) \ ((c) == '@' || (c) == '*' || (c) == '+' || (c) == '?' || (c) == '!') #else # define PATTERN_CHAR(c) 0 #endif #define GLOB_CHAR(c) \ ((c) == '*' || (c) == '?' || (c) == '[' || (c) == ']' || (c) == '^') #define CTLESC '\001' #define CTLNUL '\177' #if !defined (HAVE_ISBLANK) && !defined (isblank) # define isblank(x) ((x) == ' ' || (x) == '\t') #endif #endif /* _SYNTAX_H_ */ ))entry(name unwind_prot.hnode(typeregularcontentsô/* unwind_prot.h - Macros and functions for hacking unwind protection. */ /* Copyright (C) 1993-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_UNWIND_PROT_H) #define _UNWIND_PROT_H extern void uwp_init PARAMS((void)); /* Run a function without interrupts. */ extern void begin_unwind_frame PARAMS((char *)); extern void discard_unwind_frame PARAMS((char *)); extern void run_unwind_frame PARAMS((char *)); extern void add_unwind_protect (); /* Not portable to arbitrary C99 hosts. */ extern void remove_unwind_protect PARAMS((void)); extern void run_unwind_protects PARAMS((void)); extern void clear_unwind_protect_list PARAMS((int)); extern int have_unwind_protects PARAMS((void)); extern int unwind_protect_tag_on_stack PARAMS((const char *)); extern void uwp_init PARAMS((void)); /* Define for people who like their code to look a certain way. */ #define end_unwind_frame() /* How to protect a variable. */ #define unwind_protect_var(X) unwind_protect_mem ((char *)&(X), sizeof (X)) extern void unwind_protect_mem PARAMS((char *, int)); /* Backwards compatibility */ #define unwind_protect_int unwind_protect_var #define unwind_protect_short unwind_protect_var #define unwind_protect_string unwind_protect_var #define unwind_protect_pointer unwind_protect_var #define unwind_protect_jmp_buf unwind_protect_var #endif /* _UNWIND_PROT_H */ ))entry(name variables.hnode(typeregularcontentsuG/* variables.h -- data structures for shell variables. */ /* Copyright (C) 1987-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_VARIABLES_H_) #define _VARIABLES_H_ #include "stdc.h" #include "array.h" #include "assoc.h" /* Shell variables and functions are stored in hash tables. */ #include "hashlib.h" #include "conftypes.h" /* A variable context. */ typedef struct var_context { char *name; /* empty or NULL means global context */ int scope; /* 0 means global context */ int flags; struct var_context *up; /* previous function calls */ struct var_context *down; /* down towards global context */ HASH_TABLE *table; /* variables at this scope */ } VAR_CONTEXT; /* Flags for var_context->flags */ #define VC_HASLOCAL 0x01 #define VC_HASTMPVAR 0x02 #define VC_FUNCENV 0x04 /* also function if name != NULL */ #define VC_BLTNENV 0x08 /* builtin_env */ #define VC_TEMPENV 0x10 /* temporary_env */ #define VC_TEMPFLAGS (VC_FUNCENV|VC_BLTNENV|VC_TEMPENV) /* Accessing macros */ #define vc_isfuncenv(vc) (((vc)->flags & VC_FUNCENV) != 0) #define vc_isbltnenv(vc) (((vc)->flags & VC_BLTNENV) != 0) #define vc_istempenv(vc) (((vc)->flags & (VC_TEMPFLAGS)) == VC_TEMPENV) #define vc_istempscope(vc) (((vc)->flags & (VC_TEMPENV|VC_BLTNENV)) != 0) #define vc_haslocals(vc) (((vc)->flags & VC_HASLOCAL) != 0) #define vc_hastmpvars(vc) (((vc)->flags & VC_HASTMPVAR) != 0) /* What a shell variable looks like. */ typedef struct variable *sh_var_value_func_t PARAMS((struct variable *)); typedef struct variable *sh_var_assign_func_t PARAMS((struct variable *, char *, arrayind_t, char *)); /* For the future */ union _value { char *s; /* string value */ intmax_t i; /* int value */ COMMAND *f; /* function */ ARRAY *a; /* array */ HASH_TABLE *h; /* associative array */ double d; /* floating point number */ #if defined (HAVE_LONG_DOUBLE) long double ld; /* long double */ #endif struct variable *v; /* possible indirect variable use */ void *opaque; /* opaque data for future use */ }; typedef struct variable { char *name; /* Symbol that the user types. */ char *value; /* Value that is returned. */ char *exportstr; /* String for the environment. */ sh_var_value_func_t *dynamic_value; /* Function called to return a `dynamic' value for a variable, like $SECONDS or $RANDOM. */ sh_var_assign_func_t *assign_func; /* Function called when this `special variable' is assigned a value in bind_variable. */ int attributes; /* export, readonly, array, invisible... */ int context; /* Which context this variable belongs to. */ } SHELL_VAR; typedef struct _vlist { SHELL_VAR **list; int list_size; /* allocated size */ int list_len; /* current number of entries */ } VARLIST; /* The various attributes that a given variable can have. */ /* First, the user-visible attributes */ #define att_exported 0x0000001 /* export to environment */ #define att_readonly 0x0000002 /* cannot change */ #define att_array 0x0000004 /* value is an array */ #define att_function 0x0000008 /* value is a function */ #define att_integer 0x0000010 /* internal representation is int */ #define att_local 0x0000020 /* variable is local to a function */ #define att_assoc 0x0000040 /* variable is an associative array */ #define att_trace 0x0000080 /* function is traced with DEBUG trap */ #define att_uppercase 0x0000100 /* word converted to uppercase on assignment */ #define att_lowercase 0x0000200 /* word converted to lowercase on assignment */ #define att_capcase 0x0000400 /* word capitalized on assignment */ #define att_nameref 0x0000800 /* word is a name reference */ #define user_attrs (att_exported|att_readonly|att_integer|att_local|att_trace|att_uppercase|att_lowercase|att_capcase|att_nameref) #define attmask_user 0x0000fff /* Internal attributes used for bookkeeping */ #define att_invisible 0x0001000 /* cannot see */ #define att_nounset 0x0002000 /* cannot unset */ #define att_noassign 0x0004000 /* assignment not allowed */ #define att_imported 0x0008000 /* came from environment */ #define att_special 0x0010000 /* requires special handling */ #define att_nofree 0x0020000 /* do not free value on unset */ #define att_regenerate 0x0040000 /* regenerate when exported */ #define attmask_int 0x00ff000 /* Internal attributes used for variable scoping. */ #define att_tempvar 0x0100000 /* variable came from the temp environment */ #define att_propagate 0x0200000 /* propagate to previous scope */ #define attmask_scope 0x0f00000 #define exported_p(var) ((((var)->attributes) & (att_exported))) #define readonly_p(var) ((((var)->attributes) & (att_readonly))) #define array_p(var) ((((var)->attributes) & (att_array))) #define function_p(var) ((((var)->attributes) & (att_function))) #define integer_p(var) ((((var)->attributes) & (att_integer))) #define local_p(var) ((((var)->attributes) & (att_local))) #define assoc_p(var) ((((var)->attributes) & (att_assoc))) #define trace_p(var) ((((var)->attributes) & (att_trace))) #define uppercase_p(var) ((((var)->attributes) & (att_uppercase))) #define lowercase_p(var) ((((var)->attributes) & (att_lowercase))) #define capcase_p(var) ((((var)->attributes) & (att_capcase))) #define nameref_p(var) ((((var)->attributes) & (att_nameref))) #define invisible_p(var) ((((var)->attributes) & (att_invisible))) #define non_unsettable_p(var) ((((var)->attributes) & (att_nounset))) #define noassign_p(var) ((((var)->attributes) & (att_noassign))) #define imported_p(var) ((((var)->attributes) & (att_imported))) #define specialvar_p(var) ((((var)->attributes) & (att_special))) #define nofree_p(var) ((((var)->attributes) & (att_nofree))) #define regen_p(var) ((((var)->attributes) & (att_regenerate))) #define tempvar_p(var) ((((var)->attributes) & (att_tempvar))) #define propagate_p(var) ((((var)->attributes) & (att_propagate))) /* Variable names: lvalues */ #define name_cell(var) ((var)->name) /* Accessing variable values: rvalues */ #define value_cell(var) ((var)->value) #define function_cell(var) (COMMAND *)((var)->value) #define array_cell(var) (ARRAY *)((var)->value) #define assoc_cell(var) (HASH_TABLE *)((var)->value) #define nameref_cell(var) ((var)->value) /* so it can change later */ #define NAMEREF_MAX 8 /* only 8 levels of nameref indirection */ #define var_isset(var) ((var)->value != 0) #define var_isunset(var) ((var)->value == 0) #define var_isnull(var) ((var)->value && *(var)->value == 0) /* Assigning variable values: lvalues */ #define var_setvalue(var, str) ((var)->value = (str)) #define var_setfunc(var, func) ((var)->value = (char *)(func)) #define var_setarray(var, arr) ((var)->value = (char *)(arr)) #define var_setassoc(var, arr) ((var)->value = (char *)(arr)) #define var_setref(var, str) ((var)->value = (str)) /* Make VAR be auto-exported. */ #define set_auto_export(var) \ do { (var)->attributes |= att_exported; array_needs_making = 1; } while (0) #define SETVARATTR(var, attr, undo) \ ((undo == 0) ? ((var)->attributes |= (attr)) \ : ((var)->attributes &= ~(attr))) #define VSETATTR(var, attr) ((var)->attributes |= (attr)) #define VUNSETATTR(var, attr) ((var)->attributes &= ~(attr)) #define VGETFLAGS(var) ((var)->attributes) #define VSETFLAGS(var, flags) ((var)->attributes = (flags)) #define VCLRFLAGS(var) ((var)->attributes = 0) /* Macros to perform various operations on `exportstr' member of a SHELL_VAR. */ #define CLEAR_EXPORTSTR(var) (var)->exportstr = (char *)NULL #define COPY_EXPORTSTR(var) ((var)->exportstr) ? savestring ((var)->exportstr) : (char *)NULL #define SET_EXPORTSTR(var, value) (var)->exportstr = (value) #define SAVE_EXPORTSTR(var, value) (var)->exportstr = (value) ? savestring (value) : (char *)NULL #define FREE_EXPORTSTR(var) \ do { if ((var)->exportstr) free ((var)->exportstr); } while (0) #define CACHE_IMPORTSTR(var, value) \ (var)->exportstr = savestring (value) #define INVALIDATE_EXPORTSTR(var) \ do { \ if ((var)->exportstr) \ { \ free ((var)->exportstr); \ (var)->exportstr = (char *)NULL; \ } \ } while (0) #define ifsname(s) ((s)[0] == 'I' && (s)[1] == 'F' && (s)[2] == 'S' && (s)[3] == '\0') /* Flag values for make_local_variable and its array counterparts */ #define MKLOC_ASSOCOK 0x01 #define MKLOC_ARRAYOK 0x02 #define MKLOC_INHERIT 0x04 /* Special value for nameref with invalid value for creation or assignment */ extern SHELL_VAR nameref_invalid_value; #define INVALID_NAMEREF_VALUE (void *)&nameref_invalid_value /* Stuff for hacking variables. */ typedef int sh_var_map_func_t PARAMS((SHELL_VAR *)); /* Where we keep the variables and functions */ extern VAR_CONTEXT *global_variables; extern VAR_CONTEXT *shell_variables; extern HASH_TABLE *shell_functions; extern HASH_TABLE *temporary_env; extern int variable_context; extern char *dollar_vars[]; extern char **export_env; extern int tempenv_assign_error; extern int array_needs_making; extern int shell_level; /* XXX */ extern WORD_LIST *rest_of_args; extern int posparam_count; extern pid_t dollar_dollar_pid; extern int localvar_inherit; /* declared in variables.c */ extern void initialize_shell_variables PARAMS((char **, int)); extern int validate_inherited_value PARAMS((SHELL_VAR *, int)); extern SHELL_VAR *set_if_not PARAMS((char *, char *)); extern void sh_set_lines_and_columns PARAMS((int, int)); extern void set_pwd PARAMS((void)); extern void set_ppid PARAMS((void)); extern void make_funcname_visible PARAMS((int)); extern SHELL_VAR *var_lookup PARAMS((const char *, VAR_CONTEXT *)); extern SHELL_VAR *find_function PARAMS((const char *)); extern FUNCTION_DEF *find_function_def PARAMS((const char *)); extern SHELL_VAR *find_variable PARAMS((const char *)); extern SHELL_VAR *find_variable_noref PARAMS((const char *)); extern SHELL_VAR *find_variable_last_nameref PARAMS((const char *, int)); extern SHELL_VAR *find_global_variable_last_nameref PARAMS((const char *, int)); extern SHELL_VAR *find_variable_nameref PARAMS((SHELL_VAR *)); extern SHELL_VAR *find_variable_nameref_for_create PARAMS((const char *, int)); extern SHELL_VAR *find_variable_nameref_for_assignment PARAMS((const char *, int)); /*extern SHELL_VAR *find_variable_internal PARAMS((const char *, int));*/ extern SHELL_VAR *find_variable_tempenv PARAMS((const char *)); extern SHELL_VAR *find_variable_notempenv PARAMS((const char *)); extern SHELL_VAR *find_global_variable PARAMS((const char *)); extern SHELL_VAR *find_global_variable_noref PARAMS((const char *)); extern SHELL_VAR *find_shell_variable PARAMS((const char *)); extern SHELL_VAR *find_tempenv_variable PARAMS((const char *)); extern SHELL_VAR *find_variable_no_invisible PARAMS((const char *)); extern SHELL_VAR *find_variable_for_assignment PARAMS((const char *)); extern char *nameref_transform_name PARAMS((char *, int)); extern SHELL_VAR *copy_variable PARAMS((SHELL_VAR *)); extern SHELL_VAR *make_local_variable PARAMS((const char *, int)); extern SHELL_VAR *bind_variable PARAMS((const char *, char *, int)); extern SHELL_VAR *bind_global_variable PARAMS((const char *, char *, int)); extern SHELL_VAR *bind_function PARAMS((const char *, COMMAND *)); extern void bind_function_def PARAMS((const char *, FUNCTION_DEF *, int)); extern SHELL_VAR **map_over PARAMS((sh_var_map_func_t *, VAR_CONTEXT *)); SHELL_VAR **map_over_funcs PARAMS((sh_var_map_func_t *)); extern SHELL_VAR **all_shell_variables PARAMS((void)); extern SHELL_VAR **all_shell_functions PARAMS((void)); extern SHELL_VAR **all_visible_variables PARAMS((void)); extern SHELL_VAR **all_visible_functions PARAMS((void)); extern SHELL_VAR **all_exported_variables PARAMS((void)); extern SHELL_VAR **local_exported_variables PARAMS((void)); extern SHELL_VAR **all_local_variables PARAMS((int)); #if defined (ARRAY_VARS) extern SHELL_VAR **all_array_variables PARAMS((void)); #endif extern char **all_variables_matching_prefix PARAMS((const char *)); extern char **make_var_array PARAMS((HASH_TABLE *)); extern char **add_or_supercede_exported_var PARAMS((char *, int)); extern char *get_variable_value PARAMS((SHELL_VAR *)); extern char *get_string_value PARAMS((const char *)); extern char *sh_get_env_value PARAMS((const char *)); extern char *make_variable_value PARAMS((SHELL_VAR *, char *, int)); extern SHELL_VAR *bind_variable_value PARAMS((SHELL_VAR *, char *, int)); extern SHELL_VAR *bind_int_variable PARAMS((char *, char *, int)); extern SHELL_VAR *bind_var_to_int PARAMS((char *, intmax_t)); extern int assign_in_env PARAMS((WORD_DESC *, int)); extern int unbind_variable PARAMS((const char *)); extern int check_unbind_variable PARAMS((const char *)); extern int unbind_nameref PARAMS((const char *)); extern int unbind_variable_noref PARAMS((const char *)); extern int unbind_func PARAMS((const char *)); extern int unbind_function_def PARAMS((const char *)); extern int delete_var PARAMS((const char *, VAR_CONTEXT *)); extern int makunbound PARAMS((const char *, VAR_CONTEXT *)); extern int kill_local_variable PARAMS((const char *)); extern void delete_all_variables PARAMS((HASH_TABLE *)); extern void delete_all_contexts PARAMS((VAR_CONTEXT *)); extern VAR_CONTEXT *new_var_context PARAMS((char *, int)); extern void dispose_var_context PARAMS((VAR_CONTEXT *)); extern VAR_CONTEXT *push_var_context PARAMS((char *, int, HASH_TABLE *)); extern void pop_var_context PARAMS((void)); extern VAR_CONTEXT *push_scope PARAMS((int, HASH_TABLE *)); extern void pop_scope PARAMS((int)); extern void clear_dollar_vars PARAMS((void)); extern void push_context PARAMS((char *, int, HASH_TABLE *)); extern void pop_context PARAMS((void)); extern void push_dollar_vars PARAMS((void)); extern void pop_dollar_vars PARAMS((void)); extern void dispose_saved_dollar_vars PARAMS((void)); extern void init_bash_argv PARAMS((void)); extern void save_bash_argv PARAMS((void)); extern void push_args PARAMS((WORD_LIST *)); extern void pop_args PARAMS((void)); extern void adjust_shell_level PARAMS((int)); extern void non_unsettable PARAMS((char *)); extern void dispose_variable PARAMS((SHELL_VAR *)); extern void dispose_used_env_vars PARAMS((void)); extern void dispose_function_env PARAMS((void)); extern void dispose_builtin_env PARAMS((void)); extern void merge_temporary_env PARAMS((void)); extern void flush_temporary_env PARAMS((void)); extern void merge_builtin_env PARAMS((void)); extern void kill_all_local_variables PARAMS((void)); extern void set_var_read_only PARAMS((char *)); extern void set_func_read_only PARAMS((const char *)); extern void set_var_auto_export PARAMS((char *)); extern void set_func_auto_export PARAMS((const char *)); extern void sort_variables PARAMS((SHELL_VAR **)); extern int chkexport PARAMS((char *)); extern void maybe_make_export_env PARAMS((void)); extern void update_export_env_inplace PARAMS((char *, int, char *)); extern void put_command_name_into_env PARAMS((char *)); extern void put_gnu_argv_flags_into_env PARAMS((intmax_t, char *)); extern void print_var_list PARAMS((SHELL_VAR **)); extern void print_func_list PARAMS((SHELL_VAR **)); extern void print_assignment PARAMS((SHELL_VAR *)); extern void print_var_value PARAMS((SHELL_VAR *, int)); extern void print_var_function PARAMS((SHELL_VAR *)); #if defined (ARRAY_VARS) extern SHELL_VAR *make_new_array_variable PARAMS((char *)); extern SHELL_VAR *make_local_array_variable PARAMS((char *, int)); extern SHELL_VAR *make_new_assoc_variable PARAMS((char *)); extern SHELL_VAR *make_local_assoc_variable PARAMS((char *, int)); extern void set_pipestatus_array PARAMS((int *, int)); extern ARRAY *save_pipestatus_array PARAMS((void)); extern void restore_pipestatus_array PARAMS((ARRAY *)); #endif extern void set_pipestatus_from_exit PARAMS((int)); /* The variable in NAME has just had its state changed. Check to see if it is one of the special ones where something special happens. */ extern void stupidly_hack_special_variables PARAMS((char *)); /* Reinitialize some special variables that have external effects upon unset when the shell reinitializes itself. */ extern void reinit_special_variables PARAMS((void)); extern int get_random_number PARAMS((void)); /* The `special variable' functions that get called when a particular variable is set. */ extern void sv_ifs PARAMS((char *)); extern void sv_path PARAMS((char *)); extern void sv_mail PARAMS((char *)); extern void sv_funcnest PARAMS((char *)); extern void sv_execignore PARAMS((char *)); extern void sv_globignore PARAMS((char *)); extern void sv_ignoreeof PARAMS((char *)); extern void sv_strict_posix PARAMS((char *)); extern void sv_optind PARAMS((char *)); extern void sv_opterr PARAMS((char *)); extern void sv_locale PARAMS((char *)); extern void sv_xtracefd PARAMS((char *)); extern void sv_shcompat PARAMS((char *)); #if defined (READLINE) extern void sv_comp_wordbreaks PARAMS((char *)); extern void sv_terminal PARAMS((char *)); extern void sv_hostfile PARAMS((char *)); extern void sv_winsize PARAMS((char *)); #endif #if defined (__CYGWIN__) extern void sv_home PARAMS((char *)); #endif #if defined (HISTORY) extern void sv_histsize PARAMS((char *)); extern void sv_histignore PARAMS((char *)); extern void sv_history_control PARAMS((char *)); # if defined (BANG_HISTORY) extern void sv_histchars PARAMS((char *)); # endif extern void sv_histtimefmt PARAMS((char *)); #endif /* HISTORY */ #if defined (HAVE_TZSET) extern void sv_tz PARAMS((char *)); #endif #if defined (JOB_CONTROL) extern void sv_childmax PARAMS((char *)); #endif #endif /* !_VARIABLES_H_ */ ))entry(name version.hnode(typeregularcontentsC/* Version control for the shell. This file gets changed when you say `make version.h' to the Makefile. It is created by mkversion. */ /* The distribution version number of this shell. */ #define DISTVERSION "5.1" /* The last built version of this shell. */ #define BUILDVERSION 1 /* The release status of this shell. */ #define RELSTATUS "release" /* The default shell compatibility-level (the current version) */ #define DEFAULT_COMPAT_LEVEL 51 /* A version string for use by sccs and the what command. */ #define SCCSVERSION "@(#)Bash version 5.1.16(1) release GNU" ))entry(name xmalloc.hnode(typeregularcontentsˆ/* xmalloc.h -- defines for the `x' memory allocation functions */ /* Copyright (C) 2001-2020 Free Software Foundation, Inc. This file is part of GNU Bash, the Bourne Again SHell. Bash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Bash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Bash. If not, see . */ #if !defined (_XMALLOC_H_) #define _XMALLOC_H_ #include "stdc.h" #include "bashansi.h" /* Generic pointer type. */ #ifndef PTR_T #if defined (__STDC__) # define PTR_T void * #else # define PTR_T char * #endif #endif /* PTR_T */ /* Allocation functions in xmalloc.c */ extern PTR_T xmalloc PARAMS((size_t)); extern PTR_T xrealloc PARAMS((void *, size_t)); extern void xfree PARAMS((void *)); #if defined(USING_BASH_MALLOC) && !defined (DISABLE_MALLOC_WRAPPERS) extern PTR_T sh_xmalloc PARAMS((size_t, const char *, int)); extern PTR_T sh_xrealloc PARAMS((void *, size_t, const char *, int)); extern void sh_xfree PARAMS((void *, const char *, int)); #define xmalloc(x) sh_xmalloc((x), __FILE__, __LINE__) #define xrealloc(x, n) sh_xrealloc((x), (n), __FILE__, __LINE__) #define xfree(x) sh_xfree((x), __FILE__, __LINE__) #ifdef free #undef free #endif #define free(x) sh_xfree((x), __FILE__, __LINE__) extern PTR_T sh_malloc PARAMS((size_t, const char *, int)); #ifdef malloc #undef malloc #endif #define malloc(x) sh_malloc((x), __FILE__, __LINE__) #endif /* USING_BASH_MALLOC */ #endif /* _XMALLOC_H_ */ ))entry(namey.tab.hnode(typeregularcontents:/* A Bison parser, made by GNU Bison 3.6.4. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ #ifndef YY_YY_Y_TAB_H_INCLUDED # define YY_YY_Y_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif #if YYDEBUG extern int yydebug; #endif /* Token kinds. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE enum yytokentype { YYEMPTY = -2, YYEOF = 0, /* "end of file" */ YYerror = 256, /* error */ YYUNDEF = 257, /* "invalid token" */ IF = 258, /* IF */ THEN = 259, /* THEN */ ELSE = 260, /* ELSE */ ELIF = 261, /* ELIF */ FI = 262, /* FI */ CASE = 263, /* CASE */ ESAC = 264, /* ESAC */ FOR = 265, /* FOR */ SELECT = 266, /* SELECT */ WHILE = 267, /* WHILE */ UNTIL = 268, /* UNTIL */ DO = 269, /* DO */ DONE = 270, /* DONE */ FUNCTION = 271, /* FUNCTION */ COPROC = 272, /* COPROC */ COND_START = 273, /* COND_START */ COND_END = 274, /* COND_END */ COND_ERROR = 275, /* COND_ERROR */ IN = 276, /* IN */ BANG = 277, /* BANG */ TIME = 278, /* TIME */ TIMEOPT = 279, /* TIMEOPT */ TIMEIGN = 280, /* TIMEIGN */ WORD = 281, /* WORD */ ASSIGNMENT_WORD = 282, /* ASSIGNMENT_WORD */ REDIR_WORD = 283, /* REDIR_WORD */ NUMBER = 284, /* NUMBER */ ARITH_CMD = 285, /* ARITH_CMD */ ARITH_FOR_EXPRS = 286, /* ARITH_FOR_EXPRS */ COND_CMD = 287, /* COND_CMD */ AND_AND = 288, /* AND_AND */ OR_OR = 289, /* OR_OR */ GREATER_GREATER = 290, /* GREATER_GREATER */ LESS_LESS = 291, /* LESS_LESS */ LESS_AND = 292, /* LESS_AND */ LESS_LESS_LESS = 293, /* LESS_LESS_LESS */ GREATER_AND = 294, /* GREATER_AND */ SEMI_SEMI = 295, /* SEMI_SEMI */ SEMI_AND = 296, /* SEMI_AND */ SEMI_SEMI_AND = 297, /* SEMI_SEMI_AND */ LESS_LESS_MINUS = 298, /* LESS_LESS_MINUS */ AND_GREATER = 299, /* AND_GREATER */ AND_GREATER_GREATER = 300, /* AND_GREATER_GREATER */ LESS_GREATER = 301, /* LESS_GREATER */ GREATER_BAR = 302, /* GREATER_BAR */ BAR_AND = 303, /* BAR_AND */ yacc_EOF = 304 /* yacc_EOF */ }; typedef enum yytokentype yytoken_kind_t; #endif /* Token kinds. */ #define YYEOF 0 #define YYerror 256 #define YYUNDEF 257 #define IF 258 #define THEN 259 #define ELSE 260 #define ELIF 261 #define FI 262 #define CASE 263 #define ESAC 264 #define FOR 265 #define SELECT 266 #define WHILE 267 #define UNTIL 268 #define DO 269 #define DONE 270 #define FUNCTION 271 #define COPROC 272 #define COND_START 273 #define COND_END 274 #define COND_ERROR 275 #define IN 276 #define BANG 277 #define TIME 278 #define TIMEOPT 279 #define TIMEIGN 280 #define WORD 281 #define ASSIGNMENT_WORD 282 #define REDIR_WORD 283 #define NUMBER 284 #define ARITH_CMD 285 #define ARITH_FOR_EXPRS 286 #define COND_CMD 287 #define AND_AND 288 #define OR_OR 289 #define GREATER_GREATER 290 #define LESS_LESS 291 #define LESS_AND 292 #define LESS_LESS_LESS 293 #define GREATER_AND 294 #define SEMI_SEMI 295 #define SEMI_AND 296 #define SEMI_SEMI_AND 297 #define LESS_LESS_MINUS 298 #define AND_GREATER 299 #define AND_GREATER_GREATER 300 #define LESS_GREATER 301 #define GREATER_BAR 302 #define BAR_AND 303 #define yacc_EOF 304 /* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED union YYSTYPE { #line 328 "/Users/chet/src/bash/src/parse.y" WORD_DESC *word; /* the word that we read. */ int number; /* the number that we read. */ WORD_LIST *word_list; COMMAND *command; REDIRECT *redirect; ELEMENT element; PATTERN_LIST *pattern; #line 174 "y.tab.h" }; typedef union YYSTYPE YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; int yyparse (void); #endif /* !YY_YY_Y_TAB_H_INCLUDED */ ))))))entry(namelibnode(type directoryentry(namebashnode(type directoryentry(name Makefile.incnode(typeregularcontentsê # # Sample makefile for bash loadable builtin development # # Copyright (C) 2015 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # PACKAGE = bash VERSION = 5.1-release PACKAGE_NAME = bash PACKAGE_VERSION = 5.1-release # Include some boilerplate Gnu makefile definitions. prefix = /gnu/store/y0h72nn5qgdm51bgsira103bwsdh89dc-bash-5.1.16 exec_prefix = ${prefix} bindir = ${exec_prefix}/bin libdir = ${exec_prefix}/lib infodir = ${datarootdir}/info includedir = /gnu/store/0rjv9la51y4nyjjilhhf9cb7rdx6diyf-bash-5.1.16-include/include datarootdir = ${prefix}/share loadablesdir = ${libdir}/bash headersdir = $(includedir)/$(PACKAGE_NAME) topdir = ../.. BUILD_DIR = /tmp/guix-build-bash-5.1.16.drv-0/bash-5.1 srcdir = . # Support an alternate destination root directory for package building DESTDIR = INSTALL = install -c INSTALL_PROGRAM = ${INSTALL} INSTALL_SCRIPT = ${INSTALL} INSTALL_DATA = ${INSTALL} -m 644 INSTALLMODE= -m 0755 MAKE=make CC = gcc RM = rm -f SHELL = /bin/sh host_os = linux-gnu host_cpu = aarch64 host_vendor = unknown CFLAGS = -g -O2 -Wno-parentheses -Wno-format-security LOCAL_CFLAGS = DEFS = -DHAVE_CONFIG_H LOCAL_DEFS = -DSHELL CPPFLAGS = -DDEFAULT_PATH_VALUE='"/no-such-path"' -DSTANDARD_UTILS_PATH='"/no-such-path"' -DNON_INTERACTIVE_LOGIN_SHELLS -DSSH_SOURCE_BASHRC BASHINCDIR = ${topdir}/include SUPPORT_SRC = $(topdir)/support/ LIBBUILD = ${BUILD_DIR}/lib INTL_LIBSRC = ${topdir}/lib/intl INTL_BUILDDIR = ${LIBBUILD}/intl INTL_INC = LIBINTL_H = CCFLAGS = $(DEFS) $(LOCAL_DEFS) $(LOCAL_CFLAGS) $(CFLAGS) # # These values are generated for configure by ${topdir}/support/shobj-conf. # If your system is not supported by that script, but includes facilities for # dynamic loading of shared objects, please update the script and send the # changes to bash-maintainers@gnu.org. # SHOBJ_CC = gcc SHOBJ_CFLAGS = -fPIC SHOBJ_LD = ${CC} SHOBJ_LDFLAGS = -shared -Wl,-soname,$@ -Wl,-rpath -Wl,/gnu/store/j724qklr72gz62i6v93sm3g4i3hqbvln-readline-8.1.2/lib -Wl,-rpath -Wl,/gnu/store/pcshzl8wyhysja6daaabxhzhnxp5qa0s-ncurses-6.2.20210619/lib SHOBJ_XLDFLAGS = SHOBJ_LIBS = SHOBJ_STATUS = supported INC = -I$(headersdir) -I$(headersdir)/include -I$(headersdir)/builtins .c.o: $(SHOBJ_CC) $(SHOBJ_CFLAGS) $(CCFLAGS) $(INC) -c -o $@ $< all: example example: example.o $(SHOBJ_LD) $(SHOBJ_LDFLAGS) $(SHOBJ_XLDFLAGS) -o $@ example.o $(SHOBJ_LIBS) example.o: example.c ))))entry(name pkgconfignode(type directoryentry(namebash.pcnode(typeregularcontents³# bash.pc.in prefix=/gnu/store/y0h72nn5qgdm51bgsira103bwsdh89dc-bash-5.1.16 exec_prefix=${prefix} includedir=/gnu/store/0rjv9la51y4nyjjilhhf9cb7rdx6diyf-bash-5.1.16-include/include libdir=${exec_prefix}/lib loadablesdir=${libdir}/bash headersdir=${includedir}/bash LOCAL_CFLAGS = LOCAL_DEFS = -DSHELL CCFLAGS = ${LOCAL_DEFS} ${LOCAL_CFLAGS} CC = gcc SHOBJ_CC = gcc SHOBJ_CFLAGS = -fPIC SHOBJ_LD = ${CC} SHOBJ_LDFLAGS = -shared -Wl,-soname,$@ SHOBJ_XLDFLAGS = SHOBJ_LIBS = Name: bash Description: Bash headers for bash loadable builtins Version: 5.1-release Url: Libs: ${SHOBJ_LIBS} Cflags: ${SHOBJ_CFLAGS} ${CCFLAGS} -I${headersdir} -I${headersdir}/builtins -I${headersdir}/include ))))))entry(namesharenode(type directoryentry(namedocnode(type directoryentry(name bash-5.1.16node(type directoryentry(nameCOPYINGnode(typeregularcontentsK‰ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . )))))))))