Changeset 903 for trunk/src/gmakenew/variable.h
- Timestamp:
- May 23, 2007, 7:31:19 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmakenew/variable.h
r533 r903 61 61 int value_alloc_len; /* The amount of memory we've actually allocated. */ 62 62 /* FIXME: make lengths unsigned! */ 63 #endif 63 #endif 64 64 char *value; /* Variable value. */ 65 65 struct floc fileinfo; /* Where the variable was defined. */ … … 109 109 { 110 110 struct pattern_var *next; 111 char *target; 111 const char *suffix; 112 const char *target; 112 113 unsigned int len; 113 char *suffix;114 114 struct variable variable; 115 115 }; … … 119 119 120 120 /* expand.c */ 121 extern char *variable_buffer_output PARAMS ((char *ptr, char *string, unsigned int length));122 extern char *variable_expand PARAMS ((char *line));123 extern char *variable_expand_for_file PARAMS ((char *line, struct file *file));124 extern char *allocated_variable_expand_for_file PARAMS ((char *line, struct file *file));121 char *variable_buffer_output (char *ptr, const char *string, unsigned int length); 122 char *variable_expand (const char *line); 123 char *variable_expand_for_file (const char *line, struct file *file); 124 char *allocated_variable_expand_for_file (const char *line, struct file *file); 125 125 #define allocated_variable_expand(line) \ 126 126 allocated_variable_expand_for_file (line, (struct file *) 0) 127 extern char *expand_argument PARAMS ((const char *str, const char *end)); 128 extern char *variable_expand_string PARAMS ((char *line, char *string, 129 long length)); 130 extern void install_variable_buffer PARAMS ((char **bufp, unsigned int *lenp)); 131 extern void restore_variable_buffer PARAMS ((char *buf, unsigned int len)); 127 char *expand_argument (const char *str, const char *end); 128 char *variable_expand_string (char *line, const char *string, long length); 129 void install_variable_buffer (char **bufp, unsigned int *lenp); 130 void restore_variable_buffer (char *buf, unsigned int len); 132 131 #ifdef CONFIG_WITH_VALUE_LENGTH 133 extern void append_expanded_string_to_variable PARAMS ((struct variable *v, char *value));132 extern void append_expanded_string_to_variable (struct variable *v, char *value); 134 133 #endif 135 134 136 135 /* function.c */ 137 extern int handle_function PARAMS ((char **op, char **stringp)); 138 extern int pattern_matches PARAMS ((char *pattern, char *percent, char *str)); 139 extern char *subst_expand PARAMS ((char *o, char *text, char *subst, char *replace, 140 unsigned int slen, unsigned int rlen, int by_word)); 141 extern char *patsubst_expand PARAMS ((char *o, char *text, char *pattern, char *replace, 142 char *pattern_percent, char *replace_percent)); 136 int handle_function (char **op, const char **stringp); 137 int pattern_matches (const char *pattern, const char *percent, const char *str); 138 char *subst_expand (char *o, const char *text, const char *subst, 139 const char *replace, unsigned int slen, unsigned int rlen, 140 int by_word); 141 char *patsubst_expand_pat (char *o, const char *text, const char *pattern, 142 const char *replace, const char *pattern_percent, 143 const char *replace_percent); 144 char *patsubst_expand (char *o, const char *text, char *pattern, char *replace); 143 145 144 146 /* expand.c */ 145 extern char *recursively_expand_for_file PARAMS ((struct variable *v, 146 struct file *file)); 147 char *recursively_expand_for_file (struct variable *v, struct file *file); 147 148 #define recursively_expand(v) recursively_expand_for_file (v, NULL) 148 149 149 150 /* variable.c */ 150 extern struct variable_set_list *create_new_variable_set PARAMS ((void)); 151 extern void free_variable_set PARAMS ((struct variable_set_list *)); 152 extern struct variable_set_list *push_new_variable_scope PARAMS ((void)); 153 extern void pop_variable_scope PARAMS ((void)); 154 extern void define_automatic_variables PARAMS ((void)); 155 extern void initialize_file_variables PARAMS ((struct file *file, int read)); 156 extern void print_file_variables PARAMS ((struct file *file)); 157 extern void print_variable_set PARAMS ((struct variable_set *set, char *prefix)); 158 extern void merge_variable_set_lists PARAMS ((struct variable_set_list **to_list, struct variable_set_list *from_list)); 159 extern struct variable *do_variable_definition PARAMS ((const struct floc *flocp, const char *name, char *value, enum variable_origin origin, enum variable_flavor flavor, int target_var)); 160 extern struct variable *parse_variable_definition PARAMS ((struct variable *v, char *line)); 161 extern struct variable *try_variable_definition PARAMS ((const struct floc *flocp, char *line, enum variable_origin origin, int target_var)); 162 extern void init_hash_global_variable_set PARAMS ((void)); 163 extern void hash_init_function_table PARAMS ((void)); 164 extern struct variable *lookup_variable PARAMS ((const char *name, unsigned int length)); 165 extern struct variable *lookup_variable_in_set PARAMS ((const char *name, 166 unsigned int length, 167 const struct variable_set *set)); 151 struct variable_set_list *create_new_variable_set (void); 152 void free_variable_set (struct variable_set_list *); 153 struct variable_set_list *push_new_variable_scope (void); 154 void pop_variable_scope (void); 155 void define_automatic_variables (void); 156 void initialize_file_variables (struct file *file, int reading); 157 void print_file_variables (const struct file *file); 158 void print_variable_set (struct variable_set *set, char *prefix); 159 void merge_variable_set_lists (struct variable_set_list **to_list, 160 struct variable_set_list *from_list); 161 struct variable *do_variable_definition (const struct floc *flocp, 162 const char *name, const char *value, 163 enum variable_origin origin, 164 enum variable_flavor flavor, 165 int target_var); 166 struct variable *parse_variable_definition (struct variable *v, char *line); 167 struct variable *try_variable_definition (const struct floc *flocp, char *line, 168 enum variable_origin origin, 169 int target_var); 170 void init_hash_global_variable_set (void); 171 void hash_init_function_table (void); 172 struct variable *lookup_variable (const char *name, unsigned int length); 173 struct variable *lookup_variable_in_set (const char *name, unsigned int length, 174 const struct variable_set *set); 168 175 169 176 #ifdef CONFIG_WITH_VALUE_LENGTH 170 177 171 extern struct variable *define_variable_in_set 172 PARAMS ((const char *name, unsigned int length, char *value, 173 unsigned int value_length, int duplicate_value, 174 enum variable_origin origin, int recursive, 175 struct variable_set *set, const struct floc *flocp)); 178 struct variable *define_variable_in_set (const char *name, unsigned int length, 179 const char *value, 180 unsigned int value_length, 181 int duplicate_value, 182 enum variable_origin origin, 183 int recursive, 184 struct variable_set *set, 185 const struct floc *flocp); 176 186 177 187 /* Define a variable in the current variable set. */ 178 188 179 189 #define define_variable(n,l,v,o,r) \ 180 define_variable_in_set((n),(l),(v), 190 define_variable_in_set((n),(l),(v),~0U,1,(o),(r),\ 181 191 current_variable_set_list->set,NILF) 182 192 … … 204 214 define_variable_in_set((n),(l),(v),~0U,1,(o),(r),(f)->variables->set,NILF) 205 215 206 #else 207 208 extern struct variable *define_variable_in_set 209 PARAMS ((const char *name, unsigned int length, char *value, 210 enum variable_origin origin, int recursive, 211 struct variable_set *set, const struct floc *flocp)); 216 #else /* !CONFIG_WITH_VALUE_LENGTH */ 217 218 struct variable *define_variable_in_set (const char *name, unsigned int length, 219 const char *value, 220 enum variable_origin origin, 221 int recursive, 222 struct variable_set *set, 223 const struct floc *flocp); 212 224 213 225 /* Define a variable in the current variable set. */ … … 215 227 #define define_variable(n,l,v,o,r) \ 216 228 define_variable_in_set((n),(l),(v),(o),(r),\ 217 current_variable_set_list->set,NILF) 229 current_variable_set_list->set,NILF) /* force merge conflict */ 218 230 219 231 /* Define a variable with a location in the current variable set. */ … … 221 233 #define define_variable_loc(n,l,v,o,r,f) \ 222 234 define_variable_in_set((n),(l),(v),(o),(r),\ 223 current_variable_set_list->set,(f)) 235 current_variable_set_list->set,(f)) /* force merge conflict */ 224 236 225 237 /* Define a variable with a location in the global variable set. */ 226 238 227 239 #define define_variable_global(n,l,v,o,r,f) \ 228 define_variable_in_set((n),(l),(v),(o),(r),NULL,(f)) 240 define_variable_in_set((n),(l),(v),(o),(r),NULL,(f)) /* force merge conflict */ 229 241 230 242 /* Define a variable in FILE's variable set. */ 231 243 232 244 #define define_variable_for_file(n,l,v,o,r,f) \ 233 define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF) 234 235 #endif 245 define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF) /* force merge conflict */ 246 247 #endif /* !CONFIG_WITH_VALUE_LENGTH */ 236 248 237 249 /* Warn that NAME is an undefined variable. */ … … 244 256 }while(0) 245 257 246 extern char **target_environment PARAMS ((struct file *file)); 247 248 extern struct pattern_var *create_pattern_var PARAMS ((char *target, char *suffix)); 258 char **target_environment (struct file *file); 259 260 struct pattern_var *create_pattern_var (const char *target, 261 const char *suffix); 249 262 250 263 extern int export_all_variables;
Note:
See TracChangeset
for help on using the changeset viewer.