luabind-cvs Mailing List for luabind
Brought to you by:
arvidn,
daniel_wallin
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(53) |
Nov
(13) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(15) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(5) |
Jun
(7) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
(5) |
Nov
|
Dec
|
From: Arvid N. <ar...@us...> - 2006-10-05 23:16:37
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv9617/luabind/luabind Modified Files: object.hpp Log Message: removed spurious semicolons Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- object.hpp 5 Oct 2006 19:57:53 -0000 1.42 +++ object.hpp 5 Oct 2006 23:16:32 -0000 1.43 @@ -1012,9 +1012,9 @@ } template<class Policies> - inline static void apply(lua_State*, const boost::tuples::null_type&, const Policies&) {}; + inline static void apply(lua_State*, const boost::tuples::null_type&, const Policies&) {} - inline static void apply(lua_State*, const boost::tuples::null_type&) {}; + inline static void apply(lua_State*, const boost::tuples::null_type&) {} }; } // namespace detail |
From: Arvid N. <ar...@us...> - 2006-10-05 19:57:57
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv780/luabind/test Modified Files: test_object.cpp Log Message: added missing function, registry() Index: test_object.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/test_object.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- test_object.cpp 1 Sep 2006 13:06:23 -0000 1.31 +++ test_object.cpp 5 Oct 2006 19:57:53 -0000 1.32 @@ -147,6 +147,11 @@ globals(L)["temp"] = &temp_object; TEST_CHECK(object_cast<test_param const*>(globals(L)["temp"]) == &temp_object); TEST_CHECK(globals(L)["temp"] == temp_object); + + // test the registry + object reg = registry(L); + reg["__a"] = "foobar"; + TEST_CHECK(object_cast<std::string>(registry(L)["__a"]) == "foobar"); DOSTRING(L, "t = 2\n" |
From: Arvid N. <ar...@us...> - 2006-10-05 19:57:57
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv780/luabind/luabind Modified Files: object.hpp Log Message: added missing function, registry() Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- object.hpp 1 Sep 2006 13:06:23 -0000 1.41 +++ object.hpp 5 Oct 2006 19:57:53 -0000 1.42 @@ -1111,6 +1111,7 @@ return object(from_stack(interpreter, -1)); } +// this could be optimized by returning a proxy inline object globals(lua_State* interpreter) { lua_pushvalue(interpreter, LUA_GLOBALSINDEX); @@ -1118,6 +1119,14 @@ return object(from_stack(interpreter, -1)); } +// this could be optimized by returning a proxy +inline object registry(lua_State* interpreter) +{ + lua_pushvalue(interpreter, LUA_REGISTRYINDEX); + detail::stack_pop pop(interpreter, 1); + return object(from_stack(interpreter, -1)); +} + template<class ValueWrapper, class K> inline object gettable(ValueWrapper const& table, K const& key) { |
From: Arvid N. <ar...@us...> - 2006-10-05 19:48:28
|
Update of /cvsroot/luabind/luabind/luabind/examples/any_converter In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29589/examples/any_converter Modified Files: Jamfile Log Message: fixed filesystem example an some example Jamfiles Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/examples/any_converter/Jamfile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Jamfile 28 Nov 2005 20:55:34 -0000 1.2 +++ Jamfile 5 Oct 2006 19:48:15 -0000 1.3 @@ -5,5 +5,3 @@ /luabind//luabind ; -stage . : any_converter ; - |
From: Arvid N. <ar...@us...> - 2006-10-05 19:48:21
|
Update of /cvsroot/luabind/luabind/luabind/examples/filesystem In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv29589/examples/filesystem Modified Files: Jamfile filesystem.cpp Log Message: fixed filesystem example an some example Jamfiles Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/examples/filesystem/Jamfile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Jamfile 28 Nov 2005 20:55:34 -0000 1.2 +++ Jamfile 5 Oct 2006 19:48:15 -0000 1.3 @@ -10,5 +10,3 @@ /luabind//luabind ; -stage . : filesystem ; - Index: filesystem.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/examples/filesystem/filesystem.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- filesystem.cpp 28 Nov 2005 20:55:34 -0000 1.9 +++ filesystem.cpp 5 Oct 2006 19:48:15 -0000 1.10 @@ -57,7 +57,7 @@ .def(other<const char*>() / const_self) .def(const_self / other<const char*>()) - .property("contents", &identity, return_directory_iterator) +// .property("contents", &identity, return_directory_iterator) , def("exists", &fs::exists), @@ -110,6 +110,6 @@ args["n"] = argc; globals(L)["args"] = args; - lua_dofile(L, argv[1]); + luaL_dofile(L, argv[1]); } |
From: Arvid N. <ar...@us...> - 2006-09-01 13:06:26
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26523/test Modified Files: test_object.cpp Log Message: fixed assignment operator on index_proxy to accept an index proxy of the same type. i.e. expressions like table[x] = table[y] did not work previously. Index: test_object.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/test_object.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- test_object.cpp 13 Jun 2006 23:27:58 -0000 1.30 +++ test_object.cpp 1 Sep 2006 13:06:23 -0000 1.31 @@ -66,6 +66,7 @@ table["sum1"] = sum1; table["sum2"] = sum2; table["blurp"] = 5; + table["sum3"] = table["sum1"]; return 0; } else |
From: Arvid N. <ar...@us...> - 2006-09-01 13:06:26
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv26523/luabind Modified Files: object.hpp Log Message: fixed assignment operator on index_proxy to accept an index proxy of the same type. i.e. expressions like table[x] = table[y] did not work previously. Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- object.hpp 13 Jun 2006 23:27:57 -0000 1.40 +++ object.hpp 1 Sep 2006 13:06:23 -0000 1.41 @@ -614,6 +614,17 @@ return *this; } + this_type& operator=(this_type const& value) + { + value_wrapper_traits<Next>::unwrap(m_interpreter, m_next); + detail::stack_pop pop(m_interpreter, 1); + + lua_pushvalue(m_interpreter, m_key_index); + detail::push(m_interpreter, value); + lua_settable(m_interpreter, -3); + return *this; + } + template<class T> index_proxy<this_type> operator[](T const& key) { @@ -630,7 +641,7 @@ private: struct hidden_type {}; - this_type& operator=(index_proxy<Next> const&); +// this_type& operator=(index_proxy<Next> const&); mutable lua_State* m_interpreter; int m_key_index; |
From: Arvid N. <ar...@us...> - 2006-07-11 16:51:13
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4025/test Modified Files: test_has_get_pointer.cpp Log Message: fixed lookup problem with get_pointer on types deriving from boost types Index: test_has_get_pointer.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/test_has_get_pointer.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- test_has_get_pointer.cpp 28 Nov 2005 20:55:34 -0000 1.2 +++ test_has_get_pointer.cpp 11 Jul 2006 16:51:08 -0000 1.3 @@ -24,6 +24,7 @@ #include <boost/mpl/assert.hpp> #include <boost/shared_ptr.hpp> #include <boost/get_pointer.hpp> +#include <boost/enable_shared_from_this.hpp> namespace lb = luabind::detail; @@ -39,7 +40,9 @@ }; Y* get_pointer(Y const&); - + + struct Z : boost::enable_shared_from_this<Z> {}; + } // namespace test #ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP @@ -55,4 +58,5 @@ BOOST_MPL_ASSERT(( lb::has_get_pointer<char*> )); BOOST_MPL_ASSERT_NOT(( lb::has_get_pointer<int> )); BOOST_MPL_ASSERT_NOT(( lb::has_get_pointer<test::X> )); +BOOST_MPL_ASSERT(( lb::has_get_pointer<test::Z*> )); |
From: Arvid N. <ar...@us...> - 2006-07-11 16:51:12
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv4025/luabind/detail Modified Files: has_get_pointer.hpp Log Message: fixed lookup problem with get_pointer on types deriving from boost types Index: has_get_pointer.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/has_get_pointer.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- has_get_pointer.hpp 28 Nov 2005 20:55:34 -0000 1.2 +++ has_get_pointer.hpp 11 Jul 2006 16:51:07 -0000 1.3 @@ -55,7 +55,7 @@ # ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP template<class T> - T* get_pointer(T*); + T* get_pointer(T const volatile*); template<class T> T* get_pointer(std::auto_ptr<T> const&); |
From: Arvid N. <ar...@us...> - 2006-07-11 11:29:44
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv6628/detail Modified Files: signature_match.hpp Log Message: fixed incorrectly qualified type Index: signature_match.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/signature_match.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- signature_match.hpp 4 Dec 2005 13:56:16 -0000 1.5 +++ signature_match.hpp 11 Jul 2006 11:29:39 -0000 1.6 @@ -88,7 +88,7 @@ , Policies \ >::type BOOST_PP_CAT(converter_policy, N); \ \ - typedef typename mpl::apply_wrap2< \ + typedef typename boost::mpl::apply_wrap2< \ BOOST_PP_CAT(converter_policy, N), BOOST_PP_CAT(A, N), lua_to_cpp \ >::type BOOST_PP_CAT(converter, N); \ \ |
From: Arvid N. <ar...@us...> - 2006-07-10 13:49:49
|
Update of /cvsroot/luabind/luabind/luabind/examples/any_converter In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv24273 Modified Files: any_converter.cpp Log Message: returning a string in both cases didn't really show off the usefulness Index: any_converter.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/examples/any_converter/any_converter.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- any_converter.cpp 10 Jul 2006 13:41:23 -0000 1.5 +++ any_converter.cpp 10 Jul 2006 13:49:43 -0000 1.6 @@ -59,7 +59,7 @@ boost::any f(bool b) { if (b) return "foobar"; - else return "3.5f"; + else return 3.5f; } int main() |
From: Arvid N. <ar...@us...> - 2006-07-10 13:41:31
|
Update of /cvsroot/luabind/luabind/luabind/examples/any_converter In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv21107 Modified Files: any_converter.cpp Log Message: fixed any_converter example Index: any_converter.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/examples/any_converter/any_converter.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- any_converter.cpp 28 Nov 2005 20:55:34 -0000 1.4 +++ any_converter.cpp 10 Jul 2006 13:41:23 -0000 1.5 @@ -20,6 +20,7 @@ } #include <luabind/luabind.hpp> +#include <luabind/detail/convert_to_lua.hpp> #include <boost/any.hpp> template<class T> @@ -27,9 +28,7 @@ { static void convert(lua_State* L, const boost::any& a) { - typename luabind::detail::default_policy::template generate_converter<T, luabind::detail::cpp_to_lua>::type conv; - - conv.apply(L, *boost::any_cast<T>(&a)); + luabind::detail::convert_to_lua(L, *boost::any_cast<T>(&a)); } }; @@ -71,7 +70,11 @@ register_any_converter<std::string>(); lua_State* L = lua_open(); +#if LUA_VERSION_NUM >= 501 + luaL_openlibs(L); +#else lua_baselibopen(L); +#endif using namespace luabind; |
From: Arvid N. <ar...@us...> - 2006-06-20 21:45:08
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10382/luabind Modified Files: error.hpp Log Message: made error's constructor explicit Index: error.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/error.hpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- error.hpp 14 Jun 2006 18:17:14 -0000 1.4 +++ error.hpp 20 Jun 2006 21:45:03 -0000 1.5 @@ -45,7 +45,7 @@ class LUABIND_API error : public std::exception { public: - error(lua_State* L): m_L(L) {} + explicit error(lua_State* L): m_L(L) {} lua_State* state() const throw() { return m_L; } virtual const char* what() const throw() { |
From: Arvid N. <ar...@us...> - 2006-06-14 18:17:18
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv23625/luabind/luabind Modified Files: error.hpp Log Message: added missing LUABIND_API declarations Index: error.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/error.hpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- error.hpp 19 Feb 2004 21:11:00 -0000 1.3 +++ error.hpp 14 Jun 2006 18:17:14 -0000 1.4 @@ -42,7 +42,7 @@ // may throw, if the copy constructor of an exception that is // being thrown throws another exception, terminate will be called // and the entire application is killed. - class error : public std::exception + class LUABIND_API error : public std::exception { public: error(lua_State* L): m_L(L) {} @@ -58,7 +58,7 @@ // if an object_cast<>() fails, this is thrown // it is also thrown if the return value of // a lua function cannot be converted - class cast_failed : public std::exception + class LUABIND_API cast_failed : public std::exception { public: cast_failed(lua_State* L, LUABIND_TYPE_INFO i): m_L(L), m_info(i) {} @@ -75,16 +75,16 @@ typedef void(*error_callback_fun)(lua_State*); typedef void(*cast_failed_callback_fun)(lua_State*, LUABIND_TYPE_INFO); - void set_error_callback(error_callback_fun e); - void set_cast_failed_callback(cast_failed_callback_fun c); - error_callback_fun get_error_callback(); - cast_failed_callback_fun get_cast_failed_callback(); + LUABIND_API void set_error_callback(error_callback_fun e); + LUABIND_API void set_cast_failed_callback(cast_failed_callback_fun c); + LUABIND_API error_callback_fun get_error_callback(); + LUABIND_API cast_failed_callback_fun get_cast_failed_callback(); #endif typedef int(*pcall_callback_fun)(lua_State*); - void set_pcall_callback(pcall_callback_fun e); - pcall_callback_fun get_pcall_callback(); + LUABIND_API void set_pcall_callback(pcall_callback_fun e); + LUABIND_API pcall_callback_fun get_pcall_callback(); } |
From: Arvid N. <ar...@us...> - 2006-06-13 23:28:06
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv343/luabind/luabind Modified Files: object.hpp Added Files: nil.hpp Log Message: added luabind::nil and assignment operators to handle it Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- object.hpp 26 Mar 2006 15:47:30 -0000 1.39 +++ object.hpp 13 Jun 2006 23:27:57 -0000 1.40 @@ -30,6 +30,7 @@ #include <boost/tuple/tuple.hpp> #include <boost/optional.hpp> +#include <luabind/nil.hpp> #include <luabind/value_wrapper.hpp> #include <luabind/detail/pcall.hpp> #include <luabind/handle.hpp> @@ -356,6 +357,15 @@ lua_pop(m_interpreter, 2); } + // this will set the value to nil + iterator_proxy & operator=(luabind::detail::nil_type) + { + lua_pushvalue(m_interpreter, m_key_index); + lua_pushnil(m_interpreter); + AccessPolicy::set(m_interpreter, m_table_index); + return *this; + } + template<class T> iterator_proxy& operator=(T const& value) { @@ -580,6 +590,18 @@ // This is non-const to prevent conversion on lvalues. operator object(); + // this will set the value to nil + this_type& operator=(luabind::detail::nil_type) + { + value_wrapper_traits<Next>::unwrap(m_interpreter, m_next); + detail::stack_pop pop(m_interpreter, 1); + + lua_pushvalue(m_interpreter, m_key_index); + lua_pushnil(m_interpreter); + lua_settable(m_interpreter, -3); + return *this; + } + template<class T> this_type& operator=(T const& value) { @@ -606,6 +628,8 @@ } private: + struct hidden_type {}; + this_type& operator=(index_proxy<Next> const&); mutable lua_State* m_interpreter; --- NEW FILE: nil.hpp --- // Copyright (c) 2004 Daniel Wallin and Arvid Norberg // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), // to deal in the Software without restriction, including without limitation // the rights to use, copy, modify, merge, publish, distribute, sublicense, // and/or sell copies of the Software, and to permit persons to whom the // Software is furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF // ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A // PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT // SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR // ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE // OR OTHER DEALINGS IN THE SOFTWARE. #ifndef LUABIND_NIL_HPP #define LUABIND_NIL_HPP namespace luabind { namespace detail { struct nil_type {}; } // defined in class.cpp extern detail::nil_type nil; } #endif |
From: Arvid N. <ar...@us...> - 2006-06-13 23:28:06
|
Update of /cvsroot/luabind/luabind/luabind/doc In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv343/luabind/doc Modified Files: changes.txt docs.html docs.rst Log Message: added luabind::nil and assignment operators to handle it Index: docs.html =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/doc/docs.html,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- docs.html 26 Mar 2006 15:47:29 -0000 1.55 +++ docs.html 13 Jun 2006 23:27:57 -0000 1.56 @@ -3,12 +3,307 @@ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -<meta name="generator" content="Docutils 0.3.9: http://docutils.sourceforge.net/" /> +<meta name="generator" content="Docutils 0.4: http://docutils.sourceforge.net/" /> <title>luabind</title> <meta name="author" content="Daniel Wallin, Arvid Norberg" /> <meta name="copyright" content="Copyright Daniel Wallin, Arvid Norberg 2003." /> -<meta name="date" content="2006-01-11" /> -<link rel="stylesheet" href="style.css" type="text/css" /> +<meta name="date" content="2006-03-26" /> [...1905 lines suppressed...] </dl> </div> -<div class="section" id="known-issues"> -<h1><a name="known-issues">18 Known issues</a></h1> +<div class="section"> +<h1><a id="known-issues" name="known-issues">18 Known issues</a></h1> <ul class="simple"> <li>You cannot use strings with extra nulls in them as member names that refers to C++ members.</li> @@ -3020,8 +3334,8 @@ done with static pointer offsets.</li> </ul> </div> -<div class="section" id="acknowledgments"> -<h1><a name="acknowledgments">19 Acknowledgments</a></h1> +<div class="section"> +<h1><a id="acknowledgments" name="acknowledgments">19 Acknowledgments</a></h1> <p>Written by Daniel Wallin and Arvid Norberg. © Copyright 2003. All rights reserved.</p> <p>Evan Wies has contributed with thorough testing, countless bug reports Index: docs.rst =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/doc/docs.rst,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- docs.rst 26 Mar 2006 16:16:30 -0000 1.28 +++ docs.rst 13 Jun 2006 23:27:57 -0000 1.29 @@ -137,7 +137,9 @@ LUA_PATH Point this to your Lua directory. The build system will assume that the include and library files are located in ``$(LUA_PATH)/include/`` and - ``$(LUA_PATH)/lib/.`` + ``$(LUA_PATH)/lib/.``. If this environment variable is not defined, the + Jamfile will try to invoke ``pkg-config`` in order to find lua. It will + look for lua 5.1 (``lua5.1`` as the package is called on debian systems). For backward compatibility, there is also a makefile in the root-directory that will build the library and the test programs. If you are using a UNIX-system (or @@ -1279,6 +1281,23 @@ This function creates a new table and returns it as an object. +Assigning nil +------------- + +To set a table entry to ``nil``, you can use ``luabind::nil``. It will avoid +having to take the detour by first assigning ``nil`` to an object and then +assign that to the table entry. It will simply result in a ``lua_pushnil()`` +call, instead of copying an object. + +Example:: + + using luabind; + object table = newtable(L); + table["foo"] = "bar"; + + // now, clear the "foo"-field + table["foo"] = nil; + Defining classes in Lua ======================= Index: changes.txt =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/doc/changes.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- changes.txt 28 Nov 2005 20:55:33 -0000 1.2 +++ changes.txt 13 Jun 2006 23:27:57 -0000 1.3 @@ -1,3 +1,11 @@ +LUABIND 7.1 changes +=================== + +* Applied patches from Evan Wies to support lua 5.1 +* added a new assignment operator and a special value, + luabind::nil, to set table entries to nil. + + LUABIND BETA 7 changes ====================== |
From: Arvid N. <ar...@us...> - 2006-06-13 23:28:06
|
Update of /cvsroot/luabind/luabind/luabind/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv343/luabind/src Modified Files: class.cpp Log Message: added luabind::nil and assignment operators to handle it Index: class.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/src/class.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- class.cpp 4 Dec 2005 13:57:04 -0000 1.11 +++ class.cpp 13 Jun 2006 23:27:58 -0000 1.12 @@ -24,10 +24,16 @@ #include <luabind/config.hpp> #include <luabind/class.hpp> +#include <luabind/nil.hpp> #include <cstring> #include <iostream> +namespace luabind +{ + detail::nil_type nil; +} + namespace luabind { namespace detail { struct method_name |
From: Arvid N. <ar...@us...> - 2006-06-13 23:28:06
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv343/luabind/test Modified Files: test_object.cpp Log Message: added luabind::nil and assignment operators to handle it Index: test_object.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/test_object.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- test_object.cpp 26 Mar 2006 15:47:30 -0000 1.29 +++ test_object.cpp 13 Jun 2006 23:27:58 -0000 1.30 @@ -209,6 +209,31 @@ TEST_CHECK(iterator(t) == iterator()); TEST_CHECK(raw_iterator(t) == raw_iterator()); + t["foo"] = "bar"; + + TEST_CHECK(object_cast<std::string>(t["foo"]) == "bar"); + TEST_CHECK(object_cast<std::string>(*iterator(t)) == "bar"); + TEST_CHECK(object_cast<std::string>(*raw_iterator(t)) == "bar"); + + t["foo"] = nil; // luabind::nil_type + + TEST_CHECK(iterator(t) == iterator()); + TEST_CHECK(raw_iterator(t) == raw_iterator()); + + t["foo"] = "bar"; + iterator it1(t); + *it1 = nil; + + TEST_CHECK(iterator(t) == iterator()); + TEST_CHECK(raw_iterator(t) == raw_iterator()); + + t["foo"] = "bar"; + raw_iterator it2(t); + *it2 = nil; + + TEST_CHECK(iterator(t) == iterator()); + TEST_CHECK(raw_iterator(t) == raw_iterator()); + DOSTRING(L, "p1 = {}\n" "p2 = {}\n" |
From: Arvid N. <ar...@us...> - 2006-06-13 23:28:06
|
Update of /cvsroot/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv343/luabind Modified Files: Jamfile Log Message: added luabind::nil and assignment operators to handle it Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/Jamfile,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Jamfile 29 May 2006 18:30:41 -0000 1.7 +++ Jamfile 13 Jun 2006 23:27:57 -0000 1.8 @@ -5,47 +5,55 @@ BOOST_ROOT = [ modules.peek : BOOST_ROOT ] ; LUA_PATH = [ modules.peek : LUA_PATH ] ; -if ! $(LUA_PATH) -{ - errors.user-error - "LUA_PATH needs to be set to point to your Lua5.x directory." ; -} - -#if ! [ GLOB $(LUA_PATH)/include : lua.h ] -#{ -# errors.user-error -# "LUA_PATH seems to point to a broken Lua5.x installation." : -# "Currently set to $(LUA_PATH)" ; -#} - if ! $(BOOST_ROOT) { errors.user-error "BOOST_ROOT must be set to your boost installation path." ; } -lib lua - : - : <name>lua <search>$(LUA_PATH)/lib - <search>$(LUA_PATH)/src +if ! $(LUA_PATH) +{ + ECHO LUA_PATH not specified. using pkg-config to find lua + alias lua : : : : + <cflags>"`pkg-config --cflags lua5.1`" + <linkflags>"`pkg-config --libs lua5.1`" ; -lib lualib + lib lualib : ; + +# alias lualib : : : : +# <lua-version>5:<cflags>"`pkg-config --cflags lualib50`" +# <lua-version>5:<linkflags>"`pkg-config --libs lualib50`" +# ; +} +else +{ + lib lua : + : <name>lua <search>$(LUA_PATH)/lib + <search>$(LUA_PATH)/src : - : <name>lualib <search>$(LUA_PATH)/lib + : <include>$(LUA_PATH)/include + <include>$(LUA_PATH)/src ; + lib lualib : ; + +# lib lualib : +# <lua-version>5:<name>lualib <search>$(LUA_PATH)/lib +# : <lua-version>5:<include>$(LUA_PATH)/include +# <lua-version>5:<include>$(LUA_PATH)/src +# ; +} + project luabind : requirements - <include>./ <include>$(BOOST_ROOT) <include>$(LUA_PATH)/include/ - <include>$(LUA_PATH)/src/ + <include>./ <include>$(BOOST_ROOT) <library>/luabind//lua -# <library>/luabind//lualib +# <library>/lualib <toolset>msvc,<link>shared:<define>LUABIND_IMPORT=__declspec(dllimport) <toolset>msvc,<link>shared:<define>LUABIND_EXPORT=__declspec(dllexport) : usage-requirements - <include>./ <include>$(BOOST_ROOT) <include>$(LUA_PATH)/include/ - <include>$(LUA_PATH)/src/ + <include>./ <include>$(BOOST_ROOT) <toolset>msvc,<link>shared:<define>LUABIND_IMPORT=__declspec(dllimport) <toolset>msvc,<link>shared:<define>LUABIND_EXPORT=__declspec(dllexport) ; |
From: Arvid N. <ar...@us...> - 2006-05-29 18:30:54
|
Update of /cvsroot/luabind/luabind/luabind/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10361/luabind/src Modified Files: pcall.cpp Log Message: Applied patch by Evan Wies to make it work with lua 5.1 Index: pcall.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/src/pcall.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- pcall.cpp 15 Apr 2004 12:37:49 -0000 1.3 +++ pcall.cpp 29 May 2006 18:30:41 -0000 1.4 @@ -45,7 +45,14 @@ int resume_impl(lua_State *L, int nargs, int) { +#if LUA_VERSION_NUM >= 501 + // Lua 5.1 added LUA_YIELD as a possible return value, + // this was causing crashes, because the caller expects 0 on success. + int res = lua_resume(L, nargs); + return (res == LUA_YIELD) ? 0 : res; +#else return lua_resume(L, nargs); +#endif } }} |
From: Arvid N. <ar...@us...> - 2006-05-29 18:30:50
|
Update of /cvsroot/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10361/luabind Modified Files: Jamfile Log Message: Applied patch by Evan Wies to make it work with lua 5.1 Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/Jamfile,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Jamfile 28 Nov 2005 20:55:33 -0000 1.6 +++ Jamfile 29 May 2006 18:30:41 -0000 1.7 @@ -11,12 +11,12 @@ "LUA_PATH needs to be set to point to your Lua5.x directory." ; } -if ! [ GLOB $(LUA_PATH)/include : lua.h ] -{ - errors.user-error - "LUA_PATH seems to point to a broken Lua5.x installation." : - "Currently set to $(LUA_PATH)" ; -} +#if ! [ GLOB $(LUA_PATH)/include : lua.h ] +#{ +# errors.user-error +# "LUA_PATH seems to point to a broken Lua5.x installation." : +# "Currently set to $(LUA_PATH)" ; +#} if ! $(BOOST_ROOT) { @@ -27,6 +27,7 @@ lib lua : : <name>lua <search>$(LUA_PATH)/lib + <search>$(LUA_PATH)/src ; lib lualib @@ -37,11 +38,14 @@ project luabind : requirements <include>./ <include>$(BOOST_ROOT) <include>$(LUA_PATH)/include/ - <library>/luabind//lua <library>/luabind//lualib + <include>$(LUA_PATH)/src/ + <library>/luabind//lua +# <library>/luabind//lualib <toolset>msvc,<link>shared:<define>LUABIND_IMPORT=__declspec(dllimport) <toolset>msvc,<link>shared:<define>LUABIND_EXPORT=__declspec(dllexport) : usage-requirements <include>./ <include>$(BOOST_ROOT) <include>$(LUA_PATH)/include/ + <include>$(LUA_PATH)/src/ <toolset>msvc,<link>shared:<define>LUABIND_IMPORT=__declspec(dllimport) <toolset>msvc,<link>shared:<define>LUABIND_EXPORT=__declspec(dllexport) ; |
From: Arvid N. <ar...@us...> - 2006-05-29 18:30:46
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10361/luabind/luabind/detail Modified Files: ref.hpp Log Message: Applied patch by Evan Wies to make it work with lua 5.1 Index: ref.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/ref.hpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ref.hpp 7 Aug 2004 13:37:10 -0000 1.11 +++ ref.hpp 29 May 2006 18:30:41 -0000 1.12 @@ -32,7 +32,16 @@ struct lua_State; -namespace luabind { namespace detail +namespace luabind +{ + +#if LUA_VERSION_NUM >= 501 +#define LUA_REFNIL (-1) +#undef luaL_setn +#undef luaL_getn +#endif + +namespace detail { int LUABIND_API ref(lua_State *L); |
From: Arvid N. <ar...@us...> - 2006-05-29 18:30:44
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10361/luabind/luabind Modified Files: lua_include.hpp Log Message: Applied patch by Evan Wies to make it work with lua 5.1 Index: lua_include.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/lua_include.hpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lua_include.hpp 14 Jun 2003 21:05:01 -0000 1.2 +++ lua_include.hpp 29 May 2006 18:30:41 -0000 1.3 @@ -26,6 +26,7 @@ extern "C" { #include "lua.h" + #include "lauxlib.h" } #endif |
From: Arvid N. <ar...@us...> - 2006-05-29 18:30:44
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv10361/luabind/test Modified Files: Jamfile main.cpp Log Message: Applied patch by Evan Wies to make it work with lua 5.1 Index: main.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/main.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- main.cpp 15 Apr 2005 13:46:17 -0000 1.35 +++ main.cpp 29 May 2006 18:30:41 -0000 1.36 @@ -52,7 +52,13 @@ : m_state(lua_open()) { luaopen_base(m_state); +#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501 + // lua 5.1 or newer + luaL_openlibs(m_state); +#else + // lua 5.0.2 or older lua_baselibopen(m_state); +#endif m_top = lua_gettop(m_state); luabind::open(m_state); } @@ -109,12 +115,18 @@ int main() { + lua_state L; try { - lua_state L; test_main(L); return tests_failure ? 1 : 0; } + catch (luabind::error const& e) + { + std::cerr << "Terminated with exception: \"" << e.what() << "\"\n" + << lua_tostring(e.state(), -1) << "\n"; + return 1; + } catch (std::exception const& e) { std::cerr << "Terminated with exception: \"" << e.what() << "\"\n"; Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Jamfile,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Jamfile 16 Dec 2005 17:50:51 -0000 1.17 +++ Jamfile 29 May 2006 18:30:41 -0000 1.18 @@ -29,7 +29,7 @@ project : default-build <link>static ; lib main-lib - : main.cpp /luabind//luabind/<link>static /luabind//lua /luabind//lualib + : main.cpp /luabind//luabind/<link>static /luabind//lua : <link>static ; |
From: Arvid N. <ar...@us...> - 2006-03-26 20:34:17
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17155/luabind/detail Modified Files: policy.hpp Log Message: added a primitive converter for objects of type LUA_TTHREAD to lua_State*. Fixed bug in class_info.cpp. added stack pops ti test.hpp where a test would fail, it still preserve the stack now. Removed obsolete tests of functor and added a test of call_function where the function that is called fails. Index: policy.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/policy.hpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- policy.hpp 21 Dec 2005 23:09:47 -0000 1.54 +++ policy.hpp 26 Mar 2006 20:34:13 -0000 1.55 @@ -345,6 +345,9 @@ PRIMITIVE_CONVERTER(double) { return static_cast<double>(lua_tonumber(L, index)); } PRIMITIVE_MATCHER(double) { if (lua_type(L, index) == LUA_TNUMBER) return 0; else return -1; } + PRIMITIVE_CONVERTER(lua_State*) { return lua_tothread(L, index); } + PRIMITIVE_MATCHER(lua_State*) { if (lua_type(L, index) == LUA_TTHREAD) return 0; else return -1; } + PRIMITIVE_CONVERTER(std::string) { return std::string(lua_tostring(L, index), lua_strlen(L, index)); } PRIMITIVE_MATCHER(std::string) { if (lua_type(L, index) == LUA_TSTRING) return 0; else return -1; } |