1 /* 2 * CDDL HEADER START 3 * 4 * This file and its contents are supplied under the terms of the 5 * Common Development and Distribution License ("CDDL"), version 1.0. 6 * You may use this file only in accordance with the terms of version 7 * 1.0 of the CDDL. 8 * 9 * A full copy of the text of the CDDL should have accompanied this 10 * source. A copy of the CDDL is also available via the Internet at 11 * http://www.opensource.org/licenses/cddl1.txt 12 * See the License for the specific language governing permissions 13 * and limitations under the License. 14 * 15 * When distributing Covered Code, include this CDDL HEADER in each 16 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 17 * If applicable, add the following below this CDDL HEADER, with the 18 * fields enclosed by brackets "[]" replaced with your own identifying 19 * information: Portions Copyright [yyyy] [name of copyright owner] 20 * 21 * CDDL HEADER END 22 */ 23 /* 24 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 25 * Use is subject to license terms. 26 */ 27 /* 28 * @(#)globals.cc 1.16 06/12/12 29 */ 30 31 #pragma ident "@(#)globals.cc 1.16 06/12/12" 32 33 /* 34 * Copyright 2017 J. Schilling 35 * 36 * @(#)globals.cc 1.6 21/08/16 2017 J. Schilling 37 */ 38 #include <schily/mconfig.h> 39 #ifndef lint 40 static UConst char sccsid[] = 41 "@(#)globals.cc 1.6 21/08/16 2017 J. Schilling"; 42 #endif 43 44 /* 45 * globals.cc 46 * 47 * This declares all global variables 48 */ 49 50 /* 51 * Included files 52 */ 53 #include <mksh/globals.h> 54 55 /* 56 * Defined macros 57 */ 58 59 /* 60 * typedefs & structs 61 */ 62 63 /* 64 * Global variables 65 */ 66 char char_semantics[CHAR_SEMANTICS_ENTRIES]; 67 wchar_t char_semantics_char[] = { 68 ampersand_char, 69 asterisk_char, 70 at_char, 71 backquote_char, 72 backslash_char, 73 bar_char, 74 bracketleft_char, 75 bracketright_char, 76 colon_char, 77 dollar_char, 78 doublequote_char, 79 equal_char, 80 exclam_char, 81 greater_char, 82 hat_char, 83 hyphen_char, 84 less_char, 85 newline_char, 86 numbersign_char, 87 parenleft_char, 88 parenright_char, 89 percent_char, 90 plus_char, 91 question_char, 92 quote_char, 93 semicolon_char, 94 #ifdef SGE_SUPPORT 95 space_char, 96 tab_char, 97 #endif 98 nul_char 99 }; 100 Macro_list cond_macro_list; 101 Boolean conditional_macro_used; 102 Boolean do_not_exec_rule; /* `-n' */ 103 Boolean dollarget_seen; 104 Boolean dollarless_flag; 105 Name dollarless_value; 106 Envvar envvar; 107 #ifdef lint 108 char **environ; 109 #endif 110 int exit_status; 111 wchar_t *file_being_read; 112 /* Variable gnu_style=true if env. var. SUN_MAKE_COMPAT_MODE=GNU (RFE 4866328) */ 113 Boolean gnu_style = false; 114 Boolean sunpro_compat = false; 115 Name_set hashtab; 116 Name host_arch; 117 Name host_mach; 118 int line_number; 119 char *make_state_lockfile; 120 Boolean make_word_mentioned; 121 Makefile_type makefile_type = reading_nothing; 122 char mbs_buffer[(MAXPATHLEN * MB_LEN_MAX)]; 123 Name path_name; 124 Boolean posix = true; 125 Name hat; 126 Name query; 127 Boolean query_mentioned; 128 Boolean reading_environment; 129 Name shell_name; 130 Boolean svr4 = false; 131 Name target_arch; 132 Name target_mach; 133 Boolean tilde_rule; 134 Name virtual_root; 135 Boolean vpath_defined; 136 Name vpath_name; 137 wchar_t wcs_buffer[MAXPATHLEN]; 138 Boolean working_on_targets; 139 #if (defined(TEAMWARE_MAKE_CMN) || defined(PMAKE)) && defined(REDIRECT_ERR) 140 Boolean out_err_same; 141 #endif 142 pid_t childPid = -1; // This variable is used for killing child's process 143 // Such as qrsh, running command, etc. 144 145 /* 146 * timestamps defined in defs.h 147 */ 148 const timestruc_t file_no_time = { -1, 0 }; 149 const timestruc_t file_doesnt_exist = { 0, 0 }; 150 const timestruc_t file_is_dir = { 1, 0 }; 151 const timestruc_t file_phony_time = { 2, 0 }; 152 const timestruc_t file_min_time = { 3, 0 }; 153 const timestruc_t file_max_time = { INT_MAX, 0 }; 154