+ simgrid::s4u::NetZone* new_as = sg_platf_new_AS_begin(&AS);
+
+ /* Build a Lua representation of the new AS on the stack */
+ lua_newtable(L);
+ simgrid::s4u::NetZone** lua_as =
+ (simgrid::s4u::NetZone**)lua_newuserdata(L, sizeof(simgrid::s4u::NetZone*)); /* table userdatum */
+ *lua_as = new_as;
+ luaL_getmetatable(L, PLATF_MODULE_NAME); /* table userdatum metatable */
+ lua_setmetatable(L, -2); /* table userdatum */
+ lua_setfield(L, -2, AS_FIELDNAME); /* table -- put the userdata as field of the table */
+
+ return 1;