X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/8370bc7e204cc8f1b21af625b28ad4e0dab2a87c..5110a2c2672cde3c914ed45462633dfff7026820:/src/surf/surfxml_parse.c diff --git a/src/surf/surfxml_parse.c b/src/surf/surfxml_parse.c index bad20fbb21..ab0282afe0 100644 --- a/src/surf/surfxml_parse.c +++ b/src/surf/surfxml_parse.c @@ -4,6 +4,8 @@ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ +#include /* va_arg */ + #include "xbt/misc.h" #include "xbt/log.h" #include "xbt/str.h" @@ -23,8 +25,20 @@ char* surf_parsed_filename = NULL; // to locate parse error messages /* * Helping functions */ -void surf_parse_error(const char *msg) { - xbt_die("Parse error at %s:%d: %s\n", surf_parsed_filename, surf_parse_lineno, msg); +void surf_parse_error(const char *fmt, ...) { + va_list va; + va_start(va,fmt); + char *msg = bvprintf(fmt,va); + va_end(va); + xbt_die("Parse error at %s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg); +} +void surf_parse_warn(const char *fmt, ...) { + va_list va; + va_start(va,fmt); + char *msg = bvprintf(fmt,va); + va_end(va); + XBT_WARN("%s:%d: %s", surf_parsed_filename, surf_parse_lineno, msg); + free(msg); } double surf_parse_get_double(const char *string) {