diff options
| author | Rob Taylor <rob.taylor@codethink.co.uk> | 2007-06-29 17:33:29 +0100 |
|---|---|---|
| committer | Josh Triplett <josh@freedesktop.org> | 2007-07-13 08:33:54 -0700 |
| commit | 0f7245f57921d2b002c775c870692d148edebb5a (patch) | |
| tree | bf2ecf690a878dae6df68c19e3c3de73780ea269 | |
| parent | 78d2e4b170d776017b56231f47b9a7749e50a73f (diff) | |
| download | sparse-dev-0f7245f57921d2b002c775c870692d148edebb5a.tar.gz | |
add sparse_keep_tokens api to lib.h
Adds sparse_keep_tokens, which is the same as __sparse, but doesn't free the
tokens after parsing. Useful fow ehen you want to inspect macro symbols after
parsing.
Signed-off-by: Rob Taylor <rob.taylor@codethink.co.uk>
| -rw-r--r-- | lib.c | 13 | ||||
| -rw-r--r-- | lib.h | 1 |
2 files changed, 13 insertions, 1 deletions
@@ -749,7 +749,7 @@ struct symbol_list *sparse_initialize(int argc, char **argv, struct string_list return list; } -struct symbol_list * __sparse(char *filename) +struct symbol_list * sparse_keep_tokens(char *filename) { struct symbol_list *res; @@ -759,6 +759,17 @@ struct symbol_list * __sparse(char *filename) new_file_scope(); res = sparse_file(filename); + /* And return it */ + return res; +} + + +struct symbol_list * __sparse(char *filename) +{ + struct symbol_list *res; + + res = sparse_keep_tokens(filename); + /* Drop the tokens for this file after parsing */ clear_token_alloc(); @@ -113,6 +113,7 @@ extern void declare_builtin_functions(void); extern void create_builtin_stream(void); extern struct symbol_list *sparse_initialize(int argc, char **argv, struct string_list **files); extern struct symbol_list *__sparse(char *filename); +extern struct symbol_list *sparse_keep_tokens(char *filename); extern struct symbol_list *sparse(char *filename); static inline int symbol_list_size(struct symbol_list *list) |
