diff --git a/include/maestro/i_globals.h b/include/maestro/i_globals.h index cec6fbbc807b377c24b409075512bba3b9d401f3..75fab2a90c9821cb72f43e5a8601fc4584a1845d 100644 --- a/include/maestro/i_globals.h +++ b/include/maestro/i_globals.h @@ -163,7 +163,9 @@ extern union mstro_component_descriptor g_component_descriptor; | (MSTRO_POOL_PROTOCOL_VERSION_MINOR << 8) \ | (MSTRO_POOL_PROTOCOL_VERSION_PATCH << 0))) - +/** separators for user defined schema lists and paths enviroment variables */ +#define SCHEMA_LIST_SEP ";" +#define SCHEMA_PATH_SEP ":" /** the precomputed default path for GFS transport (incl. trailing '/') */ extern char *g_mstro_transport_gfs_dir; diff --git a/maestro/core.c b/maestro/core.c index 9a3d591743925f020344d68d2ea7e7b66b404e4c..7146b0224b13742fe1c21cc6cbe66ae5979aafa0 100644 --- a/maestro/core.c +++ b/maestro/core.c @@ -193,8 +193,7 @@ mstro_status mstro_core_init__setup_schemata(void) { env_schema_path = ""; } - char * schema_list_sep = ";"; - char * schema_path_sep = ":"; + char *schema_list_token; char *schema_path_token; @@ -231,7 +230,7 @@ mstro_status mstro_core_init__setup_schemata(void) char env_schema_path_plus_default[MAX_PATH_LENGTH]; /* get the first schema */ - schema_list_token = strtok_r(env_schema_list, schema_list_sep, &end_list_token); + schema_list_token = strtok_r(env_schema_list, SCHEMA_LIST_SEP, &end_list_token); DEBUG("first schema_list_token: %s \n", schema_list_token); /* walk through other tokens */ @@ -242,10 +241,10 @@ mstro_status mstro_core_init__setup_schemata(void) DEBUG("looking for schema_list_token: %s \n", schema_list_token); // creating list of paths to visit. i.e. current directory "." + user defined paths - snprintf(env_schema_path_plus_default, MAX_PATH_LENGTH, "%s%s%s", ".", schema_path_sep, env_schema_path); + snprintf(env_schema_path_plus_default, MAX_PATH_LENGTH, "%s%s%s", ".", SCHEMA_PATH_SEP, env_schema_path); DEBUG("list of paths for schemas: %s\n", env_schema_path_plus_default); /* get the first path */ - schema_path_token = strtok_r(env_schema_path_plus_default, schema_path_sep, &end_path_token); + schema_path_token = strtok_r(env_schema_path_plus_default, SCHEMA_PATH_SEP, &end_path_token); DEBUG("first schema_path_token: %s\n", schema_path_token); /* walk through other paths */ @@ -262,7 +261,7 @@ mstro_status mstro_core_init__setup_schemata(void) } // read the next path - schema_path_token = strtok_r(NULL, schema_path_sep, &end_path_token); + schema_path_token = strtok_r(NULL, SCHEMA_PATH_SEP, &end_path_token); } @@ -280,7 +279,7 @@ mstro_status mstro_core_init__setup_schemata(void) return status; } // read the next schema name - schema_list_token = strtok_r(NULL, schema_list_sep, &end_list_token); + schema_list_token = strtok_r(NULL, SCHEMA_LIST_SEP, &end_list_token); } return status; diff --git a/maestro/ofi.c b/maestro/ofi.c index 49fb5f1a8f100850be03b74e03b0b61f2ab4e496..06f942cdfd4b5021ee4b5e27611272ecb0bf5992 100644 --- a/maestro/ofi.c +++ b/maestro/ofi.c @@ -1980,7 +1980,6 @@ mstro_ofi__msg_context_destroy(mstro_ofi_msg_context ctx) /* FIXME check that the schema versions are compatible between the pm and the component */ bool schema_list_compatible_p(const char * component_schema_list, const char * pm_schema_list) { - char * schema_list_sep = ";"; char *schema_name; char *end_list_token; @@ -1996,7 +1995,7 @@ bool schema_list_compatible_p(const char * component_schema_list, const char * p return false; } // split the schema names in the component_schema_list - schema_name = strtok_r(component_schema_list, schema_list_sep, &end_list_token); + schema_name = strtok_r(component_schema_list, SCHEMA_LIST_SEP, &end_list_token); // for each schema name in the component_schema_list ...try to find it in the pm_schema_list while( schema_name != NULL ) { @@ -2008,7 +2007,7 @@ bool schema_list_compatible_p(const char * component_schema_list, const char * p } DEBUG("Found schema %s in %s\n", schema_name, pm_schema_list); // read the next schema name - schema_name = strtok_r(NULL, schema_list_sep, &end_list_token); + schema_name = strtok_r(NULL, SCHEMA_LIST_SEP, &end_list_token); } /*We reach here only if all component schemas were found in the pm_schema_list*/