Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 187)
+++ trunk/src/lua/lua_state.cc	(revision 188)
@@ -216,4 +216,10 @@
 }
 
+size_t lua::table_guard::get_size()
+{
+	return lua_rawlen( L->get_raw(), -1 );
+}
+
+
 bool lua::table_guard::has_field( const string& element )
 {
@@ -248,4 +254,12 @@
 }
 
+unsigned lua::table_guard::get_unsigned( const string& element, unsigned defval /*= "" */ )
+{
+	lua_getfield( L->L, -1, element.c_str() );
+	int result = lua_type( L->L, -1 ) == LUA_TNUMBER ? lua_tounsigned( L->L, -1 ) : defval;
+	lua_pop( L->L, 1 );
+	return result;
+}
+
 double lua::table_guard::get_double( const string& element, double defval /*= "" */ )
 {
@@ -274,4 +288,8 @@
 }
 
+bool nv::lua::table_guard::is_defined( const path& p )
+{
+	return L->is_defined( p, false );
+}
 
 void lua::table_guard::get_raw_flags( const std::string& element, uint8* data, uint32 count )
@@ -393,4 +411,16 @@
 }
 
+
+bool nv::lua::state::is_defined( const path& p, bool global )
+{
+	if ( !p.resolve( L, global ) )
+	{
+		return false;
+	}
+	bool result = !lua_isnil( L, -1 );
+	lua_pop( L, 1 );
+	return result;
+}
+
 int lua::state::call_function( int nargs, int nresults )
 {
