X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/129d63e8d61903819d6bb94b41996a8f045fa699..bdaf3e0e35da86e81694db125a7df5effa9f9658:/src/surf/surf.c diff --git a/src/surf/surf.c b/src/surf/surf.c index cbb8725c26..6bc08c2baf 100644 --- a/src/surf/surf.c +++ b/src/surf/surf.c @@ -5,12 +5,108 @@ /* 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 + #include "surf_private.h" #include "xbt/module.h" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(surf_kernel, surf, "Logging specific to SURF (kernel)"); +int use_sdp_solver=0; + +/* Additional declarations for Windows potability. */ + +#ifndef MAX_DRIVE +#define MAX_DRIVE 26 +#endif + +#ifdef _WIN32 +#include +static const char* disk_drives_letter_table[MAX_DRIVE] = +{ + "A:\\", + "B:\\", + "C:\\", + "D:\\", + "E:\\", + "F:\\", + "G:\\", + "H:\\", + "I:\\", + "J:\\", + "K:\\", + "L:\\", + "M:\\", + "N:\\", + "O:\\", + "P:\\", + "Q:\\", + "R:\\", + "S:\\", + "T:\\", + "U:\\", + "V:\\", + "W:\\", + "X:\\", + "Y:\\", + "Z:\\" +}; +#endif /* #ifdef _WIN32 */ + +/* + * Returns the initial path. On Windows the initial path is + * the current directory for the current process in the other + * case the function returns "./" that represents the current + * directory on Unix/Linux platforms. + */ + +const char* __surf_get_initial_path(void) +{ + + #ifdef _WIN32 + unsigned i; + char current_directory[MAX_PATH + 1] = {0}; + unsigned int len = GetCurrentDirectory(MAX_PATH + 1,current_directory); + char root[4] = {0}; + + if(!len) + return NULL; + + strncpy(root,current_directory,3); + + for(i = 0; i