aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-08-03 18:36:00 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2005-08-03 18:36:00 -0700
commit2c36119df5a9bf9ad04f665961721fdeb7ca7551 (patch)
tree295dc51738bf051de50b581c7ccb5c5fe220e146 /test-parsing.c
parentGet closer to parsing multiple files correctly. (diff)
downloadsparse-2c36119df5a9bf9ad04f665961721fdeb7ca7551.tar.gz
sparse-2c36119df5a9bf9ad04f665961721fdeb7ca7551.tar.bz2
sparse-2c36119df5a9bf9ad04f665961721fdeb7ca7551.zip
Update the calling interface to "sparse()".
Start off with sparse_initialize(argc, argv); which will return the number of filenames found. You can then use that, or just check if *argv is NULL in a loop like while (*argv) list = sparse(argv); where you get the declaration list for each file in turn.
Diffstat (limited to 'test-parsing.c')
-rw-r--r--test-parsing.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/test-parsing.c b/test-parsing.c
index 7f6f4bf..d2b9575 100644
--- a/test-parsing.c
+++ b/test-parsing.c
@@ -34,16 +34,19 @@ static void clean_up_symbols(struct symbol_list *list)
int main(int argc, char **argv)
{
- struct symbol_list *list = sparse(argc, argv);
+ sparse_initialize(argc, argv);
+ while (*argv) {
+ struct symbol_list *list = sparse(argv);
- // Simplification
- clean_up_symbols(list);
+ // Simplification
+ clean_up_symbols(list);
#if 1
- // Show the end result.
- show_symbol_list(list, "\n\n");
- printf("\n\n");
+ // Show the end result.
+ show_symbol_list(list, "\n\n");
+ printf("\n\n");
#endif
+ }
#if 0
// And show the allocation statistics