/* **************************** GLOBAL FUNCTIONS **************************** */
/* global parse functions */
-static char *src = NULL; /* temporary store the source name of a route */
-static char *dst = NULL; /* temporary store the destination name of a route */
+static const char *src = NULL; /* temporary store the source name of a route */
+static const char *dst = NULL; /* temporary store the destination name of a route */
static char *gw_src = NULL; /* temporary store the gateway source name of a route */
static char *gw_dst = NULL; /* temporary store the gateway destination name of a route */
static xbt_dynar_t link_list = NULL; /* temporary store of current list link of a route */
/**
* \brief Set the endponints for a route
*/
-static void parse_S_route_new_and_endpoints(char *src_id, char *dst_id)
+static void parse_S_route_new_and_endpoints(const char *src_id, const char *dst_id)
{
if (src != NULL && dst != NULL && link_list != NULL)
THROW2(arg_error, 0, "Route between %s to %s can not be defined",
/**
* \breif Set the endpoints for a route from lua
*/
-static void parse_S_route_new_and_endpoints_lua(char *id_src, char *id_dst)
+static void parse_S_route_new_and_endpoints_lua(const char *id_src, const char *id_dst)
{
parse_S_route_new_and_endpoints(id_src, id_dst);
}
char *cluster_bb_bw = A_surfxml_cluster_bb_bw;
char *cluster_bb_lat = A_surfxml_cluster_bb_lat;
char *host_id, *groups, *link_id = NULL;
- char *router_id, *link_router, *link_backbone, *route_src_dst;
+ char *router_id, *link_router, *link_backbone;
+#ifdef HAVE_PCRE_LIB
+ char *route_src_dst;
+#endif
unsigned int iter;
int start, end, i;
xbt_dynar_t radical_elements;
SURFXML_START_TAG(link);
SURFXML_END_TAG(link);
+ DEBUG0(" ");
+
+#ifdef HAVE_PCRE_LIB
char *new_suffix = bprintf("%s", "");
radical_elements = xbt_str_split(cluster_suffix, ".");
}
route_src_dst = bprintf("%s(.*)%s", cluster_prefix, new_suffix);
- DEBUG0(" ");
-
-#ifdef HAVE_PCRE_LIB
-
DEBUG2("<route\tsrc=\"%s\"\tdst=\"%s\"", route_src_dst, route_src_dst);
DEBUG0("symetrical=\"NO\">");
SURFXML_BUFFER_SET(route_src, route_src_dst);
*/
void routing_set_route(const char *src_id, const char *dst_id)
{
- parse_S_route_new_and_endpoints_lua((char *) src_id, (char *) dst_id);
+ parse_S_route_new_and_endpoints_lua(src_id, dst_id);
}
/*