Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Last bits of convertion from xbt_error_t to exceptions. Some more cleanups (mainly...
[simgrid.git] / src / surf / surf_parse.c
index 02d8c0f..b810106 100644 (file)
@@ -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();
 }