-static const luaL_Reg simgrid_funcs[] = {
- { "create_environment", create_environment},
- { "launch_application", launch_application},
- { "debug", debug},
- { "info", info},
- { "run", run},
- { "clean", clean},
- /* short names */
- { "platform", create_environment},
- { "application", launch_application},
- { NULL, NULL }
+
+/*
+ * Register platform for MSG
+ */
+static int msg_register_platform(lua_State * L)
+{
+ /* Tell Simgrid we dont wanna use its parser */
+ //surf_parse = console_parse_platform;
+ surf_parse_reset_callbacks();
+ MSG_create_environment(NULL);
+ return 0;
+}
+
+/*
+ * Register platform for Simdag
+ */
+
+static int sd_register_platform(lua_State * L)
+{
+ //surf_parse = console_parse_platform_wsL07;
+ surf_parse_reset_callbacks();
+ SD_create_environment(NULL);
+ return 0;
+}
+
+/*
+ * Register platform for gras
+ */
+static int gras_register_platform(lua_State * L)
+{
+ //surf_parse = console_parse_platform;
+ surf_parse_reset_callbacks();
+ gras_create_environment(NULL);
+ return 0;
+}
+
+/**
+ * Register applicaiton for MSG
+ */
+static int msg_register_application(lua_State * L)
+{
+ MSG_function_register_default(run_lua_code);
+ //surf_parse = console_parse_application;
+ MSG_launch_application(NULL);
+ return 0;
+}
+
+/*
+ * Register application for gras
+ */
+static int gras_register_application(lua_State * L)
+{
+ gras_function_register_default(run_lua_code);
+ //surf_parse = console_parse_application;
+ gras_launch_application(NULL);
+ return 0;
+}
+
+static const luaL_Reg simgrid_functions[] = {
+ {"create_environment", create_environment},
+ {"launch_application", launch_application},
+ {"debug", debug},
+ {"info", info},
+ {"run", run},
+ {"clean", clean},
+ /* short names */
+ {"platform", create_environment},
+ {"application", launch_application},
+ /* methods to bypass XML parser */
+ {"msg_register_platform", msg_register_platform},
+ {"sd_register_platform", sd_register_platform},
+ {"msg_register_application", msg_register_application},
+ {"gras_register_platform", gras_register_platform},
+ {"gras_register_application", gras_register_application},
+ /* gras sub generator method */
+ {"gras_set_process_function", gras_add_process_function},
+ {"gras_generate", gras_generate},
+ {NULL, NULL}