introduce __sparse() function
PATCH 1/2 introduce __sparse() function
This patch adds __sparse() function for those users which don't need evaluate.c (see the next patch).
Without this patch it is not possible to link test-dissect statically, it has to redefine evaluate_symbol_list().
Signed-off-by Oleg Nesterov <[email protected]>
lib.h renamed from lib.h~1_SPARSE +1 -0
@@ -84,6 +84,7 @@ extern int Wone_bit_signed_bitfield;extern void declare_builtin_functions (void );extern void create_builtin_stream (void );extern struct symbol_list *sparse_initialize (int argc,char **argv); +extern struct symbol_list *__sparse (char **argv);extern struct symbol_list *sparse (char **argv);static inline int symbol_list_size (struct symbol_list * list)
lib.c renamed from lib.c~1_SPARSE +9 -2
@@ -629,7 +629,7 @@ struct symbol_list *sparse_initialize(inreturn list; } -struct symbol_list *sparse (char **argv) +struct symbol_list *__sparse (char **argv) {struct symbol_list *res;char *filename, *next;
@@ -652,9 +652,16 @@ struct symbol_list * sparse(char **argv)/* Drop the tokens for this file after parsing */ clear_token_alloc (); +/* And return it */ +return res; +} + +struct symbol_list *sparse (char **argv) +{ +struct symbol_list *res =__sparse (argv); +/* Evaluate the complete symbol list */ evaluate_symbol_list (res); -/* And return it */ return res; }