- lua_newtable(L); /* create a table, put the userdata on top of it */
- msg_host_t *lua_host = (msg_host_t *) lua_newuserdata(L, sizeof(msg_host_t));
- *lua_host = msg_host;
- luaL_getmetatable(L, HOST_MODULE_NAME);
- lua_setmetatable(L, -2);
- lua_setfield(L, -2, "__simgrid_host"); /* put the userdata as field of the table */
+ lua_newtable(L); /* table */
+ sg_host_t *lua_host = (sg_host_t *) lua_newuserdata(L, sizeof(sg_host_t));
+ /* table userdatum */
+ *lua_host = host;
+ luaL_getmetatable(L, HOST_MODULE_NAME); /* table userdatum metatable */
+ lua_setmetatable(L, -2); /* table userdatum */
+ lua_setfield(L, -2, HOST_FIELDNAME); /* table -- put the userdata as field of the table */
+