X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a79a8e1cab86ccc687cfbc97b01b735acb996f16..445e892abe9e2f84dc82d712f9d5f97081530d59:/src/bindings/lua/lua_platf.cpp?ds=inline diff --git a/src/bindings/lua/lua_platf.cpp b/src/bindings/lua/lua_platf.cpp index 7398ed7a61..c662f755ac 100644 --- a/src/bindings/lua/lua_platf.cpp +++ b/src/bindings/lua/lua_platf.cpp @@ -286,25 +286,21 @@ int console_add_link(lua_State *L) { * add Router to AS components */ int console_add_router(lua_State* L) { - s_sg_platf_router_cbarg_t router; - memset(&router,0,sizeof(router)); - int type; - lua_ensure(lua_istable(L, -1), "Bad Arguments to create router, Should be a table with named arguments"); lua_pushstring(L, "id"); - type = lua_gettable(L, -2); + int type = lua_gettable(L, -2); lua_ensure(type == LUA_TSTRING, "Attribute 'id' must be specified for any link and must be a string."); - router.id = lua_tostring(L, -1); + const char* name = lua_tostring(L, -1); lua_pop(L,1); lua_pushstring(L,"coord"); lua_gettable(L,-2); - router.coord = lua_tostring(L, -1); + const char* coords = lua_tostring(L, -1); lua_pop(L,1); - sg_platf_new_router(&router); + sg_platf_new_router(name, coords); return 0; }