Index: trunk/nv/lib/detail/lua_functions.inc
===================================================================
--- trunk/nv/lib/detail/lua_functions.inc	(revision 165)
+++ trunk/nv/lib/detail/lua_functions.inc	(revision 166)
@@ -127,8 +127,9 @@
 NV_LUA_FUN_52( void  ,lua_upvaluejoin,(lua_State *L, int fidx1, int n1, int fidx2, int n2) );
 NV_LUA_FUN( int,lua_sethook,(lua_State *L, lua_Hook func, int mask, int count) );
-NV_LUA_FUN( lua_Hook,lua_gethook,(lua_State *L) );
+NV_LUA_FUN_52( lua_Hook,lua_gethook,(lua_State *L) );
 NV_LUA_FUN( int,lua_gethookmask,(lua_State *L) );
 NV_LUA_FUN( int,lua_gethookcount,(lua_State *L) );
 
+#if NV_LUA_VERSION != NV_LUA_5C
 /* buffer API */
 NV_LUA_FUN( void,luaL_buffinit, (lua_State *L, luaL_Buffer *B) );
@@ -141,4 +142,5 @@
 NV_LUA_FUN_52( void,luaL_pushresultsize,(luaL_Buffer *B, size_t sz) );
 NV_LUA_FUN_52( char *,luaL_buffinitsize,(lua_State *L, luaL_Buffer *B, size_t sz) );
+#endif
 
 /* lualib API */
Index: trunk/nv/lib/detail/lua_functions_compat.inc
===================================================================
--- trunk/nv/lib/detail/lua_functions_compat.inc	(revision 166)
+++ trunk/nv/lib/detail/lua_functions_compat.inc	(revision 166)
@@ -0,0 +1,11 @@
+NV_LUA_COMPAT_FUN( void,lua_pushstring,(lua_State *L, const char *s),const char*,lua_pushstring,(lua_State *L, const char *s),(L,s),(void));
+NV_LUA_COMPAT_FUN( void,lua_pushlstring,(lua_State *L, const char *s, size_t l),const char*,lua_pushlstring,(lua_State *L, const char *s, size_t l),(L,s,l),(void));
+NV_LUA_COMPAT_FUN( int,luaL_loadfile,(lua_State *L, const char *f),int,luaL_loadfilex,(lua_State *L, const char *f, const char *mode),(L,f,NULL),return);
+NV_LUA_COMPAT_FUN( int,luaL_loadbuffer,(lua_State *L, const char *buff, size_t sz, const char *n),int,luaL_loadbufferx,(lua_State *L, const char *buff, size_t sz, const char *n, const char *mode),(L,buff,sz,n,NULL),return);
+NV_LUA_COMPAT_FUN( void,lua_call,(lua_State *L, int na, int nr),void,lua_callk,(lua_State *L, int na, int nr, int ctx, lua_CFunction k ),(L,na,nr,0,NULL),(void));
+NV_LUA_COMPAT_FUN( int,lua_pcall,(lua_State *L, int na, int nr, int f),int,lua_pcallk,(lua_State *L, int na, int nr, int f, int ctx, lua_CFunction k ),(L,na,nr,f,0,NULL),return);
+NV_LUA_COMPAT_FUN( lua_Number,lua_tonumber,(lua_State *L, int idx),lua_Number,lua_tonumberx,(lua_State *L, int idx, int* isn ),(L,idx,NULL),return);
+NV_LUA_COMPAT_FUN( lua_Integer,lua_tointeger,(lua_State *L, int idx),lua_Integer,lua_tointegerx,(lua_State *L, int idx, int* isn ),(L,idx,NULL),return);
+NV_LUA_COMPAT_FUN( int,lua_yield,(lua_State *L, int nr),int,lua_yieldk,(lua_State *L, int nr, int ctx, lua_CFunction k),(L,nr,0,NULL),return);
+NV_LUA_COMPAT_FUN( int,lua_resume,(lua_State *L, int na),int,lua_resume,(lua_State *L, lua_State *from, int na),(L,NULL,na),return);
+NV_LUA_COMPAT_FUN( int,lua_load,(lua_State *L, lua_Reader reader, void *dt, const char *n),int,lua_load,(lua_State *L, lua_Reader reader, void *dt, const char *n, const char *m),(L,reader,dt,n,NULL),return);
Index: trunk/nv/lib/lua.hh
===================================================================
--- trunk/nv/lib/lua.hh	(revision 165)
+++ trunk/nv/lib/lua.hh	(revision 166)
@@ -38,30 +38,39 @@
 //#define NV_LUA_SHARED
 
