#include "xbt/log.h"
#include "xbt/str.h"
#include "xbt/dict.h"
+#include "simgrid/platf.h"
#include "surf/surfxml_parse_private.h"
#include "surf/surf_private.h"
* Pass arguments to parsing callback as structures to save some time (and allow callbacks to ignore some)
*/
-surf_parsing_host_arg_t struct_host = NULL;
-surf_parsing_router_arg_t struct_router = NULL;
surf_parsing_cluster_arg_t struct_cluster = NULL;
-surf_parsing_peer_arg_t struct_peer = NULL;
-surf_parsing_link_arg_t struct_lnk = NULL;
-
/*
* Trace related stuff
static void parse_Stag_trace(void)
{
- surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag. See comment in simgrid.dtd */
trace_id = xbt_strdup(A_surfxml_trace_id);
trace_file = xbt_strdup(A_surfxml_trace_file);
- surf_parse_get_double(&trace_periodicity, A_surfxml_trace_periodicity);
+ trace_periodicity = surf_parse_get_double(A_surfxml_trace_periodicity);
}
static void parse_Etag_trace(void)
static void parse_Stag_trace_connect(void)
{
- surf_parse_models_setup(); /* ensure that the models are created after the last <config> tag. See comment in simgrid.dtd */
-
xbt_assert(xbt_dict_get_or_null
(traces_set_list, A_surfxml_trace_connect_trace),
"Cannot connect trace %s to %s: trace unknown",
}
}
-
/* Init and free parse data */
static void init_data(void)
surfxml_add_callback(ETag_surfxml_trace_cb_list, &parse_Etag_trace);
surfxml_add_callback(STag_surfxml_trace_connect_cb_list,
&parse_Stag_trace_connect);
+
+ /* we care about the ASes while parsing the platf. Incredible, isnt it? */
+ sg_platf_ASclose_add_cb(routing_AS_close);
+ sg_platf_ASopen_add_cb(routing_AS_open);
}
static void free_data(void)
int parse_status;
surf_parse_reset_callbacks();
- surf_parse_add_callback_config();
+
+ /* Register classical callbacks */
+ surfxml_add_callback(STag_surfxml_prop_cb_list, &parse_properties_XML);
+ routing_register_callbacks();
surfxml_buffer_stack_stack_ptr = 1;
surfxml_buffer_stack_stack[0] = 0;
surf_parse_close();
if (parse_status)
xbt_die("Parse error in %s", file);
-
- surf_config_models_create_elms();
}