X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/57a4f5aab921d86f3af65a121fe8412f9b901038..25d6952dcf52e6ffc1e4a402af0e2d3c17ac3935:/src/surf/surf_parse.c diff --git a/src/surf/surf_parse.c b/src/surf/surf_parse.c index 02d8c0f8dd..b8101062bd 100644 --- a/src/surf/surf_parse.c +++ b/src/surf/surf_parse.c @@ -6,7 +6,7 @@ * under the terms of the license (GNU LGPL) which comes with this package. */ #include "xbt/misc.h" -#include "xbt/error.h" +#include "xbt/log.h" #include "surf/surf_parse.h" #include "surf/surf_private.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(parse, surf ,"Logging specific to the SURF module"); @@ -159,16 +159,21 @@ void surf_parse_open(const char *file) { xbt_assert1((surf_file_to_parse), "Unable to open \"%s\"\n",file); surf_input_buffer = surf_parse__create_buffer( surf_file_to_parse, 10); surf_parse__switch_to_buffer(surf_input_buffer); + surf_parse_lineno = 1; } void surf_parse_close(void) { + if(surf_input_buffer_stack) + xbt_dynar_free(&surf_input_buffer_stack); + if(surf_file_to_parse_stack) + xbt_dynar_free(&surf_file_to_parse_stack); + surf_parse__delete_buffer(surf_input_buffer); fclose(surf_file_to_parse); } int surf_parse(void) { - int ret=0; return surf_parse_lex(); }