-#define NV_LUA_51     0
-#define NV_LUA_52     1
+#define NV_LUA_5C     0
+#define NV_LUA_51     1
+#define NV_LUA_52     2
+
+#if NV_PLATFORM == NV_WINDOWS
+#	define NV_LUA_PATH_51  "lua51.dll"
+#	define NV_LUA_PATH_52  "lua52.dll"
+#	define NV_LUA_PATH_JIT "luajit.dll"
+#elif NV_PLATFORM == NV_APPLE
+#	define NV_LUA_PATH_51  "lua5.1.dylib"
+#	define NV_LUA_PATH_52  "lua5.2.dylib"
+#	define NV_LUA_PATH_JIT "luajit.dylib"
+#else
+#	define NV_LUA_PATH_51  "lua5.1.so"
+#	define NV_LUA_PATH_52  "lua5.2.so"
+#	define NV_LUA_PATH_JIT "luajit.so"
+#endif
+
 
 #if !defined(NV_LUA_VERSION)
-#	define NV_LUA_VERSION NV_LUA_52
-#endif
+#	define NV_LUA_VERSION     NV_LUA_5C
+#endif
+
 #if defined(NV_LUA_JIT)
-#	define NV_LUA_VERSION NV_LUA_51
-#endif
-
-#if NV_LUA_VERSION == NV_LUA_52
-#	if NV_PLATFORM == NV_WINDOWS
-#		define NV_LUA_PATH "lua52.dll"
-#	elif NV_PLATFORM == NV_APPLE
-#		define NV_LUA_PATH "lua5.2.dylib"
-#	else
-#		define NV_LUA_PATH "lua5.2.so"
+#	if NV_LUA_VERSION == NV_LUA_52
+#		error "LuaJIT requested with version 5.2!"
 #	endif
+#endif
+
+#if NV_LUA_VERSION == NV_LUA_52
+#	define NV_LUA_PATH NV_LUA_PATH_52
 #elif NV_LUA_VERSION == NV_LUA_51 
-#	if NV_PLATFORM == NV_WINDOWS
-#		define NV_LUA_PATH "lua51.dll"
-#	elif NV_PLATFORM == NV_APPLE
-#		define NV_LUA_PATH "lua5.1.dylib"
-#	else
-#		define NV_LUA_PATH "lua5.1.so"
-#	endif
+#	define NV_LUA_PATH NV_LUA_PATH_51
+#elif NV_LUA_VERSION == NV_LUA_5C
+#	define NV_LUA_PATH nullptr
 #else
 #	error "Unrecognized NV_LUA_VERSION!"
@@ -69,11 +78,5 @@
 
 #if defined(NV_LUA_JIT)
-#	if NV_PLATFORM == NV_WINDOWS
-#		define NV_LUA_PATH "luajit.dll"
-#	elif NV_PLATFORM == NV_APPLE
-#		define NV_LUA_PATH "luajit.dylib"
-#	else
-#		define NV_LUA_PATH "luajit.so"
-#	endif
+#	define NV_LUA_PATH NV_LUA_PATH_JIT
 #endif
 
@@ -96,6 +99,4 @@
 #define LUA_UNSIGNED unsigned int
 
-#define LUAI_MAXSTACK		1000000
-#define LUAI_FIRSTPSEUDOIDX	(-LUAI_MAXSTACK - 1000)
 #define LUA_IDSIZE 60
 
@@ -106,9 +107,11 @@
 #	define LUA_VERSION_NUM		502
 #	define LUA_VERSION_RELEASE	"1"
-#else
-#	define LUA_VERSION_MAJOR	"5"
+#elif NV_LUA_VERSION == NV_LUA_51
 #	define LUA_VERSION_MINOR	"1"
 #	define LUA_VERSION_NUM		501
 #	define LUA_VERSION_RELEASE	"4"
+#else
+#	define LUA_VERSION_MINOR	"?"
+#	define LUA_VERSION_RELEASE	"?"
 #endif 
 
@@ -124,4 +127,6 @@
 
 #if NV_LUA_VERSION == NV_LUA_52
