} s_sg_platf_linkctn_cbarg_t;
-XBT_PUBLIC(void) sg_platf_open(void); // Start a new platform
-XBT_PUBLIC(void) sg_platf_close(void); // Finish the creation of the platform
+XBT_PUBLIC(void) sg_platf_begin(void); // Start a new platform
+XBT_PUBLIC(void) sg_platf_end(void); // Finish the creation of the platform
-XBT_PUBLIC(void) sg_platf_new_AS_open(const char *id, const char *mode); // Begin description of new AS
-XBT_PUBLIC(void) sg_platf_new_AS_close(void); // That AS is fully described
+XBT_PUBLIC(void) sg_platf_new_AS_begin(const char *id, const char *mode); // Begin description of new AS
+XBT_PUBLIC(void) sg_platf_new_AS_end(void); // That AS is fully described
XBT_PUBLIC(void) sg_platf_new_host (sg_platf_host_cbarg_t host); // Add an host to the currently described AS
XBT_PUBLIC(void) sg_platf_new_router(sg_platf_router_cbarg_t router); // Add a router to the currently described AS
/* The callbacks to register for the routing to work */
-void routing_AS_open(const char *AS_id, const char *wanted_routing_type);
-void routing_AS_close(void);
+void routing_AS_begin(const char *AS_id, const char *wanted_routing_type);
+void routing_AS_end(void);
#endif /* _SURF_SURF_H */
int console_open(lua_State *L) {
sg_platf_init();
- sg_platf_open();
+ sg_platf_begin();
surf_parse_init_callbacks();
return 0;
}
int console_close(lua_State *L) {
- sg_platf_close();
+ sg_platf_end();
sg_platf_exit();
return 0;
}
mode = lua_tostring(L, -1);
lua_pop(L, 1);
- sg_platf_new_AS_open(id,mode);
+ sg_platf_new_AS_begin(id,mode);
return 0;
}
int console_AS_close(lua_State *L) {
- sg_platf_new_AS_close();
+ sg_platf_new_AS_end();
return 0;
}
typedef void (*sg_platf_router_cb_t)(sg_platf_router_cbarg_t);
typedef void (*sg_platf_link_cb_t)(sg_platf_link_cbarg_t);
typedef void (*sg_platf_peer_cb_t)(sg_platf_peer_cbarg_t);
-typedef void (*sg_platf_ASopen_cb_t)(const char*id, const char*routing);
+typedef void (*sg_platf_AS_begin_cb_t)(const char*id, const char*routing);
void sg_platf_host_add_cb(sg_platf_host_cb_t);
void sg_platf_router_add_cb(sg_platf_router_cb_t);
void sg_platf_link_add_cb(sg_platf_link_cb_t);
void sg_platf_peer_add_cb(sg_platf_peer_cb_t fct);
void sg_platf_postparse_add_cb(void_f_void_t fct);
-void sg_platf_ASopen_add_cb(sg_platf_ASopen_cb_t fct);
-void sg_platf_ASclose_add_cb(void_f_void_t fct);
+void sg_platf_AS_begin_add_cb(sg_platf_AS_begin_cb_t fct);
+void sg_platf_AS_end_add_cb(void_f_void_t fct);
if (!TRACE_is_enabled()) return;
//always need the call backs to ASes (we need only the root AS),
//to create the rootContainer and the rootType properly
- sg_platf_ASopen_add_cb(instr_routing_parse_start_AS);
- sg_platf_ASclose_add_cb(instr_routing_parse_end_AS);
+ sg_platf_AS_begin_add_cb(instr_routing_parse_start_AS);
+ sg_platf_AS_end_add_cb(instr_routing_parse_end_AS);
if (!TRACE_needs_platform()) return;
sg_platf_link_add_cb(instr_routing_parse_start_link);
sg_platf_host_add_cb(instr_routing_parse_start_host);
xbt_dynar_t sg_platf_link_cb_list = NULL; // of sg_platf_link_cb_t
xbt_dynar_t sg_platf_router_cb_list = NULL; // of sg_platf_router_cb_t
xbt_dynar_t sg_platf_peer_cb_list = NULL; // of sg_platf_peer_cb_t
-xbt_dynar_t sg_platf_ASopen_cb_list = NULL; //of sg_platf_ASopen_cb_t
-xbt_dynar_t sg_platf_ASclose_cb_list = NULL; //of void_f_void_t
+xbt_dynar_t sg_platf_AS_begin_cb_list = NULL; //of sg_platf_AS_begin_cb_t
+xbt_dynar_t sg_platf_AS_end_cb_list = NULL; //of void_f_void_t
xbt_dynar_t sg_platf_postparse_cb_list = NULL; // of void_f_void_t
/** Module management function: creates all internal data structures */
sg_platf_link_cb_list = xbt_dynar_new(sizeof(sg_platf_host_cb_t), NULL);
sg_platf_peer_cb_list = xbt_dynar_new(sizeof(sg_platf_peer_cb_t), NULL);
sg_platf_postparse_cb_list = xbt_dynar_new(sizeof(sg_platf_link_cb_t),NULL);
- sg_platf_ASopen_cb_list = xbt_dynar_new(sizeof(sg_platf_ASopen_cb_t),NULL);
- sg_platf_ASclose_cb_list = xbt_dynar_new(sizeof(void_f_void_t),NULL);
+ sg_platf_AS_begin_cb_list = xbt_dynar_new(sizeof(sg_platf_AS_begin_cb_t),NULL);
+ sg_platf_AS_end_cb_list = xbt_dynar_new(sizeof(void_f_void_t),NULL);
}
/** Module management function: frees all internal data structures */
void sg_platf_exit(void) {
xbt_dynar_free(&sg_platf_link_cb_list);
xbt_dynar_free(&sg_platf_postparse_cb_list);
xbt_dynar_free(&sg_platf_peer_cb_list);
- xbt_dynar_free(&sg_platf_ASopen_cb_list);
- xbt_dynar_free(&sg_platf_ASclose_cb_list);
+ xbt_dynar_free(&sg_platf_AS_begin_cb_list);
+ xbt_dynar_free(&sg_platf_AS_end_cb_list);
}
void sg_platf_new_host(sg_platf_host_cbarg_t h){
}
}
-void sg_platf_open() { /* Do nothing: just for symmetry of user code */ }
+void sg_platf_begin() { /* Do nothing: just for symmetry of user code */ }
-void sg_platf_close() {
+void sg_platf_end() {
unsigned int iterator;
void_f_void_t fun;
xbt_dynar_foreach(sg_platf_postparse_cb_list, iterator, fun) {
}
}
-void sg_platf_new_AS_open(const char *id, const char *routing) {
+void sg_platf_new_AS_begin(const char *id, const char *routing) {
unsigned int iterator;
- sg_platf_ASopen_cb_t fun;
- xbt_dynar_foreach(sg_platf_ASopen_cb_list, iterator, fun) {
+ sg_platf_AS_begin_cb_t fun;
+ xbt_dynar_foreach(sg_platf_AS_begin_cb_list, iterator, fun) {
(*fun) (id,routing);
}
}
-void sg_platf_new_AS_close() {
+void sg_platf_new_AS_end() {
unsigned int iterator;
void_f_void_t fun;
- xbt_dynar_foreach(sg_platf_ASclose_cb_list, iterator, fun) {
+ xbt_dynar_foreach(sg_platf_AS_end_cb_list, iterator, fun) {
(*fun) ();
}
}
void sg_platf_postparse_add_cb(void_f_void_t fct) {
xbt_dynar_push(sg_platf_postparse_cb_list, &fct);
}
-void sg_platf_ASopen_add_cb(sg_platf_ASopen_cb_t fct) {
- xbt_dynar_push(sg_platf_ASopen_cb_list, &fct);
+void sg_platf_AS_begin_add_cb(sg_platf_AS_begin_cb_t fct) {
+ xbt_dynar_push(sg_platf_AS_begin_cb_list, &fct);
}
-void sg_platf_ASclose_add_cb(void_f_void_t fct) {
- xbt_dynar_push(sg_platf_ASclose_cb_list, &fct);
+void sg_platf_AS_end_add_cb(void_f_void_t fct) {
+ xbt_dynar_push(sg_platf_AS_end_cb_list, &fct);
}
* @param AS_id name of this autonomous system. Must be unique in the platform
* @param wanted_routing_type one of Full, Floyd, Dijkstra or similar. Full list in the variable routing_models, in src/surf/surf_routing.c
*/
-void routing_AS_open(const char *AS_id, const char *wanted_routing_type)
+void routing_AS_begin(const char *AS_id, const char *wanted_routing_type)
{
routing_component_t new_routing;
model_type_t model = NULL;
* even if you add stuff to a closed AS
*
*/
-void routing_AS_close()
+void routing_AS_end()
{
if (current_routing == NULL) {
xbt_dynar_t radical_ends;
XBT_DEBUG("<AS id=\"%s\"\trouting=\"Cluster\">", struct_cluster->id);
- sg_platf_new_AS_open(struct_cluster->id, "Cluster");
+ sg_platf_new_AS_begin(struct_cluster->id, "Cluster");
//Make all hosts
radical_elements = xbt_str_split(struct_cluster->radical, ",");
xbt_dict_free(&patterns);
XBT_DEBUG("</AS>");
- sg_platf_new_AS_close();
+ sg_platf_new_AS_end();
XBT_DEBUG(" ");
}
surfxml_bufferstack_push(1);
XBT_DEBUG("<AS id=\"%s\"\trouting=\"Full\">", peer->id);
- sg_platf_new_AS_open(peer->id, "Full");
+ sg_platf_new_AS_begin(peer->id, "Full");
XBT_DEBUG(" ");
host_id = HOST_PEER(peer->id);
SURFXML_END_TAG(route);
XBT_DEBUG("</AS>");
- sg_platf_new_AS_close();
+ sg_platf_new_AS_end();
XBT_DEBUG(" ");
//xbt_dynar_free(&tab_elements_num);
"This program is installed automatically with SimGrid, or "
"available in the tools/ directory of the source archive.");
- sg_platf_open();
+ sg_platf_begin();
}
void ETag_surfxml_platform(void){
- sg_platf_close();
+ sg_platf_end();
}
void STag_surfxml_host(void){
surfxml_call_cb_functions(STag_surfxml_trace_connect_cb_list);
}
void STag_surfxml_AS(void){
- sg_platf_new_AS_open(A_surfxml_AS_id,A_surfxml_AS_routing);
+ sg_platf_new_AS_begin(A_surfxml_AS_id,A_surfxml_AS_routing);
}
void ETag_surfxml_AS(void){
- sg_platf_new_AS_close();
+ sg_platf_new_AS_end();
}
void STag_surfxml_ASroute(void){
surfxml_call_cb_functions(STag_surfxml_ASroute_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);
+ sg_platf_AS_end_add_cb(routing_AS_end);
+ sg_platf_AS_begin_add_cb(routing_AS_begin);
}
static void free_data(void)