Changeset 3138 for vendor/gnumake/current/variable.h
- Timestamp:
- Mar 12, 2018, 8:32:29 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/gnumake/current/variable.h
r2596 r3138 1 1 /* Definitions for using variables in GNU Make. 2 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 4 2010 Free Software Foundation, Inc. 2 Copyright (C) 1988-2016 Free Software Foundation, Inc. 5 3 This file is part of GNU Make. 6 4 … … 23 21 enum variable_origin 24 22 { 25 o_default, 26 o_env, 27 o_file, 28 o_env_override, 29 o_command, 30 o_override, /* Variable from an `override' directive. */31 o_automatic, 32 o_invalid 23 o_default, /* Variable from the default set. */ 24 o_env, /* Variable from environment. */ 25 o_file, /* Variable given in a makefile. */ 26 o_env_override, /* Variable from environment, if -e. */ 27 o_command, /* Variable given by user. */ 28 o_override, /* Variable from an 'override' directive. */ 29 o_automatic, /* Automatic variable -- cannot be set. */ 30 o_invalid /* Core dump time. */ 33 31 }; 34 32 … … 36 34 { 37 35 f_bogus, /* Bogus (error) */ 38 f_simple, /* Simple definition (:= ) */36 f_simple, /* Simple definition (:= or ::=) */ 39 37 f_recursive, /* Recursive definition (=) */ 40 38 f_append, /* Appending definition (+=) */ 41 f_conditional /* Conditional definition (?=) */ 39 f_conditional, /* Conditional definition (?=) */ 40 f_shell /* Shell assignment (!=) */ 42 41 }; 43 42 44 43 /* Structure that represents one variable definition. 45 44 Each bucket of the hash table is a chain of these, 46 chained through `next'. */45 chained through 'next'. */ 47 46 48 47 #define EXP_COUNT_BITS 15 /* This gets all the bitfields into 32 bits */ … … 51 50 struct variable 52 51 { 53 char *name; 54 int length; /* strlen (name)*/55 char *value; /* Variable value. */56 struct floc fileinfo; /* Where the variable was defined.*/57 unsigned int recursive:1; 58 unsigned int append:1; 52 char *name; /* Variable name. */ 53 char *value; /* Variable value. */ 54 floc fileinfo; /* Where the variable was defined. */ 55 int length; /* strlen (name) */ 56 unsigned int recursive:1; /* Gets recursively re-evaluated. */ 57 unsigned int append:1; /* Nonzero if an appending target-specific 59 58 variable. */ 60 59 unsigned int conditional:1; /* Nonzero if set with a ?=. */ 61 unsigned int per_target:1; 60 unsigned int per_target:1; /* Nonzero if a target-specific variable. */ 62 61 unsigned int special:1; /* Nonzero if this is a special variable. */ 63 62 unsigned int exportable:1; /* Nonzero if the variable _could_ be 64 63 exported. */ 65 unsigned int expanding:1; 64 unsigned int expanding:1; /* Nonzero if currently being expanded. */ 66 65 unsigned int private_var:1; /* Nonzero avoids inheritance of this 67 66 target-specific variable. */ … … 70 69 expansions. */ 71 70 enum variable_flavor 72 flavor ENUM_BITFIELD (3); 71 flavor ENUM_BITFIELD (3); /* Variable flavor. */ 73 72 enum variable_origin 74 origin ENUM_BITFIELD (3); 73 origin ENUM_BITFIELD (3); /* Variable origin. */ 75 74 enum variable_export 76 75 { 77 v_export,/* Export this variable. */78 v_noexport,/* Don't export this variable. */79 v_ifset,/* Export it if it has a non-default value. */80 v_default/* Decide in target_environment. */76 v_export, /* Export this variable. */ 77 v_noexport, /* Don't export this variable. */ 78 v_ifset, /* Export it if it has a non-default value. */ 79 v_default /* Decide in target_environment. */ 81 80 } export ENUM_BITFIELD (2); 82 81 }; … … 86 85 struct variable_set 87 86 { 88 struct hash_table table; 87 struct hash_table table; /* Hash table of variables. */ 89 88 }; 90 89 … … 93 92 struct variable_set_list 94 93 { 95 struct variable_set_list *next; 96 struct variable_set *set; 94 struct variable_set_list *next; /* Link in the chain. */ 95 struct variable_set *set; /* Variable set. */ 97 96 int next_is_parent; /* True if next is a parent target. */ 98 97 }; … … 112 111 extern struct variable_set_list *current_variable_set_list; 113 112 extern struct variable *default_goal_var; 113 extern struct variable shell_var; 114 114 115 115 /* expand.c */ … … 118 118 char *variable_expand_for_file (const char *line, struct file *file); 119 119 char *allocated_variable_expand_for_file (const char *line, struct file *file); 120 #define 120 #define allocated_variable_expand(line) \ 121 121 allocated_variable_expand_for_file (line, (struct file *) 0) 122 122 char *expand_argument (const char *str, const char *end); … … 135 135 const char *replace_percent); 136 136 char *patsubst_expand (char *o, const char *text, char *pattern, char *replace); 137 char *func_shell_base (char *o, char **argv, int trim_newlines); 138 void shell_completed (int exit_code, int exit_sig); 137 139 138 140 /* expand.c */ … … 148 150 void initialize_file_variables (struct file *file, int reading); 149 151 void print_file_variables (const struct file *file); 150 void print_ variable_set (struct variable_set *set, char *prefix);152 void print_target_variables (const struct file *file); 151 153 void merge_variable_set_lists (struct variable_set_list **to_list, 152 154 struct variable_set_list *from_list); 153 struct variable *do_variable_definition (const structfloc *flocp,155 struct variable *do_variable_definition (const floc *flocp, 154 156 const char *name, const char *value, 155 157 enum variable_origin origin, … … 157 159 int target_var); 158 160 char *parse_variable_definition (const char *line, 159 enum variable_flavor *flavor);160 struct variable *assign_variable_definition (struct variable *v, c har *line);161 struct variable *try_variable_definition (const struct floc *flocp,char *line,161 struct variable *v); 162 struct variable *assign_variable_definition (struct variable *v, const char *line); 163 struct variable *try_variable_definition (const floc *flocp, const char *line, 162 164 enum variable_origin origin, 163 165 int target_var); 164 166 void init_hash_global_variable_set (void); 165 167 void hash_init_function_table (void); 168 void define_new_function(const floc *flocp, const char *name, 169 unsigned int min, unsigned int max, unsigned int flags, 170 gmk_func_ptr func); 166 171 struct variable *lookup_variable (const char *name, unsigned int length); 167 172 struct variable *lookup_variable_in_set (const char *name, unsigned int length, … … 173 178 int recursive, 174 179 struct variable_set *set, 175 const structfloc *flocp);180 const floc *flocp); 176 181 177 182 /* Define a variable in the current variable set. */ … … 215 220 216 221 #define warn_undefined(n,l) do{\ 217 if (warn_undefined_variables_flag) \218 error (reading_file, \219 _("warning: undefined variable `%.*s'"), \220 (int)(l), (n));\222 if (warn_undefined_variables_flag) \ 223 error (reading_file, (l), \ 224 _("warning: undefined variable '%.*s'"), \ 225 (int)(l), (n)); \ 221 226 }while(0) 222 227 … … 229 234 230 235 #define MAKELEVEL_NAME "MAKELEVEL" 231 #define MAKELEVEL_LENGTH ( sizeof (MAKELEVEL_NAME) - 1)236 #define MAKELEVEL_LENGTH (CSTRLEN (MAKELEVEL_NAME))
Note:
See TracChangeset
for help on using the changeset viewer.