+#	define LUAI_MAXSTACK		1000000
+#	define LUAI_FIRSTPSEUDOIDX	(-LUAI_MAXSTACK - 1000)
 #	define LUA_REGISTRYINDEX	LUAI_FIRSTPSEUDOIDX
 #	define lua_upvalueindex(i)	(LUA_REGISTRYINDEX - (i))
@@ -177,4 +182,5 @@
 } luaL_Reg;
 
+/* TODO: make compat version - two buffers, decision at load time */
 #if NV_LUA_VERSION == NV_LUA_52
 typedef struct luaL_Buffer {
@@ -333,4 +339,34 @@
 #undef NV_LUA_FUN_51
 #undef NV_LUA_FUN_52
+
+#if NV_LUA_VERSION == NV_LUA_5C
+#	define NV_LUA_COMPAT_FUN( rtype, fname, fparams,u1,u2,u3,u4,u5 ) extern rtype (*fname) fparams
+#	include <nv/lib/detail/lua_functions_compat.inc>
+#	undef NV_LUA_COMPAT_FUN
+extern size_t (*lua_rawlen)        (lua_State *L, int idx);
+extern int    (*lua_absindex)      (lua_State *L, int idx);
+extern void   (*lua_getglobal)     (lua_State *L, const char *var);
+extern void   (*lua_setglobal)     (lua_State *L, const char *var);
+extern void   (*luaL_requiref)     (lua_State *L, const char *modname, lua_CFunction openf, int glb);
+extern void   (*luaL_setmetatable) (lua_State *L, const char *tname);
+extern void*  (*luaL_testudata)    (lua_State *L, int ud, const char *tname);
+extern void   (*lua_copy)          (lua_State *L, int fromidx, int toidx);
+#	define LUA_OPEQ	0
+#	define LUA_OPLT	1
+#	define LUA_OPLE	2
+extern int    (*lua_compare)       (lua_State *L, int idx1, int idx2, int op);
+extern void   (*lua_rawgetp)       (lua_State *L, int idx, const void *p);
+extern void   (*lua_rawsetp)       (lua_State *L, int idx, const void *p);
+extern void   (*lua_pushglobaltable)(lua_State* L);
+extern void   (*luaL_setfuncs)     (lua_State *L, const luaL_Reg *l, int nup);
+extern int    (*luaL_getsubtable)  (lua_State *L, int idx, const char *fname);
+
+extern const lua_Number* (*lua_version) (lua_State *L);
+extern int LUA_REGISTRYINDEX;
+extern int LUA_VERSION_NUM;
+#define lua_tounsigned(L,idx) (lua_Number)lua_tointeger(L,idx)
+#define lua_pushunsigned(L,u) lua_pushinteger(L,(lua_Integer)u)
+#define lua_objlen lua_rawlen
+#endif
 
 /* Macros */
@@ -395,5 +431,4 @@
 #else
 #endif
-
 }
 
Index: trunk/nv/library.hh
===================================================================
--- trunk/nv/library.hh	(revision 165)
+++ trunk/nv/library.hh	(revision 166)
@@ -34,6 +34,15 @@
 		/**
 		 * Opens the library
+		 *
+		 * Throws library_error on failure
 		 */
 		void open( const std::string& name );
+
+		/**
+		 * Tries to open the library
+		 *
+		 * returns true if succeeded, false otherwise
+		 */
+		bool try_open( const std::string& name );
 
 		/**
@@ -49,6 +58,15 @@
 		/**
 		 * Get symbol from library
+		 *
+		 * Throws on symbol not found
 		 */
 		void* get( const std::string& symbol );
+
+		/**
+		 * Get symbol from library
+		 *
+		 * Returns null if symbol not found
+		 */
+		void* try_get( const std::string& symbol );
 
 		/**
@@ -72,6 +90,8 @@
 		 * Opens the library and prepares it for getting symbols.
 		 * Needs to be done before any get call.
+		 *
+		 * returns true on success, false otherwise
 		 */
