[PATCH 2/6] * variable.h: Add support of struct value_records and parent_records

2014-08-14 Thread Macpaul Lin
(struct parent_record): add struct parent_record, for constructing variables dependencies. (struct value_record): add struct value_record for record each value is assigned to a variable. (variable_name_extract): add support to extract variable name with [$()] prefix. (alloc_parent_record): a functi

[PATCH 5/6] * load.c: add support of parent_records

2014-08-14 Thread Macpaul Lin
(do_variable_definition): fix API consistency for supporting parent_records. Signed-off-by: Macpaul Lin --- load.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/load.c b/load.c index b937c9f..78b800f 100644 --- a/load.c +++ b/load.c @@ -214,7 +214,8 @@ load_file (const gm

[PATCH 3/6] * variable.c: Add support for constructing value_records and parent_records

2014-08-14 Thread Macpaul Lin
(define_variable_in_set): assign NULL as initial value of a pointer to value_record. (free_parent_record): free all parent_records which were assigned. (free_variable_record): free all value_records and related parent_records belongs to a variable. (free_variable_name_and_value): add free_variable_

[PATCH 4/6] * read.c: Construct the dependency chain between parent and target variable

2014-08-14 Thread Macpaul Lin
(eval_makefile): deal with new parent_records paremeter for API consistancy, (eval): assign related parent_records to target variable, and construct tempoaray parent_records when ifdef/ifeq conditional_line is parsed. (conditional_line): when ifdef/ifeq conditional_line is encountered, construct te

[PATCH 6/6] * main.c: add --dep parameter for print variable dependency

2014-08-14 Thread Macpaul Lin
(print_dependency): print each value_record and parent_record of a variable. Signed-off-by: Macpaul Lin --- main.c | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 0508ae1..abbcb28 100644 --- a/main.c +++ b/main.c @@ -53,

[PATCH 1/6] * expand.c (variable_name_extract): extract variable name and strip prefix.

2014-08-14 Thread Macpaul Lin
Variables used in conditional lines usually has '$', '(', and ')' prefix, and etc. We can use vairable_name_extract() to extract pure variable name without these prefix. Signed-off-by: Macpaul Lin --- expand.c | 72 1 file changed,