Changeset 316 for trunk/src/lua/lua_nova.cc
- Timestamp:
- 08/20/14 12:50:51 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lua/lua_nova.cc
r217 r316 680 680 lua_rawget( L, -2 ); 681 681 682 if ( !lua_isnil( L, -1 ) ) luaL_error( L, "lua.nova - storage \"%s\" already registered!", lua_tolstring( L, lua_upvalueindex(1), 0 ) );682 if ( !lua_isnil( L, -1 ) ) luaL_error( L, "lua.nova - storage \"%s\" already registered!", lua_tolstring( L, 1, 0 ) ); 683 683 684 684 lua_newtable( L ); // g t … … 805 805 lua_settop( L, stack ); 806 806 } 807 808 void nv::lua::register_storage( state* a_state, const string& name, const string& constructor_name ) 809 { 810 // TODO: error checking 811 lua_State* L = a_state->get_raw(); 812 int stack = lua_gettop( L ); 813 // TODO: check if nova is loaded 814 lua_pushcfunction( L, nova_register_storage ); 815 lua_pushstring( L, name.c_str() ); 816 lua_call( L, 1, 1 ); 817 lua_setglobal( L, constructor_name.c_str() ); 818 lua_settop( L, stack ); 819 }
Note: See TracChangeset
for help on using the changeset viewer.