-		void open();
+		bool open();
 
 		/**
Index: trunk/src/lib/lua.cc
===================================================================
--- trunk/src/lib/lua.cc	(revision 165)
+++ trunk/src/lib/lua.cc	(revision 166)
@@ -41,9 +41,184 @@
 #undef NV_LUA_FUN_52
 
+#if NV_LUA_VERSION == NV_LUA_5C
+#	define NV_LUA_COMPAT_FUN( rt, fn, fp,u1,u2,u3,u4,u5 ) rt (*fn) fp = nullptr;
+#	include <nv/lib/detail/lua_functions_compat.inc>
+#	undef NV_LUA_COMPAT_FUN
+int LUA_REGISTRYINDEX = 0;
+int LUA_VERSION_NUM   = 0;
+size_t (*lua_rawlen)        (lua_State *L, int idx) = nullptr;
+int    (*lua_absindex)      (lua_State *L, int idx) = nullptr;
+void   (*lua_getglobal)     (lua_State *L, const char *var) = nullptr;
+void   (*lua_setglobal)     (lua_State *L, const char *var) = nullptr;
+void   (*luaL_requiref)     (lua_State *L, const char *modname, lua_CFunction openf, int glb) = nullptr;
+void   (*luaL_setmetatable) (lua_State *L, const char *tname) = nullptr;
+void*  (*luaL_testudata)    (lua_State *L, int ud, const char *tname) = nullptr;
+void   (*lua_copy)          (lua_State *L, int fromidx, int toidx) = nullptr;
+int    (*lua_compare)       (lua_State *L, int idx1, int idx2, int op) = nullptr;
+void   (*lua_rawgetp)       (lua_State *L, int idx, const void *p) = nullptr;
+void   (*lua_rawsetp)       (lua_State *L, int idx, const void *p) = nullptr;
+void   (*lua_pushglobaltable)(lua_State* L) = nullptr;
+void   (*luaL_setfuncs)     (lua_State *L, const luaL_Reg *l, int nup) = nullptr;
+int    (*luaL_getsubtable)  (lua_State *L, int idx, const char *fname) = nullptr;
+
+const lua_Number* (*lua_version) (lua_State *L) = nullptr;
+
+// only loaded in 5.1 mode to implement lua_compare
+int    (*lua_equal)        (lua_State *L, int idx1, int idx2) = nullptr;
+int    (*lua_lessthan)     (lua_State *L, int idx1, int idx2) = nullptr;
+
+
+#	define NV_LUA_COMPAT_FUN( u1,u2,u3,rt2,fn2,fp2,u4,u5 ) static rt2 (*fn2##_compat) fp2 = nullptr;
+#	include <nv/lib/detail/lua_functions_compat.inc>
+#	undef NV_LUA_COMPAT_FUN
+
+#	define NV_LUA_COMPAT_FUN( rt, fn, fp, rt2, fn2, fp2,arg,ret ) \
+		rt call_##fn2##_compat fp { ret fn2##_compat arg; } 
+#	include <nv/lib/detail/lua_functions_compat.inc>
+#	undef NV_LUA_COMPAT_FUN
+
+#	define LUAI_MAXSTACK_52		    1000000
+#	define LUAI_FIRSTPSEUDOIDX_52	(-LUAI_MAXSTACK_52 - 1000)
+#	define LUA_REGISTRYINDEX_52	    LUAI_FIRSTPSEUDOIDX_52
+#	define LUA_GLOBALSINDEX_51      (-10002)
+#	define LUA_REGISTRYINDEX_51     (-10000)
+#	define lua_upvalueindex_51(i)   (LUA_GLOBALSINDEX_51-(i))
+#	define lua_upvalueindex_52(i)   (LUA_REGISTRYINDEX_52-(i))
+
+int lua_absindex_51 (lua_State *L, int idx) { return (idx > 0 ? idx : idx + lua_gettop(L) + 1); };
+void lua_getglobal_51 (lua_State *L, const char *var) { lua_getfield(L, LUA_GLOBALSINDEX_51, var ); };
+void lua_setglobal_51 (lua_State *L, const char *var) { lua_setfield(L, LUA_GLOBALSINDEX_51, var ); };
+void luaL_requiref_51 (lua_State *L, const char *modname, lua_CFunction openf, int glb)
+{
+	lua_pushcfunction(L, openf);
+	lua_pushstring(L, modname);
+	lua_call(L, 1, 1);
+	if (glb != 0)
+	{
+		lua_pushvalue( L, LUA_GLOBALSINDEX_51 );
+		lua_pushvalue(L, -2); 
+		lua_setfield(L, -2, modname); 
+		lua_pop(L, 1); 
+	}
+}
+
+void luaL_setmetatable_51 (lua_State *L, const char *tname)
+{
+	luaL_getmetatable(L, tname);
+	lua_setmetatable(L, -2);
+}
+
+void *luaL_testudata_51 (lua_State *L, int ud, const char *tname)
+{
+	void *p = lua_touserdata(L, ud);
+	if (p != NULL) 
+	{  
+		if (lua_getmetatable(L, ud)) 
+		{
+			luaL_getmetatable(L, tname); 
+			if ( !lua_rawequal(L, -1, -2))
+				p = NULL;  
+			lua_pop(L, 2); 
+			return p;
+		}
+	}
+	return NULL;
+}
+
+const lua_Number *lua_version_51 (lua_State*) 
+{
+	static const lua_Number version = (lua_Number)LUA_VERSION_NUM;
+	return &version;
+}
+
+void lua_copy_51 (lua_State *L, int fromidx, int toidx)
+{
+	toidx = lua_absindex( L, toidx );
+	lua_pushvalue( L, fromidx );
+	lua_replace( L, toidx );
+}
+
+int lua_compare_51(lua_State *L, int idx1, int idx2, int op)
+{
+	switch (op)
+	{
+	case LUA_OPEQ : return lua_equal( L, idx1, idx2 );
+	case LUA_OPLT : return lua_lessthan( L, idx1, idx2 );
+	case LUA_OPLE : return lua_lessthan( L, idx1, idx2 ) || lua_equal( L, idx1, idx2 );
+	default:
+		return 0;
+	}
+}
+
+void lua_rawgetp_51(lua_State *L, int idx, const void *p)
+{
+	idx = lua_absindex( L, idx );
+	void* pp = const_cast<void *>(p); // EVIL
+	lua_pushlightuserdata( L, pp );
+	lua_rawget( L, idx );
+}
+
+void lua_rawsetp_51(lua_State *L, int idx, const void *p)
+{
+	idx = lua_absindex( L, idx );
+	void* pp = const_cast<void *>(p); // EVIL
+	lua_pushlightuserdata( L, pp );
+	lua_insert( L, -1 );
+	lua_rawset( L, idx );
+}
+
+int luaL_getsubtable_51(lua_State *L, int idx, const char *fname)
+{
+	lua_getfield(L, idx, fname);
+	if ( lua_istable(L, -1) ) return 1;
+	else {
+		idx = lua_absindex(L, idx);
+		lua_pop(L, 1);
+		lua_newtable(L);
+		lua_pushvalue(L, -1);
+		lua_setfield(L, idx, fname); 
+		return 0; 
+	}
+}
+
+void luaL_setfuncs_51(lua_State *L, const luaL_Reg *l, int nup)
+{
+	luaL_checkstack(L, nup, "too many upvalues");
+	for (; l->name != NULL; l++) 
+	{
+		for (int i = 0; i < nup; i++)
+		{
+			lua_pushvalue(L, -nup);
+		}
+		lua_pushcclosure(L, l->func, nup);
+		lua_setfield(L, -(nup + 2), l->name);
+	}
+	lua_pop(L, nup);
+}
+
+void lua_pushglobaltable_51(lua_State* L)
+{
+	lua_pushvalue( L, LUA_GLOBALSINDEX_51 );
+}
+
+#endif
+
 bool nv::load_lua_library( const char* path )
 {
 	static nv::library lua_library;
 	if ( lua_library.is_open() ) return true;
-	lua_library.open( path );
+#if NV_LUA_VERSION == NV_LUA_5C
+	if ( path == nullptr )
+	{
+		if (!lua_library.try_open( NV_LUA_PATH_JIT ) &&
+			!lua_library.try_open( NV_LUA_PATH_52 ) )
+		{
+			lua_library.open( NV_LUA_PATH_51 );
+		}
+	}
+	else
+#else
+		lua_library.open( path );
+#endif
 
 #	define NV_LUA_FUN( rtype, fname, fparams ) *(void **) (&fname) = lua_library.get(#fname);
@@ -64,4 +239,63 @@
 #	undef NV_LUA_FUN_51
 #	undef NV_LUA_FUN_52
+
+#if NV_LUA_VERSION == NV_LUA_5C
+#	define NV_LUA_LOAD( fname ) *(void **) (&fname) = lua_library.get(#fname);
+#	define NV_LUA_LOAD_AS( fname,fname2 ) *(void **) (&fname) = lua_library.get(#fname2);
+	bool version_52 = lua_library.try_get("luaL_checkversion_") != nullptr;
+	if (version_52)
+	{
+#	define NV_LUA_COMPAT_FUN( u1, fn, u2, u3, fn2, u5, u6, u7 ) \
+	*(void **) (&(fn2##_compat)) = lua_library.get(#fn2); \
+	fn = call_##fn2##_compat; 
+#	include <nv/lib/detail/lua_functions_compat.inc>
+#	undef NV_LUA_COMPAT_FUN
+		NV_LUA_LOAD( lua_rawlen );
+		NV_LUA_LOAD( lua_absindex );
+		NV_LUA_LOAD( lua_getglobal );
+		NV_LUA_LOAD( lua_setglobal );
+		NV_LUA_LOAD( luaL_setmetatable );
+		NV_LUA_LOAD( luaL_testudata );
+		NV_LUA_LOAD( lua_version );
+		NV_LUA_LOAD( lua_copy );
+		NV_LUA_LOAD( lua_compare );
+		NV_LUA_LOAD( lua_rawgetp );
+		NV_LUA_LOAD( lua_rawsetp );
+		NV_LUA_LOAD( lua_pushglobaltable );
+		NV_LUA_LOAD( luaL_setfuncs );
+		NV_LUA_LOAD( luaL_getsubtable );
+
+		LUA_REGISTRYINDEX = LUA_REGISTRYINDEX_52;
+		LUA_VERSION_NUM   = 502;
+	}
+	else
+	{
+#	define NV_LUA_COMPAT_FUN( u1, fn, u2, u3, u4, u5, u6, u7 ) \
+		*(void **) (&fn) = lua_library.get(#fn);
+#	include <nv/lib/detail/lua_functions_compat.inc>
+#	undef NV_LUA_COMPAT_FUN
+		NV_LUA_LOAD_AS( lua_rawlen, lua_objlen )
+		lua_absindex        = lua_absindex_51;
+		lua_getglobal       = lua_getglobal_51;
+		lua_setglobal       = lua_setglobal_51;
+		luaL_setmetatable   = luaL_setmetatable_51;
+		luaL_testudata      = luaL_testudata_51;
+		lua_version         = lua_version_51;
+		lua_copy            = lua_copy_51;
+		lua_rawgetp         = lua_rawgetp_51;
+		lua_rawsetp         = lua_rawsetp_51;
+		lua_pushglobaltable = lua_pushglobaltable_51;
+		luaL_setfuncs       = luaL_setfuncs_51;
+		luaL_getsubtable    = luaL_getsubtable_51;
+
+		NV_LUA_LOAD( lua_lessthan );
+		NV_LUA_LOAD( lua_equal );
+		lua_compare       = lua_compare_51;
+		LUA_REGISTRYINDEX = LUA_REGISTRYINDEX_51;
+		LUA_VERSION_NUM   = 501;
+	}
+#	undef NV_LUA_LOAD
+#endif
+
 	return true;
 }
Index: trunk/src/library.cc
===================================================================
--- trunk/src/library.cc	(revision 165)
+++ trunk/src/library.cc	(revision 166)
@@ -44,5 +44,20 @@
 {
 	m_name = name;
-	open();
+	if ( !open() )
+	{
+		m_handle = nullptr;
+		NV_THROW( library_error, "Can't load library!", name );
+	}
+}
+
+bool nv::library::try_open( const std::string& name )
+{
+	m_name = name;
+	if ( !open() )
+	{
+		m_handle = nullptr;
+		return false;
+	}
+	return true;
 }
 
@@ -52,9 +67,9 @@
 }
 
-void library::open()
+bool library::open( )
 {
     if ( m_handle != NULL )
     {
-        return;
+        return true;
     }
     NV_LOG( LOG_NOTICE, "library : loading '" + m_name + "'..." );
@@ -73,7 +88,9 @@
     if ( m_handle == NULL )
     {
-        NV_THROW( library_error, "Can't load library!", name );
+		NV_LOG( LOG_NOTICE, "library : '" + name + "' failed to open." );
+		return false;
     }
     NV_LOG( LOG_NOTICE, "library : '" + name + "' loaded." );
+	return true;
 }
 
@@ -86,4 +103,9 @@
     }
 	return result;
+}
+
+void* nv::library::try_get( const std::string& symbol )
+{
+	return (void*) NV_LIB_GET( (NV_LIB_HANDLE) m_handle, symbol.c_str() );
 }
 
