X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c4e0441cc7811dd6e46604a83848ce702fa58a5b..9a042f95a062f5fdf726c3ab83c91df4527db8e9:/src/surf/surf_config.c diff --git a/src/surf/surf_config.c b/src/surf/surf_config.c index 369cfa89e3..fb2a7e114a 100644 --- a/src/surf/surf_config.c +++ b/src/surf/surf_config.c @@ -95,12 +95,16 @@ static void _surf_cfg_cb__network_model(const char *name, int pos) find_model_description(surf_network_model_description, val); } -/* callback of the cpu_model variable */ -static void _surf_cfg_cb__tcp_gamma(const char *name, int pos) -{ +/* callback of the tcp gamma variable */ +static void _surf_cfg_cb__tcp_gamma(const char *name, int pos) { sg_tcp_gamma = xbt_cfg_get_double(_surf_cfg_set, name); } +static void _surf_cfg_cb__surf_path(const char *name, int pos) { + char *path = xbt_cfg_get_string_at(_surf_cfg_set, name,pos); + xbt_dynar_push(surf_path, &path); +} + /* create the config set, register what should be and parse the command line*/ @@ -148,6 +152,18 @@ void surf_config_init(int *argc, char **argv) { xbt_cfgelm_double,_surf_cfg_cb__tcp_gamma,NULL); xbt_cfg_set_double(_surf_cfg_set, "TCP_gamma", 20000.0); + xbt_cfg_register(_surf_cfg_set,"path","Lookup path for inclusions in platform and deployment XML files", + xbt_cfgelm_string, 0,0,_surf_cfg_cb__surf_path,NULL); + if (!surf_path) { + /* retrieves the current directory of the current process */ + const char *initial_path = __surf_get_initial_path(); + xbt_assert0((initial_path), + "__surf_get_initial_path() failed! Can't resolves current Windows directory"); + + surf_path = xbt_dynar_new(sizeof(char *), NULL); + xbt_cfg_set_string(_surf_cfg_set,"path", initial_path); + } + surf_config_cmd_line(argc,argv); } }