X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/773dc73ff2e12aa636dcc6dd06da8d5750d577f8..3dfb0dec2b5d519287ef09aac15f405c07770c71:/src/bindings/lua/lua_process.c diff --git a/src/bindings/lua/lua_process.c b/src/bindings/lua/lua_process.c index c10747d781..ffbcf362c2 100644 --- a/src/bindings/lua/lua_process.c +++ b/src/bindings/lua/lua_process.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2010. The SimGrid Team. +/* Copyright (c) 2010, 2012-2014. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -29,7 +29,7 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(lua_process, bindings, "Lua Bindings (process mo static int l_process_sleep(lua_State* L) { double duration = luaL_checknumber(L, 1); - MSG_error_t res = MSG_process_sleep(duration); + msg_error_t res = MSG_process_sleep(duration); switch (res) { @@ -45,7 +45,7 @@ static int l_process_sleep(lua_State* L) } } -static const luaL_reg process_functions[] = { +static const luaL_Reg process_functions[] = { {"sleep", l_process_sleep}, /* TODO: self, create, kill, suspend, is_suspended, resume, get_name, * get_pid, get_ppid, migrate @@ -59,8 +59,9 @@ static const luaL_reg process_functions[] = { */ void sglua_register_process_functions(lua_State* L) { - luaL_openlib(L, PROCESS_MODULE_NAME, process_functions, 0); - /* simgrid.process */ - lua_pop(L, 1); + lua_getglobal(L, "simgrid"); /* simgrid */ + luaL_newlib(L, process_functions); /* simgrid simgrid.process */ + lua_setfield(L, -2, "process"); /* simgrid */ + lua_pop(L, 1); /* -- */ }