remake
4.3+dbg-1.5
|
Go to the source code of this file.
Data Structures | |
struct | variable |
struct | variable_set |
struct | variable_set_list |
struct | pattern_var |
Macros | |
#define | EXP_COUNT_BITS 15 /* This gets all the bitfields into 32 bits */ |
#define | EXP_COUNT_MAX ((1<<EXP_COUNT_BITS)-1) |
#define | SIZE_MAX ((size_t)~(size_t)0) |
#define | allocated_variable_expand(line) allocated_variable_expand_for_file (line, (struct file *) 0) |
#define | recursively_expand(v) recursively_expand_for_file (v, NULL) |
#define | define_variable(n, l, v, o, r) |
#define | define_variable_cname(n, v, o, r) |
#define | define_variable_loc(n, l, v, o, r, f) |
#define | define_variable_global(n, l, v, o, r, f) define_variable_in_set((n),(l),(v),(o),(r),NULL,(f)) |
#define | define_variable_for_file(n, l, v, o, r, f) define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF) |
#define | undefine_variable_global(n, l, o) undefine_variable_in_set((n),(l),(o),NULL) |
#define | warn_undefined(n, l) |
#define | MAKELEVEL_NAME "MAKELEVEL" |
#define | MAKELEVEL_LENGTH (CSTRLEN (MAKELEVEL_NAME)) |
Enumerations | |
enum | variable_origin { o_default, o_env, o_file, o_env_override, o_command, o_override, o_automatic, o_debugger, o_invalid } |
enum | variable_flavor { f_bogus, f_simple, f_recursive, f_append, f_conditional, f_shell, f_append_value } |
Functions | |
char * | variable_buffer_output (char *ptr, const char *string, size_t length) |
char * | variable_expand (const char *line) |
char * | variable_expand_for_file (const char *line, struct file *file) |
char * | allocated_variable_expand_for_file (const char *line, struct file *file) |
char * | expand_argument (const char *str, const char *end) |
char * | variable_expand_string (char *line, const char *string, size_t length) |
void | install_variable_buffer (char **bufp, size_t *lenp) |
void | restore_variable_buffer (char *buf, size_t len) |
int | handle_function (char **op, const char **stringp) |
int | pattern_matches (const char *pattern, const char *percent, const char *str) |
char * | subst_expand (char *o, const char *text, const char *subst, const char *replace, size_t slen, size_t rlen, int by_word) |
char * | patsubst_expand_pat (char *o, const char *text, const char *pattern, const char *replace, const char *pattern_percent, const char *replace_percent) |
char * | patsubst_expand (char *o, const char *text, char *pattern, char *replace) |
char * | func_shell_base (char *o, char **argv, int trim_newlines) |
void | shell_completed (int exit_code, int exit_sig) |
char * | recursively_expand_for_file (struct variable *v, struct file *file) |
struct variable_set_list * | create_new_variable_set (void) |
const char * | origin2str (variable_origin_t origin) |
void | free_variable_set (struct variable_set_list *) |
struct variable_set_list * | push_new_variable_scope (void) |
void | pop_variable_scope (void) |
void | define_automatic_variables (void) |
void | initialize_file_variables (struct file *file, int reading) |
void | print_file_variables (const file_t *p_target, bool b_hash_stats) |
void | print_variable_data_base (void) |
void | print_variable_info (const void *item, void *arg) |
void | print_target_variables (const struct file *file) |
void | print_variable_set (struct variable_set *set, const char *prefix, int pauto) |
void | merge_variable_set_lists (struct variable_set_list **to_list, struct variable_set_list *from_list) |
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) |
char * | parse_variable_definition (const char *line, struct variable *v) |
struct variable * | assign_variable_definition (struct variable *v, const char *line) |
struct variable * | try_variable_definition (const gmk_floc *flocp, const char *line, enum variable_origin origin, int target_var) |
void | init_hash_global_variable_set (void) |
void | hash_init_function_table (void) |
void | define_new_function (const gmk_floc *flocp, const char *name, unsigned int min, unsigned int max, unsigned int flags, gmk_func_ptr func) |
struct variable * | lookup_variable (const char *name, size_t length) |
struct variable * | lookup_variable_in_set (const char *name, size_t length, const struct variable_set *set) |
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 | undefine_variable_in_set (const char *name, size_t length, enum variable_origin origin, struct variable_set *set) |
char ** | target_environment (struct file *file) |
struct pattern_var * | create_pattern_var (const char *target, const char *suffix) |
Variables | |
v_export | |
v_noexport | |
v_ifset | |
v_default | |
char * | variable_buffer |
struct variable_set_list * | current_variable_set_list |
struct variable * | default_goal_var |
struct variable | shell_var |
int | export_all_variables |
#define allocated_variable_expand | ( | line | ) | allocated_variable_expand_for_file (line, (struct file *) 0) |
#define define_variable | ( | n, | |
l, | |||
v, | |||
o, | |||
r | |||
) |
#define define_variable_cname | ( | n, | |
v, | |||
o, | |||
r | |||
) |
#define define_variable_for_file | ( | n, | |
l, | |||
v, | |||
o, | |||
r, | |||
f | |||
) | define_variable_in_set((n),(l),(v),(o),(r),(f)->variables->set,NILF) |
#define define_variable_global | ( | n, | |
l, | |||
v, | |||
o, | |||
r, | |||
f | |||
) | define_variable_in_set((n),(l),(v),(o),(r),NULL,(f)) |
#define define_variable_loc | ( | n, | |
l, | |||
v, | |||
o, | |||
r, | |||
f | |||
) |
#define EXP_COUNT_BITS 15 /* This gets all the bitfields into 32 bits */ |
#define EXP_COUNT_MAX ((1<<EXP_COUNT_BITS)-1) |
#define MAKELEVEL_LENGTH (CSTRLEN (MAKELEVEL_NAME)) |
#define MAKELEVEL_NAME "MAKELEVEL" |
#define recursively_expand | ( | v | ) | recursively_expand_for_file (v, NULL) |
#define SIZE_MAX ((size_t)~(size_t)0) |
#define undefine_variable_global | ( | n, | |
l, | |||
o | |||
) | undefine_variable_in_set((n),(l),(o),NULL) |
#define warn_undefined | ( | n, | |
l | |||
) |
enum variable_flavor |
enum variable_origin |
char* allocated_variable_expand_for_file | ( | const char * | line, |
struct file * | file | ||
) |
struct variable_set_list* create_new_variable_set | ( | void | ) |
struct pattern_var* create_pattern_var | ( | const char * | target, |
const char * | suffix | ||
) |
void define_automatic_variables | ( | void | ) |
Define the automatic variables, and record the addresses of their structures so we can change their values quickly.
void define_new_function | ( | const gmk_floc * | flocp, |
const char * | name, | ||
unsigned int | min, | ||
unsigned int | max, | ||
unsigned int | flags, | ||
gmk_func_ptr | func | ||
) |
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 | ||
) |
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 | ||
) |
char* expand_argument | ( | const char * | str, |
const char * | end | ||
) |
void free_variable_set | ( | struct variable_set_list * | ) |
char* func_shell_base | ( | char * | o, |
char ** | argv, | ||
int | trim_newlines | ||
) |
int handle_function | ( | char ** | op, |
const char ** | stringp | ||
) |
void hash_init_function_table | ( | void | ) |
void init_hash_global_variable_set | ( | void | ) |
void initialize_file_variables | ( | struct file * | file, |
int | reading | ||
) |
Initialize FILE's variable set list. If FILE already has a variable set list, the topmost variable set is left intact, but the the rest of the chain is replaced with FILE->parent's setlist. If FILE is a double-colon rule, then we will use the "root" double-colon target's variable set as the parent of FILE's variable set.
If we're READing a makefile, don't do the pattern variable search now, since the pattern variable might not have been defined yet.
Referenced by dbg_cmd_info(), and dbg_cmd_target().
void install_variable_buffer | ( | char ** | bufp, |
size_t * | lenp | ||
) |
struct variable* lookup_variable | ( | const char * | name, |
size_t | length | ||
) |
struct variable* lookup_variable_in_set | ( | const char * | name, |
size_t | length, | ||
const struct variable_set * | set | ||
) |
void merge_variable_set_lists | ( | struct variable_set_list ** | to_list, |
struct variable_set_list * | from_list | ||
) |
const char* origin2str | ( | variable_origin_t | origin | ) |
Return a string describing origin.
char* parse_variable_definition | ( | const char * | line, |
struct variable * | v | ||
) |
char* patsubst_expand | ( | char * | o, |
const char * | text, | ||
char * | pattern, | ||
char * | replace | ||
) |
char* patsubst_expand_pat | ( | char * | o, |
const char * | text, | ||
const char * | pattern, | ||
const char * | replace, | ||
const char * | pattern_percent, | ||
const char * | replace_percent | ||
) |
int pattern_matches | ( | const char * | pattern, |
const char * | percent, | ||
const char * | str | ||
) |
void pop_variable_scope | ( | void | ) |
Pop the top set off the current_variable_set_list, and free all its storage. If b_toplevel set we have the top-most global scope and some things don't get freed because they weren't malloc'd.
Print all the local variables of P_TARGET. Lines output have "# " prepended. If you want hash table statistics too, set b_hash_stats true.
void print_target_variables | ( | const struct file * | file | ) |
void print_variable_data_base | ( | void | ) |
Print the data base of variables.
void print_variable_info | ( | const void * | item, |
void * | arg | ||
) |
Print information for variable V, prefixing it with PREFIX.
Referenced by dbg_cmd_info().
void print_variable_set | ( | struct variable_set * | set, |
const char * | prefix, | ||
int | pauto | ||
) |
Print all the variables in SET. PREFIX is printed before the actual variable definitions (everything else is comments). If you want hash table statistics too, set b_hash_stats true.
struct variable_set_list* push_new_variable_scope | ( | void | ) |
Create a new variable set, push it on the current setlist, and assign current_variable_set_list to it.
void restore_variable_buffer | ( | char * | buf, |
size_t | len | ||
) |
void shell_completed | ( | int | exit_code, |
int | exit_sig | ||
) |
char* subst_expand | ( | char * | o, |
const char * | text, | ||
const char * | subst, | ||
const char * | replace, | ||
size_t | slen, | ||
size_t | rlen, | ||
int | by_word | ||
) |
char** target_environment | ( | struct file * | file | ) |
struct variable* try_variable_definition | ( | const gmk_floc * | flocp, |
const char * | line, | ||
enum variable_origin | origin, | ||
int | target_var | ||
) |
void undefine_variable_in_set | ( | const char * | name, |
size_t | length, | ||
enum variable_origin | origin, | ||
struct variable_set * | set | ||
) |
char* variable_buffer_output | ( | char * | ptr, |
const char * | string, | ||
size_t | length | ||
) |
char* variable_expand | ( | const char * | line | ) |
char* variable_expand_for_file | ( | const char * | line, |
struct file * | file | ||
) |
char* variable_expand_string | ( | char * | line, |
const char * | string, | ||
size_t | length | ||
) |
struct variable_set_list* current_variable_set_list |
struct variable* default_goal_var |
int export_all_variables |
struct variable shell_var |
v_default |
v_export |
v_ifset |
v_noexport |
char* variable_buffer |