chore(lua): rename init_* functions to open_*

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-11-04 13:54:51 -08:00
parent fd7e85f0bb
commit 543aea65c9
5 changed files with 12 additions and 12 deletions

View file

@ -84,7 +84,7 @@ static int name_lt(lua_State * L) {
return 1; return 1;
} }
void init_name(lua_State * L) { void open_name(lua_State * L) {
luaL_newmetatable(L, "name.mt"); luaL_newmetatable(L, "name.mt");
setfuncs(L, name_m, 0); setfuncs(L, name_m, 0);

View file

@ -7,6 +7,6 @@ Author: Leonardo de Moura
#ifdef LEAN_USE_LUA #ifdef LEAN_USE_LUA
#include <lua.hpp> #include <lua.hpp>
namespace lean { namespace lean {
void init_name(lua_State * L); void open_name(lua_State * L);
} }
#endif #endif

View file

@ -98,7 +98,7 @@ public:
return push_result(L, arg); return push_result(L, arg);
} }
static void init(lua_State * L) { static void open(lua_State * L) {
luaL_newmetatable(L, M); luaL_newmetatable(L, M);
setfuncs(L, m, 0); setfuncs(L, m, 0);
@ -124,14 +124,14 @@ const struct luaL_Reg num_bindings<T, N, M>::m[] = {
constexpr char const mpz_name[] = "mpz"; constexpr char const mpz_name[] = "mpz";
constexpr char const mpz_metatable[] = "mpz.mt"; constexpr char const mpz_metatable[] = "mpz.mt";
void init_mpz(lua_State * L) { void open_mpz(lua_State * L) {
num_bindings<mpz, mpz_name, mpz_metatable>::init(L); num_bindings<mpz, mpz_name, mpz_metatable>::open(L);
} }
constexpr char const mpq_name[] = "mpq"; constexpr char const mpq_name[] = "mpq";
constexpr char const mpq_metatable[] = "mpq.mt"; constexpr char const mpq_metatable[] = "mpq.mt";
void init_mpq(lua_State * L) { void open_mpq(lua_State * L) {
num_bindings<mpq, mpq_name, mpq_metatable>::init(L); num_bindings<mpq, mpq_name, mpq_metatable>::open(L);
} }
} }
#endif #endif

View file

@ -7,7 +7,7 @@ Author: Leonardo de Moura
#ifdef LEAN_USE_LUA #ifdef LEAN_USE_LUA
#include <lua.hpp> #include <lua.hpp>
namespace lean { namespace lean {
void init_mpz(lua_State * L); void open_mpz(lua_State * L);
void init_mpq(lua_State * L); void open_mpq(lua_State * L);
} }
#endif #endif

View file

@ -18,9 +18,9 @@ int main(int argc, char ** argv) {
int exitcode = 0; int exitcode = 0;
L = luaL_newstate(); L = luaL_newstate();
luaL_openlibs(L); luaL_openlibs(L);
lean::init_name(L); lean::open_name(L);
lean::init_mpz(L); lean::open_mpz(L);
lean::init_mpq(L); lean::open_mpq(L);
for (int i = 1; i < argc; i++) { for (int i = 1; i < argc; i++) {
status = luaL_loadfile(L, argv[i]); status = luaL_loadfile(L, argv[i]);