From 631d0d36105c07f3e8c4127d252f83dbabbd40a3 Mon Sep 17 00:00:00 2001 From: Matthew Gingell Date: Sun, 5 Oct 2008 12:35:36 +0000 Subject: cpplib.h (cpp_comments, [...]): New structs. 2008-10-05 Matthew Gingell Arnaud Charlet * include/cpplib.h (cpp_comments, cpp_comment_table): New structs. (cpp_get_comments): New function. * internal.h (struct cpp_reader): Add comments field. * init.c (cpp_destroy): Free comments. * lex.c (store_comment, cpp_get_comments): New functions. (comments): New struct. (save_comment): Store comments in comments struct. Co-Authored-By: Arnaud Charlet From-SVN: r140883 --- libcpp/init.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'libcpp/init.c') diff --git a/libcpp/init.c b/libcpp/init.c index 0db167c..cc7a09e 100644 --- a/libcpp/init.c +++ b/libcpp/init.c @@ -245,6 +245,7 @@ cpp_destroy (cpp_reader *pfile) { cpp_context *context, *contextn; tokenrun *run, *runn; + int i; free (pfile->op_stack); @@ -287,6 +288,14 @@ cpp_destroy (cpp_reader *pfile) free (context); } + if (pfile->comments.entries) + { + for (i = 0; i < pfile->comments.count; i++) + free (pfile->comments.entries[i].comment); + + free (pfile->comments.entries); + } + free (pfile); } -- cgit v1.1