Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New functions: xbt_str_parse_int / xbt_str_parse_double
[simgrid.git] / include / xbt / str.h
index 2a64e95..b90f86b 100644 (file)
@@ -9,12 +9,17 @@
 #ifndef XBT_STR_H
 #define XBT_STR_H
 
-#include <stdarg.h>             /* va_* */
-#include <stdio.h>  /* FILE */
 #include "xbt/misc.h"
 #include "xbt/dynar.h"
 #include "xbt/dict.h"
 
+#include <stdarg.h>             /* va_* */
+#include <stdio.h>  /* FILE */
+
+#ifdef _MSC_VER
+#define strcasecmp _stricmp
+#endif
+
 SG_BEGIN_DECL()
 
 /** @addtogroup XBT_str
@@ -52,6 +57,9 @@ XBT_PUBLIC(char *) xbt_str_from_file(FILE * file);
 
 XBT_PUBLIC(int) xbt_str_start_with(const char* str, const char* start);
 
+XBT_PUBLIC(long int) xbt_str_parse_int(const char* str, const char* error_msg);
+XBT_PUBLIC(double) xbt_str_parse_double(const char* str, const char* error_msg);
+
 #define DJB2_HASH_FUNCTION
 //#define FNV_HASH_FUNCTION