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