Index: /trunk/nv/lua/lua_path.hh
===================================================================
--- /trunk/nv/lua/lua_path.hh	(revision 187)
+++ /trunk/nv/lua/lua_path.hh	(revision 188)
@@ -35,5 +35,5 @@
 
 			template < typename T1, typename T2 >
-			path( const T1& p1, const T2& p2 )
+			path( const T1& p1, const T2& p2 ) : m_count( 0 )
 			{
 				const size_t l1 = string_length<T1>::get( p1 );
Index: /trunk/nv/lua/lua_state.hh
===================================================================
--- /trunk/nv/lua/lua_state.hh	(revision 187)
+++ /trunk/nv/lua/lua_state.hh	(revision 188)
@@ -48,10 +48,13 @@
 			table_guard( state* lstate, const path& p, bool global = true );
 			table_guard( const table_guard& parent, const path& p );
+			size_t get_size();
 			bool has_field( const std::string& element );
 			std::string get_string( const std::string& element, const std::string& defval = "" );
 			char get_char( const std::string& element, char defval = ' ' );
 			int get_integer( const std::string& element, int defval = 0 );
+			unsigned get_unsigned( const std::string& element, unsigned defval = 0 );
 			double get_double( const std::string& element, double defval = 0.0 );
 			bool get_boolean( const std::string& element, bool defval = false );
+			bool is_defined( const path& p );
 
 			template< typename R, typename T >
@@ -173,4 +176,5 @@
 			int get_stack_size();
 			void log_stack();
+			bool is_defined( const path& p, bool global = true );
 			lua_State* get_raw();
 			reference register_object( object * o );
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 )
 {
