* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/misc.h"
-#include "xbt/error.h"
-#include "surf/surf_parse.h"
+#include "xbt/log.h"
+#include "surf/surf_parse_private.h"
#include "surf/surf_private.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(parse, surf ,"Logging specific to the SURF module");
}
void surf_parse_open(const char *file) {
+ if(!file) {
+ WARN0("I hope you know what you're doing... you just gave me a NULL pointer!");
+ return;
+ }
if(!surf_input_buffer_stack)
surf_input_buffer_stack = xbt_dynar_new(sizeof(YY_BUFFER_STATE),NULL);
if(!surf_file_to_parse_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);
+ if(surf_file_to_parse) {
+ surf_parse__delete_buffer(surf_input_buffer);
+ fclose(surf_file_to_parse);
+ }
}
-int surf_parse(void)
+
+static int _surf_parse(void)
{
return surf_parse_lex();
}
+int_f_void_t surf_parse = _surf_parse;
+
void surf_parse_get_double(double *value,const char *string)
{
int ret = 0;