53 #define EXP_COUNT_BITS 15 54 #define EXP_COUNT_MAX ((1<<EXP_COUNT_BITS)-1) 123 # define SIZE_MAX ((size_t)~(size_t)0) 130 #define allocated_variable_expand(line) \ 131 allocated_variable_expand_for_file (line, (struct file *) 0) 139 int pattern_matches (
const char *pattern,
const char *percent,
const char *str);
140 char *
subst_expand (
char *o,
const char *text,
const char *subst,
141 const char *replace,
size_t slen,
size_t rlen,
144 const char *replace,
const char *pattern_percent,
145 const char *replace_percent);
146 char *
patsubst_expand (
char *o,
const char *text,
char *pattern,
char *replace);
152 #define recursively_expand(v) recursively_expand_for_file (v, NULL) 227 unsigned int min,
unsigned int max,
unsigned int flags,
242 #define define_variable(n,l,v,o,r) \ 243 define_variable_in_set((n),(l),(v),(o),(r),\ 244 current_variable_set_list->set,NILF) 248 #define define_variable_cname(n,v,o,r) \ 249 define_variable_in_set((n),(sizeof (n) - 1),(v),(o),(r),\ 250 current_variable_set_list->set,NILF) 254 #define define_variable_loc(n,l,v,o,r,f) \ 255 define_variable_in_set((n),(l),(v),(o),(r),\ 256 current_variable_set_list->set,(f)) 260 #define define_variable_global(n,l,v,o,r,f) \ 261 define_variable_in_set((n),(l),(v),(o),(r),NULL,(f)) 265 #define define_variable_for_file(n,l,v,o,r,f) \ 266 define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF) 274 #define undefine_variable_global(n,l,o) \ 275 undefine_variable_in_set((n),(l),(o),NULL) 279 #define warn_undefined(n,l) do{\ 280 if (warn_undefined_variables_flag) \ 281 error (reading_file, (l), \ 282 _("warning: undefined variable '%.*s'"), \ 293 #define MAKELEVEL_NAME "MAKELEVEL" 294 #define MAKELEVEL_LENGTH (CSTRLEN (MAKELEVEL_NAME)) variable_flavor
Definition: variable.h:38
struct variable * assign_variable_definition(struct variable *v, const char *line)
variable_origin
Definition: variable.h:25
void hash_init_function_table(void)
char * variable_expand_string(char *line, const char *string, size_t length)
Definition: variable.h:82
Definition: variable.h:91
char * value
Definition: variable.h:59
char * expand_argument(const char *str, const char *end)
void pop_variable_scope(void)
int next_is_parent
Definition: variable.h:102
unsigned int exp_count
Definition: variable.h:73
Definition: variable.h:30
struct variable shell_var
Definition: globals.h:92
const char * suffix
Definition: variable.h:110
int handle_function(char **op, const char **stringp)
char *(* gmk_func_ptr)(const char *nm, unsigned int argc, char **argv)
Definition: gnuremake.h:30
Definition: variable.h:85
unsigned int per_target
Definition: variable.h:66
struct pattern_var * next
Definition: variable.h:109
void define_new_function(const gmk_floc *flocp, const char *name, unsigned int min, unsigned int max, unsigned int flags, gmk_func_ptr func)
Definition: variable.h:32
const char * target
Definition: variable.h:111
char * variable_buffer_output(char *ptr, const char *string, size_t length)
char ** target_environment(struct file *file)
int pattern_matches(const char *pattern, const char *percent, const char *str)
void print_variable_info(const void *item, void *arg)
Definition: variable.h:98
void define_automatic_variables(void)
void restore_variable_buffer(char *buf, size_t len)
Definition: variable.h:107
struct variable_set_list * next
Definition: variable.h:100
Definition: variable.h:33
Definition: variable.h:28
struct variable * try_variable_definition(const gmk_floc *flocp, const char *line, enum variable_origin origin, int target_var)
unsigned int length
Definition: variable.h:61
Definition: variable.h:44
unsigned int recursive
Definition: variable.h:62
#define EXP_COUNT_BITS
Definition: variable.h:53
unsigned int append
Definition: variable.h:63
gmk_floc fileinfo
Definition: variable.h:60
char * allocated_variable_expand_for_file(const char *line, struct file *file)
struct variable * define_variable_in_set(const char *name, size_t length, const char *value, enum variable_origin origin, int recursive, struct variable_set *set, const gmk_floc *flocp)
void print_target_variables(const struct file *file)
void undefine_variable_in_set(const char *name, size_t length, enum variable_origin origin, struct variable_set *set)
Definition: variable.h:27
void print_variable_set(struct variable_set *set, const char *prefix, int pauto)
enum variable_origin variable_origin_t
Definition: types.h:79
void print_file_variables(const file_t *p_target, bool b_hash_stats)
Definition: variable.h:84
char * recursively_expand_for_file(struct variable *v, struct file *file)
variable_export
Definition: variable.h:80
struct variable * lookup_variable(const char *name, size_t length)
struct variable * do_variable_definition(const gmk_floc *flocp, const char *name, const char *value, enum variable_origin origin, enum variable_flavor flavor, int target_var)
unsigned int private_var
Definition: variable.h:71
void install_variable_buffer(char **bufp, size_t *lenp)
struct variable_set_list * current_variable_set_list
unsigned int exportable
Definition: variable.h:68
Definition: variable.h:42
Definition: variable.h:43
Definition: variable.h:31
struct variable_set_list * push_new_variable_scope(void)
void initialize_file_variables(struct file *file, int reading)
struct variable * lookup_variable_in_set(const char *name, size_t length, const struct variable_set *set)
void print_variable_data_base(void)
Definition: variable.h:29
char * parse_variable_definition(const char *line, struct variable *v)
const char * origin2str(variable_origin_t origin)
Definition: variable.h:46
struct pattern_var * create_pattern_var(const char *target, const char *suffix)
enum variable_flavor flavor ENUM_BITFIELD(4)
struct variable * default_goal_var
Definition: gnuremake.h:23
char * patsubst_expand(char *o, const char *text, char *pattern, char *replace)
unsigned int expanding
Definition: variable.h:70
char * subst_expand(char *o, const char *text, const char *subst, const char *replace, size_t slen, size_t rlen, int by_word)
Definition: variable.h:34
char * variable_expand_for_file(const char *line, struct file *file)
struct variable_set_list * create_new_variable_set(void)
unsigned int conditional
Definition: variable.h:65
unsigned int special
Definition: variable.h:67
void free_variable_set(struct variable_set_list *)
Definition: variable.h:40
Definition: variable.h:83
Definition: variable.h:45
char * patsubst_expand_pat(char *o, const char *text, const char *pattern, const char *replace, const char *pattern_percent, const char *replace_percent)
char * variable_expand(const char *line)
char * func_shell_base(char *o, char **argv, int trim_newlines)
Definition: variable.h:35
Definition: variable.h:41
void init_hash_global_variable_set(void)
void merge_variable_set_lists(struct variable_set_list **to_list, struct variable_set_list *from_list)
char * name
Definition: variable.h:58
Definition: variable.h:56
size_t len
Definition: variable.h:112
void shell_completed(int exit_code, int exit_sig)