Kaynağa Gözat

Merge branch 'feature/Remove_lua_lib' into develop

Iñigo Valentin 1 hafta önce
ebeveyn
işleme
1c5bda5fff
100 değiştirilmiş dosya ile 37 ekleme ve 14426 silme
  1. 1 1
      .github/agents/build-fixer.agent.md
  2. 7 7
      .github/copilot-instructions.md
  3. 27 2
      CMakeLists.txt
  4. 1 1
      debian/control
  5. 1 1
      doc/BUILD.md
  6. 0 27
      lib/CMakeLists.txt
  7. 0 4
      lib/luabind/.gitignore
  8. 0 65
      lib/luabind/INSTALL
  9. 0 248
      lib/luabind/Jamroot
  10. 0 22
      lib/luabind/LICENSE
  11. 0 167
      lib/luabind/luabind/adopt_policy.hpp
  12. 0 112
      lib/luabind/luabind/back_reference.hpp
  13. 0 37
      lib/luabind/luabind/back_reference_fwd.hpp
  14. 0 942
      lib/luabind/luabind/class.hpp
  15. 0 50
      lib/luabind/luabind/class_info.hpp
  16. 0 137
      lib/luabind/luabind/config.hpp
  17. 0 143
      lib/luabind/luabind/container_policy.hpp
  18. 0 61
      lib/luabind/luabind/copy_policy.hpp
  19. 0 119
      lib/luabind/luabind/dependency_policy.hpp
  20. 0 330
      lib/luabind/luabind/detail/call.hpp
  21. 0 259
      lib/luabind/luabind/detail/call_0x.hpp
  22. 0 541
      lib/luabind/luabind/detail/call_function.hpp
  23. 0 425
      lib/luabind/luabind/detail/call_member.hpp
  24. 0 66
      lib/luabind/luabind/detail/call_operator_iterate.hpp
  25. 0 85
      lib/luabind/luabind/detail/class_registry.hpp
  26. 0 211
      lib/luabind/luabind/detail/class_rep.hpp
  27. 0 142
      lib/luabind/luabind/detail/constructor.hpp
  28. 0 41
      lib/luabind/luabind/detail/conversion_storage.hpp
  29. 0 92
      lib/luabind/luabind/detail/convert_to_lua.hpp
  30. 0 55
      lib/luabind/luabind/detail/debug.hpp
  31. 0 266
      lib/luabind/luabind/detail/decorate_type.hpp
  32. 0 193
      lib/luabind/luabind/detail/deduce_signature.hpp
  33. 0 123
      lib/luabind/luabind/detail/enum_maker.hpp
  34. 0 188
      lib/luabind/luabind/detail/format_signature.hpp
  35. 0 53
      lib/luabind/luabind/detail/garbage_collector.hpp
  36. 0 107
      lib/luabind/luabind/detail/has_get_pointer.hpp
  37. 0 35
      lib/luabind/luabind/detail/index_tuple.hpp
  38. 0 168
      lib/luabind/luabind/detail/inheritance.hpp
  39. 0 124
      lib/luabind/luabind/detail/instance_holder.hpp
  40. 0 60
      lib/luabind/luabind/detail/link_compatibility.hpp
  41. 0 105
      lib/luabind/luabind/detail/make_instance.hpp
  42. 0 44
      lib/luabind/luabind/detail/most_derived.hpp
  43. 0 52
      lib/luabind/luabind/detail/object_call.hpp
  44. 0 132
      lib/luabind/luabind/detail/object_rep.hpp
  45. 0 45
      lib/luabind/luabind/detail/open.hpp
  46. 0 79
      lib/luabind/luabind/detail/operator_id.hpp
  47. 0 119
      lib/luabind/luabind/detail/other.hpp
  48. 0 36
      lib/luabind/luabind/detail/pcall.hpp
  49. 0 54
      lib/luabind/luabind/detail/pointee_sizeof.hpp
  50. 0 40
      lib/luabind/luabind/detail/pointee_typeid.hpp
  51. 0 1035
      lib/luabind/luabind/detail/policy.hpp
  52. 0 85
      lib/luabind/luabind/detail/primitives.hpp
  53. 0 33
      lib/luabind/luabind/detail/property.hpp
  54. 0 112
      lib/luabind/luabind/detail/ref.hpp
  55. 0 74
      lib/luabind/luabind/detail/signature_match.hpp
  56. 0 52
      lib/luabind/luabind/detail/stack_utils.hpp
  57. 0 190
      lib/luabind/luabind/detail/typetraits.hpp
  58. 0 34
      lib/luabind/luabind/detail/yes_no.hpp
  59. 0 72
      lib/luabind/luabind/discard_result_policy.hpp
  60. 0 93
      lib/luabind/luabind/error.hpp
  61. 0 110
      lib/luabind/luabind/exception_handler.hpp
  62. 0 42
      lib/luabind/luabind/from_stack.hpp
  63. 0 62
      lib/luabind/luabind/function.hpp
  64. 0 16
      lib/luabind/luabind/get_main_thread.hpp
  65. 0 39
      lib/luabind/luabind/get_pointer.hpp
  66. 0 144
      lib/luabind/luabind/handle.hpp
  67. 0 112
      lib/luabind/luabind/iterator_policy.hpp
  68. 0 39
      lib/luabind/luabind/lua_include.hpp
  69. 0 32
      lib/luabind/luabind/luabind.hpp
  70. 0 125
      lib/luabind/luabind/make_function.hpp
  71. 0 40
      lib/luabind/luabind/nil.hpp
  72. 0 43
      lib/luabind/luabind/no_dependency.hpp
  73. 0 1470
      lib/luabind/luabind/object.hpp
  74. 0 36
      lib/luabind/luabind/open.hpp
  75. 0 403
      lib/luabind/luabind/operator.hpp
  76. 0 280
      lib/luabind/luabind/out_value_policy.hpp
  77. 0 31
      lib/luabind/luabind/prefix.hpp
  78. 0 85
      lib/luabind/luabind/raw_policy.hpp
  79. 0 73
      lib/luabind/luabind/return_reference_to_policy.hpp
  80. 0 103
      lib/luabind/luabind/scope.hpp
  81. 0 83
      lib/luabind/luabind/shared_ptr_converter.hpp
  82. 0 111
      lib/luabind/luabind/tag_function.hpp
  83. 0 65
      lib/luabind/luabind/typeid.hpp
  84. 0 168
      lib/luabind/luabind/value_wrapper.hpp
  85. 0 125
      lib/luabind/luabind/vector.hpp
  86. 0 16
      lib/luabind/luabind/version.hpp
  87. 0 59
      lib/luabind/luabind/weak_ref.hpp
  88. 0 236
      lib/luabind/luabind/wrapper_base.hpp
  89. 0 53
      lib/luabind/luabind/yield_policy.hpp
  90. 0 337
      lib/luabind/src/class.cpp
  91. 0 120
      lib/luabind/src/class_info.cpp
  92. 0 168
      lib/luabind/src/class_registry.cpp
  93. 0 395
      lib/luabind/src/class_rep.cpp
  94. 0 140
      lib/luabind/src/create_class.cpp
  95. 0 78
      lib/luabind/src/error.cpp
  96. 0 87
      lib/luabind/src/exception_handler.cpp
  97. 0 136
      lib/luabind/src/function.cpp
  98. 0 258
      lib/luabind/src/inheritance.cpp
  99. 0 43
      lib/luabind/src/link_compatibility.cpp
  100. 0 267
      lib/luabind/src/object_rep.cpp

+ 1 - 1
.github/agents/build-fixer.agent.md

@@ -20,7 +20,7 @@ You are a specialist at fixing V-Gears build and test failures. Your job is to g
 2. Form one specific hypothesis about the root cause before editing; read the relevant sources/CMake files to confirm it.
 3. Apply the minimal fix and rebuild only the affected target first, then the full build.
 4. If the same error persists after two fix attempts, stop editing and re-read the full compiler output — do not loop.
-5. For sanitizer (`build-asan`) failures, remember the known quirks: luajit must be pre-built uninstrumented, `ASAN_OPTIONS=detect_leaks=0` for builds, and `vptr:*/OgreSingleton.h` is a known UBSAN false positive to suppress, not fix.
+5. For sanitizer (`build-asan`) failures, remember that system LuaJIT is an uninstrumented dependency, and `vptr:*/OgreSingleton.h` is a known UBSAN false positive to suppress, not fix.
 
 ## Output Format
 

+ 7 - 7
.github/copilot-instructions.md

@@ -11,11 +11,12 @@ V-Gears is a free, cross-platform reimplementation of the Final Fantasy VII engi
 ## Architecture
 
 - `src/common/` — application base class and file utilities shared by all targets.
-- `src/core/` — engine runtime: audio, console, entities, walkmesh, UI, particles, savemap, `ScriptManager` (Lua bindings via luabind/LuaJIT).
+- `src/core/` — engine runtime: audio, console, entities, walkmesh, UI, particles, savemap, `ScriptManager` (Lua bindings via sol2 and system LuaJIT).
 - `src/data/` — FF7 binary format parsers (LGP, LZS, HRC, TEX, field files, worldmap TXZ...). Most formats follow a triplet: `*File` (data), `*FileSerializer` (read/write), `*FileManager` (Ogre resource loading).
-- `src/installer/` — Qt data installer (`v-gears-installer`); includes the script `decompiler/` that converts field/world scripts into Lua.
+- `src/installer/` — Qt data installer (`v-gears-installer`); includes the script `decompiler/` that converts field/world scripts into Lua and the SfxDump audio converter.
 - `src/map/`, `src/modules/`, `src/viewer/` — field map code, game modules (e.g. worldmap), and the model viewer.
-- `lib/` — bundled third-party code (luabind, luajit, sfxdump). Do not restyle, modernize, or refactor these.
+- `src/third_party/sol/` — vendored sol2 single header. Do not restyle, modernize, or refactor it.
+- LuaJIT is a system dependency.
 - `test/` — Boost.Test suite mirroring `src/` paths; sources are listed manually in `test/CMakeLists.txt`.
 - `data/` — runtime configuration only (Ogre plugins/resources cfgs). Not game data.
 - `doc/` — all guides; `doc/code/FFVII/` documents the original binary formats.
@@ -51,7 +52,6 @@ Follow [doc/STYLE.md](../doc/STYLE.md) (C++) and [doc/STYLE-LUA.md](../doc/STYLE
 
 Verified working recipe — keep these quirks intact:
 
-1. Pre-build luajit without sanitizers (host build tools break under ASAN): `cmake -S . -B build-normal -DCMAKE_BUILD_TYPE=Release && cmake --build build-normal --target liblua -j6`, then copy its generated headers into the ASAN build dir.
-2. Configure `build-asan` with `-DCMAKE_C_FLAGS='-fsanitize=address,undefined -fno-omit-frame-pointer -g'` (same for CXX flags, plus `-DCMAKE_EXE_LINKER_FLAGS='-fsanitize=address,undefined'`).
-3. Build with `ASAN_OPTIONS=detect_leaks=0` (luajit host tools have benign leaks).
-4. Run with a UBSAN suppression for `vptr:*/OgreSingleton.h` — a false positive inherent to OGRE's singleton pattern, not a real bug.
+1. Configure `build-asan` with `-DCMAKE_C_FLAGS='-fsanitize=address,undefined -fno-omit-frame-pointer -g'` (same for CXX flags, plus `-DCMAKE_EXE_LINKER_FLAGS='-fsanitize=address,undefined'`). System LuaJIT is used as an uninstrumented dependency.
+2. Build the project normally with the sanitizer flags enabled.
+3. Run with a UBSAN suppression for `vptr:*/OgreSingleton.h` — a false positive inherent to OGRE's singleton pattern, not a real bug.

+ 27 - 2
CMakeLists.txt

@@ -47,14 +47,39 @@ if(NOT CMAKE_BUILD_TYPE)
     set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build" FORCE)
 endif()
 
-# First, build external libraries (luabind and luajit).
-add_subdirectory(lib)
+# LuaJIT is a system dependency; sol2 is header-only.
+find_package(PkgConfig QUIET)
+if(PKG_CONFIG_FOUND)
+    pkg_check_modules(LUAJIT QUIET luajit)
+endif()
+
+if(LUAJIT_FOUND)
+    set(VGEARS_LUAJIT_INCLUDE_DIRS ${LUAJIT_INCLUDE_DIRS})
+    set(VGEARS_LUAJIT_LIBRARIES ${LUAJIT_LINK_LIBRARIES})
+else()
+    find_path(VGEARS_LUAJIT_INCLUDE_DIR
+        NAMES lua.hpp
+        PATH_SUFFIXES luajit-2.1 luajit-2.0 luajit-5.1
+    )
+    find_library(VGEARS_LUAJIT_LIBRARY
+        NAMES luajit-5.1 luajit-2.1 luajit
+    )
+    if(NOT VGEARS_LUAJIT_INCLUDE_DIR OR NOT VGEARS_LUAJIT_LIBRARY)
+        message(FATAL_ERROR
+            "LuaJIT development files were not found. Install libluajit-5.1-dev "
+            "or set VGEARS_LUAJIT_INCLUDE_DIR and VGEARS_LUAJIT_LIBRARY."
+        )
+    endif()
+    set(VGEARS_LUAJIT_INCLUDE_DIRS ${VGEARS_LUAJIT_INCLUDE_DIR})
+    set(VGEARS_LUAJIT_LIBRARIES ${VGEARS_LUAJIT_LIBRARY})
+endif()
 
 # Build v-gears (and, if requested, the installer).
 add_subdirectory(src)
 
 # If requested, build tests
 if(BUILD_TESTS)
+    enable_testing()
     add_subdirectory(test)
 endif()
 

+ 1 - 1
debian/control

@@ -2,7 +2,7 @@ Source: v-gears
 Section: games
 Priority: extra
 Maintainer: I�igo Valentin <i@inigovalentin.com>
-Build-Depends: debhelper(>= 7.0.50~),libogre-1.12-dev, libtiyxml-dev, cmake, cdbs, libois-dev, libboost-program-options-dev, libboost-filesystem-dev, libvorbis-dev, libopenal-dev, libboost-test-dev, zlib1g-dev, libqt5core5a, libqt5widgets5
+Build-Depends: debhelper(>= 7.0.50~),libogre-1.12-dev, libtiyxml-dev, cmake, cdbs, libois-dev, libboost-program-options-dev, libboost-filesystem-dev, libvorbis-dev, libopenal-dev, libboost-test-dev, zlib1g-dev, libqt5core5a, libqt5widgets5, libluajit-5.1-dev
 Standards-Version: 3.9.5
 Homepage: https://v-gears.inigovalentin.com
 Vcs-Git: git://https://github.com/v-gears/v-gears.git

+ 1 - 1
doc/BUILD.md

@@ -4,7 +4,7 @@
 If you are runind Debian (or derivates), you can install the required dependencies by running as root
 
 ```bash
-apt install g++ cmake libqt5widgets5 qtbase5-dev zlib1g-dev libogre-1.12-dev libois-dev libvorbis-dev libboost-dev libboost-program-options-dev libboost-test-dev libboost-filesystem-dev libboost-thread-dev lua5.2 liblua5.2-dev libluabind-dev luajit libopenal-dev libtinyxml-dev
+apt install g++ cmake libqt5widgets5 qtbase5-dev zlib1g-dev libogre-1.12-dev libois-dev libvorbis-dev libboost-dev libboost-program-options-dev libboost-test-dev libboost-filesystem-dev libboost-thread-dev libopenal-dev libtinyxml-dev libluajit-5.1-dev
 ```
 
 ## Deterministic fallbacks

+ 0 - 27
lib/CMakeLists.txt

@@ -1,27 +0,0 @@
-add_subdirectory(luajit) # LuaJIT has its own configuration.
-
-add_subdirectory(sfxdump) # SFXDump has its own configuration.
-
-# Collect luabind sources and headers explicitly and create a modern target.
-file(GLOB_RECURSE LUABIND_SRC_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-    "luabind/src/*.cpp"
-    "luabind/src/*.c"
-)
-file(GLOB_RECURSE LUABIND_HEADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
-    "luabind/luabind/*.h"
-    "luabind/luabind/*.hpp"
-    "luabind/luabind/detail/*.h"
-    "luabind/luabind/detail/*.hpp"
-)
-
-add_library(libluabind STATIC ${LUABIND_SRC_FILES} ${LUABIND_HEADER_FILES})
-
-target_include_directories(libluabind
-    PUBLIC
-        ${CMAKE_CURRENT_SOURCE_DIR}/luabind
-        ${CMAKE_CURRENT_SOURCE_DIR}/luajit/src
-        ${CMAKE_CURRENT_SOURCE_DIR}/luabind/luabind
-        ${CMAKE_CURRENT_SOURCE_DIR}/luabind/luabind/detail
-)
-
-set_target_properties(libluabind PROPERTIES FOLDER "lib")

+ 0 - 4
lib/luabind/.gitignore

@@ -1,4 +0,0 @@
-bin.v2
-bin
-doc/*.html
-doc/version.rst

+ 0 - 65
lib/luabind/INSTALL

@@ -1,65 +0,0 @@
-luabind installation
-====================
-
-The build system used by luabind is Boost Build V2, which can be found
-at:
-
-  http://www.boost.org/doc/tools/build/index.html
-
-The installation instructions are available at:
-
-  http://www.boost.org/doc/tools/build/doc/html/bbv2/installation.html
-
-If you are using Debian or Ubuntu, you can simply install the
-"boost-build" package:
-
-  $ sudo apt-get install boost-build
-
-Other distributions may have similar packages.
-
-On Windows, you can download pre-built "bjam" binaries, and follow the
-installation instructions on the page linked above.
-
-
-Windows
--------
-
-The environment variable "BOOST_ROOT" must be set to the directory where Boost
-was extracted. "LUA_PATH" must be set to a directory where Lua binaries and
-headers reside. The recommended way to get the Lua libraries is to download the
-"DLL and Includes" package from:
-
-  http://luabinaries.luaforge.net/download.html
-
-With these enviroment variables properly set:
-
-  $ set BOOST_ROOT=...
-  $ set LUA_PATH=...
-  $ bjam stage
-
-Will build the default library variants and place them in a directory called
-"stage". This can be controlled with the "--stagedir" option:
-
-  $ bjam --stagedir=libs stage
-
-Would place the libraries in a "libs" directory.
-
-Note that there is nothing magic going on here. If you don't want to
-build the libraries this way, or run the tests, there is nothing
-stopping you from using whatever build system you want. For example,
-simply dropping the source files in a Visual Studio project should just
-work. The only requirement is that "LUABIND_DYNAMIC_LINK" must be
-defined when building and linking to a shared library.
-
-\*nix
------
-
-  $ bjam install
-
-Will build and install the default library variants, and install them together
-with the header files to the default prefix, which is "/usr/local". The install
-prefix can be controlled with the "--prefix" option. For example:
-
-  $ bjam --prefix=/usr install
-
-Will install to "/usr/lib" and "/usr/include".

+ 0 - 248
lib/luabind/Jamroot

@@ -1,248 +0,0 @@
-import docutils ;
-import os ;
-import errors ;
-import notfile ;
-import package ;
-import path ;
-import virtual-target ;
-
-VERSION = 0.9.0 ;
-BOOST_ROOT = [ os.environ BOOST_ROOT ] ;
-
-rule debug-message ( txt * )
-{
-    if --debug-build in [ modules.peek : ARGV ]
-    {
-        echo [luabind DEBUG] $(txt) ;
-    }
-}
-
-debug-message figuring out which libraries to link to... ;
-debug-message os.name is [ os.name ] ;
-
-if [ os.name ] = NT
-{
-    if ! $(BOOST_ROOT)
-    {
-        errors.user-error "*** BOOST_ROOT must be set to a Boost installation." ;
-    }
-
-    LUA_PATH = [ os.environ LUA_PATH ] ;
-
-    if ! $(LUA_PATH)
-    {
-        errors.user-error "*** LUA_PATH must be set." ;
-    }
-
-    local includes = [ GLOB $(LUA_PATH)/include $(LUA_PATH)/src : lua.h ] ;
-
-    if ! $(includes)
-    {
-        errors.user-error "*** Unable to determine Lua include directory." ;
-    }
-
-    includes = $(includes:D) ;
-
-    debug-message found include directory in $(includes) ;
-
-    if [ GLOB $(LUA_PATH) : lib ]
-    {
-        lib lua : : <link>static <name>lua5.1 <search>$(LUA_PATH)/lib/static : : <include>$(includes) ;
-        lib lua : : <link>shared <name>lua5.1 <search>$(LUA_PATH)/lib : : <include>$(includes) ;
-    }
-    else if [ GLOB $(LUA_PATH) : lua5.1.dll ]
-    {
-        lib lua : : <name>lua5.1 <search>$(LUA_PATH) : : <include>$(includes) ;
-    }
-}
-else if [ os.name ] in LINUX MACOSX FREEBSD
-{
-    LUA_PATH = [ os.environ LUA_PATH ] ;
-    HOME = [ os.environ HOME ] ;
-
-    local possible-prefixes =
-        $(LUA_PATH) $(HOME)/Library/Frameworks /Library/Frameworks /usr /usr/local /opt/local /opt ;
-
-    local possible-suffixes =
-        include/lua5.1 include/lua51 include/lua include ;
-
-    local includes = [ GLOB $(possible-prefixes)/$(possible-suffixes) : lua.h ] ;
-
-    if ! $(includes)
-    {
-        errors.user-error "*** Unable to determine Lua include directory." ;
-    }
-
-    local includes = $(includes[1]:D) ;
-    local prefix = $(includes:D) ;
-
-    if $(prefix:B) = "include"
-    {
-        prefix = $(prefix:D) ;
-    }
-
-    local lib = $(prefix)/lib ;
-
-    local names = liblua5.1 liblua51 liblua ;
-    local extensions = .a .so ;
-
-    library = [ GLOB $(lib)/lua51 $(lib)/lua5.1 $(lib)/lua $(lib) :
-        $(names)$(extensions) ] ;
-    lib-name = [ MATCH "lib(.*)" : $(library[1]:B) ] ;
-
-    debug-message prefix: $(prefix) ;
-    debug-message includes: $(includes) ;
-    debug-message lib: $(library:D) ;
-    debug-message candidates: $(library) ;
-    debug-message linking to: $(lib-name) ;
-
-    if ! $(lib-name)
-    {
-        errors.user-error "*** Unable to find Lua library." ;
-    }
-
-    lib m : : <link>shared ;
-    if [ os.name ] = LINUX
-    {
-        lib dl : : <link>shared ;
-    }
-    else
-    {
-        alias dl ;
-    }
-    lib lua : m dl : <name>$(lib-name) <search>$(library:D) : : <include>$(includes) ;
-}
-
-rule tag-names ( name : type ? : property-set )
-{
-    if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB &&
-        [ $(property-set).get <variant> ] = debug
-    {
-        name = $(name)d ;
-    }
-
-    local result = [ virtual-target.add-prefix-and-suffix $(name) : $(type) : $(property-set) ] ;
-
-    if $(type) = SHARED_LIB &&
-        ( ! ( [ $(property-set).get <target-os> ] in windows cygwin darwin aix ) &&
-          ! ( [ $(property-set).get <toolset> ] in pgi ) )
-    {
-        result = $(result).$(VERSION) ;
-    }
-
-    return $(result) ;
-}
-
-SOURCES =
-    class.cpp
-    class_info.cpp
-    class_registry.cpp
-    class_rep.cpp
-    create_class.cpp
-    error.cpp
-    exception_handler.cpp
-    function.cpp
-    inheritance.cpp
-    link_compatibility.cpp
-    object_rep.cpp
-    open.cpp
-    pcall.cpp
-    scope.cpp
-    stack_content_by_name.cpp
-    weak_ref.cpp
-    wrapper_base.cpp ;
-
-usage-requirements =
-    <library>lua
-    <toolset>msvc,<link>shared:<cxxflags>/wd4251
-    <link>shared:<define>LUABIND_DYNAMIC_LINK
-    <tag>@tag-names ;
-
-lib luabind
-    : src/$(SOURCES)
-    # requirements
-    : <include>. <include>$(BOOST_ROOT)
-      $(usage-requirements)
-    # default-build
-    :
-    # usage-requirements
-    : <include>. <include>$(BOOST_ROOT)
-      $(usage-requirements)
-    ;
-
-alias test
-  : test//test
-  # requirements
-  :
-  # default-build
-  : <link>static <link>shared release debug ;
-
-explicit test ;
-
-rule git-describe ( )
-{
-    local result = [ SHELL "git describe HEAD 2>&1" : exit-status ] ;
-
-    if $(result[2]) = 0
-    {
-        return [ MATCH "^v([a-zA-Z.0-9\\-]+)" : $(result[1]) ] ;
-    }
-}
-
-version-tag = [ git-describe ] ;
-
-if $(version-tag)
-{
-    actions make-version-file
-    {
-        echo ".. |version| replace:: $(version-tag)" > doc/version.rst
-    }
-
-    notfile make-version-file : @make-version-file ;
-}
-else
-{
-    alias make-version-file ;
-}
-
-if docs in [ modules.peek : ARGV ] 
-{
-    local result = [ SHELL "rst2html.py --version 2>&1" : exit-status ] ;
-    if $(result[2]) = 0
-    {
-        found-rst2html = rst2html.py ;
-    }
-}
-
-html docs.html
-  : doc/docs.rst
-  : <dependency>make-version-file
-    <docutils-cmd>$(found-rst2html)
-    <docutils-html>"--traceback -gdt --stylesheet=style.css --link-stylesheet" ;
-
-stage docs : docs.html : <location>doc ;
-explicit docs docs.html make-version-file ;
-
-headers = [ path.glob-tree luabind : *.hpp ] ;
-
-package.install install
-  : <install-header-subdir>luabind
-    <install-source-root>luabind
-    <install-no-version-symlinks>on
-  :
-  : luabind
-  : $(headers)
-  ;
-
-local stage-locate = [ MATCH "^--stagedir=(.*)" : [ modules.peek : ARGV ] ] ;
-stage-locate ?= stage ;
-
-install stage
-  : luabind
-  : <location>$(stage-locate)
-    <install-no-version-symlinks>on
-    <install-dependencies>on
-    <install-type>LIB
-  ;
-
-explicit stage ;

+ 0 - 22
lib/luabind/LICENSE

@@ -1,22 +0,0 @@
-// Copyright (c) 2003 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.
-

+ 0 - 167
lib/luabind/luabind/adopt_policy.hpp

@@ -1,167 +0,0 @@
-// Copyright (c) 2003 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_ADOPT_POLICY_HPP_INCLUDED
-#define LUABIND_ADOPT_POLICY_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/wrapper_base.hpp>
-#include <luabind/detail/policy.hpp>
-#include <luabind/back_reference_fwd.hpp>
-#include <luabind/wrapper_base.hpp>
-#include <boost/type_traits/is_polymorphic.hpp>
-
-namespace luabind { namespace detail 
-{
-    template <class T>
-    void adjust_backref_ownership(T* ptr, mpl::true_)
-    {
-        if (wrap_base* p = dynamic_cast<wrap_base*>(ptr))
-        {
-            wrapped_self_t& wrapper = wrap_access::ref(*p);
-            wrapper.get(wrapper.state());
-            wrapper.m_strong_ref.set(wrapper.state());
-        }
-    }
-
-    inline void adjust_backref_ownership(void*, mpl::false_)
-    {}
-
-	template <class Pointer, class Direction = lua_to_cpp>
-    struct adopt_pointer : pointer_converter
-	{
-		typedef adopt_pointer type;
-
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-
-		template<class T>
-		T* apply(lua_State* L, by_pointer<T>, int index)
-		{
-            T* ptr = pointer_converter::apply(
-                L, LUABIND_DECORATE_TYPE(T*), index);
-
-            object_rep* obj = static_cast<object_rep*>(
-                lua_touserdata(L, index));
-            obj->release();
-
-            adjust_backref_ownership(ptr, boost::is_polymorphic<T>());
-
-            return ptr;
-		}
-
-		template<class T>
-		int match(lua_State* L, by_pointer<T>, int index)
-		{
-            return pointer_converter::match(
-                L, LUABIND_DECORATE_TYPE(T*), index);
-		}
-
-		template<class T>
-		void converter_postcall(lua_State*, T, int) {}
-	};
-
-    template <class Pointer, class T>
-    struct pointer_or_default
-    {
-        typedef Pointer type;
-    };
-
-    template <class T>
-    struct pointer_or_default<void, T>
-    {
-        typedef std::auto_ptr<T> type;
-    };
-
-	template <class Pointer>
-	struct adopt_pointer<Pointer, cpp_to_lua>
-	{
-		typedef adopt_pointer type;
-
-		template<class T>
-		void apply(lua_State* L, T* ptr)
-		{
-			if (ptr == 0) 
-			{
-				lua_pushnil(L);
-				return;
-			}
-
-			// if there is a back_reference, then the
-			// ownership will be removed from the
-			// back reference and put on the lua stack.
-			if (luabind::move_back_reference(L, ptr))
-				return;
-
-            typedef typename pointer_or_default<Pointer, T>::type
-                pointer_type;
-
-            make_instance(L, pointer_type(ptr));
-		}
-	};
-
-	template <int N, class Pointer = void>
-	struct adopt_policy : conversion_policy<N>
-	{
-//		BOOST_STATIC_CONSTANT(int, index = N);
-
-		static void precall(lua_State*, const index_map&) {}
-		static void postcall(lua_State*, const index_map&) {}
-
-		struct only_accepts_nonconst_pointers {};
-
-		template<class T, class Direction>
-		struct apply
-		{
-			typedef luabind::detail::is_nonconst_pointer<T> is_nonconst_p;
-			typedef typename boost::mpl::if_<
-                is_nonconst_p
-              , adopt_pointer<Pointer, Direction>
-              , only_accepts_nonconst_pointers
-            >::type type;
-		};
-	};
-
-}}
-
-namespace luabind
-{
-	template<int N>
-	detail::policy_cons<detail::adopt_policy<N>, detail::null_type> 
-	adopt(LUABIND_PLACEHOLDER_ARG(N))
-	{ 
-		return detail::policy_cons<detail::adopt_policy<N>, detail::null_type>(); 
-	}
-
-    template <class Pointer, int N>
-    detail::policy_cons<detail::adopt_policy<N, Pointer>, detail::null_type>
-    adopt(LUABIND_PLACEHOLDER_ARG(N))
-    {
-        return detail::policy_cons<detail::adopt_policy<N, Pointer>, detail::null_type>();
-    }
-}
-
-#endif // LUABIND_ADOPT_POLICY_HPP_INCLUDE
-

+ 0 - 112
lib/luabind/luabind/back_reference.hpp

@@ -1,112 +0,0 @@
-// 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_BACK_REFERENCE_040510_HPP
-#define LUABIND_BACK_REFERENCE_040510_HPP
-
-#include <luabind/lua_include.hpp>
-#include <luabind/wrapper_base.hpp>
-#include <luabind/detail/has_get_pointer.hpp>
-#include <luabind/get_pointer.hpp>
-#include <boost/type_traits/is_polymorphic.hpp>
-#include <boost/type_traits/is_const.hpp>
-#include <boost/mpl/if.hpp>
-
-namespace luabind {
-
-namespace detail
-{
-  namespace mpl = boost::mpl;
- 
-  template<class T>
-  wrap_base const* get_back_reference_aux0(T const* p, mpl::true_)
-  {
-      return dynamic_cast<wrap_base const*>(p);
-  }
-
-  template<class T>
-  wrap_base const* get_back_reference_aux0(T const*, mpl::false_)
-  {
-      return 0;
-  }
-
-  template<class T>
-  wrap_base const* get_back_reference_aux1(T const* p)
-  {
-      return get_back_reference_aux0(p, boost::is_polymorphic<T>());
-  }
-
-  template<class T>
-  wrap_base const* get_back_reference_aux2(T const& x, mpl::true_)
-  {
-      return get_back_reference_aux1(get_pointer(x));
-  }
-
-  template<class T>
-  wrap_base const* get_back_reference_aux2(T const& x, mpl::false_)
-  {
-      return get_back_reference_aux1(&x);
-  }
-
-  template<class T>
-  wrap_base const* get_back_reference(T const& x)
-  {
-      return detail::get_back_reference_aux2(
-          x
-        , has_get_pointer<T>()
-      );
-  }
-  
-} // namespace detail
-
-template<class T>
-bool get_back_reference(lua_State* L, T const& x)
-{
-#ifndef LUABIND_NO_RTTI
-    if (wrap_base const* w = detail::get_back_reference(x))
-    {
-        detail::wrap_access::ref(*w).get(L);
-        return true;
-    }
-#endif
-    return false;
-}
-
-template<class T>
-bool move_back_reference(lua_State* L, T const& x)
-{
-#ifndef LUABIND_NO_RTTI
-    if (wrap_base* w = const_cast<wrap_base*>(detail::get_back_reference(x)))
-    {
-        assert(detail::wrap_access::ref(*w).m_strong_ref.is_valid());
-        detail::wrap_access::ref(*w).get(L);
-        detail::wrap_access::ref(*w).m_strong_ref.reset();
-        return true;
-    }
-#endif
-    return false;
-}
-
-} // namespace luabind
-
-#endif // LUABIND_BACK_REFERENCE_040510_HPP
-

+ 0 - 37
lib/luabind/luabind/back_reference_fwd.hpp

@@ -1,37 +0,0 @@
-// 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_BACK_REFERENCE_FWD_040510_HPP
-#define LUABIND_BACK_REFERENCE_FWD_040510_HPP
-
-namespace luabind {
-
-template<class T>
-bool get_back_reference(lua_State* L, T const& x);
-
-template<class T>
-bool move_back_reference(lua_State* L, T const& x);
-
-} // namespace luabind
-
-#endif // LUABIND_BACK_REFERENCE_FWD_040510_HPP
-

+ 0 - 942
lib/luabind/luabind/class.hpp

@@ -1,942 +0,0 @@
-// Copyright (c) 2003 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_CLASS_HPP_INCLUDED
-#define LUABIND_CLASS_HPP_INCLUDED
-
-/*
-	ISSUES:
-	------------------------------------------------------
-
-	* solved for member functions, not application operator *
-	if we have a base class that defines a function a derived class must be able to
-	override that function (not just overload). Right now we just add the other overload
-	to the overloads list and will probably get an ambiguity. If we want to support this
-	each method_rep must include a vector of type_info pointers for each parameter.
-	Operators do not have this problem, since operators always have to have
-	it's own type as one of the arguments, no ambiguity can occur. Application
-	operator, on the other hand, would have this problem.
-	Properties cannot be overloaded, so they should always be overridden.
-	If this is to work for application operator, we really need to specify if an application
-	operator is const or not.
-
-	If one class registers two functions with the same name and the same
-	signature, there's currently no error. The last registered function will
-	be the one that's used.
-	How do we know which class registered the function? If the function was
-	defined by the base class, it is a legal operation, to override it.
-	we cannot look at the pointer offset, since it always will be zero for one of the bases.
-
-
-
-	TODO:
-	------------------------------------------------------
-
- 	finish smart pointer support
-		* the adopt policy should not be able to adopt pointers to held_types. This
-		must be prohibited.
-		* name_of_type must recognize holder_types and not return "custom"
-
-	document custom policies, custom converters
-
-	store the instance object for policies.
-
-	support the __concat metamethod. This is a bit tricky, since it cannot be
-	treated as a normal operator. It is a binary operator but we want to use the
-	__tostring implementation for both arguments.
-	
-*/
-
-#include <luabind/prefix.hpp>
-#include <luabind/config.hpp>
-
-#include <string>
-#include <cassert>
-
-#ifndef LUABIND_CPP0x
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
-#include <boost/preprocessor/repetition/repeat.hpp>
-#endif
-#include <boost/type_traits/is_same.hpp>
-#include <boost/type_traits/is_member_object_pointer.hpp>
-#include <boost/mpl/apply.hpp>
-#include <boost/mpl/lambda.hpp>
-#include <boost/mpl/logical.hpp>
-#include <boost/mpl/find_if.hpp>
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/logical.hpp>
-#include <boost/mpl/vector/vector10.hpp>
-
-#include <luabind/config.hpp>
-#include <luabind/scope.hpp>
-#include <luabind/back_reference.hpp>
-#include <luabind/function.hpp>
-#include <luabind/dependency_policy.hpp>
-#include <luabind/detail/constructor.hpp>
-#include <luabind/detail/call.hpp>
-#include <luabind/detail/deduce_signature.hpp>
-#include <luabind/detail/primitives.hpp>
-#include <luabind/detail/property.hpp>
-#include <luabind/detail/typetraits.hpp>
-#include <luabind/detail/class_rep.hpp>
-#include <luabind/detail/call.hpp>
-#include <luabind/detail/object_rep.hpp>
-#include <luabind/detail/call_member.hpp>
-#include <luabind/detail/enum_maker.hpp>
-#include <luabind/detail/operator_id.hpp>
-#include <luabind/detail/pointee_typeid.hpp>
-#include <luabind/detail/link_compatibility.hpp>
-#include <luabind/detail/inheritance.hpp>
-#include <luabind/detail/signature_match.hpp>
-#include <luabind/no_dependency.hpp>
-#include <luabind/typeid.hpp>
-
-// to remove the 'this' used in initialization list-warning
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable: 4355)
-#endif
-
-namespace boost
-{
-
-  template <class T> class shared_ptr;
-
-} // namespace boost
-
-namespace luabind
-{	
-	namespace detail
-	{
-		struct unspecified {};
-
-		template<class Derived> struct operator_;
-
-		struct you_need_to_define_a_get_const_holder_function_for_your_smart_ptr {};
-	}
-
-	template<class T, class X1 = detail::unspecified, class X2 = detail::unspecified, class X3 = detail::unspecified>
-	struct class_;
-
-	// TODO: this function will only be invoked if the user hasn't defined a correct overload
-	// maybe we should have a static assert in here?
-	inline detail::you_need_to_define_a_get_const_holder_function_for_your_smart_ptr*
-	get_const_holder(...)
-	{
-		return 0;
-	}
-
-	template <class T>
-	boost::shared_ptr<T const>* get_const_holder(boost::shared_ptr<T>*)
-	{
-		return 0;
-	}
-
-# ifdef LUABIND_CPP0x
-
-    template <class... Args>
-    struct bases
-    {};
-
-    typedef bases<> no_bases;
-
-# else
-
-    template <
-        BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(
-            LUABIND_MAX_BASES, class A, detail::null_type)
-    >
-    struct bases
-    {};
-
-    typedef bases<detail::null_type> no_bases;
-
-# endif // LUABIND_CPP0x
-
-	namespace detail
-	{
-        template <class T>
-        struct is_bases
-          : mpl::false_
-        {};
-
-# ifdef LUABIND_CPP0x
-        template <class... Args>
-        struct is_bases<bases<Args...> >
-          : mpl::true_
-        {};
-# else
-        template <BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, class A)>
-        struct is_bases<bases<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, A)> >
-          : mpl::true_
-        {};
-# endif
-
-        template <class T, class P>
-        struct is_unspecified
-          : mpl::apply1<P, T>
-        {};
-
-        template <class P>
-        struct is_unspecified<unspecified, P>
-          : mpl::true_
-        {};
-
-        template <class P>
-        struct is_unspecified_mfn
-        {
-            template <class T>
-            struct apply
-              : is_unspecified<T, P>
-            {};
-        };
-
-		template<class Predicate>
-		struct get_predicate
-		{
-            typedef mpl::protect<is_unspecified_mfn<Predicate> > type;
-		};
-
-        template <class Result, class Default>
-        struct result_or_default
-        {
-            typedef Result type;
-        };
-
-        template <class Default>
-        struct result_or_default<unspecified, Default>
-        {
-            typedef Default type;
-        };
-
-		template<class Parameters, class Predicate, class DefaultValue>
-		struct extract_parameter
-		{
-			typedef typename get_predicate<Predicate>::type pred;
-			typedef typename boost::mpl::find_if<Parameters, pred>::type iterator;
-            typedef typename result_or_default<
-                typename iterator::type, DefaultValue
-            >::type type;
-		};
-
-		// prints the types of the values on the stack, in the
-		// range [start_index, lua_gettop()]
-
-		LUABIND_API std::string stack_content_by_name(lua_State* L, int start_index);
-	
-		struct LUABIND_API create_class
-		{
-			static int stage1(lua_State* L);
-			static int stage2(lua_State* L);
-		};
-
-	} // detail
-
-	namespace detail {
-
-		template<class T>
-		struct static_scope
-		{
-			static_scope(T& self_) : self(self_)
-			{
-			}
-
-			T& operator[](scope s) const
-			{
-				self.add_inner_scope(s);
-				return self;
-			}
-
-		private:
-			template<class U> void operator,(U const&) const;
-			void operator=(static_scope const&);
-			
-			T& self;
-		};
-
-		struct class_registration;
-
-		struct LUABIND_API class_base : scope
-		{
-		public:
-			class_base(char const* name);		
-
-			struct base_desc
-			{
-				type_id type;
-				int ptr_offset;
-			};
-
-			void init(
-                type_id const& type, class_id id
-              , type_id const& wrapped_type, class_id wrapper_id);
-
-            void add_base(type_id const& base, cast_function cast);
-
-			void add_member(registration* member);
-			void add_default_member(registration* member);
-
-			const char* name() const;
-
-			void add_static_constant(const char* name, int val);
-			void add_inner_scope(scope& s);
-
-            void add_cast(class_id src, class_id target, cast_function cast);
-
-		private:
-			class_registration* m_registration;
-		};
-
-// MSVC complains about member being sensitive to alignment (C4121)
-// when F is a pointer to member of a class with virtual bases.
-# ifdef BOOST_MSVC
-#  pragma pack(push)
-#  pragma pack(16)
-# endif
-
-		template <class Class, class F, class Policies>
-		struct memfun_registration : registration
-		{
-			memfun_registration(char const* name, F f, Policies const& policies)
-			  : name(name)
-			  , f(f)
-			  , policies(policies)
-			{}
-
-			void register_(lua_State* L) const
-			{
-				object fn = make_function(
-					L, f, deduce_signature(f, (Class*)0), policies);
-
-				add_overload(
-					object(from_stack(L, -1))
-				  , name
-				  , fn
-				);
-			}
-
-			char const* name;
-			F f;
-			Policies policies;
-		};
-
-# ifdef BOOST_MSVC
-#  pragma pack(pop)
-# endif
-
-        template <class P, class T>
-        struct default_pointer
-        {
-            typedef P type;
-        };
-
-        template <class T>
-        struct default_pointer<null_type, T>
-        {
-            typedef std::auto_ptr<T> type;
-        };
-
-        template <class Class, class Pointer, class Signature, class Policies>
-        struct constructor_registration : registration
-        {
-            constructor_registration(Policies const& policies)
-              : policies(policies)
-            {}
-
-            void register_(lua_State* L) const
-            {
-                typedef typename default_pointer<Pointer, Class>::type pointer;
-
-                object fn = make_function(
-                    L
-                  , construct<Class, pointer, Signature>(), Signature()
-                  , policies
-                );
-
-                add_overload(
-                    object(from_stack(L, -1))
-                  , "__init"
-                  , fn
-                );
-            }
-
-            Policies policies;
-        };
-
-        template <class T>
-        struct reference_result
-          : mpl::if_<
-                mpl::or_<boost::is_pointer<T>, is_primitive<T> >
-              , T
-              , typename boost::add_reference<T>::type
-            >
-        {};
-
-        template <class T>
-        struct reference_argument
-          : mpl::if_<
-                mpl::or_<boost::is_pointer<T>, is_primitive<T> >
-              , T
-              , typename boost::add_reference<
-                    typename boost::add_const<T>::type
-                >::type
-            >
-        {};
-
-        template <class T, class Policies>
-        struct inject_dependency_policy
-          : mpl::if_<
-                mpl::or_<
-                    is_primitive<T>
-                  , has_policy<Policies, detail::no_dependency_policy>
-                >
-              , Policies
-              , policy_cons<dependency_policy<0, 1>, Policies>
-            >
-        {};
-
-        template <
-            class Class
-          , class Get, class GetPolicies
-          , class Set = null_type, class SetPolicies = null_type
-        >
-        struct property_registration : registration
-        {
-            property_registration(
-                char const* name
-              , Get const& get
-              , GetPolicies const& get_policies
-              , Set const& set = Set()
-              , SetPolicies const& set_policies = SetPolicies()
-            )
-              : name(name)
-              , get(get)
-              , get_policies(get_policies)
-              , set(set)
-              , set_policies(set_policies)
-            {}
-
-            void register_(lua_State* L) const
-            {
-                object context(from_stack(L, -1));
-                register_aux(
-                    L
-                  , context
-                  , make_get(L, get, boost::is_member_object_pointer<Get>())
-                  , set
-                );
-            }
-
-            template <class F>
-            object make_get(lua_State* L, F const& f, mpl::false_) const
-            {
-                return make_function(
-                    L, f, deduce_signature(f, (Class*)0), get_policies);
-            }
-
-            template <class T, class D>
-            object make_get(lua_State* L, D T::* mem_ptr, mpl::true_) const
-            {
-                typedef typename reference_result<D>::type result_type;
-                typedef typename inject_dependency_policy<
-                    D, GetPolicies>::type policies;
-
-                return make_function(
-                    L
-                  , access_member_ptr<T, D, result_type>(mem_ptr)
-                  , mpl::vector2<result_type, Class const&>()
-                  , policies()
-                );
-            }
-
-            template <class F>
-            object make_set(lua_State* L, F const& f, mpl::false_) const
-            {
-                return make_function(
-                    L, f, deduce_signature(f, (Class*)0), set_policies);
-            }
-
-            template <class T, class D>
-            object make_set(lua_State* L, D T::* mem_ptr, mpl::true_) const
-            {
-                typedef typename reference_argument<D>::type argument_type;
-
-                return make_function(
-                    L
-                  , access_member_ptr<T, D>(mem_ptr)
-                  , mpl::vector3<void, Class&, argument_type>()
-                  , set_policies
-                );
-            }
-
-            template <class S>
-            void register_aux(
-                lua_State* L, object const& context
-              , object const& get_, S const&) const
-            {
-                context[name] = property(
-                    get_
-                  , make_set(L, set, boost::is_member_object_pointer<Set>())
-                );
-            }
-
-            void register_aux(
-                lua_State*, object const& context
-              , object const& get_, null_type) const
-            {
-                context[name] = property(get_);
-            }
-
-            char const* name;
-            Get get;
-            GetPolicies get_policies;
-            Set set;
-            SetPolicies set_policies;
-        };
-
-	} // namespace detail
-
-	// registers a class in the lua environment
-	template<class T, class X1, class X2, class X3>
-	struct class_: detail::class_base 
-	{
-		typedef class_<T, X1, X2, X3> self_t;
-
-	private:
-
-		template<class A, class B, class C, class D>
-		class_(const class_<A,B,C,D>&);
-
-	public:
-
-        typedef boost::mpl::vector4<X1, X2, X3, detail::unspecified> parameters_type;
-
-		// WrappedType MUST inherit from T
-		typedef typename detail::extract_parameter<
-		    parameters_type
-		  , boost::is_base_and_derived<T, boost::mpl::_>
-		  , detail::null_type
-		>::type WrappedType;
-
-		typedef typename detail::extract_parameter<
-		    parameters_type
-		  , boost::mpl::not_<
-		        boost::mpl::or_<
-                    detail::is_bases<boost::mpl::_>
-                  , boost::is_base_and_derived<boost::mpl::_, T>
-                  , boost::is_base_and_derived<T, boost::mpl::_>
-				>
-			>
-		  , detail::null_type
-		>::type HeldType;
-
-        template <class Src, class Target>
-        void add_downcast(Src*, Target*, boost::mpl::true_)
-        {
-            add_cast(
-                detail::registered_class<Src>::id
-              , detail::registered_class<Target>::id
-              , detail::dynamic_cast_<Src, Target>::execute
-            );
-        }
-
-        template <class Src, class Target>
-        void add_downcast(Src*, Target*, boost::mpl::false_)
-        {}
-
-		// this function generates conversion information
-		// in the given class_rep structure. It will be able
-		// to implicitly cast to the given template type
-		template<class To>
-		void gen_base_info(detail::type_<To>)
-		{
-            add_base(typeid(To), detail::static_cast_<T, To>::execute);
-            add_cast(
-                detail::registered_class<T>::id
-              , detail::registered_class<To>::id
-              , detail::static_cast_<T, To>::execute
-            );
-
-            add_downcast((To*)0, (T*)0, boost::is_polymorphic<To>());
-		}
-
-		void gen_base_info(detail::type_<detail::null_type>)
-		{}
-
-# ifndef LUABIND_CPP0x
-
-#define LUABIND_GEN_BASE_INFO(z, n, text) gen_base_info(detail::type_<BaseClass##n>());
-
-		template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, class BaseClass)>
-		void generate_baseclass_list(detail::type_<bases<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_BASES, BaseClass)> >)
-		{
-			BOOST_PP_REPEAT(LUABIND_MAX_BASES, LUABIND_GEN_BASE_INFO, _)
-		}
-
-#undef LUABIND_GEN_BASE_INFO
-
-# else // !LUABIND_CPP0x
-
-        template <class... Args>
-        void ignore(Args&&...)
-        {}
-
-        template <class... Bases>
-        void generate_baseclass_list(detail::type_<bases<Bases...> >)
-        {
-            ignore((gen_base_info(detail::type_<Bases>()), 0)...);
-        }
-
-# endif // !LUABIND_CPP0x
-
-		class_(const char* name): class_base(name), scope(*this)
-		{
-#ifndef NDEBUG
-			detail::check_link_compatibility();
-#endif
-		   	init(); 
-		}
-
-		template<class F>
-		class_& def(const char* name, F f)
-		{
-			return this->virtual_def(
-				name, f, detail::null_type()
-			  , detail::null_type(), boost::mpl::true_());
-		}
-
-		// virtual functions
-		template<class F, class DefaultOrPolicies>
-		class_& def(char const* name, F fn, DefaultOrPolicies default_or_policies)
-		{
-			return this->virtual_def(
-				name, fn, default_or_policies, detail::null_type()
-			  , LUABIND_MSVC_TYPENAME detail::is_policy_cons<DefaultOrPolicies>::type());
-		}
-
-		template<class F, class Default, class Policies>
-		class_& def(char const* name, F fn
-			, Default default_, Policies const& policies)
-		{
-			return this->virtual_def(
-				name, fn, default_
-			  , policies, boost::mpl::false_());
-		}
-
-# ifdef LUABIND_CPP0x
-
-        template <class... Args, class Policies = detail::null_type>
-        class_& def(constructor<Args...>, Policies const& policies = Policies())
-        {
-            return this->def_constructor((constructor<Args...>*)0, policies);
-        }
-
-# else
-
-		template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A)>
-		class_& def(constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)> sig)
-		{
-            return this->def_constructor(&sig, detail::null_type());
-		}
-
-		template<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A), class Policies>
-		class_& def(constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)> sig, const Policies& policies)
-		{
-            return this->def_constructor(&sig, policies);
-		}
-
-# endif // LUABIND_CPP0x
-
-        template <class Getter>
-        class_& property(const char* name, Getter g)
-        {
-            this->add_member(
-                new detail::property_registration<T, Getter, detail::null_type>(
-                    name, g, detail::null_type()));
-            return *this;
-        }
-
-        template <class Getter, class MaybeSetter>
-        class_& property(const char* name, Getter g, MaybeSetter s)
-        {
-            return property_impl(
-                name, g, s
-              , boost::mpl::bool_<detail::is_policy_cons<MaybeSetter>::value>()
-            );
-        }
-
-        template<class Getter, class Setter, class GetPolicies>
-        class_& property(const char* name, Getter g, Setter s, const GetPolicies& get_policies)
-        {
-            typedef detail::property_registration<
-                T, Getter, GetPolicies, Setter, detail::null_type
-            > registration_type;
-
-            this->add_member(
-                new registration_type(name, g, get_policies, s));
-            return *this;
-        }
-
-        template<class Getter, class Setter, class GetPolicies, class SetPolicies>
-        class_& property(
-            const char* name
-          , Getter g, Setter s
-          , GetPolicies const& get_policies
-          , SetPolicies const& set_policies)
-        {
-            typedef detail::property_registration<
-                T, Getter, GetPolicies, Setter, SetPolicies
-            > registration_type;
-
-            this->add_member(
-                new registration_type(name, g, get_policies, s, set_policies));
-            return *this;
-        }
-
-        template <class C, class D>
-        class_& def_readonly(const char* name, D C::*mem_ptr)
-        {
-            typedef detail::property_registration<T, D C::*, detail::null_type>
-                registration_type;
-
-            this->add_member(
-                new registration_type(name, mem_ptr, detail::null_type()));
-            return *this;
-        }
-
-        template <class C, class D, class Policies>
-        class_& def_readonly(const char* name, D C::*mem_ptr, Policies const& policies)
-        {
-            typedef detail::property_registration<T, D C::*, Policies>
-                registration_type;
-
-            this->add_member(
-                new registration_type(name, mem_ptr, policies));
-            return *this;
-        }
-
-        template <class C, class D>
-        class_& def_readwrite(const char* name, D C::*mem_ptr)
-        {
-            typedef detail::property_registration<
-                T, D C::*, detail::null_type, D C::*
-            > registration_type;
-
-            this->add_member(
-                new registration_type(
-                    name, mem_ptr, detail::null_type(), mem_ptr));
-            return *this;
-        }
-
-        template <class C, class D, class GetPolicies>
-        class_& def_readwrite(
-            const char* name, D C::*mem_ptr, GetPolicies const& get_policies)
-        {
-            typedef detail::property_registration<
-                T, D C::*, GetPolicies, D C::*
-            > registration_type;
-
-            this->add_member(
-                new registration_type(
-                    name, mem_ptr, get_policies, mem_ptr));
-            return *this;
-        }
-
-        template <class C, class D, class GetPolicies, class SetPolicies>
-        class_& def_readwrite(
-            const char* name
-          , D C::*mem_ptr
-          , GetPolicies const& get_policies
-          , SetPolicies const& set_policies
-        )
-        {
-            typedef detail::property_registration<
-                T, D C::*, GetPolicies, D C::*, SetPolicies
-            > registration_type;
-
-            this->add_member(
-                new registration_type(
-                    name, mem_ptr, get_policies, mem_ptr, set_policies));
-            return *this;
-        }
-
-		template<class Derived, class Policies>
-		class_& def(detail::operator_<Derived>, Policies const& policies)
-		{
-			return this->def(
-				Derived::name()
-			  , &Derived::template apply<T, Policies>::execute
-			  , policies
-			);
-		}
-
-		template<class Derived>
-		class_& def(detail::operator_<Derived>)
-		{
-			return this->def(
-				Derived::name()
-			  , &Derived::template apply<T, detail::null_type>::execute
-			);
-		}
-
-		detail::enum_maker<self_t> enum_(const char*)
-		{
-			return detail::enum_maker<self_t>(*this);
-		}
-		
-		detail::static_scope<self_t> scope;
-		
-	private:
-		void operator=(class_ const&);
-
-        void add_wrapper_cast(detail::null_type*)
-        {}
-
-        template <class U>
-        void add_wrapper_cast(U*)
-        {
-            add_cast(
-                detail::registered_class<U>::id
-              , detail::registered_class<T>::id
-              , detail::static_cast_<U,T>::execute
-            );
-
-            add_downcast((T*)0, (U*)0, boost::is_polymorphic<T>());
-        }
-
-		void init()
-		{
-			typedef typename detail::extract_parameter<
-					parameters_type
-				,	boost::mpl::or_<
-							detail::is_bases<boost::mpl::_>
-						,	boost::is_base_and_derived<boost::mpl::_, T>
-					>
-				,	no_bases
-			>::type bases_t;
-
-			typedef typename 
-				boost::mpl::if_<detail::is_bases<bases_t>
-					,	bases_t
-					,	bases<bases_t>
-				>::type Base;
-	
-            class_base::init(
-                typeid(T)
-              , detail::registered_class<T>::id
-              , typeid(WrappedType)
-              , detail::registered_class<WrappedType>::id
-            );
-
-            add_wrapper_cast((WrappedType*)0);
-
-			generate_baseclass_list(detail::type_<Base>());
-		}
-
-		template<class Getter, class GetPolicies>
-		class_& property_impl(const char* name,
-									 Getter g,
-									 GetPolicies policies,
-									 boost::mpl::bool_<true>)
-		{
-            this->add_member(
-                new detail::property_registration<T, Getter, GetPolicies>(
-                    name, g, policies));
-			return *this;
-		}
-
-		template<class Getter, class Setter>
-		class_& property_impl(const char* name,
-									 Getter g,
-									 Setter s,
-									 boost::mpl::bool_<false>)
-		{
-            typedef detail::property_registration<
-                T, Getter, detail::null_type, Setter, detail::null_type
-            > registration_type;
-
-            this->add_member(
-                new registration_type(name, g, detail::null_type(), s));
-			return *this;
-		}
-
-		// these handle default implementation of virtual functions
-		template<class F, class Policies>
-		class_& virtual_def(char const* name, F const& fn
-			, Policies const&, detail::null_type, boost::mpl::true_)
-		{
-			this->add_member(
-				new detail::memfun_registration<T, F, Policies>(
-					name, fn, Policies()));
-			return *this;
-		}
-
-		template<class F, class Default, class Policies>
-		class_& virtual_def(char const* name, F const& fn
-			, Default const& default_, Policies const&, boost::mpl::false_)
-		{
-			this->add_member(
-				new detail::memfun_registration<T, F, Policies>(
-					name, fn, Policies()));
-
-			this->add_default_member(
-				new detail::memfun_registration<T, Default, Policies>(
-					name, default_, Policies()));
-
-			return *this;
-		}
-
-        template<class Signature, class Policies>
-		class_& def_constructor(Signature*, Policies const&)
-        {
-            typedef typename Signature::signature signature;
-
-            typedef typename boost::mpl::if_<
-                boost::is_same<WrappedType, detail::null_type>
-              , T
-              , WrappedType
-            >::type construct_type;
-
-            this->add_member(
-                new detail::constructor_registration<
-                    construct_type, HeldType, signature, Policies>(
-                        Policies()));
-
-            this->add_default_member(
-                new detail::constructor_registration<
-                    construct_type, HeldType, signature, Policies>(
-                        Policies()));
-
-            return *this;
-        }
-	};
-
-}
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#endif // LUABIND_CLASS_HPP_INCLUDED
-

+ 0 - 50
lib/luabind/luabind/class_info.hpp

@@ -1,50 +0,0 @@
-// Copyright (c) 2003 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_CLASS_INFO_HPP_INCLUDED
-#define LUABIND_CLASS_INFO_HPP_INCLUDED
-
-#include <luabind/prefix.hpp>
-#include <luabind/lua_include.hpp>
-#include <luabind/luabind.hpp>
-#include <luabind/object.hpp>
-
-namespace luabind
-{
-	struct LUABIND_API class_info
-	{	
-		std::string name;
-		object methods;
-		object attributes;
-	};
-
-    LUABIND_API class_info get_class_info(argument const&);
-
-    // returns a table of bound class names
-    LUABIND_API object get_class_names(lua_State* L);
-
-	LUABIND_API void bind_class_info(lua_State*);
-}
-
-#endif
-

+ 0 - 137
lib/luabind/luabind/config.hpp

@@ -1,137 +0,0 @@
-// Copyright (c) 2003 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_CONFIG_HPP_INCLUDED
-#define LUABIND_CONFIG_HPP_INCLUDED
-
-#include <boost/config.hpp>
-
-#ifdef BOOST_MSVC
-	#define LUABIND_ANONYMOUS_FIX static
-#else
-	#define LUABIND_ANONYMOUS_FIX
-#endif
-
-#if defined (BOOST_MSVC) && (BOOST_MSVC <= 1200)
-
-#define for if (false) {} else for
-
-#include <cstring>
-
-namespace std
-{
-	using ::strlen;
-	using ::strcmp;
-	using ::type_info;
-}
-
-#endif
-
-
-#if defined (BOOST_MSVC) && (BOOST_MSVC <= 1300)
-	#define LUABIND_MSVC_TYPENAME
-#else
-	#define LUABIND_MSVC_TYPENAME typename
-#endif
-
-// the maximum number of arguments of functions that's
-// registered. Must at least be 2
-#ifndef LUABIND_MAX_ARITY
-	#define LUABIND_MAX_ARITY 10
-#elif LUABIND_MAX_ARITY <= 1
-	#undef LUABIND_MAX_ARITY
-	#define LUABIND_MAX_ARITY 2
-#endif
-
-// the maximum number of classes one class
-// can derive from
-// max bases must at least be 1
-#ifndef LUABIND_MAX_BASES
-	#define LUABIND_MAX_BASES 4
-#elif LUABIND_MAX_BASES <= 0
-	#undef LUABIND_MAX_BASES
-	#define LUABIND_MAX_BASES 1
-#endif
-
-// LUABIND_NO_ERROR_CHECKING
-// define this to remove all error checks
-// this will improve performance and memory
-// footprint.
-// if it is defined matchers will only be called on
-// overloaded functions, functions that's
-// not overloaded will be called directly. The
-// parameters on the lua stack are assumed
-// to match those of the function.
-// exceptions will still be catched when there's
-// no error checking.
-
-// LUABIND_NOT_THREADSAFE
-// this define will make luabind non-thread safe. That is,
-// it will rely on a static variable. You can still have
-// multiple lua states and use coroutines, but only
-// one of your real threads may run lua code.
-
-// LUABIND_NO_EXCEPTIONS
-// this define will disable all usage of try, catch and throw in
-// luabind. This will in many cases disable runtime-errors, such
-// as invalid casts, when calling lua-functions that fails or
-// returns values that cannot be converted by the given policy.
-// Luabind requires that no function called directly or indirectly
-// by luabind throws an exception (throwing exceptions through
-// C code has undefined behavior, lua is written in C).
-
-#ifdef LUABIND_DYNAMIC_LINK
-# ifdef BOOST_WINDOWS
-#  ifdef LUABIND_BUILDING
-#   define LUABIND_API __declspec(dllexport)
-#  else
-#   define LUABIND_API __declspec(dllimport)
-#  endif
-# else
-#  if defined(_GNUC_) && _GNUC_ >=4
-#   define LUABIND_API __attribute__ ((visibility("default")))
-#  endif
-# endif
-#endif
-
-#ifndef LUABIND_API
-# define LUABIND_API
-#endif
-
-#if !defined(LUABIND_CPP0x) \
- && !defined(BOOST_NO_DECLTYPE) \
- && !defined(BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS) \
- && !defined(BOOST_NO_VARIADIC_TEMPLATES)
-
-# define LUABIND_CPP0x
-
-#endif
-
-namespace luabind {
-
-LUABIND_API void disable_super_deprecation();
-
-} // namespace luabind
-
-#endif // LUABIND_CONFIG_HPP_INCLUDED
-

+ 0 - 143
lib/luabind/luabind/container_policy.hpp

@@ -1,143 +0,0 @@
-// Copyright (c) 2003 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_CONTAINER_POLICY_HPP_INCLUDED
-#define LUABIND_CONTAINER_POLICY_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/policy.hpp>
-#include <boost/mpl/apply_wrap.hpp>
-
-namespace luabind { namespace detail {
-
-	namespace mpl = boost::mpl;
-
-	template<class Policies>
-	struct container_converter_lua_to_cpp
-	{
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-
-        template<class T>
-		T apply(lua_State* L, by_const_reference<T>, int index)
-		{
-			typedef typename T::value_type value_type;
-
-			typedef typename find_conversion_policy<1, Policies>::type converter_policy;
-			typename mpl::apply_wrap2<converter_policy,value_type,lua_to_cpp>::type converter;
-
-			T container;
-
-			lua_pushnil(L);
-			while (lua_next(L, index))
-			{
-				container.push_back(converter.apply(L, LUABIND_DECORATE_TYPE(value_type), -1));
-				lua_pop(L, 1); // pop value
-			}
-
-			return container;
-		}
-
-		template<class T>
-		T apply(lua_State* L, by_value<T>, int index)
-		{
-			return apply(L, by_const_reference<T>(), index);
-		}
-
-		template<class T>
-		static int match(lua_State* L, by_const_reference<T>, int index)
-		{
-			if (lua_istable(L, index)) return 0; else return -1;
-		}
-
-		template<class T>
-		void converter_postcall(lua_State*, T, int) {}
-	};
-
-	template<class Policies>
-	struct container_converter_cpp_to_lua
-	{
-		template<class T>
-		void apply(lua_State* L, const T& container)
-		{
-			typedef typename T::value_type value_type;
-
-			typedef typename find_conversion_policy<1, Policies>::type converter_policy;
-			typename mpl::apply_wrap2<converter_policy,value_type,lua_to_cpp>::type converter;
-
-			lua_newtable(L);
-
-			int index = 1;
-
-			for (typename T::const_iterator i = container.begin(); i != container.end(); ++i)
-			{
-				converter.apply(L, *i);
-				lua_rawseti(L, -2, index);
-				++index;
-			}
-		}
-	};
-
-	template<int N, class Policies>
-//	struct container_policy : converter_policy_tag
-	struct container_policy : conversion_policy<N>
-	{
-//		BOOST_STATIC_CONSTANT(int, index = N);
-
-		static void precall(lua_State*, const index_map&) {}
-		static void postcall(lua_State*, const index_map&) {}
-
-		struct only_accepts_nonconst_pointers {};
-
-		template<class T, class Direction>
-		struct apply
-		{
-			typedef typename boost::mpl::if_<boost::is_same<lua_to_cpp, Direction>
-				, container_converter_lua_to_cpp<Policies>
-				, container_converter_cpp_to_lua<Policies>
-			>::type type;
-		};
-	};
-
-}}
-
-namespace luabind
-{
-	template<int N>
-	detail::policy_cons<detail::container_policy<N, detail::null_type>, detail::null_type> 
-	container(LUABIND_PLACEHOLDER_ARG(N)) 
-	{ 
-		return detail::policy_cons<detail::container_policy<N, detail::null_type>, detail::null_type>(); 
-	}
-
-	template<int N, class Policies>
-	detail::policy_cons<detail::container_policy<N, Policies>, detail::null_type> 
-	container(LUABIND_PLACEHOLDER_ARG(N), const Policies&) 
-	{ 
-		return detail::policy_cons<detail::container_policy<N, Policies>, detail::null_type>(); 
-	}
-}
-
-#endif // LUABIND_CONTAINER_POLICY_HPP_INCLUDED

+ 0 - 61
lib/luabind/luabind/copy_policy.hpp

@@ -1,61 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_COPY_POLICY_081021_HPP
-# define LUABIND_COPY_POLICY_081021_HPP
-
-# include <luabind/detail/policy.hpp>
-
-namespace luabind {
-
-namespace detail
-{
-
-  struct copy_converter
-  {
-      template <class T>
-      void apply(lua_State* L, T const& x)
-      {
-          value_converter().apply(L, x);
-      }
-
-      template <class T>
-      void apply(lua_State* L, T* x)
-      {
-          if (!x)
-              lua_pushnil(L);
-          else
-              apply(L, *x);
-      }
-  };
-
-  template <int N>
-  struct copy_policy : conversion_policy<N>
-  {
-      static void precall(lua_State*, index_map const&)
-      {}
-
-      static void postcall(lua_State*, index_map const&)
-      {}
-
-      template <class T, class Direction>
-      struct apply
-      {
-          typedef copy_converter type;
-      };
-  };
-
-} // namespace detail
-
-template <int N>
-detail::policy_cons<detail::copy_policy<N>, detail::null_type>
-copy(LUABIND_PLACEHOLDER_ARG(N))
-{
-    return detail::policy_cons<detail::copy_policy<N>, detail::null_type>();
-}
-
-} // namespace luabind
-
-#endif // LUABIND_COPY_POLICY_081021_HPP
-

+ 0 - 119
lib/luabind/luabind/dependency_policy.hpp

@@ -1,119 +0,0 @@
-// Copyright (c) 2003 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_DEPENDENCY_POLICY_HPP_INCLUDED
-#define LUABIND_DEPENDENCY_POLICY_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/policy.hpp>
-
-namespace luabind { namespace detail 
-{
-	// makes A dependent on B, meaning B will outlive A.
-	// internally A stores a reference to B
-	template<int A, int B>
-	struct dependency_policy
-	{
-		static void postcall(lua_State* L, const index_map& indices)
-		{
-			int nurse_index = indices[A];
-			int patient = indices[B];
-
-			object_rep* nurse = static_cast<object_rep*>(lua_touserdata(L, nurse_index));
-
-			// If the nurse isn't an object_rep, just make this a nop.
-			if (nurse == 0)
-				return;
-
-			nurse->add_dependency(L, patient);
-		}
-	};
-
-}}
-
-#if defined (BOOST_MSVC) && (BOOST_MSVC <= 1200)
-
-namespace luabind
-{
-	// most absurd workaround of all time?
-	namespace detail
-	{
-		template<int N>
-		struct size_char_array
-		{
-			char storage[N + 2];
-		};
-
-		template<int N>
-		size_char_array<N> deduce_size(LUABIND_PLACEHOLDER_ARG(N));
-
-		template<class T>
-		struct get_index_workaround
-		{
-			static T t;
-			BOOST_STATIC_CONSTANT(int, value = sizeof(deduce_size(t)) - 2);
-		};
-	}
-
-	template<class A, class B>
-	detail::policy_cons<detail::dependency_policy<detail::get_index_workaround<A>::value
-		, detail::get_index_workaround<B>::value>, detail::null_type> dependency(A,B)
-	{
-		return detail::policy_cons<detail::dependency_policy<
-			detail::get_index_workaround<A>::value, detail::get_index_workaround<B>::value>
-			, detail::null_type>();
-	}
-
-	template<class A>
-	detail::policy_cons<detail::dependency_policy<0
-		, detail::get_index_workaround<A>::value>, detail::null_type>
-	return_internal_reference(A)
-	{
-		return detail::policy_cons<detail::dependency_policy<0
-			, detail::get_index_workaround<A>::value>, detail::null_type>();
-	}
-}
-
-#else
-
-namespace luabind
-{
-	template<int A, int B>
-	detail::policy_cons<detail::dependency_policy<A, B>, detail::null_type>
-	dependency(LUABIND_PLACEHOLDER_ARG(A), LUABIND_PLACEHOLDER_ARG(B))
-	{
-		return detail::policy_cons<detail::dependency_policy<A, B>, detail::null_type>();
-	}
-
-	template<int A>
-	detail::policy_cons<detail::dependency_policy<0, A>, detail::null_type>
-	return_internal_reference(LUABIND_PLACEHOLDER_ARG(A))
-	{
-		return detail::policy_cons<detail::dependency_policy<0, A>, detail::null_type>();
-	}
-}
-
-#endif
-
-#endif // LUABIND_DEPENDENCY_POLICY_HPP_INCLUDED
-

+ 0 - 330
lib/luabind/luabind/detail/call.hpp

@@ -1,330 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#if !BOOST_PP_IS_ITERATING
-
-# ifndef LUABIND_CALL2_080911_HPP
-#  define LUABIND_CALL2_080911_HPP
-
-#  include <luabind/config.hpp>
-
-#  ifdef LUABIND_CPP0x
-#   include <luabind/detail/call_0x.hpp>
-#  else
-
-#  include <boost/mpl/apply_wrap.hpp>
-#  include <boost/mpl/begin_end.hpp>
-#  include <boost/mpl/deref.hpp>
-#  include <boost/mpl/front.hpp>
-#  include <boost/mpl/long.hpp>
-#  include <boost/mpl/size.hpp>
-#  include <boost/preprocessor/control/if.hpp>
-#  include <boost/preprocessor/iteration/iterate.hpp>
-#  include <boost/preprocessor/iteration/local.hpp>
-#  include <boost/preprocessor/repetition/enum.hpp>
-#  include <boost/preprocessor/repetition/enum_trailing_params.hpp>
-#  include <boost/type_traits/is_void.hpp>
-
-#  include <luabind/detail/policy.hpp>
-#  include <luabind/yield_policy.hpp>
-
-namespace luabind { namespace detail {
-
-struct invoke_context;
-
-struct LUABIND_API function_object
-{
-    function_object(lua_CFunction entry)
-      : entry(entry)
-      , next(0)
-    {}
-
-    virtual ~function_object()
-    {}
-
-    virtual int call(
-        lua_State* L, invoke_context& ctx) const = 0;
-    virtual void format_signature(lua_State* L, char const* function) const = 0;
-
-    lua_CFunction entry;
-    std::string name;
-    function_object* next;
-    object keepalive;
-};
-
-struct LUABIND_API invoke_context
-{
-    invoke_context()
-      : best_score((std::numeric_limits<int>::max)())
-      , candidate_index(0)
-    {}
-
-    operator bool() const
-    {
-        return candidate_index == 1;
-    }
-
-    void format_error(lua_State* L, function_object const* overloads) const;
-
-    int best_score;
-    function_object const* candidates[10];
-    int candidate_index;
-};
-
-template <class F, class Signature, class Policies, class IsVoid>
-inline int invoke0(
-    lua_State* L, function_object const& self, invoke_context& ctx
-  , F const& f, Signature, Policies const& policies, IsVoid, mpl::true_)
-{
-    return invoke_member(
-        L, self, ctx, f, Signature(), policies
-      , mpl::long_<mpl::size<Signature>::value - 1>(), IsVoid()
-    );
-}
-
-template <class F, class Signature, class Policies, class IsVoid>
-inline int invoke0(
-    lua_State* L, function_object const& self, invoke_context& ctx,
-    F const& f, Signature, Policies const& policies, IsVoid, mpl::false_)
-{
-    return invoke_normal(
-        L, self, ctx, f, Signature(), policies
-      , mpl::long_<mpl::size<Signature>::value - 1>(), IsVoid()
-    );
-}
-
-template <class F, class Signature, class Policies>
-inline int invoke(
-    lua_State* L, function_object const& self, invoke_context& ctx
-  , F const& f, Signature, Policies const& policies)
-{
-    return invoke0(
-        L, self, ctx, f, Signature(), policies
-      , boost::is_void<typename mpl::front<Signature>::type>()
-      , boost::is_member_function_pointer<F>()
-   );
-}
-
-inline int maybe_yield_aux(lua_State*, int results, mpl::false_)
-{
-    return results;
-}
-
-inline int maybe_yield_aux(lua_State* L, int results, mpl::true_)
-{
-    return lua_yield(L, results);
-}
-
-template <class Policies>
-int maybe_yield(lua_State* L, int results, Policies*)
-{
-    return maybe_yield_aux(
-        L, results, has_policy<Policies, yield_policy>());
-}
-
-inline int sum_scores(int const* first, int const* last)
-{
-    int result = 0;
-
-    for (; first != last; ++first)
-    {
-        if (*first < 0)
-            return *first;
-        result += *first;
-    }
-
-    return result;
-}
-
-#  define LUABIND_INVOKE_NEXT_ITER(n) \
-    typename mpl::next< \
-        BOOST_PP_IF( \
-            n, BOOST_PP_CAT(iter,BOOST_PP_DEC(n)), first) \
-    >::type
-
-#  define LUABIND_INVOKE_NEXT_INDEX(n) \
-    BOOST_PP_IF( \
-        n \
-      , BOOST_PP_CAT(index,BOOST_PP_DEC(n)) + \
-            BOOST_PP_CAT(c,BOOST_PP_DEC(n)).consumed_args() \
-      , 1 \
-    )
-
-#  define LUABIND_INVOKE_COMPUTE_ARITY(n) + BOOST_PP_CAT(c,n).consumed_args()
-
-#  define LUABIND_INVOKE_DECLARE_CONVERTER(n) \
-    typedef LUABIND_INVOKE_NEXT_ITER(n) BOOST_PP_CAT(iter,n); \
-    typedef typename mpl::deref<BOOST_PP_CAT(iter,n)>::type \
-        BOOST_PP_CAT(a,n); \
-    typedef typename find_conversion_policy<n + 1, Policies>::type \
-        BOOST_PP_CAT(p,n); \
-    typename mpl::apply_wrap2< \
-        BOOST_PP_CAT(p,n), BOOST_PP_CAT(a,n), lua_to_cpp>::type BOOST_PP_CAT(c,n); \
-    int const BOOST_PP_CAT(index,n) = LUABIND_INVOKE_NEXT_INDEX(n);
-
-#  define LUABIND_INVOKE_COMPUTE_SCORE(n)                                   \
-    , BOOST_PP_CAT(c,n).match(                                              \
-        L, LUABIND_DECORATE_TYPE(BOOST_PP_CAT(a,n)), BOOST_PP_CAT(index,n))
-
-#  define LUABIND_INVOKE_ARG(z, n, base) \
-    BOOST_PP_CAT(c,base(n)).apply( \
-        L, LUABIND_DECORATE_TYPE(BOOST_PP_CAT(a,base(n))), BOOST_PP_CAT(index,base(n)))
-
-#  define LUABIND_INVOKE_CONVERTER_POSTCALL(n) \
-    BOOST_PP_CAT(c,n).converter_postcall( \
-        L, LUABIND_DECORATE_TYPE(BOOST_PP_CAT(a,n)), BOOST_PP_CAT(index,n));
-
-#  define BOOST_PP_ITERATION_PARAMS_1 \
-    (3, (0, LUABIND_MAX_ARITY, <luabind/detail/call.hpp>))
-#  include BOOST_PP_ITERATE()
-
-#  define LUABIND_INVOKE_VOID
-#  define BOOST_PP_ITERATION_PARAMS_1 \
-    (3, (0, LUABIND_MAX_ARITY, <luabind/detail/call.hpp>))
-#  include BOOST_PP_ITERATE()
-
-#  undef LUABIND_INVOKE_VOID
-#  define LUABIND_INVOKE_MEMBER
-#  define BOOST_PP_ITERATION_PARAMS_1 \
-    (3, (0, LUABIND_MAX_ARITY, <luabind/detail/call.hpp>))
-#  include BOOST_PP_ITERATE()
-
-#  define LUABIND_INVOKE_VOID
-#  define BOOST_PP_ITERATION_PARAMS_1 \
-    (3, (0, LUABIND_MAX_ARITY, <luabind/detail/call.hpp>))
-#  include BOOST_PP_ITERATE()
-
-}} // namespace luabind::detail
-
-# endif // LUABIND_CPP0x
-
-# endif // LUABIND_CALL2_080911_HPP
-
-#else // BOOST_PP_IS_ITERATING
-
-# ifdef LUABIND_INVOKE_MEMBER
-#  define N BOOST_PP_INC(BOOST_PP_ITERATION())
-# else
-#  define N BOOST_PP_ITERATION()
-# endif
-
-template <class F, class Signature, class Policies>
-inline int
-# ifdef LUABIND_INVOKE_MEMBER
-invoke_member
-# else
-invoke_normal
-# endif
-(
-    lua_State* L, function_object const& self, invoke_context& ctx
-  , F const& f, Signature, Policies const&, mpl::long_<N>
-# ifdef LUABIND_INVOKE_VOID
-  , mpl::true_
-# else
-  , mpl::false_
-# endif
-)
-{
-    typedef typename mpl::begin<Signature>::type first;
-# ifndef LUABIND_INVOKE_VOID
-    typedef typename mpl::deref<first>::type result_type;
-    typedef typename find_conversion_policy<0, Policies>::type result_policy;
-    typename mpl::apply_wrap2<
-        result_policy, result_type, cpp_to_lua>::type result_converter;
-# endif
-
-# if N > 0
-#  define BOOST_PP_LOCAL_MACRO(n) LUABIND_INVOKE_DECLARE_CONVERTER(n)
-#  define BOOST_PP_LOCAL_LIMITS (0,N-1)
-#  include BOOST_PP_LOCAL_ITERATE()
-# endif
-
-    int const arity = 0
-# if N > 0
-#  define BOOST_PP_LOCAL_MACRO(n) LUABIND_INVOKE_COMPUTE_ARITY(n)
-#  define BOOST_PP_LOCAL_LIMITS (0,N-1)
-#  include BOOST_PP_LOCAL_ITERATE()
-# endif
-    ;
-
-    int const arguments = lua_gettop(L);
-
-    int score = -1;
-
-    if (arity == arguments)
-    {
-        int const scores[] = {
-            0
-# if N > 0
-#  define BOOST_PP_LOCAL_MACRO(n) LUABIND_INVOKE_COMPUTE_SCORE(n)
-#  define BOOST_PP_LOCAL_LIMITS (0,N-1)
-#  include BOOST_PP_LOCAL_ITERATE()
-# endif
-        };
-
-        score = sum_scores(scores + 1, scores + 1 + N);
-    }
-
-    if (score >= 0 && score < ctx.best_score)
-    {
-        ctx.best_score = score;
-        ctx.candidates[0] = &self;
-        ctx.candidate_index = 1;
-    }
-    else if (score == ctx.best_score)
-    {
-        ctx.candidates[ctx.candidate_index++] = &self;
-    }
-
-    int results = 0;
-
-    if (self.next)
-    {
-        results = self.next->call(L, ctx);
-    }
-
-    if (score == ctx.best_score && ctx.candidate_index == 1)
-    {
-# ifndef LUABIND_INVOKE_VOID
-        result_converter.apply(
-            L,
-# endif
-# ifdef LUABIND_INVOKE_MEMBER
-            (c0.apply(L, LUABIND_DECORATE_TYPE(a0), index0).*f)(
-                BOOST_PP_ENUM(BOOST_PP_DEC(N), LUABIND_INVOKE_ARG, BOOST_PP_INC)
-            )
-# else
-#  define LUABIND_INVOKE_IDENTITY(x) x
-            f(
-                BOOST_PP_ENUM(N, LUABIND_INVOKE_ARG, LUABIND_INVOKE_IDENTITY)
-            )
-#  undef LUABIND_INVOKE_IDENTITY
-# endif
-# ifndef LUABIND_INVOKE_VOID
-        )
-# endif
-        ;
-
-# if N > 0
-#  define BOOST_PP_LOCAL_MACRO(n) LUABIND_INVOKE_CONVERTER_POSTCALL(n)
-#  define BOOST_PP_LOCAL_LIMITS (0,N-1)
-#  include BOOST_PP_LOCAL_ITERATE()
-# endif
-
-        results = maybe_yield(L, lua_gettop(L) - arguments, (Policies*)0);
-
-        int const indices[] = {
-            arguments + results BOOST_PP_ENUM_TRAILING_PARAMS(N, index)
-        };
-
-        policy_list_postcall<Policies>::apply(L, indices);
-    }
-
-    return results;
-}
-
-# undef N
-
-#endif
-

+ 0 - 259
lib/luabind/luabind/detail/call_0x.hpp

@@ -1,259 +0,0 @@
-// Copyright Daniel Wallin 2010. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_DETAIL_CALL_0X_100630_HPP
-# define LUABIND_DETAIL_CALL_0X_100630_HPP
-
-# include <luabind/config.hpp>
-# include <luabind/vector.hpp>
-# include <luabind/yield_policy.hpp>
-# include <luabind/detail/policy.hpp>
-# include <luabind/detail/index_tuple.hpp>
-# include <type_traits>
-
-namespace luabind { namespace detail {
-
-struct invoke_context;
-
-struct LUABIND_API function_object
-{
-    function_object(lua_CFunction entry)
-      : entry(entry)
-      , next(0)
-    {}
-
-    virtual ~function_object()
-    {}
-
-    virtual int call(
-        lua_State* L, invoke_context& ctx) const = 0;
-    virtual void format_signature(lua_State* L, char const* function) const = 0;
-
-    lua_CFunction entry;
-    std::string name;
-    function_object* next;
-    object keepalive;
-};
-
-struct LUABIND_API invoke_context
-{
-    invoke_context()
-      : best_score((std::numeric_limits<int>::max)())
-      , candidate_index(0)
-    {}
-
-    operator bool() const
-    {
-        return candidate_index == 1;
-    }
-
-    void format_error(lua_State* L, function_object const* overloads) const;
-
-    int best_score;
-    function_object const* candidates[10];
-    int candidate_index;
-};
-
-template <class F, class... Args, class Policies>
-inline int invoke(
-    lua_State* L, function_object const& self, invoke_context& ctx
-  , F const& f, vector<Args...>, Policies const& policies)
-{
-    return invoke_aux(
-        L, self, ctx, f, policies, vector<Args...>()
-      , typename make_index_tuple<sizeof...(Args) - 1>::type()
-    );
-}
-
-template <int N, class T, class Policies>
-struct make_arg_converter
-{
-    typedef typename find_conversion_policy<N + 1, Policies>::type generator;
-    typedef typename mpl::apply_wrap2<generator, T, lua_to_cpp>::type type;
-};
-
-template <class R, class Policies>
-struct make_result_converter
-{
-    typedef typename find_conversion_policy<0, Policies>::type generator;
-    typedef typename mpl::apply_wrap2<generator, R, cpp_to_lua>::type type;
-};
-
-struct void_result
-{};
-
-template <class Policies>
-struct make_result_converter<void, Policies>
-{
-    typedef void_result type;
-};
-
-template <class F, class Policies, class R, class... Args, int... Indices>
-inline int invoke_aux(
-    lua_State* L, function_object const& self, invoke_context& ctx
-  , F const& f, Policies const& policies
-  , vector<R, Args...>, index_tuple<Indices...>)
-{
-    typename make_result_converter<R, Policies>::type result_converter;
-
-    return invoke_actual(
-        L, self, ctx, f, policies
-      , vector<R, Args...>(), index_tuple<Indices...>(), result_converter
-      , typename make_arg_converter<Indices, Args, Policies>::type()...
-    );
-}
-
-inline int sum_scores(int const* first, int const* last)
-{
-    int result = 0;
-
-    for (; first != last; ++first)
-    {
-        if (*first < 0)
-            return *first;
-        result += *first;
-    }
-
-    return result;
-}
-
-template <class T, class Converter>
-int compute_score(lua_State* L, Converter& converter, int index)
-{
-    return converter.match(L, LUABIND_DECORATE_TYPE(T), index);
-}
-
-inline int compute_indices(int*, int base)
-{
-    return base;
-}
-
-template <class Converter, class... Rest>
-int compute_indices(
-    int* target, int base, Converter& converter, Rest&... rest)
-{
-    *target = base;
-    return compute_indices(target + 1, base + converter.consumed_args(), rest...);
-}
-
-template <class F, class ResultConverter, class... Args>
-void invoke_function(
-    lua_State* L, F const& f, std::false_type, ResultConverter& result_converter
-  , Args&&... args)
-{
-    result_converter.apply(L, f(std::forward<Args>(args)...));
-}
-
-template <class F, class... Args>
-void invoke_function(
-    lua_State* L, F const& f, std::false_type, void_result, Args&&... args)
-{
-    f(std::forward<Args>(args)...);
-}
-
-template <class F, class ResultConverter, class This, class... Args>
-void invoke_function(
-    lua_State* L, F const& f, std::true_type, ResultConverter& result_converter
-  , This&& this_, Args&&... args)
-{
-    result_converter.apply(L, (this_.*f)(std::forward<Args>(args)...));
-}
-
-template <class F, class This, class... Args>
-void invoke_function(
-    lua_State* L, F const& f, std::true_type, void_result, This&& this_, Args&&... args)
-{
-    (this_.*f)(std::forward<Args>(args)...);
-}
-
-inline int maybe_yield_aux(lua_State*, int results, mpl::false_)
-{
-    return results;
-}
-
-inline int maybe_yield_aux(lua_State* L, int results, mpl::true_)
-{
-    return lua_yield(L, results);
-}
-
-template <class Policies>
-int maybe_yield(lua_State* L, int results, Policies*)
-{
-    return maybe_yield_aux(
-        L, results, has_policy<Policies, yield_policy>());
-}
-
-// Helper that ignores everything passed to it. Used so that we can invoke
-// postcall on converters in a parameter pack expansion.
-template <class... T>
-void ignore(T&&...)
-{}
-
-template <
-    class F, class Policies, class R, class... Args, int... Indices
-  , class ResultConverter, class... Converters
->
-inline int invoke_actual(
-    lua_State* L, function_object const& self, invoke_context& ctx
-  , F const& f, Policies const& policies
-  , vector<R, Args...>, index_tuple<Indices...>
-  , ResultConverter& result_converter, Converters&&... converters)
-{
-    int indices[sizeof...(Args) + 1];
-    int const arity = compute_indices(indices + 1, 1, converters...) - 1;
-
-    int const arguments = lua_gettop(L);
-    int score = -1;
-
-    if (arity == arguments)
-    {
-        int const scores[] = {
-            compute_score<Args>(L, converters, indices[Indices + 1])...
-        };
-
-        score = sum_scores(scores, scores + sizeof...(Args));
-    }
-
-    if (score >= 0 && score < ctx.best_score)
-    {
-        ctx.best_score = score;
-        ctx.candidates[0] = &self;
-        ctx.candidate_index = 1;
-    }
-    else if (score == ctx.best_score)
-    {
-        ctx.candidates[ctx.candidate_index++] = &self;
-    }
-
-    int results = 0;
-
-    if (self.next)
-    {
-        results = self.next->call(L, ctx);
-    }
-
-    if (score == ctx.best_score && ctx.candidate_index == 1)
-    {
-        invoke_function(
-            L, f, std::is_member_function_pointer<F>(), result_converter
-          , converters.apply(L, LUABIND_DECORATE_TYPE(Args), indices[Indices + 1])...
-        );
-
-        ignore(
-            (converters.converter_postcall(
-                L, LUABIND_DECORATE_TYPE(Args), indices[Indices + 1]), 0)...
-        );
-
-        results = maybe_yield(L, lua_gettop(L) - arguments, (Policies*)0);
-        indices[0] = arguments + results;
-
-        policy_list_postcall<Policies>::apply(L, indices);
-    }
-
-    return results;
-}
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_DETAIL_CALL_0X_100630_HPP

+ 0 - 541
lib/luabind/luabind/detail/call_function.hpp

@@ -1,541 +0,0 @@
-// Copyright (c) 2003 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.
-
-
-#if !BOOST_PP_IS_ITERATING
-
-#ifndef LUABIND_CALL_FUNCTION_HPP_INCLUDED
-#define LUABIND_CALL_FUNCTION_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-
-#include <boost/mpl/if.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/mpl/or.hpp>
-#ifndef LUABIND_CPP0x
-# include <boost/preprocessor/repeat.hpp>
-# include <boost/preprocessor/iteration/iterate.hpp>
-# include <boost/preprocessor/repetition/enum.hpp>
-# include <boost/preprocessor/repetition/enum_params.hpp>
-# include <boost/preprocessor/repetition/enum_binary_params.hpp>
-# include <boost/preprocessor/punctuation/comma_if.hpp>
-#endif
-
-#include <luabind/error.hpp>
-#include <luabind/detail/convert_to_lua.hpp>
-#include <luabind/detail/pcall.hpp>
-
-namespace luabind
-{
-	namespace detail
-	{
-
-		// if the proxy_function_caller returns non-void
-			template<class Ret, class Tuple>
-			class proxy_function_caller
-			{
-//			friend class luabind::object;
-			public:
-
-				typedef int(*function_t)(lua_State*, int, int);
-
-				proxy_function_caller(
-					lua_State* L
-					, int params
-					, function_t fun
-					, const Tuple args)
-					: m_state(L)
-					, m_params(params)
-					, m_fun(fun)
-					, m_args(args)
-					, m_called(false)
-				{
-				}
-
-				proxy_function_caller(const proxy_function_caller& rhs)
-					: m_state(rhs.m_state)
-					, m_params(rhs.m_params)
-					, m_fun(rhs.m_fun)
-					, m_args(rhs.m_args)
-					, m_called(rhs.m_called)
-				{
-					rhs.m_called = true;
-				}
-
-				~proxy_function_caller()
-				{
-					if (m_called) return;
-
-					m_called = true;
-					lua_State* L = m_state;
-
-					int top = lua_gettop(L);
-
-					push_args_from_tuple<1>::apply(L, m_args);
-# ifdef LUABIND_CPP0x
-                    if (m_fun(L, std::tuple_size<Tuple>::value, 0))
-# else
-					if (m_fun(L, boost::tuples::length<Tuple>::value, 0))
-# endif
-					{
-						assert(lua_gettop(L) == top - m_params + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw luabind::error(L);
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-									" If you want to handle the error you can use luabind::set_error_callback()");
-						std::terminate();
-
-#endif
-					}
-
-					// pops the return values from the function call
-					stack_pop pop(L, lua_gettop(L) - top + m_params);
-				}
-
-				operator Ret()
-				{
-					typename mpl::apply_wrap2<default_policy,Ret,lua_to_cpp>::type converter;
-
-					m_called = true;
-					lua_State* L = m_state;
-
-					int top = lua_gettop(L);
-
-					push_args_from_tuple<1>::apply(L, m_args);
-# ifdef LUABIND_CPP0x
-                    if (m_fun(L, std::tuple_size<Tuple>::value, 1))
-# else
-					if (m_fun(L, boost::tuples::length<Tuple>::value, 1))
-# endif
-					{
-						assert(lua_gettop(L) == top - m_params + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw luabind::error(L); 
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-	
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-								" If you want to handle the error you can use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-
-					// pops the return values from the function call
-					stack_pop pop(L, lua_gettop(L) - top + m_params);
-
-					if (converter.match(L, LUABIND_DECORATE_TYPE(Ret), -1) < 0)
-					{
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw cast_failed(L, typeid(Ret));
-#else
-						cast_failed_callback_fun e = get_cast_failed_callback();
-						if (e) e(L, typeid(Ret));
-
-						assert(0 && "the lua function's return value could not be converted."
-									" If you want to handle the error you can use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-					return converter.apply(L, LUABIND_DECORATE_TYPE(Ret), -1);
-				}
-
-				template<class Policies>
-				Ret operator[](const Policies& p)
-				{
-					typedef typename detail::find_conversion_policy<0, Policies>::type converter_policy;
-					typename mpl::apply_wrap2<converter_policy,Ret,lua_to_cpp>::type converter;
-
-					m_called = true;
-					lua_State* L = m_state;
-
-					int top = lua_gettop(L);
-
-					detail::push_args_from_tuple<1>::apply(L, m_args, p);
-# ifdef LUABIND_CPP0x
-                    if (m_fun(L, std::tuple_size<Tuple>::value, 1))
-# else
-					if (m_fun(L, boost::tuples::length<Tuple>::value, 1))
-# endif
-					{ 
-						assert(lua_gettop(L) == top - m_params + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw error(L);
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-	
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-								" If you want to handle the error you can use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-
-					// pops the return values from the function call
-					stack_pop pop(L, lua_gettop(L) - top + m_params);
-
-					if (converter.match(L, LUABIND_DECORATE_TYPE(Ret), -1) < 0)
-					{
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw cast_failed(L, typeid(Ret));
-#else
-						cast_failed_callback_fun e = get_cast_failed_callback();
-						if (e) e(L, typeid(Ret));
-
-						assert(0 && "the lua function's return value could not be converted."
-									" If you want to handle the error you can use luabind::set_error_callback()");
-						std::terminate();
-
-#endif
-					}
-
-					return converter.apply(L, LUABIND_DECORATE_TYPE(Ret), -1);
-				}
-
-			private:
-
-				lua_State* m_state;
-				int m_params;
-				function_t m_fun;
-				Tuple m_args;
-				mutable bool m_called;
-
-			};
-
-		// if the proxy_member_caller returns void
-			template<class Tuple>
-			class proxy_function_void_caller
-			{
-			public:
-
-				typedef int(*function_t)(lua_State*, int, int);
-
-				proxy_function_void_caller(
-					lua_State* L
-					, int params
-					, function_t fun
-					, const Tuple args)
-					: m_state(L)
-					, m_params(params)
-					, m_fun(fun)
-					, m_args(args)
-					, m_called(false)
-				{
-				}
-
-				proxy_function_void_caller(const proxy_function_void_caller& rhs)
-					: m_state(rhs.m_state)
-					, m_params(rhs.m_params)
-					, m_fun(rhs.m_fun)
-					, m_args(rhs.m_args)
-					, m_called(rhs.m_called)
-				{
-					rhs.m_called = true;
-				}
-
-				~proxy_function_void_caller()
-				{
-					if (m_called) return;
-
-					m_called = true;
-					lua_State* L = m_state;
-
-					int top = lua_gettop(L);
-
-					push_args_from_tuple<1>::apply(L, m_args);
-# ifdef LUABIND_CPP0x
-                    if (m_fun(L, std::tuple_size<Tuple>::value, 0))
-# else
-					if (m_fun(L, boost::tuples::length<Tuple>::value, 0))
-# endif
-					{
-						assert(lua_gettop(L) == top - m_params + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw luabind::error(L);
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-	
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-								" If you want to handle the error you can use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-					// pops the return values from the function call
-					stack_pop pop(L, lua_gettop(L) - top + m_params);
-				}
-
-				template<class Policies>
-				void operator[](const Policies& p)
-				{
-					m_called = true;
-					lua_State* L = m_state;
-
-					int top = lua_gettop(L);
-
-					detail::push_args_from_tuple<1>::apply(L, m_args, p);
-# ifdef LUABIND_CPP0x
-                    if (m_fun(L, std::tuple_size<Tuple>::value, 0))
-# else
-					if (m_fun(L, boost::tuples::length<Tuple>::value, 0))
-# endif
-					{
-						assert(lua_gettop(L) == top - m_params + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw error(L);
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-	
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-							" If you want to handle the error you can use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-					// pops the return values from the function call
-					stack_pop pop(L, lua_gettop(L) - top + m_params);
-				}
-
-			private:
-
-				lua_State* m_state;
-				int m_params;
-				function_t m_fun;
-				Tuple m_args;
-				mutable bool m_called;
-
-			};
-
-	}
-
-# ifdef LUABIND_CPP0x
-
-
-namespace detail
-{
-
-  template <class R, class... Args>
-  struct make_proxy
-  {
-      typedef proxy_function_caller<R, std::tuple<Args const*...> > type;
-  };
-
-  template <class... Args>
-  struct make_proxy<void, Args...>
-  {
-      typedef proxy_function_void_caller<std::tuple<Args const*...> > type;
-  };
-
-} // namespace detail
-
-template <class R, class... Args>
-typename detail::make_proxy<R, Args...>::type call_function(
-    lua_State* L, char const* name, Args const&... args)
-{
-    assert(name && "luabind::call_function() expects a function name");
-
-    lua_pushstring(L, name);
-    lua_gettable(L, LUA_GLOBALSINDEX);
-
-    typedef typename detail::make_proxy<R, Args...>::type proxy_type;
-    return proxy_type(L, 1, &detail::pcall, std::tuple<Args const*...>(&args...));
-}
-
-template <class R, class... Args>
-typename detail::make_proxy<R, Args...>::type call_function(
-    object const& obj, Args const&... args)
-{
-    obj.push(obj.interpreter());
-
-    typedef typename detail::make_proxy<R, Args...>::type proxy_type;
-    return proxy_type(
-        obj.interpreter(), 1, &detail::pcall, std::tuple<Args const*...>(&args...));
-}
-
-template <class R, class... Args>
-typename detail::make_proxy<R, Args...>::type resume_function(
-    lua_State* L, char const* name, Args const&... args)
-{
-    assert(name && "luabind::call_function() expects a function name");
-
-    lua_pushstring(L, name);
-    lua_gettable(L, LUA_GLOBALSINDEX);
-
-    typedef typename detail::make_proxy<R, Args...>::type proxy_type;
-    return proxy_type(L, 1, &detail::resume_impl, std::tuple<Args const*...>(&args...));
-}
-
-template <class R, class... Args>
-typename detail::make_proxy<R, Args...>::type resume_function(
-    object const& obj, Args const&... args)
-{
-    obj.push(obj.interpreter());
-
-    typedef typename detail::make_proxy<R, Args...>::type proxy_type;
-    return proxy_type(
-        obj.interpreter(), 1, &detail::resume_impl, std::tuple<Args const*...>(&args...));
-}
-
-template <class R, class... Args>
-typename detail::make_proxy<R, Args...>::type resume(
-    lua_State* L, Args const&... args)
-{
-    typedef typename detail::make_proxy<R, Args...>::type proxy_type;
-    return proxy_type(
-        L, 0, &detail::resume_impl, std::tuple<Args const*...>(&args...));
-}
-
-# else // LUABIND_CPP0x
-
-	#define BOOST_PP_ITERATION_PARAMS_1 (4, (0, LUABIND_MAX_ARITY, <luabind/detail/call_function.hpp>, 1))
-	#include BOOST_PP_ITERATE()
-
-# endif // LUABIND_CPP0x
-
-}
-
-#endif // LUABIND_CALL_FUNCTION_HPP_INCLUDED
-
-#else
-#if BOOST_PP_ITERATION_FLAGS() == 1
-
-#define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
-#define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
-
-
-	template<class Ret BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
-	typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type
-	call_function(lua_State* L, const char* name BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_OPERATOR_PARAMS, _) )
-	{
-		assert(name && "luabind::call_function() expects a function name");
-		typedef boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> tuple_t;
-#if BOOST_PP_ITERATION() == 0
-		tuple_t args;
-#else
-		tuple_t args(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), &a));
-#endif
-		typedef typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type proxy_type;
-
-		lua_pushstring(L, name);
-		lua_gettable(L, LUA_GLOBALSINDEX);
-
-		return proxy_type(L, 1, &detail::pcall, args);
-	}
-
-	template<class Ret BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
-	typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type
-	call_function(luabind::object const& obj BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_OPERATOR_PARAMS, _) )
-	{
-		typedef boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> tuple_t;
-#if BOOST_PP_ITERATION() == 0
-		tuple_t args;
-#else
-		tuple_t args(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), &a));
-#endif
-		typedef typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type proxy_type;
-
-		obj.push(obj.interpreter());
-		return proxy_type(obj.interpreter(), 1, &detail::pcall, args);
-	}
-
-	template<class Ret BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
-	typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type
-	resume_function(lua_State* L, const char* name BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_OPERATOR_PARAMS, _) )
-	{
-		assert(name && "luabind::resume_function() expects a function name");
-		typedef boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> tuple_t;
-#if BOOST_PP_ITERATION() == 0
-		tuple_t args;
-#else
-		tuple_t args(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), &a));
-#endif
-		typedef typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type proxy_type;
-
-		lua_pushstring(L, name);
-		lua_gettable(L, LUA_GLOBALSINDEX);
-
-		return proxy_type(L, 1, &detail::resume_impl, args);
-	}
-
-	template<class Ret BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
-	typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type
-	resume_function(luabind::object const& obj BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_OPERATOR_PARAMS, _) )
-	{
-		typedef boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> tuple_t;
-#if BOOST_PP_ITERATION() == 0
-		tuple_t args;
-#else
-		tuple_t args(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), &a));
-#endif
-		typedef typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type proxy_type;
-
-		obj.push(obj.interpreter());
-		return proxy_type(obj.interpreter(), 1, &detail::resume_impl, args);
-	}
-
-	template<class Ret BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
-	typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type
-	resume(lua_State* L BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_OPERATOR_PARAMS, _) )
-	{
-		typedef boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> tuple_t;
-#if BOOST_PP_ITERATION() == 0
-		tuple_t args;
-#else
-		tuple_t args(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), &a));
-#endif
-		typedef typename boost::mpl::if_<boost::is_void<Ret>
-			, luabind::detail::proxy_function_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_function_caller<Ret, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type proxy_type;
-
-		return proxy_type(L, 0, &detail::resume_impl, args);
-	}
-
-
-#undef LUABIND_OPERATOR_PARAMS
-#undef LUABIND_TUPLE_PARAMS
-
-
-#endif
-#endif
-

+ 0 - 425
lib/luabind/luabind/detail/call_member.hpp

@@ -1,425 +0,0 @@
-// Copyright (c) 2003 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.
-
-
-#if !BOOST_PP_IS_ITERATING
-
-#ifndef LUABIND_CALL_MEMBER_HPP_INCLUDED
-#define LUABIND_CALL_MEMBER_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/convert_to_lua.hpp>
-#include <luabind/detail/pcall.hpp>
-#include <luabind/error.hpp>
-#include <luabind/detail/stack_utils.hpp>
-#include <luabind/object.hpp> // TODO: REMOVE DEPENDENCY
-
-#ifndef LUABIND_CPP0x
-# include <boost/tuple/tuple.hpp>
-
-# include <boost/preprocessor/control/if.hpp>
-# include <boost/preprocessor/facilities/expand.hpp>
-# include <boost/preprocessor/repetition/enum.hpp>
-#else
-# include <tuple>
-#endif
-
-#include <boost/mpl/apply_wrap.hpp>
-
-namespace luabind
-{
-	namespace detail
-	{
-
-		namespace mpl = boost::mpl;
-
-		// if the proxy_member_caller returns non-void
-			template<class Ret, class Tuple>
-			class proxy_member_caller
-			{
-//			friend class luabind::object;
-			public:
-
-				proxy_member_caller(lua_State* L_, const Tuple args)
-					: L(L_)
-					, m_args(args)
-					, m_called(false)
-				{
-				}
-
-				proxy_member_caller(const proxy_member_caller& rhs)
-					: L(rhs.L)
-					, m_args(rhs.m_args)
-					, m_called(rhs.m_called)
-				{
-					rhs.m_called = true;
-				}
-
-				~proxy_member_caller()
-				{
-					if (m_called) return;
-
-					m_called = true;
-
-					// don't count the function and self-reference
-					// since those will be popped by pcall
-					int top = lua_gettop(L) - 2;
-
-					// pcall will pop the function and self reference
-					// and all the parameters
-
-					push_args_from_tuple<1>::apply(L, m_args);
-# ifdef LUABIND_CPP0x
-                    if (pcall(L, std::tuple_size<Tuple>::value + 1, 0))
-# else
-					if (pcall(L, boost::tuples::length<Tuple>::value + 1, 0))
-# endif
-					{
-						assert(lua_gettop(L) == top + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw luabind::error(L);
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-	
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-								"If you want to handle this error use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-					// pops the return values from the function
-					stack_pop pop(L, lua_gettop(L) - top);
-				}
-
-				operator Ret()
-				{
-					typename mpl::apply_wrap2<default_policy,Ret,lua_to_cpp>::type converter;
-
-					m_called = true;
-
-					// don't count the function and self-reference
-					// since those will be popped by pcall
-					int top = lua_gettop(L) - 2;
-
-					// pcall will pop the function and self reference
-					// and all the parameters
-					push_args_from_tuple<1>::apply(L, m_args);
-# ifdef LUABIND_CPP0x
-                    if (pcall(L, std::tuple_size<Tuple>::value + 1, 1))
-# else
-					if (pcall(L, boost::tuples::length<Tuple>::value + 1, 1))
-# endif
-					{
-						assert(lua_gettop(L) == top + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw luabind::error(L); 
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-	
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-							"If you want to handle this error use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-
-					// pops the return values from the function
-					stack_pop pop(L, lua_gettop(L) - top);
-
-					if (converter.match(L, LUABIND_DECORATE_TYPE(Ret), -1) < 0)
-					{
-						assert(lua_gettop(L) == top + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw cast_failed(L, typeid(Ret));
-#else
-						cast_failed_callback_fun e = get_cast_failed_callback();
-						if (e) e(L, typeid(Ret));
-
-						assert(0 && "the lua function's return value could not be converted."
-							"If you want to handle this error use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-
-					return converter.apply(L, LUABIND_DECORATE_TYPE(Ret), -1);
-				}
-
-				template<class Policies>
-				Ret operator[](const Policies& p)
-				{
-					typedef typename find_conversion_policy<0, Policies>::type converter_policy;
-					typename mpl::apply_wrap2<converter_policy,Ret,lua_to_cpp>::type converter;
-
-					m_called = true;
-
-					// don't count the function and self-reference
-					// since those will be popped by pcall
-					int top = lua_gettop(L) - 2;
-
-					// pcall will pop the function and self reference
-					// and all the parameters
-
-					detail::push_args_from_tuple<1>::apply(L, m_args, p);
-# ifdef LUABIND_CPP0x
-                    if (pcall(L, std::tuple_size<Tuple>::value + 1, 1))
-# else
-					if (pcall(L, boost::tuples::length<Tuple>::value + 1, 1))
-# endif
-					{
-						assert(lua_gettop(L) == top + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw error(L);
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-	
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-							"If you want to handle this error use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-
-					// pops the return values from the function
-					stack_pop pop(L, lua_gettop(L) - top);
-
-					if (converter.match(L, LUABIND_DECORATE_TYPE(Ret), -1) < 0)
-					{
-						assert(lua_gettop(L) == top + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw cast_failed(L, typeid(Ret));
-#else
-						cast_failed_callback_fun e = get_cast_failed_callback();
-						if (e) e(L, typeid(Ret));
-
-						assert(0 && "the lua function's return value could not be converted."
-							"If you want to handle this error use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-
-					return converter.apply(L, LUABIND_DECORATE_TYPE(Ret), -1);
-				}
-
-			private:
-
-				lua_State* L;
-				Tuple m_args;
-				mutable bool m_called;
-
-			};
-
-		// if the proxy_member_caller returns void
-			template<class Tuple>
-			class proxy_member_void_caller
-			{
-			friend class luabind::object;
-			public:
-
-				proxy_member_void_caller(lua_State* L_, const Tuple args)
-					: L(L_)
-					, m_args(args)
-					, m_called(false)
-				{
-				}
-
-				proxy_member_void_caller(const proxy_member_void_caller& rhs)
-					: L(rhs.L)
-					, m_args(rhs.m_args)
-					, m_called(rhs.m_called)
-				{
-					rhs.m_called = true;
-				}
-
-				~proxy_member_void_caller()
-				{
-					if (m_called) return;
-
-					m_called = true;
-
-					// don't count the function and self-reference
-					// since those will be popped by pcall
-					int top = lua_gettop(L) - 2;
-
-					// pcall will pop the function and self reference
-					// and all the parameters
-
-					push_args_from_tuple<1>::apply(L, m_args);
-# ifdef LUABIND_CPP0x
-                    if (pcall(L, std::tuple_size<Tuple>::value + 1, 0))
-# else
-					if (pcall(L, boost::tuples::length<Tuple>::value + 1, 0))
-# endif
-					{
-						assert(lua_gettop(L) == top + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw luabind::error(L);
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-	
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-							"If you want to handle this error use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-					// pops the return values from the function
-					stack_pop pop(L, lua_gettop(L) - top);
-				}
-
-				template<class Policies>
-				void operator[](const Policies& p)
-				{
-					m_called = true;
-
-					// don't count the function and self-reference
-					// since those will be popped by pcall
-					int top = lua_gettop(L) - 2;
-
-					// pcall will pop the function and self reference
-					// and all the parameters
-
-					detail::push_args_from_tuple<1>::apply(L, m_args, p);
-# ifdef LUABIND_CPP0x
-                    if (pcall(L, std::tuple_size<Tuple>::value + 1, 0))
-# else
-					if (pcall(L, boost::tuples::length<Tuple>::value + 1, 0))
-# endif
-					{
-						assert(lua_gettop(L) == top + 1);
-#ifndef LUABIND_NO_EXCEPTIONS
-						throw error(L);
-#else
-						error_callback_fun e = get_error_callback();
-						if (e) e(L);
-	
-						assert(0 && "the lua function threw an error and exceptions are disabled."
-							"If you want to handle this error use luabind::set_error_callback()");
-						std::terminate();
-#endif
-					}
-					// pops the return values from the function
-					stack_pop pop(L, lua_gettop(L) - top);
-				}
-
-			private:
-				lua_State* L;
-				Tuple m_args;
-				mutable bool m_called;
-
-			};
-
-	} // detail
-
-# ifdef LUABIND_CPP0x
-
-namespace detail
-{
-
-  template <class R, class... Args>
-  struct make_member_proxy
-  {
-      typedef proxy_member_caller<R, std::tuple<Args const*...> > type;
-  };
-
-  template <class... Args>
-  struct make_member_proxy<void, Args...>
-  {
-      typedef proxy_member_void_caller<std::tuple<Args const*...> > type;
-  };
-
-} // namespace detail
-
-template <class R, class... Args>
-typename detail::make_member_proxy<R, Args...>::type call_member(
-    object const& obj, char const* name, Args const&... args)
-{
-    // get the function
-    obj.push(obj.interpreter());
-    lua_pushstring(obj.interpreter(), name);
-    lua_gettable(obj.interpreter(), -2);
-    // duplicate the self-object
-    lua_pushvalue(obj.interpreter(), -2);
-    // remove the bottom self-object
-    lua_remove(obj.interpreter(), -3);
-
-    typedef typename detail::make_member_proxy<R, Args...>::type proxy_type;
-    return proxy_type(obj.interpreter(), std::tuple<Args const*...>(&args...));
-}
-
-# else // LUABIND_CPP0x
-
-	#define BOOST_PP_ITERATION_PARAMS_1 (4, (0, LUABIND_MAX_ARITY, <luabind/detail/call_member.hpp>, 1))
-	#include BOOST_PP_ITERATE()
-
-# endif
-
-}
-
-#endif // LUABIND_CALL_MEMBER_HPP_INCLUDED
-
-#else
-#if BOOST_PP_ITERATION_FLAGS() == 1
-
-#define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
-#define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
-
-	template<class R BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
-	typename boost::mpl::if_<boost::is_void<R>
-			, luabind::detail::proxy_member_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_member_caller<R, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type
-	call_member(object const& obj, const char* name BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_OPERATOR_PARAMS, _))
-	{
-		typedef boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> tuple_t;
-#if BOOST_PP_ITERATION() == 0
-		tuple_t args;
-#else
-		tuple_t args(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), &a));
-#endif
-
-		typedef typename boost::mpl::if_<boost::is_void<R>
-			, luabind::detail::proxy_member_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-			, luabind::detail::proxy_member_caller<R, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type proxy_type;
-
-		// this will be cleaned up by the proxy object
-		// once the call has been made
-
-		// get the function
-		obj.push(obj.interpreter());
-		lua_pushstring(obj.interpreter(), name);
-		lua_gettable(obj.interpreter(), -2);
-		// duplicate the self-object
-		lua_pushvalue(obj.interpreter(), -2);
-		// remove the bottom self-object
-		lua_remove(obj.interpreter(), -3);
-
-		// now the function and self objects
-		// are on the stack. These will both
-		// be popped by pcall
-		return proxy_type(obj.interpreter(), args);
-	}
-
-#undef LUABIND_OPERATOR_PARAMS
-#undef LUABIND_TUPLE_PARAMS
-
-#endif
-#endif
-

+ 0 - 66
lib/luabind/luabind/detail/call_operator_iterate.hpp

@@ -1,66 +0,0 @@
-// 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.
-
-#define N BOOST_PP_ITERATION()
-
-#define LUABIND_UNWRAP_PARAMETER(z, n, _) \
-    typename detail::unwrap_parameter_type<T, BOOST_PP_CAT(A, n)>::type \
-        BOOST_PP_CAT(_, n)
-
-template<class Self BOOST_PP_ENUM_TRAILING_PARAMS(N, class A)>
-struct BOOST_PP_CAT(call_operator, N) 
-    : detail::operator_<
-          BOOST_PP_CAT(call_operator, N)<
-              Self BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
-          >
-      >
-{
-    BOOST_PP_CAT(call_operator, N)(int) {}
-
-    template<class T, class Policies>
-    struct apply
-    {
-        static void execute(
-            lua_State* L
-          , typename detail::unwrap_parameter_type<T, Self>::type self
-            BOOST_PP_ENUM_TRAILING(N, LUABIND_UNWRAP_PARAMETER, _)
-        )
-        {
-            using namespace detail;
-            operator_result(
-                L
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-              , self(BOOST_PP_ENUM_PARAMS(N, _))
-#else
-              , (self(BOOST_PP_ENUM_PARAMS(N, _)), detail::operator_void_return())
-#endif
-              , (Policies*)0
-            );
-        } 
-    };
-
-    static char const* name() { return "__call"; }
-};
-
-#undef LUABIND_UNWRAP_PARAMETER
-#undef N
-

+ 0 - 85
lib/luabind/luabind/detail/class_registry.hpp

@@ -1,85 +0,0 @@
-// Copyright (c) 2003 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_CLASS_REGISTRY_HPP_INCLUDED
-#define LUABIND_CLASS_REGISTRY_HPP_INCLUDED
-
-#include <map>
-
-#include <luabind/config.hpp>
-#include <luabind/open.hpp>
-#include <luabind/typeid.hpp>
-
-namespace luabind { namespace detail
-{
-	class class_rep;
-
-	struct LUABIND_API class_registry
-	{
-		class_registry(lua_State* L);
-
-		static class_registry* get_registry(lua_State* L);
-
-		int cpp_instance() const { return m_instance_metatable; }
-		int cpp_class() const { return m_cpp_class_metatable; }
-
-		int lua_instance() const { return m_instance_metatable; }
-		int lua_class() const { return m_lua_class_metatable; }
-		int lua_function() const { return m_lua_function_metatable; }
-
-		void add_class(type_id const& info, class_rep* crep);
-
-		class_rep* find_class(type_id const& info) const;
-
-        std::map<type_id, class_rep*> const& get_classes() const
-        {
-            return m_classes;
-        }
-
-	private:
-
-		std::map<type_id, class_rep*> m_classes;
-
-		// this is a lua reference that points to the lua table
-		// that is to be used as meta table for all C++ class 
-		// instances. It is a kind of v-table.
-		int m_instance_metatable;
-
-		// this is a lua reference to the metatable to be used
-		// for all classes defined in C++.
-		int m_cpp_class_metatable;
-
-		// this is a lua reference to the metatable to be used
-		// for all classes defined in lua
-		int m_lua_class_metatable;
-
-		// this metatable only contains a destructor
-		// for luabind::Detail::free_functions::function_rep
-		int m_lua_function_metatable;
-
-	};
-
-}}
-
-#endif // LUABIND_CLASS_REGISTRY_HPP_INCLUDED
-

+ 0 - 211
lib/luabind/luabind/detail/class_rep.hpp

@@ -1,211 +0,0 @@
-// Copyright (c) 2003 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_CLASS_REP_HPP_INCLUDED
-#define LUABIND_CLASS_REP_HPP_INCLUDED
-
-#include <boost/limits.hpp>
-
-#include <string>
-#include <utility>
-#include <vector>
-
-#include <luabind/config.hpp>
-#include <luabind/lua_include.hpp>
-#include <luabind/detail/garbage_collector.hpp>
-#include <luabind/detail/operator_id.hpp>
-#include <luabind/detail/class_registry.hpp>
-#include <luabind/error.hpp>
-#include <luabind/handle.hpp>
-#include <luabind/detail/primitives.hpp>
-#include <luabind/typeid.hpp>
-#include <luabind/detail/ref.hpp>
-
-namespace luabind { namespace detail
-{
-
-	LUABIND_API std::string stack_content_by_name(lua_State* L, int start_index);
-
-	struct class_registration;
-
-	struct conversion_storage;
-
-	// This function is used as a tag to identify "properties".
-	LUABIND_API int property_tag(lua_State*);
-
-	// this is class-specific information, poor man's vtable
-	// this is allocated statically (removed by the compiler)
-	// a pointer to this structure is stored in the lua tables'
-	// metatable with the name __classrep
-	// it is used when matching parameters to function calls
-	// to determine possible implicit casts
-	// it is also used when finding the best match for overloaded
-	// methods
-
-    class cast_graph;
-    class class_id_map;
-
-	class LUABIND_API class_rep
-	{
-	friend struct class_registration;
-	friend int super_callback(lua_State*);
-//TODO: avoid the lua-prefix
-	friend int lua_class_gettable(lua_State*);
-	friend int lua_class_settable(lua_State*);
-	friend int static_class_gettable(lua_State*);
-	public:
-
-		enum class_type
-		{
-			cpp_class = 0,
-			lua_class = 1
-		};
-
-		// EXPECTS THE TOP VALUE ON THE LUA STACK TO
-		// BE THE USER DATA WHERE THIS CLASS IS BEING
-		// INSTANTIATED!
-		class_rep(type_id const& type
-			, const char* name
-			, lua_State* L
-        );
-
-		// used when creating a lua class
-		// EXPECTS THE TOP VALUE ON THE LUA STACK TO
-		// BE THE USER DATA WHERE THIS CLASS IS BEING
-		// INSTANTIATED!
-		class_rep(lua_State* L, const char* name);
-
-		~class_rep();
-
-		std::pair<void*,void*> allocate(lua_State* L) const;
-
-		// this is called as metamethod __call on the class_rep.
-		static int constructor_dispatcher(lua_State* L);
-
-		struct base_info
-		{
-			int pointer_offset; // the offset added to the pointer to obtain a basepointer (due to multiple-inheritance)
-			class_rep* base;
-		};
-
-		void add_base_class(const base_info& binfo);
-
-		const std::vector<base_info>& bases() const throw() { return m_bases; }
-
-		void set_type(type_id const& t) { m_type = t; }
-		type_id const& type() const throw() { return m_type; }
-
-		const char* name() const throw() { return name_; }
-
-		// the lua reference to the metatable for this class' instances
-		int metatable_ref() const throw() { return m_instance_metatable; }
-
-		void get_table(lua_State* L) const { m_table.push(L); }
-		void get_default_table(lua_State* L) const { m_default_table.push(L); }
-
-		class_type get_class_type() const { return m_class_type; }
-
-		void add_static_constant(const char* name, int val);
-
-		static int super_callback(lua_State* L);
-
-		static int lua_settable_dispatcher(lua_State* L);
-
-		// called from the metamethod for __index
-		// obj is the object pointer
-		static int static_class_gettable(lua_State* L);
-
-		bool has_operator_in_lua(lua_State*, int id);
-
-        cast_graph const& casts() const
-        {
-            return *m_casts;
-        }
-
-        class_id_map const& classes() const
-        {
-            return *m_classes;
-        }
-
-	private:
-
-		void cache_operators(lua_State*);
-
-		// this is a pointer to the type_info structure for
-		// this type
-		// warning: this may be a problem when using dll:s, since
-		// typeid() may actually return different pointers for the same
-		// type.
-		type_id m_type;
-
-		// a list of info for every class this class derives from
-		// the information stored here is sufficient to do
-		// type casts to the base classes
-		std::vector<base_info> m_bases;
-
-		// the class' name (as given when registered to lua with class_)
-		const char* name_;
-
-		// a reference to this structure itself. Since this struct
-		// is kept inside lua (to let lua collect it when lua_close()
-		// is called) we need to lock it to prevent collection.
-		// the actual reference is not currently used.
-		detail::lua_reference m_self_ref;
-
-		// this should always be used when accessing
-		// members in instances of a class.
-		// this table contains c closures for all
-		// member functions in this class, they
-		// may point to both static and virtual functions
-		handle m_table;
-
-		// this table contains default implementations of the
-		// virtual functions in m_table.
-		handle m_default_table;
-
-		// the type of this class.. determines if it's written in c++ or lua
-		class_type m_class_type;
-
-		// this is a lua reference that points to the lua table
-		// that is to be used as meta table for all instances
-		// of this class.
-		int m_instance_metatable;
-
-		std::map<const char*, int, ltstr> m_static_constants;
-
-		// the first time an operator is invoked
-		// we check the associated lua table
-		// and cache the result
-		int m_operator_cache;
-
-        cast_graph* m_casts;
-        class_id_map* m_classes;
-	};
-
-	bool is_class_rep(lua_State* L, int index);
-
-}}
-
-//#include <luabind/detail/overload_rep_impl.hpp>
-
-#endif // LUABIND_CLASS_REP_HPP_INCLUDED

+ 0 - 142
lib/luabind/luabind/detail/constructor.hpp

@@ -1,142 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#if !BOOST_PP_IS_ITERATING
-
-# ifndef LUABIND_DETAIL_CONSTRUCTOR_081018_HPP
-#  define LUABIND_DETAIL_CONSTRUCTOR_081018_HPP
-
-#  include <luabind/get_main_thread.hpp>
-#  include <luabind/object.hpp>
-#  include <luabind/wrapper_base.hpp>
-#  include <luabind/detail/inheritance.hpp>
-
-#  ifndef LUABIND_CPP0x
-#   include <boost/preprocessor/iteration/iterate.hpp>
-#   include <boost/preprocessor/iteration/local.hpp>
-#   include <boost/preprocessor/repetition/enum_params.hpp>
-#   include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#  endif
-
-namespace luabind { namespace detail {
-
-inline void inject_backref(lua_State*, void*, void*)
-{}
-
-template <class T>
-void inject_backref(lua_State* L, T* p, wrap_base*)
-{
-    weak_ref(get_main_thread(L), L, 1).swap(wrap_access::ref(*p));
-}
-
-#  ifdef LUABIND_CPP0x
-
-template <class T, class Pointer, class Signature>
-struct construct;
-
-template <class T, class Pointer, class R, class Self, class... Args>
-struct construct<T, Pointer, vector<R, Self, Args...> >
-{
-    typedef pointer_holder<Pointer, T> holder_type;
-
-    void operator()(argument const& self_, Args... args) const
-    {
-        object_rep* self = touserdata<object_rep>(self_);
-
-        std::auto_ptr<T> instance(new T(args...));
-        inject_backref(self_.interpreter(), instance.get(), instance.get());
-
-        void* naked_ptr = instance.get();
-        Pointer ptr(instance.release());
-
-        void* storage = self->allocate(sizeof(holder_type));
-
-        self->set_instance(new (storage) holder_type(
-            ptr, registered_class<T>::id, naked_ptr));
-    }
-};
-
-#   else // LUABIND_CPP0x
-
-template <std::size_t Arity, class T, class Pointer, class Signature>
-struct construct_aux;
-
-template <class T, class Pointer, class Signature>
-struct construct
-  : construct_aux<mpl::size<Signature>::value - 2, T, Pointer, Signature>
-{};
-
-template <class T, class Pointer, class Signature>
-struct construct_aux<0, T, Pointer, Signature>
-{
-    typedef pointer_holder<Pointer, T> holder_type;
-
-    void operator()(argument const& self_) const
-    {
-        object_rep* self = touserdata<object_rep>(self_);
-
-        std::auto_ptr<T> instance(new T);
-        inject_backref(self_.interpreter(), instance.get(), instance.get());
-
-        void* naked_ptr = instance.get();
-        Pointer ptr(instance.release());
-
-        void* storage = self->allocate(sizeof(holder_type));
-
-        self->set_instance(new (storage) holder_type(
-            ptr, registered_class<T>::id, naked_ptr));
-    }
-};
-
-#  define BOOST_PP_ITERATION_PARAMS_1 \
-    (3, (1, LUABIND_MAX_ARITY, <luabind/detail/constructor.hpp>))
-#  include BOOST_PP_ITERATE()
-
-#  endif // LUABIND_CPP0x
-
-}} // namespace luabind::detail
-
-# endif // LUABIND_DETAIL_CONSTRUCTOR_081018_HPP
-
-#else // !BOOST_PP_IS_ITERATING
-
-# define N BOOST_PP_ITERATION()
-
-template <class T, class Pointer, class Signature>
-struct construct_aux<N, T, Pointer, Signature>
-{
-    typedef typename mpl::begin<Signature>::type first;
-    typedef typename mpl::next<first>::type iter0;
-
-# define BOOST_PP_LOCAL_MACRO(n) \
-    typedef typename mpl::next< \
-        BOOST_PP_CAT(iter,BOOST_PP_DEC(n))>::type BOOST_PP_CAT(iter,n); \
-    typedef typename BOOST_PP_CAT(iter,n)::type BOOST_PP_CAT(a,BOOST_PP_DEC(n));
-
-# define BOOST_PP_LOCAL_LIMITS (1,N)
-# include BOOST_PP_LOCAL_ITERATE()
-
-    typedef pointer_holder<Pointer, T> holder_type;
-
-    void operator()(argument const& self_, BOOST_PP_ENUM_BINARY_PARAMS(N,a,_)) const
-    {
-        object_rep* self = touserdata<object_rep>(self_);
-
-        std::auto_ptr<T> instance(new T(BOOST_PP_ENUM_PARAMS(N,_)));
-        inject_backref(self_.interpreter(), instance.get(), instance.get());
-
-        void* naked_ptr = instance.get();
-        Pointer ptr(instance.release());
-
-        void* storage = self->allocate(sizeof(holder_type));
-
-        self->set_instance(new (storage) holder_type(
-            ptr, registered_class<T>::id, naked_ptr));
-    }
-};
-
-# undef N
-
-#endif
-

+ 0 - 41
lib/luabind/luabind/detail/conversion_storage.hpp

@@ -1,41 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_CONVERSION_STORAGE_080930_HPP
-# define LUABIND_CONVERSION_STORAGE_080930_HPP
-
-# include <luabind/config.hpp>
-# include <boost/aligned_storage.hpp>
-
-namespace luabind { namespace detail {
-
-typedef void(*destruction_function)(void*);
-
-// This is used by the converters in policy.hpp, and
-// class_rep::convert_to as temporary storage when constructing
-// holders.
-
-struct conversion_storage
-{
-    conversion_storage()
-      : destructor(0)
-    {}
-
-    ~conversion_storage()
-    {
-        if (destructor)
-            destructor(&data);
-    }
-
-    // Unfortunately the converters currently doesn't have access to
-    // the actual type being converted when this is instantiated, so
-    // we have to guess a max size.
-    boost::aligned_storage<128> data;
-    destruction_function destructor;
-};
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_CONVERSION_STORAGE_080930_HPP
-

+ 0 - 92
lib/luabind/luabind/detail/convert_to_lua.hpp

@@ -1,92 +0,0 @@
-// Copyright (c) 2003 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_CONVERT_TO_LUA_HPP_INCLUDED
-#define LUABIND_CONVERT_TO_LUA_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/policy.hpp>
-#include <boost/ref.hpp>
-
-#include <boost/mpl/apply_wrap.hpp>
-
-namespace luabind { namespace detail
-{
-	template<bool IsReferenceWrapper = false>
-	struct unwrap_ref
-	{
-		template<class T>
-		static const T& get(const T& r) { return r; }
-
-		template<class T>
-		struct apply
-		{
-			typedef T type;
-		};
-	};
-
-	template<>
-	struct unwrap_ref<true>
-	{
-		template<class T>
-		static T& get(const boost::reference_wrapper<T>& r) { return r.get(); }
-
-		template<class T>
-		struct apply
-		{
-			typedef typename T::type& type;
-		};
-	};
-
-	namespace mpl = boost::mpl;
-	
-	template<class T>
-	void convert_to_lua(lua_State* L, const T& v)
-	{
-		typedef typename mpl::apply_wrap1<
-			unwrap_ref<boost::is_reference_wrapper<T>::value>
-		  , T
-		>::type value_type;
-
-		typename mpl::apply_wrap2<default_policy,value_type,cpp_to_lua>::type converter;
-
-		converter.apply(L, unwrap_ref<boost::is_reference_wrapper<T>::value>::get(v));
-	}
-
-	template<int Index, class T, class Policies>
-	void convert_to_lua_p(lua_State* L, const T& v, const Policies&)
-	{
-		typedef typename mpl::apply_wrap1<
-			unwrap_ref<boost::is_reference_wrapper<T>::value>
-		  , T
-		>::type value_type;
-
-		typedef typename find_conversion_policy<Index, Policies>::type converter_policy;
-		typename mpl::apply_wrap2<converter_policy,value_type,cpp_to_lua>::type converter;
-
-		converter.apply(L, unwrap_ref<boost::is_reference_wrapper<T>::value>::get(v));
-	}
-}}
-
-#endif
-

+ 0 - 55
lib/luabind/luabind/detail/debug.hpp

@@ -1,55 +0,0 @@
-// Copyright (c) 2003 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_DEBUG_HPP_INCLUDED
-#define LUABIND_DEBUG_HPP_INCLUDED
-
-#ifndef NDEBUG
-
-#include <luabind/lua_include.hpp>
-#include <cassert>
-
-namespace luabind { namespace detail
-{
-	struct stack_checker_type
-	{
-		stack_checker_type(lua_State* L)
-			: m_L(L)
-			, m_stack(lua_gettop(m_L))
-		{}
-
-		~stack_checker_type()
-		{
-			assert(m_stack == lua_gettop(m_L));
-		}
-
-		lua_State* m_L;
-		int m_stack;
-	};
-
-}}
-#define LUABIND_CHECK_STACK(L) luabind::detail::stack_checker_type stack_checker_object(L)
-#else
-#define LUABIND_CHECK_STACK(L) do {} while (0)
-#endif
-
-#endif // LUABIND_DEBUG_HPP_INCLUDED

+ 0 - 266
lib/luabind/luabind/detail/decorate_type.hpp

@@ -1,266 +0,0 @@
-// Copyright (c) 2003 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_DECORATE_TYPE_HPP_INCLUDED
-#define LUABIND_DECORATE_TYPE_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/primitives.hpp>
-
-namespace luabind { namespace detail
-{
-
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-	template<class T>
-	struct decorated_type
-	{
-		static by_value<T> t;
-		static inline by_value<T>& get() { return /*by_value<T>()*/t; }
-	};
-
-	template<class T>
-	by_value<T> decorated_type<T>::t;
-
-	template<class T>
-	struct decorated_type<T*>
-	{
-		static by_pointer<T> t;
-		static inline by_pointer<T>& get() { return /*by_pointer<T>()*/t; }
-	};
-
-	template<class T>
-	by_pointer<T> decorated_type<T*>::t;
-
-	template<class T>
-	struct decorated_type<const T*>
-	{
-		static by_const_pointer<T> t;
-		static inline by_const_pointer<T> get() { return /*by_const_pointer<T>()*/t; }
-	};
-
-	template<class T>
-	by_const_pointer<T> decorated_type<const T*>::t;
-
-	template<class T>
-	struct decorated_type<const T* const>
-	{
-		static by_const_pointer<T> t;
-		static inline by_const_pointer<T>& get() { return /*by_const_pointer<T>()*/t; }
-	};
-
-	template<class T>
-	by_const_pointer<T> decorated_type<const T* const>::t;
-
-	template<class T>
-	struct decorated_type<T&>
-	{
-		static by_reference<T> t;
-		static inline by_reference<T>& get() { return /*by_reference<T>()*/t; }
-	};
-
-	template<class T>
-	by_reference<T> decorated_type<T&>::t;
-
-	template<class T>
-	struct decorated_type<const T&>
-	{
-		static by_const_reference<T> t;
-		static inline by_const_reference<T>& get() { return /*by_const_reference<T>()*/t; }
-	};
-
-	template<class T>
-	by_const_reference<T> decorated_type<const T&>::t;
-
-	#define LUABIND_DECORATE_TYPE(t) luabind::detail::decorated_type<t>::get()
-
-#else
-
-#include <boost/type_traits/is_array.hpp>
-
-	namespace
-	{
-		LUABIND_ANONYMOUS_FIX char decorated_type_array[64];
-	}
-
-	template<class T>
-	struct decorated_type_cref_impl
-	{
-#if defined(BOOST_MSVC) && BOOST_MSVC == 1200
-		template<class U>
-		static by_const_reference<U> get(const U&)
-		{
-			return by_const_reference<U>();
-		}
-		static T data() { return reinterpret_cast<T>(decorated_type_array); }
-#else
-	
-		static void(*data())(T)
-		{ return (void(*)(T))0; }
-
-		template<class U>
-		static by_const_reference<U> get(void(*f)(const U&))
-		{ return by_const_reference<U>(); }
-#endif
-	};
-
-	template<class T>
-	struct decorated_type_ref_impl
-	{
-#if defined(BOOST_MSVC) && BOOST_MSVC == 1200
-		template<class U>
-		static by_reference<U> get(U&)
-		{
-			return by_reference<U>();
-		}
-		static T data() { return reinterpret_cast<T>(decorated_type_array); }
-#else
-		static void(*data())(T)
-		{ return (void(*)(T))0; }
-
-		template<class U>
-		static by_reference<U> get(void(*)(U&))
-		{ return by_reference<U>(); }
-#endif
-	};
-
-	template<class T>
-	struct decorated_type_cptr_impl
-	{
-#if defined(BOOST_MSVC) && BOOST_MSVC == 1200
-		template<class U>
-		static by_const_pointer<U> get(const U*)
-		{
-			return by_const_pointer<U>();
-		}
-		static T& data() { return reinterpret_cast<T&>(decorated_type_array); }
-#else
-		static void(*data())(T)
-		{ return (void(*)(T))0; }
-
-		template<class U>
-		static by_const_pointer<U> get(void(*)(const U*))
-		{ return by_const_pointer<U>(); }
-#endif
-	};
-
-	template<class T>
-	struct decorated_type_ptr_impl
-	{
-#if defined(BOOST_MSVC) && BOOST_MSVC == 1200
-		template<class U>
-		static by_pointer<U> get(U*)
-		{
-			return by_pointer<U>();
-		}
-		static T& data() { return reinterpret_cast<T&>(decorated_type_array); }
-#else
-		static void(*data())(T)
-		{ return (void(*)(T))0; }
-
-		template<class U>
-		static by_pointer<U> get(void(*)(U*))
-		{ return by_pointer<U>(); }
-#endif
-	};
-
-	template<class T>
-	struct decorated_type_value_impl
-	{
-#if defined(BOOST_MSVC) && BOOST_MSVC == 1200
-		template<class U>
-		static by_value<U> get(U&)
-		{
-			return by_value<U>();
-		}
-		static T& data() { return reinterpret_cast<T&>(decorated_type_array); }
-#else
-		static void(*data())(T&)
-		{ return (void(*)(T&))0; }
-
-		template<class U>
-		static by_value<U> get(void(*)(U&))
-		{ return by_value<U>(); }
-#endif
-	};
-
-	template<>
-	struct decorated_type_value_impl<void>
-	{
-		static by_value<void> get(int)
-		{
-			return by_value<void>();
-		}
-		static int data() { return 0; }
-	};
-
-	template<class T>
-	struct decorated_type_array_impl
-	{
-		template<class U>
-		static by_pointer<U> get(U*)
-		{
-			return by_pointer<U>();
-		}
-
-		template<class U>
-		static by_pointer<U> get(void(*)(U))
-		{ return by_pointer<U>(); }
-
-		static T& data() { return reinterpret_cast<T&>(decorated_type_array); }
-	};
-
-	template<class T>
-	struct decorated_type
-//		: boost::mpl::if_<boost::is_array<T>
-//			,	decorated_type_array_impl<T>
-		:		boost::mpl::if_<luabind::detail::is_const_reference<T>
-					, decorated_type_cref_impl<T>
-					, typename boost::mpl::if_<luabind::detail::is_nonconst_reference<T>
-						, decorated_type_ref_impl<T>
-						, typename boost::mpl::if_<luabind::detail::is_nonconst_pointer<T>
-							, decorated_type_ptr_impl<T>
-							, typename boost::mpl::if_<luabind::detail::is_const_pointer<T>
-								, decorated_type_cptr_impl<T>
-								, decorated_type_value_impl<T>
-					>::type
-				>::type
-			>::type
-		>::type
-//	>::type
-	{
-	};
-
-#if defined(BOOST_MSVC) && BOOST_MSVC == 1200
-	#define LUABIND_DECORATE_TYPE(t) luabind::detail::decorated_type<t>::get(luabind::detail::decorated_type<t>::data())
-#else
-//	#define LUABIND_DECORATE_TYPE(t) luabind::detail::decorated_type<t>::get((void(*)(type<t>))0)
-	#define LUABIND_DECORATE_TYPE(t) luabind::detail::decorated_type<t>::get(luabind::detail::decorated_type<t>::data())
-		//#define LUABIND_DECORATE_TYPE(t) luabind::detail::decorated_type<t>::get(type<t>())
-#endif
-
-#endif
-
-}}
-
-#endif // LUABIND_DECORATE_TYPE_HPP_INCLUDED

+ 0 - 193
lib/luabind/luabind/detail/deduce_signature.hpp

@@ -1,193 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#if !BOOST_PP_IS_ITERATING
-
-# ifndef LUABIND_DEDUCE_SIGNATURE_080911_HPP
-#  define LUABIND_DEDUCE_SIGNATURE_080911_HPP
-
-#  include <luabind/detail/most_derived.hpp>
-#  include <luabind/vector.hpp>
-
-#  ifndef LUABIND_CPP0x
-#   if LUABIND_MAX_ARITY <= 8
-#    include <boost/mpl/vector/vector10.hpp>
-#   else
-#    include <boost/mpl/vector/vector50.hpp>
-#   endif
-#   include <boost/preprocessor/cat.hpp>
-#   include <boost/preprocessor/iteration/iterate.hpp>
-#   include <boost/preprocessor/repetition/enum_params.hpp>
-#  endif
-
-namespace luabind { namespace detail {
-
-#  ifdef LUABIND_CPP0x
-
-template <class R, class... Args>
-vector<R, Args...> deduce_signature(R(*)(Args...), ...)
-{
-    return vector<R, Args...>();
-}
-
-template <class R, class T, class... Args>
-vector<R, T&, Args...> deduce_signature(R(T::*)(Args...))
-{
-    return vector<R, T&, Args...>();
-}
-
-template <class R, class T, class Wrapped, class... Args>
-vector<R, typename most_derived<T,Wrapped>::type&, Args...>
-deduce_signature(R(T::*)(Args...), Wrapped*)
-{
-    return vector<R, typename most_derived<T,Wrapped>::type&, Args...>();
-}
-
-template <class R, class T, class... Args>
-vector<R, T const&, Args...> deduce_signature(R(T::*)(Args...) const)
-{
-    return vector<R, T const&, Args...>();
-}
-
-template <class R, class T, class Wrapped, class... Args>
-vector<R, typename most_derived<T,Wrapped>::type const&, Args...>
-deduce_signature(R(T::*)(Args...) const, Wrapped*)
-{
-    return vector<R, typename most_derived<T,Wrapped>::type const&, Args...>();
-}
-
-// This is primarily intended to catch C++0x lambda closures. It figures out
-// the signature of a function object, and strips the object type from the
-// resulting signature:
-//
-//   vector<void, unspecified const&, ...>
-//
-//     into
-//
-//   vector<void, ...>
-//
-// This overload is all luabind needs to correctly handle monomorphic function
-// objects with a fixed signature such as C++0x lambdas. The standard doesn't
-// explicitly say that an implementation isn't allowed to add additional
-// overloads of operator() to the closure type, in practice however, noone
-// seems to.
-
-template <class Signature>
-struct strip_this_argument;
-
-template <class R, class T, class... Args>
-struct strip_this_argument<vector<R, T, Args...> >
-{
-    typedef vector<R, Args...> type;
-};
-
-template <class F>
-typename strip_this_argument<
-    decltype(deduce_signature(&F::operator()))
->::type deduce_signature(F const&)
-{
-    return typename strip_this_argument<
-        decltype(deduce_signature(&F::operator()))>::type();
-}
-
-#  else // LUABIND_CPP0x
-
-namespace mpl = boost::mpl;
-
-template <class R>
-mpl::vector1<R> deduce_signature(R(*)(), ...)
-{
-    return mpl::vector1<R>();
-}
-
-template <class R, class T>
-mpl::vector2<R,T&> deduce_signature(R(T::*)())
-{
-    return mpl::vector2<R,T&>();
-}
-
-template <class R, class T, class Wrapped>
-mpl::vector2<R,typename most_derived<T,Wrapped>::type&>
-deduce_signature(R(T::*)(), Wrapped*)
-{
-    return mpl::vector2<R,typename most_derived<T,Wrapped>::type&>();
-}
-
-template <class R, class T>
-mpl::vector2<R,T const&> deduce_signature(R(T::*)() const)
-{
-    return mpl::vector2<R,T const&>();
-}
-
-template <class R, class T, class Wrapped>
-mpl::vector2<R,typename most_derived<T,Wrapped>::type const&>
-deduce_signature(R(T::*)() const, Wrapped*)
-{
-    return mpl::vector2<R,typename most_derived<T,Wrapped>::type const&>();
-}
-
-#  define BOOST_PP_ITERATION_PARAMS_1 \
-    (3, (1, LUABIND_MAX_ARITY, <luabind/detail/deduce_signature.hpp>))
-#  include BOOST_PP_ITERATE()
-
-#  endif // LUABIND_CPP0x
-
-}} // namespace luabind::detail
-
-# endif // LUABIND_DEDUCE_SIGNATURE_080911_HPP
-
-#else // BOOST_PP_IS_ITERATING
-
-# define N BOOST_PP_ITERATION()
-# define NPLUS1 BOOST_PP_INC(N)
-
-template <class R, BOOST_PP_ENUM_PARAMS(N,class A)>
-BOOST_PP_CAT(mpl::vector,NPLUS1)<R, BOOST_PP_ENUM_PARAMS(N,A)>
-deduce_signature(R(*)(BOOST_PP_ENUM_PARAMS(N,A)), ...)
-{
-    return BOOST_PP_CAT(mpl::vector,NPLUS1)<R,BOOST_PP_ENUM_PARAMS(N,A)>();
-}
-
-# define NPLUS2 BOOST_PP_INC(NPLUS1)
-
-template <class R, class T, BOOST_PP_ENUM_PARAMS(N,class A)>
-BOOST_PP_CAT(mpl::vector,NPLUS2)<R, T&, BOOST_PP_ENUM_PARAMS(N,A)>
-deduce_signature(R(T::*)(BOOST_PP_ENUM_PARAMS(N,A)))
-{
-    return BOOST_PP_CAT(mpl::vector,NPLUS2)<R,T&,BOOST_PP_ENUM_PARAMS(N,A)>();
-}
-
-template <class R, class T, BOOST_PP_ENUM_PARAMS(N,class A), class Wrapped>
-BOOST_PP_CAT(mpl::vector,NPLUS2)<
-    R, typename most_derived<T,Wrapped>::type&, BOOST_PP_ENUM_PARAMS(N,A)
->
-deduce_signature(R(T::*)(BOOST_PP_ENUM_PARAMS(N,A)), Wrapped*)
-{
-    return BOOST_PP_CAT(mpl::vector,NPLUS2)<
-        R,typename most_derived<T,Wrapped>::type&,BOOST_PP_ENUM_PARAMS(N,A)>();
-}
-
-template <class R, class T, BOOST_PP_ENUM_PARAMS(N,class A)>
-BOOST_PP_CAT(mpl::vector,NPLUS2)<R, T const&, BOOST_PP_ENUM_PARAMS(N,A)>
-deduce_signature(R(T::*)(BOOST_PP_ENUM_PARAMS(N,A)) const)
-{
-    return BOOST_PP_CAT(mpl::vector,NPLUS2)<R,T const&,BOOST_PP_ENUM_PARAMS(N,A)>();
-}
-
-template <class R, class T, BOOST_PP_ENUM_PARAMS(N,class A), class Wrapped>
-BOOST_PP_CAT(mpl::vector,NPLUS2)<
-    R, typename most_derived<T,Wrapped>::type const&, BOOST_PP_ENUM_PARAMS(N,A)
->
-deduce_signature(R(T::*)(BOOST_PP_ENUM_PARAMS(N,A)) const, Wrapped*)
-{
-    return BOOST_PP_CAT(mpl::vector,NPLUS2)<
-        R,typename most_derived<T,Wrapped>::type const&,BOOST_PP_ENUM_PARAMS(N,A)>();
-}
-
-# undef NPLUS2
-# undef NPLUS1
-# undef N
-
-#endif  // BOOST_PP_IS_ITERATING
-

+ 0 - 123
lib/luabind/luabind/detail/enum_maker.hpp

@@ -1,123 +0,0 @@
-// Copyright (c) 2003 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_ENUM_MAKER_HPP_INCLUDED
-#define LUABIND_ENUM_MAKER_HPP_INCLUDED
-
-#include <vector>
-#include <string>
-
-#include <luabind/config.hpp>
-#include <luabind/detail/class_rep.hpp>
-
-namespace luabind
-{
-	struct value;
-
-	struct value_vector : public std::vector<value>
-	{
-		// a bug in intel's compiler forces us to declare these constructors explicitly.
-		value_vector();
-		virtual ~value_vector();
-		value_vector(const value_vector& v);
-		value_vector& operator,(const value& rhs);
-	};
-
-	struct value
-	{
-	friend class std::vector<value>;
-		template<class T>
-		value(const char* name, T v)
-			: name_(name)
-			, val_(v)
-		{}
-
-		const char* name_;
-		int val_;
-
-		value_vector operator,(const value& rhs) const
-		{
-			value_vector v;
-
-			v.push_back(*this);
-			v.push_back(rhs);
-
-			return v;
-		}
-
-	private: 
-
-		value() {}
-	};
-
-	inline value_vector::value_vector()
-		: std::vector<value>()
-	{
-	}
-
-	inline value_vector::~value_vector() {}
-
-	inline value_vector::value_vector(const value_vector& rhs)
-		: std::vector<value>(rhs)
-	{
-	}
-
-	inline value_vector& value_vector::operator,(const value& rhs)
-	{
-		push_back(rhs);
-		return *this;
-	}
-
-	namespace detail
-	{
-		template<class From>
-		struct enum_maker
-		{
-			explicit enum_maker(From& from): from_(from) {}
-
-			From& operator[](const value& val)
-			{
-				from_.add_static_constant(val.name_, val.val_);
-				return from_;
-			}
-			
-			From& operator[](const value_vector& values)
-			{
-				for (value_vector::const_iterator i = values.begin(); i != values.end(); ++i)
-				{
-					from_.add_static_constant(i->name_, i->val_);
-				}
-
-				return from_;
-			}
-
-			From& from_;
-
-		private:
-            void operator=(enum_maker const&); // C4512, assignment operator could not be generated
-			template<class T> void operator,(T const&) const;
-		};
-	}
-}
-
-#endif // LUABIND_ENUM_MAKER_HPP_INCLUDED

+ 0 - 188
lib/luabind/luabind/detail/format_signature.hpp

@@ -1,188 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_FORMAT_SIGNATURE_081014_HPP
-# define LUABIND_FORMAT_SIGNATURE_081014_HPP
-
-# include <luabind/config.hpp>
-# include <luabind/lua_include.hpp>
-# include <luabind/typeid.hpp>
-
-# include <boost/mpl/begin_end.hpp>
-# include <boost/mpl/next.hpp>
-# include <boost/mpl/size.hpp>
-
-namespace luabind { namespace adl
-{
-
-  class object;
-  class argument;
-  template <class Base>
-  struct table;
-
-} // namespace adl
-
-using adl::object;
-using adl::argument;
-using adl::table;
-
-} // namespace luabind
-
-namespace luabind { namespace detail {
-
-LUABIND_API std::string get_class_name(lua_State* L, type_id const& i);
-
-template <class T>
-struct type_to_string
-{
-    static void get(lua_State* L)
-    {
-        lua_pushstring(L, get_class_name(L, typeid(T)).c_str());
-    }
-};
-
-template <class T>
-struct type_to_string<T*>
-{
-    static void get(lua_State* L)
-    {
-        type_to_string<T>::get(L);
-        lua_pushstring(L, "*");
-        lua_concat(L, 2);
-    }
-};
-
-template <class T>
-struct type_to_string<T&>
-{
-    static void get(lua_State* L)
-    {
-        type_to_string<T>::get(L);
-        lua_pushstring(L, "&");
-        lua_concat(L, 2);
-    }
-};
-
-template <class T>
-struct type_to_string<T const>
-{
-    static void get(lua_State* L)
-    {
-        type_to_string<T>::get(L);
-        lua_pushstring(L, " const");
-        lua_concat(L, 2);
-    }
-};
-
-# define LUABIND_TYPE_TO_STRING(x) \
-    template <> \
-    struct type_to_string<x> \
-    { \
-        static void get(lua_State* L) \
-        { \
-            lua_pushstring(L, #x); \
-        } \
-    };
-
-# define LUABIND_INTEGRAL_TYPE_TO_STRING(x) \
-    LUABIND_TYPE_TO_STRING(x) \
-    LUABIND_TYPE_TO_STRING(unsigned x)
-
-LUABIND_INTEGRAL_TYPE_TO_STRING(char)
-LUABIND_INTEGRAL_TYPE_TO_STRING(short)
-LUABIND_INTEGRAL_TYPE_TO_STRING(int)
-LUABIND_INTEGRAL_TYPE_TO_STRING(long)
-
-LUABIND_TYPE_TO_STRING(void)
-LUABIND_TYPE_TO_STRING(bool)
-LUABIND_TYPE_TO_STRING(std::string)
-LUABIND_TYPE_TO_STRING(lua_State)
-
-LUABIND_TYPE_TO_STRING(luabind::object)
-LUABIND_TYPE_TO_STRING(luabind::argument)
-
-# undef LUABIND_INTEGRAL_TYPE_TO_STRING
-# undef LUABIND_TYPE_TO_STRING
-
-template <class Base>
-struct type_to_string<table<Base> >
-{
-    static void get(lua_State* L)
-    {
-        lua_pushstring(L, "table");
-    }
-};
-
-# ifndef LUABIND_CPP0x
-
-template <class End>
-void format_signature_aux(lua_State*, bool, End, End)
-{}
-
-template <class Iter, class End>
-void format_signature_aux(lua_State* L, bool first, Iter, End end)
-{
-    if (!first)
-        lua_pushstring(L, ",");
-    type_to_string<typename Iter::type>::get(L);
-    format_signature_aux(L, false, typename mpl::next<Iter>::type(), end);
-}
-
-template <class Signature>
-void format_signature(lua_State* L, char const* function, Signature)
-{
-    typedef typename mpl::begin<Signature>::type first;
-
-    type_to_string<typename first::type>::get(L);
-
-    lua_pushstring(L, " ");
-    lua_pushstring(L, function);
-
-    lua_pushstring(L, "(");
-    format_signature_aux(
-        L
-      , true
-      , typename mpl::next<first>::type()
-      , typename mpl::end<Signature>::type()
-    );
-    lua_pushstring(L, ")");
-
-    lua_concat(L, static_cast<int>(mpl::size<Signature>()) * 2 + 2);
-}
-
-# else // LUABIND_CPP0x
-
-inline void format_signature_aux(lua_State*, vector<>, bool)
-{}
-
-template <class T, class... Args>
-void format_signature_aux(lua_State* L, vector<T, Args...>, bool first = true)
-{
-    if (!first)
-        lua_pushstring(L, ",");
-    type_to_string<T>::get(L);
-    format_signature_aux(L, vector<Args...>(), false);
-}
-
-template <class R, class... Args>
-void format_signature(lua_State* L, char const* function, vector<R, Args...>)
-{
-    type_to_string<R>::get(L);
-
-    lua_pushstring(L, " ");
-    lua_pushstring(L, function);
-
-    lua_pushstring(L, "(");
-    format_signature_aux(L, vector<R, Args...>());
-    lua_pushstring(L, ")");
-
-    lua_concat(L, (sizeof...(Args) + 1) * 2 + 2);
-}
-
-# endif // LUABIND_CPP0x
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_FORMAT_SIGNATURE_081014_HPP
-

+ 0 - 53
lib/luabind/luabind/detail/garbage_collector.hpp

@@ -1,53 +0,0 @@
-// Copyright (c) 2003 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_GARBAGE_COLLECTOR_HPP_INCLUDED
-#define LUABIND_GARBAGE_COLLECTOR_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-
-namespace luabind { namespace detail
-{
-	// function that is used as __gc metafunction on several objects
-	template<class T>
-	inline int garbage_collector(lua_State* L)
-	{
-		T* obj = static_cast<T*>(lua_touserdata(L, -1));
-		obj->~T();
-		return 0;
-	}
-
-	template<class T>
-	struct garbage_collector_s
-	{
-		static int apply(lua_State* L)
-		{
-			T* obj = static_cast<T*>(lua_touserdata(L, -1));
-			obj->~T();
-			return 0;
-		}
-	};
-
-}}
-
-#endif // LUABIND_GARBAGE_COLLECTOR_HPP_INCLUDED

+ 0 - 107
lib/luabind/luabind/detail/has_get_pointer.hpp

@@ -1,107 +0,0 @@
-// Copyright (c) 2005 Daniel Wallin
-
-// 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_HAS_GET_POINTER_051022_HPP
-# define LUABIND_HAS_GET_POINTER_051022_HPP
-
-# include <boost/type_traits/add_reference.hpp>
-
-# ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
-#  include <memory>
-# endif
-
-namespace luabind { namespace detail { 
-
-namespace has_get_pointer_
-{
-
-  struct any 
-  { 
-      template<class T> any(T const&);
-  };
-
-  struct no_overload_tag 
-  {};
-
-  typedef char (&yes)[1];
-  typedef char (&no)[2];
-
-  no_overload_tag operator,(no_overload_tag, int);
-
-//
-// On compilers with ADL, we need these generic overloads in this
-// namespace as well as in luabind::. Otherwise get_pointer(any)
-// will be found before them.
-//
-# ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
-
-  template<class T>
-  T* get_pointer(T const volatile*);
-
-  template<class T>
-  T* get_pointer(std::auto_ptr<T> const&);
-
-# endif
-
-//
-// On compilers that doesn't support ADL, the overload below has to
-// live in luabind::.
-//
-# ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
-}} // namespace detail::has_get_pointer_
-# endif
-
-detail::has_get_pointer_::no_overload_tag 
-  get_pointer(detail::has_get_pointer_::any);
-
-# ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
-namespace detail { namespace has_get_pointer_ 
-{
-# endif
-
-  template<class T>
-  yes check(T const&);
-  no check(no_overload_tag);
-
-  template<class T>
-  struct impl
-  {
-      static typename boost::add_reference<T>::type x;
-
-      BOOST_STATIC_CONSTANT(bool,
-          value = sizeof(has_get_pointer_::check( (get_pointer(x),0) )) == 1
-      );
-
-      typedef boost::mpl::bool_<value> type;
-  };
-
-} // namespace has_get_pointer_
-
-template<class T>
-struct has_get_pointer
-  : has_get_pointer_::impl<T>::type
-{};
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_HAS_GET_POINTER_051022_HPP
-

+ 0 - 35
lib/luabind/luabind/detail/index_tuple.hpp

@@ -1,35 +0,0 @@
-// Copyright Daniel Wallin 2010. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_DETAIL_INDEX_TUPLE_100629_HPP
-# define LUABIND_DETAIL_INDEX_TUPLE_100629_HPP
-
-namespace luabind { namespace detail {
-
-template <int... N>
-struct index_tuple
-{};
-
-template <int N, int I, class Indices>
-struct make_index_tuple_aux;
-
-template <int N, int I, int... Indices>
-struct make_index_tuple_aux<N, I, index_tuple<Indices...> >
-  : make_index_tuple_aux<N - 1, I + 1, index_tuple<Indices..., I> >
-{};
-
-template <int I, int... Indices>
-struct make_index_tuple_aux<0, I, index_tuple<Indices...> >
-{
-    typedef index_tuple<Indices...> type;
-};
-
-template <int N>
-struct make_index_tuple
-  : make_index_tuple_aux<N, 0, index_tuple<> >
-{};
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_DETAIL_INDEX_TUPLE_100629_HPP

+ 0 - 168
lib/luabind/luabind/detail/inheritance.hpp

@@ -1,168 +0,0 @@
-// Copyright Daniel Wallin 2009. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_INHERITANCE_090217_HPP
-# define LUABIND_INHERITANCE_090217_HPP
-
-# include <cassert>
-# include <limits>
-# include <map>
-# include <memory>
-# include <vector>
-# include <luabind/typeid.hpp>
-# include <boost/scoped_ptr.hpp>
-
-namespace luabind { namespace detail {
-
-typedef void*(*cast_function)(void*);
-typedef std::size_t class_id;
-
-class_id const unknown_class = (std::numeric_limits<class_id>::max)();
-
-class class_rep;
-
-class LUABIND_API cast_graph
-{
-public:
-    cast_graph();
-    ~cast_graph();
-
-    // `src` and `p` here describe the *most derived* object. This means that
-    // for a polymorphic type, the pointer must be cast with
-    // dynamic_cast<void*> before being passed in here, and `src` has to
-    // match typeid(*p).
-    std::pair<void*, int> cast(
-        void* p, class_id src, class_id target
-      , class_id dynamic_id, void const* dynamic_ptr) const;
-    void insert(class_id src, class_id target, cast_function cast);
-
-private:
-    class impl;
-    boost::scoped_ptr<impl> m_impl;
-};
-
-// Maps a type_id to a class_id. Note that this actually partitions the
-// id-space into two, using one half for "local" ids; ids that are used only as
-// keys into the conversion cache. This is needed because we need a unique key
-// even for types that hasn't been registered explicitly.
-class LUABIND_API class_id_map
-{
-public:
-    class_id_map();
-
-    class_id get(type_id const& type) const;
-    class_id get_local(type_id const& type);
-    void put(class_id id, type_id const& type);
-
-private:
-    typedef std::map<type_id, class_id> map_type;
-    map_type m_classes;
-    class_id m_local_id;
-
-    static class_id const local_id_base;
-};
-
-inline class_id_map::class_id_map()
-  : m_local_id(local_id_base)
-{}
-
-inline class_id class_id_map::get(type_id const& type) const
-{
-    map_type::const_iterator i = m_classes.find(type);
-    if (i == m_classes.end() || i->second >= local_id_base)
-        return unknown_class;
-    return i->second;
-}
-
-inline class_id class_id_map::get_local(type_id const& type)
-{
-    std::pair<map_type::iterator, bool> result = m_classes.insert(
-        std::make_pair(type, 0));
-
-    if (result.second)
-        result.first->second = m_local_id++;
-
-    assert(m_local_id >= local_id_base);
-
-    return result.first->second;
-}
-
-inline void class_id_map::put(class_id id, type_id const& type)
-{
-    assert(id < local_id_base);
-
-    std::pair<map_type::iterator, bool> result = m_classes.insert(
-        std::make_pair(type, 0));
-
-    assert(
-        result.second
-        || result.first->second == id
-        || result.first->second >= local_id_base
-    );
-
-    result.first->second = id;
-}
-
-class class_map
-{
-public:
-    class_rep* get(class_id id) const;
-    void put(class_id id, class_rep* cls);
-
-private:
-    std::vector<class_rep*> m_classes;
-};
-
-inline class_rep* class_map::get(class_id id) const
-{
-    if (id >= m_classes.size())
-        return 0;
-    return m_classes[id];
-}
-
-inline void class_map::put(class_id id, class_rep* cls)
-{
-    if (id >= m_classes.size())
-        m_classes.resize(id + 1);
-    m_classes[id] = cls;
-}
-
-template <class S, class T>
-struct static_cast_
-{
-    static void* execute(void* p)
-    {
-        return static_cast<T*>(static_cast<S*>(p));
-    }
-};
-
-template <class S, class T>
-struct dynamic_cast_
-{
-    static void* execute(void* p)
-    {
-        return dynamic_cast<T*>(static_cast<S*>(p));
-    }
-};
-
-// Thread safe class_id allocation.
-LUABIND_API class_id allocate_class_id(type_id const& cls);
-
-template <class T>
-struct registered_class
-{
-    static class_id const id;
-};
-
-template <class T>
-class_id const registered_class<T>::id = allocate_class_id(typeid(T));
-
-template <class T>
-struct registered_class<T const>
-  : registered_class<T>
-{};
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_INHERITANCE_090217_HPP

+ 0 - 124
lib/luabind/luabind/detail/instance_holder.hpp

@@ -1,124 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_INSTANCE_HOLDER_081024_HPP
-# define LUABIND_INSTANCE_HOLDER_081024_HPP
-
-# include <luabind/detail/inheritance.hpp>
-# include <luabind/get_pointer.hpp>
-# include <luabind/typeid.hpp>
-# include <boost/type_traits/is_polymorphic.hpp>
-# include <stdexcept>
-
-namespace luabind { namespace detail {
-
-class instance_holder
-{
-public:
-    instance_holder(bool pointee_const)
-      : m_pointee_const(pointee_const)
-    {}
-
-    virtual ~instance_holder()
-    {}
-
-    virtual std::pair<void*, int> get(
-        cast_graph const& casts, class_id target) const = 0;
-
-    virtual void release() = 0;
-
-    bool pointee_const() const
-    {
-        return m_pointee_const;
-    }
-
-private:
-    bool m_pointee_const;
-};
-
-namespace mpl = boost::mpl;
-
-inline mpl::false_ check_const_pointer(void*)
-{
-    return mpl::false_();
-}
-
-inline mpl::true_ check_const_pointer(void const*)
-{
-    return mpl::true_();
-}
-
-template <class T>
-void release_ownership(std::auto_ptr<T>& p)
-{
-    p.release();
-}
-
-template <class P>
-void release_ownership(P const&)
-{
-    throw std::runtime_error(
-        "luabind: smart pointer does not allow ownership transfer");
-}
-
-template <class T>
-class_id static_class_id(T*)
-{
-    return registered_class<T>::id;
-}
-
-template <class P, class Pointee = void const>
-class pointer_holder : public instance_holder
-{
-public:
-    pointer_holder(
-        P p, class_id dynamic_id, void* dynamic_ptr
-    )
-      : instance_holder(check_const_pointer(false ? get_pointer(p) : 0))
-      , p(p)
-      , weak(0)
-      , dynamic_id(dynamic_id)
-      , dynamic_ptr(dynamic_ptr)
-    {}
-
-    std::pair<void*, int> get(cast_graph const& casts, class_id target) const
-    {
-        if (target == registered_class<P>::id)
-            return std::pair<void*, int>(&this->p, 0);
-
-        void* naked_ptr = const_cast<void*>(static_cast<void const*>(
-            weak ? weak : get_pointer(p)));
-
-        if (!naked_ptr)
-            return std::pair<void*, int>((void*)0, 0);
-
-        return casts.cast(
-            naked_ptr
-          , static_class_id(false ? get_pointer(p) : 0)
-          , target
-          , dynamic_id
-          , dynamic_ptr
-        );
-    }
-
-    void release()
-    {
-        weak = const_cast<void*>(static_cast<void const*>(
-            get_pointer(p)));
-        release_ownership(p);
-    }
-
-private:
-    mutable P p;
-    // weak will hold a possibly stale pointer to the object owned
-    // by p once p has released it's owership. This is a workaround
-    // to make adopt() work with virtual function wrapper classes.
-    void* weak;
-    class_id dynamic_id;
-    void* dynamic_ptr;
-};
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_INSTANCE_HOLDER_081024_HPP

+ 0 - 60
lib/luabind/luabind/detail/link_compatibility.hpp

@@ -1,60 +0,0 @@
-// Copyright (c) 2003 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_LINK_COMPATIBILITY_HPP_INCLUDED
-#define LUABIND_LINK_COMPATIBILITY_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-
-namespace luabind { namespace detail
-{
-
-#ifdef LUABIND_NOT_THREADSAFE
-	LUABIND_API void not_threadsafe_defined_conflict();
-#else
-	LUABIND_API void not_threadsafe_not_defined_conflict();
-#endif
-
-#ifdef LUABIND_NO_ERROR_CHECKING
-	LUABIND_API void no_error_checking_defined_conflict();
-#else
-	LUABIND_API void no_error_checking_not_defined_conflict();
-#endif
-
-	inline void check_link_compatibility()
-	{
-	#ifdef LUABIND_NOT_THREADSAFE
-		not_threadsafe_defined_conflict();
-	#else
-		not_threadsafe_not_defined_conflict();
-	#endif
-
-	#ifdef LUABIND_NO_ERROR_CHECKING
-		no_error_checking_defined_conflict();
-	#else
-		no_error_checking_not_defined_conflict();
-	#endif
-	}
-
-}}
-
-#endif

+ 0 - 105
lib/luabind/luabind/detail/make_instance.hpp

@@ -1,105 +0,0 @@
-// Copyright Daniel Wallin 2009. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_DETAIL_MAKE_INSTANCE_090310_HPP
-# define LUABIND_DETAIL_MAKE_INSTANCE_090310_HPP
-
-# include <boost/type_traits/is_polymorphic.hpp>
-# include <luabind/detail/inheritance.hpp>
-# include <luabind/detail/object_rep.hpp>
-
-namespace luabind { namespace detail {
-
-template <class T>
-std::pair<class_id, void*> get_dynamic_class_aux(
-    lua_State* L, T const* p, mpl::true_)
-{
-    lua_pushliteral(L, "__luabind_class_id_map");
-    lua_rawget(L, LUA_REGISTRYINDEX);
-
-    class_id_map& class_ids = *static_cast<class_id_map*>(
-        lua_touserdata(L, -1));
-
-    lua_pop(L, 1);
-
-    return std::make_pair(
-        class_ids.get_local(typeid(*p))
-      , dynamic_cast<void*>(const_cast<T*>(p))
-    );
-}
-
-template <class T>
-std::pair<class_id, void*> get_dynamic_class_aux(
-    lua_State*, T const* p, mpl::false_)
-{
-    return std::make_pair(registered_class<T>::id, (void*)p);
-}
-
-template <class T>
-std::pair<class_id, void*> get_dynamic_class(lua_State* L, T* p)
-{
-    return get_dynamic_class_aux(L, p, boost::is_polymorphic<T>());
-}
-
-template <class T>
-class_rep* get_pointee_class(class_map const& classes, T*)
-{
-    return classes.get(registered_class<T>::id);
-}
-
-template <class P>
-class_rep* get_pointee_class(lua_State* L, P const& p, class_id dynamic_id)
-{
-    lua_pushliteral(L, "__luabind_class_map");
-    lua_rawget(L, LUA_REGISTRYINDEX);
-
-    class_map const& classes = *static_cast<class_map*>(
-        lua_touserdata(L, -1));
-
-    lua_pop(L, 1);
-
-    class_rep* cls = classes.get(dynamic_id);
-
-    if (!cls)
-        cls = get_pointee_class(classes, get_pointer(p));
-
-    return cls;
-}
-
-// Create an appropriate instance holder for the given pointer like object.
-template <class P>
-void make_instance(lua_State* L, P p)
-{
-    std::pair<class_id, void*> dynamic = get_dynamic_class(L, get_pointer(p));
-
-    class_rep* cls = get_pointee_class(L, p, dynamic.first);
-
-    if (!cls)
-    {
-        throw std::runtime_error("Trying to use unregistered class");
-    }
-
-    object_rep* instance = push_new_instance(L, cls);
-
-    typedef pointer_holder<P> holder_type;
-
-    void* storage = instance->allocate(sizeof(holder_type));
-
-    try
-    {
-        new (storage) holder_type(p, dynamic.first, dynamic.second);
-    }
-    catch (...)
-    {
-        instance->deallocate(storage);
-        lua_pop(L, 1);
-        throw;
-    }
-
-    instance->set_instance(static_cast<holder_type*>(storage));
-}
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_DETAIL_MAKE_INSTANCE_090310_HPP

+ 0 - 44
lib/luabind/luabind/detail/most_derived.hpp

@@ -1,44 +0,0 @@
-// Copyright (c) 2005 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 MOST_DERIVED_051018_HPP
-# define MOST_DERIVED_051018_HPP
-
-# include <boost/mpl/if.hpp>
-# include <boost/type_traits/is_base_and_derived.hpp>
-
-namespace luabind { namespace detail {
-
-template<class Class, class WrappedClass>
-struct most_derived
-{
-    typedef typename boost::mpl::if_<
-        boost::is_base_and_derived<Class, WrappedClass>
-      , WrappedClass
-      , Class
-    >::type type;
-};
-
-}} // namespace luabind::detail
-
-#endif // MOST_DERIVED_051018_HPP
-

+ 0 - 52
lib/luabind/luabind/detail/object_call.hpp

@@ -1,52 +0,0 @@
-// Copyright (c) 2005 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.
-
-#if !BOOST_PP_IS_ITERATING
-# error Do not include object_call.hpp directly!
-#endif
-
-#include <boost/preprocessor/repetition/enum_params.hpp>
-#include <boost/preprocessor/repetition/enum_binary_params.hpp>
-#include <boost/preprocessor/facilities/intercept.hpp>
-
-#define N BOOST_PP_ITERATION()
-
-template<BOOST_PP_ENUM_PARAMS(N, class A)>
-call_proxy<
-    Derived
-  , boost::tuples::tuple<
-        BOOST_PP_ENUM_BINARY_PARAMS(N, A, const* BOOST_PP_INTERCEPT)
-    >
-> operator()(BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a))
-{
-    typedef boost::tuples::tuple<
-        BOOST_PP_ENUM_BINARY_PARAMS(N, A, const* BOOST_PP_INTERCEPT)
-    > arguments;
-
-    return call_proxy<Derived, arguments>(
-        derived()
-      , arguments(BOOST_PP_ENUM_PARAMS(N, &a))
-    );
-}
-
-#undef N
-

+ 0 - 132
lib/luabind/luabind/detail/object_rep.hpp

@@ -1,132 +0,0 @@
-// Copyright (c) 2003 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_OBJECT_REP_HPP_INCLUDED
-#define LUABIND_OBJECT_REP_HPP_INCLUDED
-
-#include <cstdlib>
-#include <boost/aligned_storage.hpp>
-#include <luabind/config.hpp>
-#include <luabind/detail/class_rep.hpp>
-#include <luabind/detail/instance_holder.hpp>
-#include <luabind/detail/ref.hpp>
-
-namespace luabind { namespace detail
-{
-	void finalize(lua_State* L, class_rep* crep);
-
-	// this class is allocated inside lua for each pointer.
-	// it contains the actual c++ object-pointer.
-	// it also tells if it is const or not.
-	class LUABIND_API object_rep
-	{
-	public:
-		object_rep(instance_holder* instance, class_rep* crep);
-		~object_rep();
-
-		const class_rep* crep() const { return m_classrep; }
-		class_rep* crep() { return m_classrep; }
-
-		void set_instance(instance_holder* instance) { m_instance = instance; }
-
-		void add_dependency(lua_State* L, int index);
-        void release_dependency_refs(lua_State* L);
-
-		std::pair<void*, int> get_instance(class_id target) const
-		{
-			if (m_instance == 0)
-				return std::pair<void*, int>((void*)0, -1);
-			return m_instance->get(m_classrep->casts(), target);
-		}
-
-		bool is_const() const
-		{
-			return m_instance && m_instance->pointee_const();
-		}
-
-        void release()
-        {
-            if (m_instance)
-                m_instance->release();
-        }
-
-		void* allocate(std::size_t size)
-		{
-			if (size <= 32)
-				return &m_instance_buffer;
-			return std::malloc(size);
-		}
-
-		void deallocate(void* storage)
-		{
-			if (storage == &m_instance_buffer)
-				return;
-			std::free(storage);
-		}
-
-	private:
-
-	object_rep(object_rep const&)
-	{}
-
-	void operator=(object_rep const&)
-	{}
-
-        instance_holder* m_instance;
-        boost::aligned_storage<32> m_instance_buffer;
-		class_rep* m_classrep; // the class information about this object's type
-        std::size_t m_dependency_cnt; // counts dependencies
-	};
-
-	template<class T>
-	struct delete_s
-	{
-		static void apply(void* ptr)
-		{
-			delete static_cast<T*>(ptr);
-		}
-	};
-
-	template<class T>
-	struct destruct_only_s
-	{
-		static void apply(void* ptr)
-		{
-			// Removes unreferenced formal parameter warning on VC7.
-			(void)ptr;
-#ifndef NDEBUG
-			int completeness_check[sizeof(T)];
-			(void)completeness_check;
-#endif
-			static_cast<T*>(ptr)->~T();
-		}
-	};
-
-    LUABIND_API object_rep* get_instance(lua_State* L, int index);
-    LUABIND_API void push_instance_metatable(lua_State* L);
-    LUABIND_API object_rep* push_new_instance(lua_State* L, class_rep* cls);
-
-}}
-
-#endif // LUABIND_OBJECT_REP_HPP_INCLUDED
-

+ 0 - 45
lib/luabind/luabind/detail/open.hpp

@@ -1,45 +0,0 @@
-// Copyright (c) 2003 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_OPEN_HPP_INCLUDED
-#define LUABIND_OPEN_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-
-namespace luabind
-{
-	namespace detail
-	{
-		LUABIND_API void add_operator_to_metatable(lua_State* L, int op_index);
-		LUABIND_API int create_cpp_class_metatable(lua_State* L);
-		LUABIND_API int create_cpp_instance_metatable(lua_State* L);
-		LUABIND_API int create_lua_class_metatable(lua_State* L);
-		LUABIND_API int create_lua_instance_metatable(lua_State* L);
-		LUABIND_API int create_lua_function_metatable(lua_State* L);
-	}
-
-	LUABIND_API void open(lua_State* L);
-}
-
-#endif // LUABIND_OPEN_HPP_INCLUDED
-

+ 0 - 79
lib/luabind/luabind/detail/operator_id.hpp

@@ -1,79 +0,0 @@
-// Copyright (c) 2003 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_OPERATOR_ID_HPP_INCLUDED
-#define LUABIND_OPERATOR_ID_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-
-namespace luabind { namespace detail {
-
-	enum operator_id
-	{
-		op_add = 0,
-		op_sub,
-		op_mul,
-		op_div,
-		op_pow,
-		op_lt,
-		op_le,
-		op_eq,
-		op_call,
-		op_unm,
-		op_tostring,
-        op_concat,
-		op_len,
-
-		number_of_operators
-	};
-
-	inline const char* get_operator_name(int i)
-	{
-		static const char* a[number_of_operators] = {
-            "__add", "__sub", "__mul", "__div", "__pow", 
-            "__lt", "__le", "__eq", "__call", "__unm", 
-            "__tostring", "__concat", "__len" };
-		return a[i];
-	}
-
-	inline const char* get_operator_symbol(int i)
-	{
-		static const char* a[number_of_operators] = {
-            "+", "-", "*", "/", "^", "<", 
-            "<=", "==", "()", "- (unary)", 
-            "tostring", "..", "#" };
-		return a[i];
-	}
-
-	inline bool is_unary(int i)
-	{
-		// the reason why unary minus is not considered a unary operator here is
-		// that it always is given two parameters, where the second parameter always
-		// is nil.
-		return i == op_tostring;
-	}
-
-
-}}
-
-#endif // LUABIND_OPERATOR_ID_HPP_INCLUDED

+ 0 - 119
lib/luabind/luabind/detail/other.hpp

@@ -1,119 +0,0 @@
-// Copyright (c) 2003 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_OTHER_HPP_INCLUDED
-#define LUABIND_OTHER_HPP_INCLUDED
-
-// header derived from source code found in Boost.Python
-
-// Copyright David Abrahams 2002. Permission to copy, use,
-// modify, sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
-
-#include <luabind/config.hpp>
-#include <boost/config.hpp>
-
-namespace luabind
-{
-	template<class T>
-	struct other
-	{
-		typedef T type;
-	};
-}
-
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-namespace luabind { namespace detail
-{
-	template<typename T>
-	class unwrap_other
-	{
-	public:
-			typedef T type;
-	};
-
-	template<typename T>
-	class unwrap_other<other<T> >
-	{
-	public:
-			typedef T type;
-	};
-}} // namespace luabind::detail
-
-# else // no partial specialization
-
-#include <boost/type.hpp>
-
-namespace luabind { namespace detail
-{
-	typedef char (&yes_other_t)[1];
-	typedef char (&no_other_t)[2];
-
-	no_other_t is_other_test(...);
-
-	template<typename T>
-	yes_other_t is_other_test(type_< other<T> >);
-
-	template<bool wrapped>
-	struct other_unwrapper
-	{
-			template <class T>
-			struct apply
-			{
-					typedef T type;
-			};
-	};
-
-	template<>
-	struct other_unwrapper<true>
-	{
-			template <class T>
-			struct apply
-			{
-					typedef typename T::type type;
-			};
-	};
-
-	template<typename T>
-	class is_other
-	{
-	 public:
-			BOOST_STATIC_CONSTANT(
-					bool, value = (
-							sizeof(detail::is_other_test(type_<T>()))
-							== sizeof(detail::yes_other_t)));
-	};
-
-	template <typename T>
-	class unwrap_other
-			: public detail::other_unwrapper<
-			is_other<T>::value
-	>::template apply<T>
-	{};
-
-}} // namespace luabind::detail
-#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-#endif // LUABIND_OTHER_HPP_INCLUDED

+ 0 - 36
lib/luabind/luabind/detail/pcall.hpp

@@ -1,36 +0,0 @@
-// Copyright (c) 2003 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_PCALL_HPP_INCLUDED
-#define LUABIND_PCALL_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-
-struct lua_State;
-
-namespace luabind { namespace detail
-{
-	LUABIND_API int pcall(lua_State *L, int nargs, int nresults);
-	LUABIND_API int resume_impl(lua_State *L, int nargs, int nresults);
-}}
-
-#endif

+ 0 - 54
lib/luabind/luabind/detail/pointee_sizeof.hpp

@@ -1,54 +0,0 @@
-// 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 POINTEE_SIZEOF_040211_HPP
-#define POINTEE_SIZEOF_040211_HPP
-
-#include <boost/mpl/int.hpp>
-
-namespace luabind {
-
-    namespace detail {
-
-    template<class T> T& deref_type(T(*)(), int);
-    template<class T> T& deref_type(T*(*)(), long);
-
-    } // namespace detail
-
-    // returns the indirect sizeof U, as in
-    //    sizeof(T*) = sizeof(T)
-    //    sizeof(T&) = sizeof(T)
-    //    sizeof(T)  = sizeof(T)
-    template<class T>
-    struct pointee_sizeof
-    {
-        BOOST_STATIC_CONSTANT(int, value = (
-            sizeof(detail::deref_type((T(*)())0), 0L)
-        ));
-
-        typedef boost::mpl::int_<value> type;
-    };
-
-} // namespace luabind
-
-#endif // POINTEE_SIZEOF_040211_HPP
-

+ 0 - 40
lib/luabind/luabind/detail/pointee_typeid.hpp

@@ -1,40 +0,0 @@
-// Copyright (c) 2004 Daniel Wallin
-
-// 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 POINTEE_TYPEID_040211_HPP
-#define POINTEE_TYPEID_040211_HPP
-
-#include <luabind/config.hpp>
-#include <luabind/typeid.hpp>
-
-namespace luabind { namespace detail {
-
-    template<class T>
-    type_id pointee_typeid(T*)
-    {
-        return typeid(T);
-    }
-
-}} // namespace luabind::detail
-
-#endif // POINTEE_TYPEID_040211_HPP
-

+ 0 - 1035
lib/luabind/luabind/detail/policy.hpp

@@ -1,1035 +0,0 @@
-// Copyright (c) 2003 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_POLICY_HPP_INCLUDED
-#define LUABIND_POLICY_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-
-#include <typeinfo>
-#include <string>
-#include <memory>
-
-#include <boost/type_traits/is_enum.hpp>
-#include <boost/type_traits/is_array.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/integral_c.hpp>
-#include <boost/mpl/equal_to.hpp>
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/or.hpp>
-#include <boost/type_traits/add_reference.hpp>
-#include <boost/type_traits/remove_reference.hpp>
-#include <boost/type_traits/is_pointer.hpp>
-#include <boost/type_traits/is_base_and_derived.hpp>
-#include <boost/bind/arg.hpp>
-#include <boost/bind/placeholders.hpp>
-#include <boost/limits.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/version.hpp>
-
-#include <luabind/detail/class_registry.hpp>
-#include <luabind/detail/primitives.hpp>
-#include <luabind/detail/object_rep.hpp>
-#include <luabind/detail/typetraits.hpp>
-#include <luabind/detail/debug.hpp>
-#include <luabind/detail/class_rep.hpp>
-#include <luabind/detail/has_get_pointer.hpp>
-#include <luabind/detail/make_instance.hpp>
-
-#include <boost/type_traits/add_reference.hpp>
-
-#include <luabind/detail/decorate_type.hpp>
-#include <luabind/weak_ref.hpp>
-#include <luabind/back_reference_fwd.hpp>
-
-#include <luabind/value_wrapper.hpp>
-#include <luabind/from_stack.hpp>
-#include <luabind/typeid.hpp>
-
-namespace luabind
-{
-	namespace detail
-	{
-		struct conversion_policy_base {};
-	}
-
-	template<int N, bool HasArg = true>
-	struct conversion_policy : detail::conversion_policy_base
-	{
-		BOOST_STATIC_CONSTANT(int, index = N);
-		BOOST_STATIC_CONSTANT(bool, has_arg = HasArg);
-	};
-
-	class index_map
-	{
-	public:
-		index_map(const int* m): m_map(m) {}
-
-		int operator[](int index) const
-		{
-			return m_map[index];
-		}
-
-	private:
-		const int* m_map;
-	};
-
-//	 template<class T> class functor;
-	 class weak_ref;
-}
-
-namespace luabind { namespace detail
-{
-	template<class H, class T>
-	struct policy_cons
-	{
-		typedef H head;
-		typedef T tail;
-
-		template<class U>
-		policy_cons<U, policy_cons<H,T> > operator,(policy_cons<U,detail::null_type>)
-		{
-			return policy_cons<U, policy_cons<H,T> >();
-		}
-
-		template<class U>
-		policy_cons<U, policy_cons<H,T> > operator+(policy_cons<U,detail::null_type>)
-		{
-			return policy_cons<U, policy_cons<H,T> >();
-		}
-
-		template<class U>
-		policy_cons<U, policy_cons<H,T> > operator|(policy_cons<U,detail::null_type>)
-		{
-			return policy_cons<U, policy_cons<H,T> >();
-		}
-	};
-
-	struct indirection_layer
-	{
-		template<class T>
-		indirection_layer(const T&);
-	};
-
-	yes_t is_policy_cons_test(const null_type&);
-	template<class H, class T>
-	yes_t is_policy_cons_test(const policy_cons<H,T>&);
-	no_t is_policy_cons_test(...);
-
-	template<class T>
-	struct is_policy_cons
-	{
-		static const T& t;
-
-		BOOST_STATIC_CONSTANT(bool, value = 
-			sizeof(is_policy_cons_test(t)) == sizeof(yes_t));
-
-		typedef boost::mpl::bool_<value> type;
-	};	
-
-	template<bool>
-	struct is_string_literal
-	{
-		static no_t helper(indirection_layer);
-		static yes_t helper(const char*);
-	};
-
-	template<>
-	struct is_string_literal<false>
-	{
-		static no_t helper(indirection_layer);
-	};
-	
-
-    namespace mpl = boost::mpl;
-
-    template <class T, class Clone>
-    void make_pointee_instance(lua_State* L, T& x, mpl::true_, Clone)
-    {
-        if (get_pointer(x))
-        {
-            make_instance(L, x);
-        }
-        else
-        {
-            lua_pushnil(L);
-        }
-    }
-
-    template <class T>
-    void make_pointee_instance(lua_State* L, T& x, mpl::false_, mpl::true_)
-    {
-        std::auto_ptr<T> ptr(new T(x));
-        make_instance(L, ptr);
-    }
-
-    template <class T>
-    void make_pointee_instance(lua_State* L, T& x, mpl::false_, mpl::false_)
-    {
-        make_instance(L, &x);
-    }
-
-    template <class T, class Clone>
-    void make_pointee_instance(lua_State* L, T& x, Clone)
-    {
-        make_pointee_instance(L, x, has_get_pointer<T>(), Clone());
-    }
-
-// ********** pointer converter ***********
-
-	struct pointer_converter
-	{
-		typedef pointer_converter type;
-        typedef mpl::false_ is_native;
-
-        pointer_converter()
-          : result(0)
-        {}
-
-        void* result;
-
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-
-		template<class T>
-		void apply(lua_State* L, T* ptr)
-		{
-			if (ptr == 0) 
-			{
-				lua_pushnil(L);
-				return;
-			}
-
-			if (luabind::get_back_reference(L, ptr))
-				return;
-
-            make_instance(L, ptr);
-		}
-
-		template<class T>
-		T* apply(lua_State*, by_pointer<T>, int)
-		{
-            return static_cast<T*>(result);
-		}
-
-		template<class T>
-		int match(lua_State* L, by_pointer<T>, int index)
-		{
-			if (lua_isnil(L, index)) return 0;
-			object_rep* obj = get_instance(L, index);
-			if (obj == 0) return -1;
-
-            if (obj->is_const())
-                return -1;
-
-            std::pair<void*, int> s = obj->get_instance(registered_class<T>::id);
-            result = s.first;
-            return s.second;
-		}
-
-		template<class T>
-		void converter_postcall(lua_State*, by_pointer<T>, int) 
-		{}
-	};
-
-// ******* value converter *******
-
-	struct value_converter
-	{
-		typedef value_converter type;
-        typedef mpl::false_ is_native;
-
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-
-        value_converter()
-          : result(0)
-        {}
-
-        void* result;
-
-		template<class T>
-		void apply(lua_State* L, T x)
-		{
-			if (luabind::get_back_reference(L, x))
-				return;
-
-            make_pointee_instance(L, x, mpl::true_());
-		}
-
-		template<class T>
-		T apply(lua_State*, by_value<T>, int)
-		{
-            return *static_cast<T*>(result);
-		}
-
-		template<class T>
-		int match(lua_State* L, by_value<T>, int index)
-		{
-			// special case if we get nil in, try to match the holder type
-			if (lua_isnil(L, index))
-				return -1;
-
-			object_rep* obj = get_instance(L, index);
-			if (obj == 0) return -1;
-
-            std::pair<void*, int> s = obj->get_instance(registered_class<T>::id);
-            result = s.first;
-            return s.second;
-		}
-
-		template<class T>
-		void converter_postcall(lua_State*, T, int) {}
-	};
-
-// ******* const pointer converter *******
-
-    struct const_pointer_converter
-	{
-		typedef const_pointer_converter type;
-        typedef mpl::false_ is_native;
-
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-
-        const_pointer_converter()
-          : result(0)
-        {}
-
-        void* result;
-
-		template<class T>
-		void apply(lua_State* L, const T* ptr)
-		{
-			if (ptr == 0) 
-			{
-				lua_pushnil(L);
-				return;
-			}
-
-			if (luabind::get_back_reference(L, ptr))
-				return;
-
-            make_instance(L, ptr);
-		}
-
-		template<class T>
-		T const* apply(lua_State*, by_const_pointer<T>, int)
-		{
-			return static_cast<T const*>(result);
-		}
-
-		template<class T>
-		int match(lua_State* L, by_const_pointer<T>, int index)
-		{
-			if (lua_isnil(L, index)) return 0;
-			object_rep* obj = get_instance(L, index);
-			if (obj == 0) return -1; // if the type is not one of our own registered types, classify it as a non-match
-            std::pair<void*, int> s = obj->get_instance(registered_class<T>::id);
-            if (s.second >= 0 && !obj->is_const())
-                s.second += 10;
-            result = s.first;
-            return s.second;
-		}
-
-        template<class T>
-        void converter_postcall(lua_State*, T, int) {}
-	};
-
-// ******* reference converter *******
-
-    struct ref_converter : pointer_converter
-	{
-		typedef ref_converter type;
-        typedef mpl::false_ is_native;
-
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-
-		template<class T>
-		void apply(lua_State* L, T& ref)
-		{
-			if (luabind::get_back_reference(L, ref))
-				return;
-
-            make_pointee_instance(L, ref, mpl::false_());
-		}
-
-		template<class T>
-		T& apply(lua_State* L, by_reference<T>, int index)
-		{
-			assert(!lua_isnil(L, index));
-            return *pointer_converter::apply(L, by_pointer<T>(), index);
-		}
-
-		template<class T>
-		int match(lua_State* L, by_reference<T>, int index)
-		{
-            object_rep* obj = get_instance(L, index);
-            if (obj == 0) return -1;
-
-            if (obj->is_const())
-                return -1;
-
-            std::pair<void*, int> s = obj->get_instance(registered_class<T>::id);
-            result = s.first;
-            return s.second;
-		}
-
-		template<class T>
-		void converter_postcall(lua_State*, T, int) {}
-	};
-
-// ******** const reference converter *********
-
-	struct const_ref_converter
-	{
-		typedef const_ref_converter type;
-        typedef mpl::false_ is_native;
-
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-
-        const_ref_converter()
-          : result(0)
-        {}
-
-        void* result;
-
-		template<class T>
-		void apply(lua_State* L, T const& ref)
-		{
-			if (luabind::get_back_reference(L, ref))
-				return;
-
-            make_pointee_instance(L, ref, mpl::false_());
-		}
-
-		template<class T>
-		T const& apply(lua_State*, by_const_reference<T>, int)
-		{
-			return *static_cast<T*>(result);
-		}
-
-		template<class T>
-		int match(lua_State* L, by_const_reference<T>, int index)
-		{
-			object_rep* obj = get_instance(L, index);
-			if (obj == 0) return -1; // if the type is not one of our own registered types, classify it as a non-match
-
-            std::pair<void*, int> s = obj->get_instance(registered_class<T>::id);
-            if (s.second >= 0 && !obj->is_const())
-                s.second += 10;
-            result = s.first;
-            return s.second;
-		}
-
-		template<class T>
-		void converter_postcall(lua_State*, by_const_reference<T>, int)
-		{
-		}
-	};
-
-	// ****** enum converter ********
-
-	struct enum_converter
-	{
-		typedef enum_converter type;
-        typedef mpl::true_ is_native;
-
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-		
-		void apply(lua_State* L, int val)
-		{
-			lua_pushnumber(L, val);
-		}
-
-		template<class T>
-		T apply(lua_State* L, by_value<T>, int index)
-		{
-			return static_cast<T>(static_cast<int>(lua_tonumber(L, index)));
-		}
-		
-		template<class T>
-		static int match(lua_State* L, by_value<T>, int index)
-		{
-			if (lua_isnumber(L, index)) return 0; else return -1;
-		}
-
-		template<class T>
-		T apply(lua_State* L, by_const_reference<T>, int index)
-		{
-			return static_cast<T>(static_cast<int>(lua_tonumber(L, index)));
-		}
-
-		template<class T>
-		static int match(lua_State* L, by_const_reference<T>, int index)
-		{
-			if (lua_isnumber(L, index)) return 0; else return -1;
-		}
-
-		template<class T>
-		void converter_postcall(lua_State*, T, int) {}
-	};
-
-	template <class U>
-	struct value_wrapper_converter
-	{
-		typedef value_wrapper_converter<U> type;
-		typedef mpl::true_ is_native;
-
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-
-		template<class T>
-		T apply(lua_State* L, by_const_reference<T>, int index)
-		{
-			return T(from_stack(L, index));
-		}
-
-		template<class T>
-		T apply(lua_State* L, by_value<T>, int index)
-		{
-			return apply(L, by_const_reference<T>(), index);
-		}
-
-		template<class T>
-		static int match(lua_State* L, by_const_reference<T>, int index)
-		{
-			return value_wrapper_traits<T>::check(L, index) 
-                ? (std::numeric_limits<int>::max)() / LUABIND_MAX_ARITY
-                : -1;
-		}
-
-		template<class T>
-		static int match(lua_State* L, by_value<T>, int index)
-		{
-			return match(L, by_const_reference<T>(), index);
-		}
-
-		void converter_postcall(...) {}
-
-		template<class T>
-		void apply(lua_State* interpreter, T const& value_wrapper)
-		{
-			value_wrapper_traits<T>::unwrap(interpreter, value_wrapper);
-		}
-    };
-
-    template <class T>
-    struct default_converter_generator
-      : mpl::eval_if<
-            is_value_wrapper_arg<T>
-          , value_wrapper_converter<T>
-          , mpl::eval_if<
-                boost::is_enum<typename boost::remove_reference<T>::type>
-              , enum_converter
-              , mpl::eval_if<
-                    is_nonconst_pointer<T>
-                  , pointer_converter
-                  , mpl::eval_if<
-                        is_const_pointer<T>
-                      , const_pointer_converter
-                      , mpl::eval_if<
-                            is_nonconst_reference<T>
-                          , ref_converter
-                          , mpl::eval_if<
-                                is_const_reference<T>
-                              , const_ref_converter
-                              , value_converter
-                            >
-                        >
-                    >
-                >
-            >
-        >
-    {};
-
-} // namespace detail
-
-// *********** default_policy *****************
-
-template <class T>
-struct default_converter
-  : detail::default_converter_generator<T>::type
-{};
-
-template <class T, class Derived = default_converter<T> >
-struct native_converter_base
-{
-    typedef boost::mpl::true_ is_native;
-
-    int const consumed_args(...)
-    {
-        return 1;
-    }
-
-    template <class U>
-    void converter_postcall(lua_State*, U const&, int)
-    {}
-
-    int match(lua_State* L, detail::by_value<T>, int index)
-    {
-        return derived().compute_score(L, index);
-    }
-
-    int match(lua_State* L, detail::by_value<T const>, int index)
-    {
-        return derived().compute_score(L, index);
-    }
-
-    int match(lua_State* L, detail::by_const_reference<T>, int index)
-    {
-        return derived().compute_score(L, index);
-    }
-
-    T apply(lua_State* L, detail::by_value<T>, int index)
-    {
-        return derived().from(L, index);
-    }
-
-    T apply(lua_State* L, detail::by_value<T const>, int index)
-    {
-        return derived().from(L, index);
-    }
-
-    T apply(lua_State* L, detail::by_const_reference<T>, int index)
-    {
-        return derived().from(L, index);
-    }
-
-    void apply(lua_State* L, T const& value)
-    {
-        derived().to(L, value);
-    }
-
-    Derived& derived()
-    {
-        return static_cast<Derived&>(*this);
-    }
-};
-
-template <class T>
-lua_Integer as_lua_integer(T v)
-{
-    return static_cast<lua_Integer>(v);
-}
-
-template <class T>
-lua_Number as_lua_number(T v)
-{
-    return static_cast<lua_Number>(v);
-}
-
-# define LUABIND_NUMBER_CONVERTER(type, kind) \
-    template <> \
-struct default_converter<type> \
-  : native_converter_base<type> \
-{ \
-    int compute_score(lua_State* L, int index) \
-    { \
-        return lua_type(L, index) == LUA_TNUMBER ? 0 : -1; \
-    }; \
-    \
-    type from(lua_State* L, int index) \
-    { \
-        return static_cast<type>(BOOST_PP_CAT(lua_to, kind)(L, index)); \
-    } \
-    \
-    void to(lua_State* L, type const& value) \
-    { \
-        BOOST_PP_CAT(lua_push, kind)(L, BOOST_PP_CAT(as_lua_, kind)(value)); \
-    } \
-}; \
-\
-template <> \
-struct default_converter<type const> \
-  : default_converter<type> \
-{}; \
-\
-template <> \
-struct default_converter<type const&> \
-  : default_converter<type> \
-{};
-
-LUABIND_NUMBER_CONVERTER(char, integer)
-LUABIND_NUMBER_CONVERTER(signed char, integer)
-LUABIND_NUMBER_CONVERTER(unsigned char, integer)
-LUABIND_NUMBER_CONVERTER(signed short, integer)
-LUABIND_NUMBER_CONVERTER(unsigned short, integer)
-LUABIND_NUMBER_CONVERTER(signed int, integer)
-
-LUABIND_NUMBER_CONVERTER(unsigned int, number)
-LUABIND_NUMBER_CONVERTER(unsigned long, number)
-
-LUABIND_NUMBER_CONVERTER(signed long, integer)
-LUABIND_NUMBER_CONVERTER(float, number)
-LUABIND_NUMBER_CONVERTER(double, number)
-LUABIND_NUMBER_CONVERTER(long double, number)
-
-# undef LUABIND_NUMBER_CONVERTER
-
-template <>
-struct default_converter<bool>
-  : native_converter_base<bool>
-{
-    static int compute_score(lua_State* L, int index)
-    {
-        return lua_type(L, index) == LUA_TBOOLEAN ? 0 : -1;
-    }
-
-    bool from(lua_State* L, int index)
-    {
-        return lua_toboolean(L, index) == 1;
-    }
-
-    void to(lua_State* L, bool value)
-    {
-        lua_pushboolean(L, value);
-    }
-};
-
-template <>
-struct default_converter<bool const>
-  : default_converter<bool>
-{};
-
-template <>
-struct default_converter<bool const&>
-  : default_converter<bool>
-{};
-
-template <>
-struct default_converter<std::string>
-  : native_converter_base<std::string>
-{
-    static int compute_score(lua_State* L, int index)
-    {
-        return lua_type(L, index) == LUA_TSTRING ? 0 : -1;
-    }
-
-    std::string from(lua_State* L, int index)
-    {
-        return std::string(lua_tostring(L, index), lua_strlen(L, index));
-    }
-
-    void to(lua_State* L, std::string const& value)
-    {
-        lua_pushlstring(L, value.data(), value.size());
-    }
-};
-
-template <>
-struct default_converter<std::string const>
-  : default_converter<std::string>
-{};
-
-template <>
-struct default_converter<std::string const&>
-  : default_converter<std::string>
-{};
-
-template <>
-struct default_converter<char const*>
-{
-    typedef boost::mpl::true_ is_native;
-
-    int const consumed_args(...)
-    {
-        return 1;
-    }
-
-    template <class U>
-    static int match(lua_State* L, U, int index)
-    {
-        int type = lua_type(L, index);
-        return (type == LUA_TSTRING || type == LUA_TNIL) ? 0 : -1;
-    }
-
-    template <class U>
-    char const* apply(lua_State* L, U, int index)
-    {
-        return lua_tostring(L, index);
-    }
-
-    void apply(lua_State* L, char const* str)
-    {
-        lua_pushstring(L, str);
-    }
-
-    template <class U>
-    void converter_postcall(lua_State*, U, int)
-    {}
-};
-
-template <>
-struct default_converter<const char* const>
-  : default_converter<char const*>
-{};
-
-template <>
-struct default_converter<char*>
-  : default_converter<char const*>
-{};
-
-template <std::size_t N>
-struct default_converter<char const[N]>
-  : default_converter<char const*>
-{};
-
-template <std::size_t N>
-struct default_converter<char[N]>
-  : default_converter<char const*>
-{};
-
-template <>
-struct default_converter<lua_State*>
-{
-    int const consumed_args(...)
-    {
-        return 0;
-    }
-
-    template <class U>
-    lua_State* apply(lua_State* L, U, int)
-    {
-        return L;
-    }
-
-    template <class U>
-    static int match(lua_State*, U, int)
-    {
-        return 0;
-    }
-
-    template <class U>
-    void converter_postcall(lua_State*, U, int) {}
-};
-
-namespace detail
-{
-
-	struct default_policy : converter_policy_tag
-	{
-		BOOST_STATIC_CONSTANT(bool, has_arg = true);
-
-		template<class T>
-		static void precall(lua_State*, T, int) {}
-
-		template<class T, class Direction>
-		struct apply
-		{
-            typedef default_converter<T> type;
-        };
-	};
-
-    template<class T>
-    struct is_primitive
-      : default_converter<T>::is_native
-    {};
-
-// ============== new policy system =================
-
-	template<int, class> struct find_conversion_policy;
-
-	template<bool IsConverter = false>
-	struct find_conversion_impl
-	{
-		template<int N, class Policies>
-		struct apply
-		{
-			typedef typename find_conversion_policy<N, typename Policies::tail>::type type;
-		};
-	};
-
-	template<>
-	struct find_conversion_impl<true>
-	{
-		template<int N, class Policies>
-		struct apply
-		{
-			typedef typename Policies::head head;
-			typedef typename Policies::tail tail;
-
-			BOOST_STATIC_CONSTANT(bool, found = (N == head::index));
-
-			typedef typename
-				boost::mpl::if_c<found
-					, head
-					, typename find_conversion_policy<N, tail>::type
-				>::type type;
-		};
-	};
-
-	template<class Policies>
-	struct find_conversion_impl2
-	{
-		template<int N>
-		struct apply
-			: find_conversion_impl<
-				boost::is_base_and_derived<conversion_policy_base, typename Policies::head>::value
-			>::template apply<N, Policies>
-		{
-		};
-	};
-
-	template<>
-	struct find_conversion_impl2<detail::null_type>
-	{
-		template<int N>
-		struct apply
-		{
-			typedef default_policy type;
-		};
-	};
-
-	template<int N, class Policies>
-	struct find_conversion_policy : find_conversion_impl2<Policies>::template apply<N>
-	{
-	};
-
-	template<class List>
-	struct policy_list_postcall
-	{
-		typedef typename List::head head;
-		typedef typename List::tail tail;
-
-		static void apply(lua_State* L, const index_map& i)
-		{
-			head::postcall(L, i);
-			policy_list_postcall<tail>::apply(L, i);
-		}
-	};
-
-	template<>
-	struct policy_list_postcall<detail::null_type>
-	{
-		static void apply(lua_State*, const index_map&) {}
-	};
-
-// ==================================================
-
-// ************** precall and postcall on policy_cons *********************
-
-
-	template<class List>
-	struct policy_precall
-	{
-		typedef typename List::head head;
-		typedef typename List::tail tail;
-
-		static void apply(lua_State* L, int index)
-		{
-			head::precall(L, index);
-			policy_precall<tail>::apply(L, index);
-		}
-	};
-
-	template<>
-	struct policy_precall<detail::null_type>
-	{
-		static void apply(lua_State*, int) {}
-	};
-
-	template<class List>
-	struct policy_postcall
-	{
-		typedef typename List::head head;
-		typedef typename List::tail tail;
-
-		static void apply(lua_State* L, int index)
-		{
-			head::postcall(L, index);
-			policy_postcall<tail>::apply(L, index);
-		}
-	};
-
-	template<>
-	struct policy_postcall<detail::null_type>
-	{
-		static void apply(lua_State*, int) {}
-	};
-
-    template <class Policies, class Sought>
-    struct has_policy
-      : mpl::if_<
-            boost::is_same<typename Policies::head, Sought>
-          , mpl::true_
-          , has_policy<typename Policies::tail, Sought>
-        >::type
-    {};
-
-    template <class Sought>
-    struct has_policy<null_type, Sought>
-      : mpl::false_
-    {};
-
-}} // namespace luabind::detail
-
-
-namespace luabind { namespace
-{
-#if defined(__GNUC__) && ( \
-    (BOOST_VERSION < 103500) \
- || (BOOST_VERSION < 103900 && (__GNUC__ * 100 + __GNUC_MINOR__ <= 400)) \
- || (__GNUC__ * 100 + __GNUC_MINOR__ < 400))
-  static inline boost::arg<0> return_value()
-  {
-	  return boost::arg<0>();
-  }
-
-  static inline boost::arg<0> result()
-  {
-	  return boost::arg<0>();
-  }
-# define LUABIND_PLACEHOLDER_ARG(N) boost::arg<N>(*)()
-#elif defined(BOOST_MSVC) || defined(__MWERKS__) \
-  || (BOOST_VERSION >= 103900 && defined(__GNUC__) \
-        && (__GNUC__ * 100 + __GNUC_MINOR__ == 400))
-  static boost::arg<0> return_value;
-  static boost::arg<0> result;
-# define LUABIND_PLACEHOLDER_ARG(N) boost::arg<N>
-#else
-  boost::arg<0> return_value;
-  boost::arg<0> result;
-# define LUABIND_PLACEHOLDER_ARG(N) boost::arg<N>
-#endif
-}}
-
-#endif // LUABIND_POLICY_HPP_INCLUDED
-

+ 0 - 85
lib/luabind/luabind/detail/primitives.hpp

@@ -1,85 +0,0 @@
-// Copyright (c) 2003 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_PRIMITIVES_HPP_INCLUDED
-#define LUABIND_PRIMITIVES_HPP_INCLUDED
-
-#include <algorithm>
-#include <cstring>
-
-#include <luabind/config.hpp>
-#include <luabind/detail/yes_no.hpp>
-
-namespace luabind { namespace detail
-{
-	template<class T>
-	struct identity
-	{
-		typedef T type;
-	};
-
-	template<class T>
-    struct type_ {};
-
-	struct null_type {};
-
-/*	typedef char yes_t;
-	typedef double no_t;*/
-
-	struct lua_to_cpp {};
-	struct cpp_to_lua {};
-
-	template<class T> struct by_value {};
-	template<class T> struct by_reference {};
-	template<class T> struct by_const_reference {};
-	template<class T> struct by_pointer {};
-	template<class T> struct by_const_pointer {};
-
-	struct converter_policy_tag {};
-
-	struct ltstr
-	{
-		bool operator()(const char* s1, const char* s2) const { return std::strcmp(s1, s2) < 0; }
-	};
-
-	template<int N>
-	struct aligned 
-	{
-		char storage[N];
-	};
-
-	// returns the offset added to a Derived* when cast to a Base*
-	// TODO: return ptrdiff
-	template<class Derived, class Base>
-	int ptr_offset(type_<Derived>, type_<Base>)
-	{
-		aligned<sizeof(Derived)> obj;
-		Derived* ptr = reinterpret_cast<Derived*>(&obj);
-
-		return int(static_cast<char*>(static_cast<void*>(static_cast<Base*>(ptr)))
-		- static_cast<char*>(static_cast<void*>(ptr)));
-	}
-
-}}
-
-#endif // LUABIND_PRIMITIVES_HPP_INCLUDED

+ 0 - 33
lib/luabind/luabind/detail/property.hpp

@@ -1,33 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_PROPERTY_081020_HPP
-# define LUABIND_PROPERTY_081020_HPP
-
-namespace luabind { namespace detail {
-
-template <class Class, class T, class Result = T>
-struct access_member_ptr
-{
-    access_member_ptr(T Class::* mem_ptr)
-      : mem_ptr(mem_ptr)
-    {}
-
-    Result operator()(Class const& x) const
-    {
-        return const_cast<Class&>(x).*mem_ptr;
-    }
-
-    void operator()(Class& x, T const& value) const
-    {
-        x.*mem_ptr = value;
-    }
-
-    T Class::* mem_ptr;
-};
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_PROPERTY_081020_HPP
-

+ 0 - 112
lib/luabind/luabind/detail/ref.hpp

@@ -1,112 +0,0 @@
-// Copyright (c) 2003 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_REF_HPP_INCLUDED
-#define LUABIND_REF_HPP_INCLUDED
-
-#include <cassert>
-#include <algorithm>
-
-#include <luabind/config.hpp>
-#include <luabind/lua_include.hpp>
-
-namespace luabind
-{
-
-namespace detail
-{
-
-	struct lua_reference
-	{
-		lua_reference(lua_State* L_ = 0)
-			: L(L_)
-			, m_ref(LUA_NOREF)
-		{}
-		lua_reference(lua_reference const& r)
-			: L(r.L)
-			, m_ref(LUA_NOREF)
-		{
-			if (!r.is_valid()) return;
-			r.get(L);
-			set(L);
-		}
-		~lua_reference() { reset(); }
-
-		lua_State* state() const { return L; }
-
-		void operator=(lua_reference const& r)
-		{
-			// TODO: self assignment problems
-			reset();
-			if (!r.is_valid()) return;
-			r.get(r.state());
-			set(r.state());
-		}
-
-		bool is_valid() const
-		{ return m_ref != LUA_NOREF; }
-
-		void set(lua_State* L_)
-		{
-			reset();
-			L = L_;
-			m_ref = luaL_ref(L, LUA_REGISTRYINDEX);
-		}
-
-		void replace(lua_State* L_)
-		{
-			lua_rawseti(L_, LUA_REGISTRYINDEX, m_ref);
-		}
-
-		// L may not be the same pointer as
-		// was used when creating this reference
-		// since it may be a thread that shares
-		// the same globals table.
-		void get(lua_State* L_) const
-		{
-			assert(m_ref != LUA_NOREF);
-			assert(L_);
-			lua_rawgeti(L_, LUA_REGISTRYINDEX, m_ref);
-		}
-
-		void reset()
-		{
-			if (L && m_ref != LUA_NOREF) luaL_unref(L, LUA_REGISTRYINDEX, m_ref);
-			m_ref = LUA_NOREF;
-		}
-
-		void swap(lua_reference& r)
-		{
-			assert(r.L == L);
-			std::swap(r.m_ref, m_ref);
-		}
-
-	private:
-		lua_State* L;
-		int m_ref;
-	};
-
-}}
-
-#endif // LUABIND_REF_HPP_INCLUDED
-

+ 0 - 74
lib/luabind/luabind/detail/signature_match.hpp

@@ -1,74 +0,0 @@
-// Copyright (c) 2003 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_SIGNATURE_MATCH_HPP_INCLUDED
-#define LUABIND_SIGNATURE_MATCH_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-
-#include <boost/config.hpp>
-#ifndef LUABIND_CPP0x
-# include <boost/preprocessor/repetition/enum_params.hpp>
-# include <boost/preprocessor/repetition/enum_params_with_a_default.hpp>
-# include <boost/preprocessor/cat.hpp>
-# include <boost/preprocessor/arithmetic/inc.hpp>
-# include <boost/mpl/vector.hpp>
-# include <boost/mpl/size.hpp>
-# include <boost/mpl/remove.hpp>
-#endif
-
-namespace luabind
-{
-
-	namespace adl
-	{
-		class argument;
-	}
-
-# ifdef LUABIND_CPP0x
-
-    template <class... Args>
-    struct constructor
-    {
-        typedef vector<void, argument const&, Args...> signature;
-    };
-
-# else
-
-	template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(LUABIND_MAX_ARITY, class A, detail::null_type)>
-	struct constructor
-	{
-		typedef BOOST_PP_CAT(
-			boost::mpl::vector, BOOST_PP_INC(BOOST_PP_INC(LUABIND_MAX_ARITY)))<
-				void, argument const&, BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, A)
-		> signature0;
-
-		typedef typename boost::mpl::remove<
-			signature0, detail::null_type>::type signature;
-	};
-
-# endif // LUABIND_CPP0x
-
-}
-
-#endif // LUABIND_SIGNATURE_MATCH_HPP_INCLUDED
-

+ 0 - 52
lib/luabind/luabind/detail/stack_utils.hpp

@@ -1,52 +0,0 @@
-// Copyright (c) 2003 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_STACK_UTILS_HPP_INCLUDED
-#define LUABIND_STACK_UTILS_HPP_INCLUDED
-
-#include <cassert>
-
-namespace luabind { namespace detail
-{
-
-	struct stack_pop
-	{
-		stack_pop(lua_State* L, int n)
-			: m_state(L)
-			, m_n(n)
-			{
-			}
-
-		~stack_pop() 
-		{
-			lua_pop(m_state, m_n);
-		}
-
-	private:
-
-		lua_State* m_state;
-		int m_n;
-	};
-}}
-
-#endif // LUABIND_STACK_UTILS_HPP_INCLUDED
-

+ 0 - 190
lib/luabind/luabind/detail/typetraits.hpp

@@ -1,190 +0,0 @@
-// Copyright (c) 2003 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_TYPETRAITS_HPP_INCLUDED
-#define LUABIND_TYPETRAITS_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <boost/mpl/if.hpp>
-#include <boost/type_traits/is_reference.hpp>
-#include <boost/type_traits/is_const.hpp>
-#include <luabind/detail/primitives.hpp>
-
-namespace luabind { namespace detail 
-{
-
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-	template<class T>
-	struct is_const_type
-	{
-		typedef typename boost::mpl::if_<boost::is_const<T>
-			, yes_t
-			, no_t
-		>::type type;
-	};
-
-	template<bool is_Reference = false>
-	struct is_const_reference_helper
-	{
-		template<class>
-		struct apply
-		{
-			enum
-			{
-				value = false
-			};
-		};
-	};
-
-	template<class T>
-	typename is_const_type<T>::type is_const_reference_tester(T&);
-	no_t is_const_reference_tester(...);
-
-	template<>
-	struct is_const_reference_helper<true>
-	{
-		template<class T>
-		struct apply
-		{
-			static T getT();
-
-			enum
-			{
-				value = sizeof(is_const_reference_tester(getT())) == sizeof(yes_t)
-			};
-		};
-	};
-
-	template<class T>
-	struct is_const_reference
-		: is_const_reference_helper<boost::is_reference<T>::value>::template apply<T>
-	{
-		typedef boost::mpl::bool_<value> type;
-	};
-
-#else
-
-	template<class T>
-	struct is_const_reference
-	{
-		enum { value = false };
-		typedef boost::mpl::bool_<value> type;
-	};
-
-	template<class T>
-	struct is_const_reference<const T&>
-	{
-		enum { value = true };
-		typedef boost::mpl::bool_<value> type;
-	};
-
-#endif
-
-
-	template<class T>
-	struct is_nonconst_reference
-	{
-		enum
-		{
-			value = boost::is_reference<T>::value && !is_const_reference<T>::value
-		};
-		typedef boost::mpl::bool_<value> type;
-	};
-
-	template<class A>
-	yes_t is_const_pointer_helper(void(*)(const A*));
-	no_t is_const_pointer_helper(...);
-
-	template<class T>
-	struct is_const_pointer
-	{
-		enum { value = sizeof(is_const_pointer_helper((void(*)(T))0)) == sizeof(yes_t) };
-		typedef boost::mpl::bool_<value> type;
-	};
-
-	template<class A>
-	yes_t is_nonconst_pointer_helper(void(*)(A*));
-	no_t is_nonconst_pointer_helper(...);
-
-	template<class T>
-	struct is_nonconst_pointer
-	{
-		enum { value = sizeof(is_nonconst_pointer_helper((void(*)(T))0)) == sizeof(yes_t) && !is_const_pointer<T>::value };
-		typedef boost::mpl::bool_<value> type;
-	};
-/*
-	template<class T>
-	struct is_constructable_from_helper
-	{
-		static yes_t check(const T&);
-		static no_t check(...);
-	};
-
-	template<class T, class From>
-	struct is_constructable_from
-	{
-		static From getFrom();
-
-		enum
-		{
-			value = sizeof(is_constructable_from_helper<T>::check(getFrom())) == sizeof(yes_t)
-		};
-	};
-
-	template<class T>
-	struct is_const_member_function_helper
-	{
-		static no_t test(...);
-		template<class R>
-		static yes_t test(R(T::*)() const);
-		template<class R, class A1>
-		static yes_t test(R(T::*)(A1) const);
-		template<class R, class A1, class A2>
-		static yes_t test(R(T::*)(A1,A2) const);
-		template<class R, class A1, class A2, class A3>
-		static yes_t test(R(T::*)(A1,A2,A3) const);
-	};
-
-	template<class T, class U>
-	struct is_const_member_function
-	{
-		static U getU();
-
-		enum
-		{
-			value = sizeof(is_const_member_function_helper<T>::test(getU())) == sizeof(yes_t)
-		};
-	};
-*/
-
-	template<int v1, int v2>
-	struct max_c
-	{
-		enum { value = (v1>v2)?v1:v2 };
-	};
-
-}}
-
-#endif // LUABIND_TYPETRAITS_HPP_INCLUDED
-

+ 0 - 34
lib/luabind/luabind/detail/yes_no.hpp

@@ -1,34 +0,0 @@
-// Copyright (c) 2004 Daniel Wallin
-
-// 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 YES_NO_040211_HPP
-#define YES_NO_040211_HPP
-
-namespace luabind { namespace detail {
-
-    typedef char(&yes_t)[1];
-    typedef char(&no_t)[2];
-
-}} // namespace luabind::detail
-
-#endif // YES_NO_040211_HPP
-

+ 0 - 72
lib/luabind/luabind/discard_result_policy.hpp

@@ -1,72 +0,0 @@
-// Copyright (c) 2003 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_DISCARD_RESULT_POLICY_HPP_INCLUDED
-#define LUABIND_DISCARD_RESULT_POLICY_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/policy.hpp>
-
-namespace luabind { namespace detail 
-{
-	struct discard_converter
-	{
-		template<class T>
-		void apply(lua_State*, T) {}
-	};
-
-	struct discard_result_policy : conversion_policy<0>
-	{
-		static void precall(lua_State*, const index_map&) {}
-		static void postcall(lua_State*, const index_map&) {}
-
-		struct can_only_convert_from_cpp_to_lua {};
-
-		template<class T, class Direction>
-		struct apply
-		{
-			typedef typename boost::mpl::if_<boost::is_same<Direction, cpp_to_lua>
-				, discard_converter
-				, can_only_convert_from_cpp_to_lua
-			>::type type;
-		};
-	};
-
-}}
-
-namespace luabind
-{
-  detail::policy_cons<
-      detail::discard_result_policy, detail::null_type> const discard_result = {};
-
-  namespace detail
-  {
-    inline void ignore_unused_discard_result()
-    {
-        (void)discard_result;
-    }
-  }
-}
-
-#endif // LUABIND_DISCARD_RESULT_POLICY_HPP_INCLUDED
-

+ 0 - 93
lib/luabind/luabind/error.hpp

@@ -1,93 +0,0 @@
-// Copyright (c) 2003 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_ERROR_HPP_INCLUDED
-#define LUABIND_ERROR_HPP_INCLUDED
-
-#include <luabind/prefix.hpp>
-#include <exception>
-#include <luabind/config.hpp>
-#include <luabind/typeid.hpp>
-
-struct lua_State;
-
-namespace luabind
-{
-
-#ifndef LUABIND_NO_EXCEPTIONS
-
-	// this exception usually means that the lua function you called
-	// from C++ failed with an error code. You will have to
-	// read the error code from the top of the lua stack
-	// the reason why this exception class doesn't contain
-	// the message itself is that std::string's copy constructor
-	// 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 LUABIND_API error : public std::exception
-	{
-	public:
-		explicit error(lua_State* L): m_L(L) {}
-		lua_State* state() const throw() { return m_L; }
-		virtual const char* what() const throw()
-		{
-			return "lua runtime error";
-		}
-	private:
-		lua_State* m_L;
-	};
-
-	// if an object_cast<>() fails, this is thrown
-	// it is also thrown if the return value of
-	// a lua function cannot be converted
-	class LUABIND_API cast_failed : public std::exception
-	{
-	public:
-		cast_failed(lua_State* L, type_id const& i): m_L(L), m_info(i) {}
-		lua_State* state() const throw() { return m_L; }
-		type_id info() const throw() { return m_info; }
-		virtual const char* what() const throw() { return "unable to make cast"; }
-	private:
-		lua_State* m_L;
-		type_id m_info;
-	};
-
-#else
-
-	typedef void(*error_callback_fun)(lua_State*);
-	typedef void(*cast_failed_callback_fun)(lua_State*, type_id const&);
-
-	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*);
-	LUABIND_API void set_pcall_callback(pcall_callback_fun e);
-	LUABIND_API pcall_callback_fun get_pcall_callback();
-
-}
-
-#endif // LUABIND_ERROR_HPP_INCLUDED
-

+ 0 - 110
lib/luabind/luabind/exception_handler.hpp

@@ -1,110 +0,0 @@
-// Copyright Daniel Wallin 2005. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_EXCEPTION_HANDLER_050601_HPP
-# define LUABIND_EXCEPTION_HANDLER_050601_HPP
-
-# include <luabind/lua_include.hpp>
-# include <luabind/config.hpp>
-# include <boost/optional.hpp>
-# include <boost/type.hpp>
-
-# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-#  include <boost/mpl/if.hpp>
-#  include <boost/type_traits/is_pointer.hpp>
-# endif
-
-namespace luabind {
-
-# ifndef LUABIND_NO_EXCEPTIONS
-
-namespace detail
-{
-
-  struct LUABIND_API exception_handler_base
-  {
-      exception_handler_base()
-        : next(0)
-      {}
-
-      virtual ~exception_handler_base() {}
-      virtual void handle(lua_State*) const = 0;
-
-      void try_next(lua_State*) const;
-
-      exception_handler_base* next;
-  };
-
-  namespace mpl = boost::mpl;
-
-  template<class E, class Handler>
-  struct exception_handler : exception_handler_base
-  {
-#  if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-      typedef typename mpl::if_<
-          boost::is_pointer<E>, E, E const&
-      >::type argument;
-#  else
-      typedef E const& argument;
-#  endif
-
-      exception_handler(Handler handler)
-        : handler(handler)
-      {}
-
-      void handle(lua_State* L) const
-      {
-          try
-          {
-              try_next(L);
-          }
-          catch (argument e)
-          {
-              handler(L, e);
-          }
-      }
-
-      Handler handler;
-  };
-
-  LUABIND_API void handle_exception_aux(lua_State* L);
-  LUABIND_API void register_exception_handler(exception_handler_base*);
-
-} // namespace detail
-
-# endif
-
-template<class E, class Handler>
-void register_exception_handler(Handler handler, boost::type<E>* = 0)
-{
-# ifndef LUABIND_NO_EXCEPTIONS
-    detail::register_exception_handler(
-        new detail::exception_handler<E, Handler>(handler)
-    );
-# endif
-}
-
-template<class R, class F>
-boost::optional<R> handle_exceptions(lua_State* L, F fn, boost::type<R>* = 0)
-{
-# ifndef LUABIND_NO_EXCEPTIONS
-    try
-    {
-        return fn();
-    }
-    catch (...)
-    {
-        detail::handle_exception_aux(L);
-    }
-
-    return boost::optional<R>();
-# else
-    return fn();
-# endif
-}
-
-} // namespace luabind
-
-#endif // LUABIND_EXCEPTION_HANDLER_050601_HPP
-

+ 0 - 42
lib/luabind/luabind/from_stack.hpp

@@ -1,42 +0,0 @@
-// Copyright (c) 2005 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_FROM_STACK_050715_HPP
-#define LUABIND_FROM_STACK_050715_HPP
-
-namespace luabind {
-
-struct from_stack
-{
-    from_stack(lua_State* interpreter, int index)
-      : interpreter(interpreter)
-      , index(index)
-    {}
-
-    lua_State* interpreter;
-    int index;
-};
-
-} // namespace luabind
-
-#endif // LUABIND_FROM_STACK_050715_HPP
-

+ 0 - 62
lib/luabind/luabind/function.hpp

@@ -1,62 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_FUNCTION2_081014_HPP
-# define LUABIND_FUNCTION2_081014_HPP
-
-# include <luabind/make_function.hpp>
-# include <luabind/scope.hpp>
-# include <luabind/detail/call_function.hpp>
-
-namespace luabind {
-
-namespace detail
-{
-
-  template <class F, class Policies>
-  struct function_registration : registration
-  {
-      function_registration(char const* name, F f, Policies const& policies)
-        : name(name)
-        , f(f)
-        , policies(policies)
-      {}
-
-      void register_(lua_State* L) const
-      {
-          object fn = make_function(L, f, deduce_signature(f), policies);
-
-          add_overload(
-              object(from_stack(L, -1))
-            , name
-            , fn
-          );
-      }
-
-      char const* name;
-      F f;
-      Policies policies;
-  };
-
-  LUABIND_API bool is_luabind_function(lua_State* L, int index);
-
-} // namespace detail
-
-template <class F, class Policies>
-scope def(char const* name, F f, Policies const& policies)
-{
-    return scope(std::auto_ptr<detail::registration>(
-        new detail::function_registration<F, Policies>(name, f, policies)));
-}
-
-template <class F>
-scope def(char const* name, F f)
-{
-    return def(name, f, detail::null_type());
-}
-
-} // namespace luabind
-
-#endif // LUABIND_FUNCTION2_081014_HPP
-

+ 0 - 16
lib/luabind/luabind/get_main_thread.hpp

@@ -1,16 +0,0 @@
-// Copyright Daniel Wallin 2009. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_GET_MAIN_THREAD_090321_HPP
-# define LUABIND_GET_MAIN_THREAD_090321_HPP
-
-# include <luabind/config.hpp>
-
-namespace luabind {
-
-LUABIND_API lua_State* get_main_thread(lua_State* L);
-
-} // namespace luabind
-
-#endif // LUABIND_GET_MAIN_THREAD_090321_HPP

+ 0 - 39
lib/luabind/luabind/get_pointer.hpp

@@ -1,39 +0,0 @@
-// Copyright (c) 2005 Daniel Wallin
-
-// 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_GET_POINTER_051023_HPP
-# define LUABIND_GET_POINTER_051023_HPP
-
-//
-// We need these overloads in the luabind namespace.
-//
-
-# include <boost/get_pointer.hpp>
-
-namespace luabind {
-
-using boost::get_pointer;
-
-} // namespace luabind
-
-#endif // LUABIND_GET_POINTER_051023_HPP
-

+ 0 - 144
lib/luabind/luabind/handle.hpp

@@ -1,144 +0,0 @@
-// Copyright (c) 2005 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_HANDLE_050420_HPP
-#define LUABIND_HANDLE_050420_HPP
-
-#include <luabind/lua_include.hpp>
-#include <luabind/value_wrapper.hpp>
-
-namespace luabind {
-
-// A reference to a Lua value. Represents an entry in the
-// registry table.
-class handle 
-{
-public:
-    handle();
-    handle(lua_State* interpreter, int stack_index);
-    handle(lua_State* main, lua_State* interpreter, int stack_index);
-    handle(handle const& other);
-    ~handle();
-
-    handle& operator=(handle const& other);
-    void swap(handle& other);
-
-    void push(lua_State* interpreter) const;
-
-    lua_State* interpreter() const;
-
-    void replace(lua_State* interpreter, int stack_index);
-
-private:
-    lua_State* m_interpreter;
-    int m_index;
-};
-
-inline handle::handle()
-  : m_interpreter(0)
-  , m_index(LUA_NOREF)
-{}
-
-inline handle::handle(handle const& other)
-  : m_interpreter(other.m_interpreter)
-  , m_index(LUA_NOREF)
-{
-    if (m_interpreter == 0) return;
-    lua_rawgeti(m_interpreter, LUA_REGISTRYINDEX, other.m_index);
-    m_index = luaL_ref(m_interpreter, LUA_REGISTRYINDEX);
-}
-
-inline handle::handle(lua_State* interpreter, int stack_index)
-  : m_interpreter(interpreter)
-  , m_index(LUA_NOREF)
-{
-    lua_pushvalue(interpreter, stack_index);
-    m_index = luaL_ref(interpreter, LUA_REGISTRYINDEX);
-}
-
-inline handle::handle(lua_State* main, lua_State* interpreter, int stack_index)
-  : m_interpreter(main)
-  , m_index(LUA_NOREF)
-{
-    lua_pushvalue(interpreter, stack_index);
-    m_index = luaL_ref(interpreter, LUA_REGISTRYINDEX);
-}
-
-inline handle::~handle()
-{
-    if (m_interpreter && m_index != LUA_NOREF)
-        luaL_unref(m_interpreter, LUA_REGISTRYINDEX, m_index);
-}
-
-inline handle& handle::operator=(handle const& other)
-{
-    handle(other).swap(*this);
-    return *this;
-}
-
-inline void handle::swap(handle& other)
-{
-    std::swap(m_interpreter, other.m_interpreter);
-    std::swap(m_index, other.m_index);
-}
-
-inline void handle::push(lua_State* interpreter) const
-{
-    lua_rawgeti(interpreter, LUA_REGISTRYINDEX, m_index);
-}
-
-inline lua_State* handle::interpreter() const
-{
-    return m_interpreter;
-}
-
-inline void handle::replace(lua_State* interpreter, int stack_index)
-{
-    lua_pushvalue(interpreter, stack_index);
-    lua_rawseti(interpreter, LUA_REGISTRYINDEX, m_index);
-}
-
-template<>
-struct value_wrapper_traits<handle>
-{
-    typedef boost::mpl::true_ is_specialized;
-
-    static lua_State* interpreter(handle const& value)
-    {
-        return value.interpreter();
-    }
-    
-    static void unwrap(lua_State* interpreter, handle const& value)
-    {
-        value.push(interpreter);
-    }
-
-    static bool check(...)
-    {
-        return true;
-    }
-};
-
-} // namespace luabind
-
-#endif // LUABIND_HANDLE_050420_HPP
-

+ 0 - 112
lib/luabind/luabind/iterator_policy.hpp

@@ -1,112 +0,0 @@
-// Copyright Daniel Wallin 2007. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_ITERATOR_POLICY__071111_HPP
-# define LUABIND_ITERATOR_POLICY__071111_HPP
-
-# include <luabind/config.hpp>
-# include <luabind/detail/policy.hpp>
-# include <luabind/detail/convert_to_lua.hpp>
-
-namespace luabind { namespace detail {
-
-template <class Iterator>
-struct iterator
-{
-    static int next(lua_State* L)
-    {
-        iterator* self = static_cast<iterator*>(
-            lua_touserdata(L, lua_upvalueindex(1)));
-
-        if (self->first != self->last)
-        {
-            convert_to_lua(L, *self->first);
-            ++self->first;
-        }
-        else
-        {
-            lua_pushnil(L);
-        }
-
-        return 1;
-    }
-
-    static int destroy(lua_State* L)
-    {
-        iterator* self = static_cast<iterator*>(lua_touserdata(L, 1));
-        self->~iterator();
-        return 0;
-    }
-
-    iterator(Iterator first, Iterator last)
-      : first(first)
-      , last(last)
-    {}
-
-    Iterator first;
-    Iterator last;
-};
-
-template <class Iterator>
-int make_range(lua_State* L, Iterator first, Iterator last)
-{
-    void* storage = lua_newuserdata(L, sizeof(iterator<Iterator>));
-    lua_newtable(L);
-    lua_pushcclosure(L, iterator<Iterator>::destroy, 0);
-    lua_setfield(L, -2, "__gc");
-    lua_setmetatable(L, -2);
-    lua_pushcclosure(L, iterator<Iterator>::next, 1);
-    new (storage) iterator<Iterator>(first, last);
-    return 1;
-}
-
-template <class Container>
-int make_range(lua_State* L, Container& container)
-{
-    return make_range(L, container.begin(), container.end());
-}
-
-struct iterator_converter
-{
-    typedef iterator_converter type;
-
-    template <class Container>
-    void apply(lua_State* L, Container& container)
-    {
-        make_range(L, container);
-    }
-
-    template <class Container>
-    void apply(lua_State* L, Container const& container)
-    {
-        make_range(L, container);
-    }
-};
-
-struct iterator_policy : conversion_policy<0>
-{
-    static void precall(lua_State*, index_map const&)
-    {}
-
-    static void postcall(lua_State*, index_map const&)
-    {}
-
-    template <class T, class Direction>
-    struct apply
-    {
-        typedef iterator_converter type;
-    };
-};
-
-}} // namespace luabind::detail
-
-namespace luabind { namespace {
-
-LUABIND_ANONYMOUS_FIX detail::policy_cons<
-    detail::iterator_policy, detail::null_type> return_stl_iterator;
-
-}} // namespace luabind::unnamed
-
-#endif // LUABIND_ITERATOR_POLICY__071111_HPP
-

+ 0 - 39
lib/luabind/luabind/lua_include.hpp

@@ -1,39 +0,0 @@
-// Copyright (c) 2003 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 LUA_INCLUDE_HPP_INCLUDED
-#define LUA_INCLUDE_HPP_INCLUDED
-
-#ifndef LUABIND_CPLUSPLUS_LUA
-extern "C"
-{
-#endif
-
-	#include "lua.h"
-	#include "lauxlib.h"
-
-#ifndef LUABIND_CPLUSPLUS_LUA
-}
-#endif
-
-#endif
-

+ 0 - 32
lib/luabind/luabind/luabind.hpp

@@ -1,32 +0,0 @@
-// Copyright (c) 2003 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_BIND_HPP_INCLUDED
-#define LUABIND_BIND_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/class.hpp>
-#include <luabind/function.hpp>
-#include <luabind/open.hpp>
-
-#endif // LUABIND_BIND_HPP_INCLUDED

+ 0 - 125
lib/luabind/luabind/make_function.hpp

@@ -1,125 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_MAKE_FUNCTION_081014_HPP
-# define LUABIND_MAKE_FUNCTION_081014_HPP
-
-# include <luabind/config.hpp>
-# include <luabind/object.hpp>
-# include <luabind/vector.hpp>
-# include <luabind/detail/call.hpp>
-# include <luabind/detail/deduce_signature.hpp>
-# include <luabind/detail/format_signature.hpp>
-
-namespace luabind {
-
-namespace detail
-{
-# ifndef LUABIND_NO_EXCEPTIONS
-  LUABIND_API void handle_exception_aux(lua_State* L);
-# endif
-
-// MSVC complains about member being sensitive to alignment (C4121)
-// when F is a pointer to member of a class with virtual bases.
-# ifdef BOOST_MSVC
-#  pragma pack(push)
-#  pragma pack(16)
-# endif
-
-  template <class F, class Signature, class Policies>
-  struct function_object_impl : function_object
-  {
-      function_object_impl(F f, Policies const& policies)
-        : function_object(&entry_point)
-        , f(f)
-        , policies(policies)
-      {}
-
-      int call(lua_State* L, invoke_context& ctx) const
-      {
-          return invoke(L, *this, ctx, f, Signature(), policies);
-      }
-
-      void format_signature(lua_State* L, char const* function) const
-      {
-          detail::format_signature(L, function, Signature());
-      }
-
-      static int entry_point(lua_State* L)
-      {
-          function_object_impl const* impl =
-              *(function_object_impl const**)lua_touserdata(L, lua_upvalueindex(1));
-
-          invoke_context ctx;
-
-          int results = 0;
-
-# ifndef LUABIND_NO_EXCEPTIONS
-          bool exception_caught = false;
-
-          try
-          {
-              results = invoke(
-                  L, *impl, ctx, impl->f, Signature(), impl->policies);
-          }
-          catch (...)
-          {
-              exception_caught = true;
-              handle_exception_aux(L);
-          }
-
-          if (exception_caught)
-              lua_error(L);
-# else
-          results = invoke(L, *impl, ctx, impl->f, Signature(), impl->policies);
-# endif
-
-          if (!ctx)
-          {
-              ctx.format_error(L, impl);
-              lua_error(L);
-          }
-
-          return results;
-      }
-
-      F f;
-      Policies policies;
-  };
-
-# ifdef BOOST_MSVC
-#  pragma pack(pop)
-# endif
-
-  LUABIND_API object make_function_aux(
-      lua_State* L, function_object* impl
-  );
-
-  LUABIND_API void add_overload(object const&, char const*, object const&);
-
-} // namespace detail
-
-template <class F, class Signature, class Policies>
-object make_function(lua_State* L, F f, Signature, Policies)
-{
-    typedef typename detail::as_vector<Signature>::type signature;
-
-    return detail::make_function_aux(
-        L
-      , new detail::function_object_impl<F, signature, Policies>(
-            f, Policies()
-        )
-    );
-}
-
-template <class F>
-object make_function(lua_State* L, F f)
-{
-    return make_function(L, detail::deduce_signature(f), detail::null_type());
-}
-
-} // namespace luabind
-
-#endif // LUABIND_MAKE_FUNCTION_081014_HPP
-

+ 0 - 40
lib/luabind/luabind/nil.hpp

@@ -1,40 +0,0 @@
-// 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
-
-#include <luabind/config.hpp>
-
-namespace luabind
-{
-   namespace detail
-   {
-      struct nil_type {};
-   }
-
-   // defined in class.cpp
-   extern LUABIND_API detail::nil_type nil;
-}
-
-#endif
-

+ 0 - 43
lib/luabind/luabind/no_dependency.hpp

@@ -1,43 +0,0 @@
-// Copyright Daniel Wallin 2010. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_NO_DEPENDENCY_100324_HPP
-# define LUABIND_NO_DEPENDENCY_100324_HPP
-
-# include <luabind/detail/policy.hpp>
-
-namespace luabind {
-
-namespace detail
-{
-
-  struct no_dependency_policy
-  {
-      static void precall(lua_State*, index_map const&)
-      {}
-
-      static void postcall(lua_State*, index_map const&)
-      {}
-  };
-
-  typedef policy_cons<no_dependency_policy, null_type>
-      no_dependency_node;
-
-} // namespace detail
-
-detail::no_dependency_node const no_dependency = {};
-
-namespace detail
-{
-
-  inline void ignore_unused_no_dependency()
-  {
-      (void)no_dependency;
-  }
-
-} // namespace detail
-
-} // namespace luabind
-
-#endif // LUABIND_NO_DEPENDENCY_100324_HPP

+ 0 - 1470
lib/luabind/luabind/object.hpp

@@ -1,1470 +0,0 @@
-// Copyright (c) 2005 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_OBJECT_050419_HPP
-#define LUABIND_OBJECT_050419_HPP
-
-#include <boost/implicit_cast.hpp> // detail::push()
-#include <boost/ref.hpp> // detail::push()
-#include <boost/mpl/bool.hpp> // value_wrapper_traits specializations
-#include <boost/mpl/apply_wrap.hpp>
-#ifdef LUABIND_CPP0x
-# include <tuple>
-#else
-# include <boost/tuple/tuple.hpp>
-#endif
-#include <boost/optional.hpp>
-
-#include <luabind/nil.hpp>
-#include <luabind/value_wrapper.hpp>
-#include <luabind/detail/pcall.hpp>
-#include <luabind/handle.hpp>
-#include <luabind/from_stack.hpp>
-#include <luabind/detail/policy.hpp>
-#include <luabind/detail/stack_utils.hpp>
-#include <luabind/detail/convert_to_lua.hpp> // REFACTOR
-#include <luabind/typeid.hpp>
-
-#include <boost/iterator/iterator_facade.hpp> // iterator
-
-#ifndef LUABIND_CPP0x
-#include <boost/preprocessor/iteration/iterate.hpp>
-#endif
-#include <boost/utility/enable_if.hpp>
-
-namespace luabind {
-
-namespace detail 
-{
-  namespace mpl = boost::mpl;
-  
-  template<class T, class ConverterGenerator>
-  void push_aux(lua_State* interpreter, T& value, ConverterGenerator*)
-  {
-      typedef typename boost::mpl::if_<
-          boost::is_reference_wrapper<T>
-        , BOOST_DEDUCED_TYPENAME boost::unwrap_reference<T>::type&
-        , T
-      >::type unwrapped_type;
-
-      typename mpl::apply_wrap2<
-          ConverterGenerator,unwrapped_type,cpp_to_lua
-      >::type cv;
-
-      cv.apply(
-          interpreter
-        , boost::implicit_cast<
-              BOOST_DEDUCED_TYPENAME boost::unwrap_reference<T>::type&
-          >(value)
-      );
-  }
-
-  template<class T, class Policies>
-  void push(lua_State* interpreter, T& value, Policies const&)
-  {
-      typedef typename find_conversion_policy<
-          0
-        , Policies
-      >::type converter_policy;
-
-      push_aux(interpreter, value, (converter_policy*)0);
-  }
-
-  template<class T>
-  void push(lua_State* interpreter, T& value)
-  {
-      push(interpreter, value, null_type());
-  }
-
-} // namespace detail
-
-namespace adl
-{
-  namespace mpl = boost::mpl;
-  
-  template <class T>
-  class object_interface;
-  
-  namespace is_object_interface_aux
-  {
-    typedef char (&yes)[1];
-    typedef char (&no)[2];
-    
-    template <class T>
-    yes check(object_interface<T>*);
-    no check(void*);
-
-    template <class T>
-    struct impl 
-    {
-        BOOST_STATIC_CONSTANT(bool, value =
-            sizeof(is_object_interface_aux::check((T*)0)) == sizeof(yes)
-        );
-
-        typedef mpl::bool_<value> type;
-    };
-
-  } // namespace detail
-
-  template <class T>
-  struct is_object_interface
-    : is_object_interface_aux::impl<T>::type
-  {};
-
-  template <class R, class T, class U>
-  struct enable_binary
-# ifndef BOOST_NO_SFINAE
-    : boost::enable_if<
-          mpl::or_<
-              is_object_interface<T>
-            , is_object_interface<U>
-          >
-        , R
-      >
-  {};
-# else
-  {
-      typedef R type;
-  };
-# endif
-
-  template<class T, class U>
-  int binary_interpreter(lua_State*& L, T const& lhs, U const& rhs
-    , boost::mpl::true_, boost::mpl::true_)
-  {
-       L = value_wrapper_traits<T>::interpreter(lhs);
-		 lua_State* L2 = value_wrapper_traits<U>::interpreter(rhs);
-
-       // you are comparing objects with different interpreters
-       // that's not allowed.
-		 assert(L == L2 || L == 0 || L2 == 0);
-
-       // if the two objects we compare have different interpreters
-       // then they
-
-       if (L != L2) return -1;
-       if (L == 0) return 1;
-       return 0;
-  }
-	
-  template<class T, class U>
-  int binary_interpreter(lua_State*& L, T const& x, U const&
-    , boost::mpl::true_, boost::mpl::false_)
-  {
-       L = value_wrapper_traits<T>::interpreter(x);
-       return 0;
-  }
-
-  template<class T, class U>
-  int binary_interpreter(lua_State*& L, T const&, U const& x, boost::mpl::false_, boost::mpl::true_)
-  {
-      L = value_wrapper_traits<U>::interpreter(x);
-      return 0;
-  }
-
-  template<class T, class U>
-  int binary_interpreter(lua_State*& L, T const& x, U const& y)
-  {
-      return binary_interpreter(
-          L
-        , x
-        , y
-        , is_value_wrapper<T>()
-        , is_value_wrapper<U>()
-      );
-  }
-
-#define LUABIND_BINARY_OP_DEF(op, fn) \
-  template<class LHS, class RHS> \
-  typename enable_binary<bool,LHS,RHS>::type \
-  operator op(LHS const& lhs, RHS const& rhs) \
-  { \
-      lua_State* L = 0; \
-      switch (binary_interpreter(L, lhs, rhs)) \
-      { \
-          case 1: \
-              return true; \
-          case -1: \
-              return false; \
-      } \
-\
-      assert(L); \
-\
-      detail::stack_pop pop1(L, 1); \
-      detail::push(L, lhs); \
-      detail::stack_pop pop2(L, 1); \
-      detail::push(L, rhs); \
-\
-      return fn(L, -1, -2) != 0; \
-  }
-
-LUABIND_BINARY_OP_DEF(==, lua_equal)
-LUABIND_BINARY_OP_DEF(<, lua_lessthan)
-
-  template<class ValueWrapper>
-  std::ostream& operator<<(std::ostream& os
-    , object_interface<ValueWrapper> const& v)
-  {
-      using namespace luabind;
-      lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-          static_cast<ValueWrapper const&>(v));
-      detail::stack_pop pop(interpreter, 1);
-      value_wrapper_traits<ValueWrapper>::unwrap(interpreter
-        , static_cast<ValueWrapper const&>(v));
-		char const* p = lua_tostring(interpreter, -1);
-        std::size_t len = lua_strlen(interpreter, -1);
-		std::copy(p, p + len, std::ostream_iterator<char>(os));
-		return os;
-	}
-
-#undef LUABIND_BINARY_OP_DEF
-
-  template<class LHS, class RHS>
-  typename enable_binary<bool,LHS,RHS>::type
-  operator>(LHS const& lhs, RHS const& rhs)
-  {
-      return !(lhs < rhs || lhs == rhs);
-  }
-
-  template<class LHS, class RHS>
-  typename enable_binary<bool,LHS,RHS>::type 
-  operator<=(LHS const& lhs, RHS const& rhs)
-  {
-      return lhs < rhs || lhs == rhs;
-  }
-
-  template<class LHS, class RHS>
-  typename enable_binary<bool,LHS,RHS>::type 
-  operator>=(LHS const& lhs, RHS const& rhs)
-  {
-      return !(lhs < rhs);
-  }
-
-  template<class LHS, class RHS>
-  typename enable_binary<bool,LHS,RHS>::type 
-  operator!=(LHS const& lhs, RHS const& rhs)
-  {
-      return !(lhs == rhs);
-  }
-
-  template<class ValueWrapper, class Arguments>
-  struct call_proxy;
-
-  template<class Next>
-  class index_proxy;
-
-  class object;
-  
-  template<class Derived>
-  class object_interface
-  {
-      struct safe_bool_type {};
-  public:
-      ~object_interface() {}
-
-# ifdef LUABIND_CPP0x
-
-      template <class... Args>
-      call_proxy<
-          Derived, std::tuple<Args const*...>
-      > operator()(Args const& ...args)
-      {
-          typedef std::tuple<Args const*...> arguments;
-          return call_proxy<Derived, arguments>(derived(), arguments(&args...));
-      }
-
-# else
-
-      call_proxy<Derived, boost::tuples::tuple<> > operator()();
-
-      template<class A0>
-      call_proxy<
-          Derived
-        , boost::tuples::tuple<A0 const*>
-      > operator()(A0 const& a0)
-      {
-          typedef boost::tuples::tuple<A0 const*> arguments;
-
-          return call_proxy<Derived, arguments>(
-              derived()
-            , arguments(&a0)
-          );
-      }
-
-      template<class A0, class A1>
-      call_proxy<
-          Derived
-        , boost::tuples::tuple<A0 const*, A1 const*>
-      > operator()(A0 const& a0, A1 const& a1)
-      {
-          typedef boost::tuples::tuple<A0 const*, A1 const*> arguments;
-
-          return call_proxy<Derived, arguments>(
-              derived()
-            , arguments(&a0, &a1)
-          );
-      }
-
-      // The rest of the overloads are PP-generated.
-      #define BOOST_PP_ITERATION_PARAMS_1 (3, \
-          (3, LUABIND_MAX_ARITY, <luabind/detail/object_call.hpp>))
-      #include BOOST_PP_ITERATE()
-
-# endif // LUABIND_CPP0x
-
-      operator safe_bool_type*() const
-      {
-          lua_State* L = value_wrapper_traits<Derived>::interpreter(derived());
-
-          if (!L)
-              return 0;
-
-          value_wrapper_traits<Derived>::unwrap(L, derived());
-          detail::stack_pop pop(L, 1);
-
-          return lua_toboolean(L, -1) == 1 ? (safe_bool_type*)1 : 0;
-      }
-
-  private:
-      Derived& derived()
-      {
-          return *static_cast<Derived*>(this);
-      }
-
-      Derived const& derived() const
-      {
-          return *static_cast<Derived const*>(this);
-      }
-  };
-
-#ifdef LUABIND_USE_VALUE_WRAPPER_TAG
-  struct iterator_proxy_tag;
-#endif
-  
-  template<class AccessPolicy>
-  class iterator_proxy
-    : public object_interface<iterator_proxy<AccessPolicy> >
-  {
-  public:
-#ifdef LUABIND_USE_VALUE_WRAPPER_TAG
-      typedef iterator_proxy_tag value_wrapper_tag;
-#endif
-
-      iterator_proxy(lua_State* interpreter, handle const& table, handle const& key)
-        : m_interpreter(interpreter)
-        , m_table_index(lua_gettop(interpreter) + 1)
-        , m_key_index(m_table_index + 1)
-      {
-          table.push(m_interpreter);
-          key.push(m_interpreter);
-      }
-
-      iterator_proxy(iterator_proxy const& other)
-        : m_interpreter(other.m_interpreter)
-        , m_table_index(other.m_table_index)
-        , m_key_index(other.m_key_index)
-      {
-          other.m_interpreter = 0;
-      }
-
-      ~iterator_proxy()
-      {
-          if (m_interpreter)
-              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)
-      {
-          lua_pushvalue(m_interpreter, m_key_index);
-          detail::push(m_interpreter, value);
-          AccessPolicy::set(m_interpreter, m_table_index);
-          return *this;
-      }
-
-      template<class Key>
-      index_proxy<iterator_proxy<AccessPolicy> > operator[](Key const& key)
-      {
-          return index_proxy<iterator_proxy<AccessPolicy> >(
-              *this, m_interpreter, key
-          );
-      }
-
-      // This is non-const to prevent conversion on lvalues.
-      operator object();
-
-      lua_State* interpreter() const
-      {
-          return m_interpreter;
-      }
-
-      // TODO: Why is it non-const?
-      void push(lua_State* interpreter)
-      {
-          assert(interpreter == m_interpreter);
-          lua_pushvalue(m_interpreter, m_key_index);
-          AccessPolicy::get(m_interpreter, m_table_index);
-      }
-
-  private:
-      mutable lua_State* m_interpreter;
-      int m_table_index;
-      int m_key_index;
-  };
-
-} // namespace adl
-
-namespace detail
-{
-  struct basic_access
-  {
-      static void set(lua_State* interpreter, int table)
-      {
-          lua_settable(interpreter, table);
-      }
-
-      static void get(lua_State* interpreter, int table)
-      {
-          lua_gettable(interpreter, table);
-      }
-  };
-
-  struct raw_access
-  {
-      static void set(lua_State* interpreter, int table)
-      {
-          lua_rawset(interpreter, table);
-      }
-
-      static void get(lua_State* interpreter, int table)
-      {
-          lua_rawget(interpreter, table);
-      }
-  };
-
-  template<class AccessPolicy>
-  class basic_iterator 
-    : public boost::iterator_facade<
-        basic_iterator<AccessPolicy>
-      , adl::iterator_proxy<AccessPolicy>
-      , boost::single_pass_traversal_tag
-      , adl::iterator_proxy<AccessPolicy>
-    >
-  {
-  public:
-      basic_iterator()
-        : m_interpreter(0)
-      {}
-
-      template<class ValueWrapper>
-      explicit basic_iterator(ValueWrapper const& value_wrapper)
-        : m_interpreter(
-              value_wrapper_traits<ValueWrapper>::interpreter(value_wrapper)
-          )
-      {
-          detail::stack_pop pop(m_interpreter, 1);
-          value_wrapper_traits<ValueWrapper>::unwrap(m_interpreter, value_wrapper);
-
-          lua_pushnil(m_interpreter);
-          if (lua_next(m_interpreter, -2) != 0)
-          {
-              detail::stack_pop pop(m_interpreter, 2);
-              handle(m_interpreter, -2).swap(m_key);
-          }
-          else
-          {
-              m_interpreter = 0;
-              return;
-          }
-
-          handle(m_interpreter, -1).swap(m_table);
-      }
-
-      adl::object key() const;
-
-  private:
-      friend class boost::iterator_core_access;
-
-      void increment()
-      {
-          m_table.push(m_interpreter);
-          m_key.push(m_interpreter);
-
-          detail::stack_pop pop(m_interpreter, 1);
-
-          if (lua_next(m_interpreter, -2) != 0)
-          {
-              m_key.replace(m_interpreter, -2);
-              lua_pop(m_interpreter, 2);
-          }
-          else
-          {
-              m_interpreter = 0;
-              handle().swap(m_table);
-              handle().swap(m_key);
-          }
-      }
-
-      bool equal(basic_iterator const& other) const
-      {
-          if (m_interpreter == 0 && other.m_interpreter == 0)
-              return true;
-
-          if (m_interpreter != other.m_interpreter)
-              return false;
-
-          detail::stack_pop pop(m_interpreter, 2);
-          m_key.push(m_interpreter);
-          other.m_key.push(m_interpreter);
-          return lua_equal(m_interpreter, -2, -1) != 0;
-      }
-
-      adl::iterator_proxy<AccessPolicy> dereference() const 
-      {
-          return adl::iterator_proxy<AccessPolicy>(m_interpreter, m_table, m_key);
-      }
-
-      lua_State* m_interpreter;
-      handle m_table;
-      handle m_key;
-  };
-
-// Needed because of some strange ADL issues.
-
-/*#define LUABIND_OPERATOR_ADL_WKND(op) \
-  inline bool operator op( \
-      basic_iterator<basic_access> const& x \
-    , basic_iterator<basic_access> const& y) \
-  { \
-      return boost::operator op(x, y); \
-  } \
- \
-  inline bool operator op( \
-      basic_iterator<raw_access> const& x \
-    , basic_iterator<raw_access> const& y) \
-  { \
-      return boost::operator op(x, y); \
-  }
-
-  LUABIND_OPERATOR_ADL_WKND(==)
-  LUABIND_OPERATOR_ADL_WKND(!=)
-
-#undef LUABIND_OPERATOR_ADL_WKND
- */
-} // namespace detail
-
-namespace adl
-{
- 
-#ifdef LUABIND_USE_VALUE_WRAPPER_TAG
-  struct index_proxy_tag;    
-#endif
-
-  template<class Next>
-  class index_proxy
-    : public object_interface<index_proxy<Next> >
-  {
-  public:
-#ifdef LUABIND_USE_VALUE_WRAPPER_TAG
-      typedef index_proxy_tag value_wrapper_tag;
-#endif
-
-      typedef index_proxy<Next> this_type;
-
-      template<class Key>
-      index_proxy(Next const& next, lua_State* interpreter, Key const& key)
-        : m_interpreter(interpreter)
-        , m_key_index(lua_gettop(interpreter) + 1)
-        , m_next(next)
-      {
-          detail::push(m_interpreter, key);
-      }
-
-      index_proxy(index_proxy const& other)
-        : m_interpreter(other.m_interpreter)
-        , m_key_index(other.m_key_index)
-        , m_next(other.m_next)
-      {
-          other.m_interpreter = 0;
-      }
-
-      ~index_proxy()
-      {
-          if (m_interpreter)
-              lua_pop(m_interpreter, 1);
-      }
-
-      // 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)
-      {
-          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;
-      }
-
-      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)
-      {
-          return index_proxy<this_type>(*this, m_interpreter, key);
-      }
-
-      void push(lua_State* interpreter);
-
-      lua_State* interpreter() const
-      {
-          return m_interpreter;
-      }
-
-  private:
-		struct hidden_type {};
-		
-//      this_type& operator=(index_proxy<Next> const&);
-
-      mutable lua_State* m_interpreter;
-      int m_key_index;
-
-      Next const& m_next;
-  };
-
-} // namespace adl
-
-typedef detail::basic_iterator<detail::basic_access> iterator;
-typedef detail::basic_iterator<detail::raw_access> raw_iterator;
-
-#ifndef LUABIND_USE_VALUE_WRAPPER_TAG
-template<class T>
-struct value_wrapper_traits<adl::index_proxy<T> >
-#else
-template<>
-struct value_wrapper_traits<adl::index_proxy_tag>
-#endif
-{
-    typedef boost::mpl::true_ is_specialized;
-
-    template<class Next>
-    static lua_State* interpreter(adl::index_proxy<Next> const& proxy)
-    {
-        return proxy.interpreter();
-    }
-
-    template<class Next>
-    static void unwrap(lua_State* interpreter, adl::index_proxy<Next> const& proxy)
-    {
-        const_cast<adl::index_proxy<Next>&>(proxy).push(interpreter);
-    }
-};
-
-#ifndef LUABIND_USE_VALUE_WRAPPER_TAG
-template<class AccessPolicy>
-struct value_wrapper_traits<adl::iterator_proxy<AccessPolicy> >
-#else
-template<>
-struct value_wrapper_traits<adl::iterator_proxy_tag>
-#endif
-{
-    typedef boost::mpl::true_ is_specialized;
-
-    template<class Proxy>
-    static lua_State* interpreter(Proxy const& p)
-    {
-        return p.interpreter();
-    }
-
-    template<class Proxy>
-    static void unwrap(lua_State* interpreter, Proxy const& p)
-    {
-        // TODO: Why const_cast?
-        const_cast<Proxy&>(p).push(interpreter);
-    }
-};
-
-namespace adl
-{
-
-  // An object holds a reference to a Lua value residing
-  // in the registry.
-  class object : public object_interface<object>
-  {
-  public:
-      object()
-      {}
-
-      explicit object(handle const& other)
-        : m_handle(other)
-      {}
-
-      explicit object(from_stack const& stack_reference)
-        : m_handle(stack_reference.interpreter, stack_reference.index)
-      {
-      }
-
-      template<class T>
-      object(lua_State* interpreter, T const& value)
-      {
-          detail::push(interpreter, value);
-          detail::stack_pop pop(interpreter, 1);
-          handle(interpreter, -1).swap(m_handle);
-      }
-
-      template<class T, class Policies>
-      object(lua_State* interpreter, T const& value, Policies const&)
-      {
-          detail::push(interpreter, value, Policies());
-          detail::stack_pop pop(interpreter, 1);
-          handle(interpreter, -1).swap(m_handle);
-      }
-
-      void push(lua_State* interpreter) const;
-      lua_State* interpreter() const;
-      bool is_valid() const;
-
-      template<class T>
-      index_proxy<object> operator[](T const& key) const
-      {
-          return index_proxy<object>(
-              *this, m_handle.interpreter(), key
-          );
-      }
-
-      void swap(object& other)
-      {
-          m_handle.swap(other.m_handle);
-      }
-
-  private:
-      handle m_handle;
-  };
-
-  inline void object::push(lua_State* interpreter) const
-  {
-      m_handle.push(interpreter);
-  }
-
-  inline lua_State* object::interpreter() const
-  {
-      return m_handle.interpreter();
-  }
-
-  inline bool object::is_valid() const
-  {
-      return m_handle.interpreter() != 0;
-  }
-
-  class argument : public object_interface<argument>
-  {
-  public:
-	  argument(from_stack const& stack_reference)
-		: m_interpreter(stack_reference.interpreter)
-		, m_index(stack_reference.index)
-	  {
-		  if (m_index < 0)
-			  m_index = lua_gettop(m_interpreter) - m_index + 1;
-	  }
-
-      template<class T>
-      index_proxy<argument> operator[](T const& key) const
-      {
-          return index_proxy<argument>(*this, m_interpreter, key);
-      }
-
-	  void push(lua_State* L) const
-	  {
-		  lua_pushvalue(L, m_index);
-	  }
-
-	  lua_State* interpreter() const
-	  {
-		  return m_interpreter;
-	  }
-
-  private:
-	  lua_State* m_interpreter;
-	  int m_index;
-  };
-
-} // namespace adl
-
-using adl::object;
-using adl::argument;
-
-#ifndef LUABIND_USE_VALUE_WRAPPER_TAG
-template <class ValueWrapper, class Arguments>
-struct value_wrapper_traits<adl::call_proxy<ValueWrapper, Arguments> >
-#else
-template<>
-struct value_wrapper_traits<adl::call_proxy_tag>
-#endif
-{
-    typedef boost::mpl::true_ is_specialized;
-
-    template<class W, class A>
-    static lua_State* interpreter(adl::call_proxy<W,A> const& proxy)
-    {
-        return value_wrapper_traits<W>::interpreter(*proxy.value_wrapper);
-    }
-
-    template<class W, class A>
-    static void unwrap(lua_State*, adl::call_proxy<W,A> const& proxy)
-    {
-        object result = const_cast<adl::call_proxy<W,A>&>(proxy);
-        result.push(result.interpreter());
-    }
-};
-
-template<>
-struct value_wrapper_traits<object>
-{
-    typedef boost::mpl::true_ is_specialized;
-
-    static lua_State* interpreter(object const& value)
-    {
-        return value.interpreter();
-    }
-
-    static void unwrap(lua_State* interpreter, object const& value)
-    {
-        value.push(interpreter);
-    }
-
-    static bool check(...)
-    {
-        return true;
-    }
-};
-
-template<>
-struct value_wrapper_traits<argument>
-{
-    typedef boost::mpl::true_ is_specialized;
-
-    static lua_State* interpreter(argument const& value)
-    {
-        return value.interpreter();
-    }
-
-    static void unwrap(lua_State* interpreter, argument const& value)
-    {
-        value.push(interpreter);
-    }
-
-    static bool check(...)
-    {
-        return true;
-    }
-};
-
-template<class Next>
-inline void adl::index_proxy<Next>::push(lua_State* interpreter)
-{
-    assert(interpreter == m_interpreter);
-
-    value_wrapper_traits<Next>::unwrap(m_interpreter, m_next);
-
-    lua_pushvalue(m_interpreter, m_key_index);
-    lua_gettable(m_interpreter, -2);
-    lua_remove(m_interpreter, -2);
-}
-
-template<class Next>
-inline adl::index_proxy<Next>::operator object()
-{
-    detail::stack_pop pop(m_interpreter, 1);
-    push(m_interpreter);
-    return object(from_stack(m_interpreter, -1));
-}
-
-template<class AccessPolicy>
-adl::iterator_proxy<AccessPolicy>::operator object()
-{
-    lua_pushvalue(m_interpreter, m_key_index);
-    AccessPolicy::get(m_interpreter, m_table_index);
-    detail::stack_pop pop(m_interpreter, 1);
-    return object(from_stack(m_interpreter, -1));
-}
-
-template<class AccessPolicy>
-object detail::basic_iterator<AccessPolicy>::key() const
-{
-    return object(m_key);
-}
-
-namespace detail 
-{
-
-  template<
-      class T
-    , class ValueWrapper
-    , class Policies
-    , class ErrorPolicy
-    , class ReturnType
-  >
-  ReturnType object_cast_aux(
-      ValueWrapper const& value_wrapper
-    , T*
-    , Policies*
-    , ErrorPolicy*
-    , ReturnType*
-  )
-  {
-      lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-          value_wrapper
-      );
-
-#ifndef LUABIND_NO_ERROR_CHECKING
-      if (!interpreter) 
-          return ErrorPolicy::handle_error(interpreter, typeid(void));
-#endif
-
-      value_wrapper_traits<ValueWrapper>::unwrap(interpreter, value_wrapper);
-
-      detail::stack_pop pop(interpreter, 1);
-
-      typedef typename detail::find_conversion_policy<
-          0
-        , Policies
-      >::type converter_generator;
-
-      typename mpl::apply_wrap2<converter_generator, T, lua_to_cpp>::type cv;
-
-      if (cv.match(interpreter, LUABIND_DECORATE_TYPE(T), -1) < 0)
-      {
-          return ErrorPolicy::handle_error(interpreter, typeid(T));
-      }
-
-      return cv.apply(interpreter, LUABIND_DECORATE_TYPE(T), -1);
-  }
-
-# ifdef BOOST_MSVC
-#  pragma warning(push)
-#  pragma warning(disable:4702) // unreachable code
-# endif
-
-  template<class T>
-  struct throw_error_policy
-  {
-      static T handle_error(lua_State* interpreter, type_id const& type_info)
-      {
-#ifndef LUABIND_NO_EXCEPTIONS
-          throw cast_failed(interpreter, type_info);
-#else
-          cast_failed_callback_fun e = get_cast_failed_callback();
-          if (e) e(interpreter, type_info);
-
-          assert(0 && "object_cast failed. If you want to handle this error use "
-              "luabind::set_error_callback()");
-          std::terminate();
-#endif
-          return *(typename boost::remove_reference<T>::type*)0;
-      }
-  };
-
-# ifdef BOOST_MSVC
-#  pragma warning(pop)
-# endif
-
-  template<class T>
-  struct nothrow_error_policy
-  {
-      static boost::optional<T> handle_error(lua_State*, type_id const&)
-      {
-          return boost::optional<T>();
-      }
-  };
-
-} // namespace detail
-
-template<class T, class ValueWrapper>
-T object_cast(ValueWrapper const& value_wrapper)
-{
-    return detail::object_cast_aux(
-        value_wrapper
-      , (T*)0
-      , (detail::null_type*)0
-      , (detail::throw_error_policy<T>*)0
-      , (T*)0
-    );
-}
-
-template<class T, class ValueWrapper, class Policies>
-T object_cast(ValueWrapper const& value_wrapper, Policies const&)
-{
-    return detail::object_cast_aux(
-        value_wrapper
-      , (T*)0
-      , (Policies*)0
-      , (detail::throw_error_policy<T>*)0
-      , (T*)0
-    );
-}
-
-template<class T, class ValueWrapper>
-boost::optional<T> object_cast_nothrow(ValueWrapper const& value_wrapper)
-{
-    return detail::object_cast_aux(
-        value_wrapper
-      , (T*)0
-      , (detail::null_type*)0
-      , (detail::nothrow_error_policy<T>*)0
-      , (boost::optional<T>*)0
-    );
-}
-
-template<class T, class ValueWrapper, class Policies>
-boost::optional<T> object_cast_nothrow(ValueWrapper const& value_wrapper, Policies const&)
-{
-    return detail::object_cast_aux(
-        value_wrapper
-      , (T*)0
-      , (Policies*)0
-      , (detail::nothrow_error_policy<T>*)0
-      , (boost::optional<T>*)0
-    );
-}
-
-namespace detail
-{
-
-  template<int Index>
-  struct push_args_from_tuple
-  {
-# ifdef LUABIND_CPP0x
-
-      template <class Args, class Policies, class N, class E>
-      static void push_args(
-          lua_State* L, Args const& args, Policies const& policies, N, E)
-      {
-          convert_to_lua_p<N::value + 1>(L, *std::get<N::value>(args), policies);
-          push_args(
-              L, args, policies, std::integral_constant<int, N::value + 1>(), E());
-      }
-
-      template <class Args, class Policies, class E>
-      static void push_args(lua_State* L, Args const&, Policies const&, E, E)
-      {}
-
-      template <class... Args, class Policies = null_type>
-      static void apply(
-          lua_State* L, std::tuple<Args...> const& args
-        , Policies const policies = Policies())
-      {
-          push_args(
-              L
-            , args
-            , policies
-            , std::integral_constant<int, 0>()
-            , std::integral_constant<int, sizeof...(Args)>()
-          );
-      }
-
-# else // LUABIND_CPP0x
-
-      template<class H, class T, class Policies>
-      inline static void apply(lua_State* L, const boost::tuples::cons<H, T>& x, const Policies& p) 
-      {
-          convert_to_lua_p<Index>(L, *x.get_head(), p);
-          push_args_from_tuple<Index+1>::apply(L, x.get_tail(), p);
-      }
-
-      template<class H, class T>
-      inline static void apply(lua_State* L, const boost::tuples::cons<H, T>& x) 
-      {
-          convert_to_lua(L, *x.get_head());
-          push_args_from_tuple<Index+1>::apply(L, x.get_tail());
-      }
-
-      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&) {}
-
-# endif // LUABIND_CPP0x
-  };
-
-} // namespace detail
-
-namespace adl
-{
-
-  template<class ValueWrapper, class Arguments>
-  struct call_proxy
-  {
-      call_proxy(ValueWrapper& value_wrapper, Arguments arguments)
-        : value_wrapper(&value_wrapper)
-        , arguments(arguments)
-      {}
-
-      call_proxy(call_proxy const& other)
-        : value_wrapper(other.value_wrapper)
-        , arguments(other.arguments)
-      {
-          other.value_wrapper = 0;
-      }
-
-      ~call_proxy()
-      {
-          if (value_wrapper)
-              call((detail::null_type*)0);
-      }
-
-      operator object()
-      {
-          return call((detail::null_type*)0);
-      }
-
-      template<class Policies>
-      object operator[](Policies const&)
-      {
-          return call((Policies*)0);
-      }
-
-      template<class Policies>
-      object call(Policies*)
-      {
-          lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-              *value_wrapper
-          );
-
-          value_wrapper_traits<ValueWrapper>::unwrap(
-              interpreter
-            , *value_wrapper
-          );
-
-          value_wrapper = 0;
-
-          detail::push_args_from_tuple<1>::apply(interpreter, arguments, Policies());
-
-# ifdef LUABIND_CPP0x
-          if (detail::pcall(interpreter, std::tuple_size<Arguments>::value, 1))
-# else
-          if (detail::pcall(interpreter, boost::tuples::length<Arguments>::value, 1))
-# endif
-          {
-#ifndef LUABIND_NO_EXCEPTIONS
-              throw luabind::error(interpreter);
-#else
-              error_callback_fun e = get_error_callback();
-              if (e) e(interpreter);
-
-              assert(0 && "the lua function threw an error and exceptions are disabled."
-                  "if you want to handle this error use luabind::set_error_callback()");
-              std::terminate();
-#endif
-          }
-
-          detail::stack_pop pop(interpreter, 1);
-          return object(from_stack(interpreter, -1));
-      }
-
-      mutable ValueWrapper* value_wrapper;
-      Arguments arguments;
-  };
-
-# ifndef LUABIND_CPP0x
-
-  template<class Derived>
-  call_proxy<Derived, boost::tuples::tuple<> >
-  object_interface<Derived>::operator()()
-  {
-      return call_proxy<Derived, boost::tuples::tuple<> >(
-          derived()
-        , boost::tuples::tuple<>()
-      );
-  }
-
-# endif
-
-  // Simple value_wrapper adaptor with the sole purpose of helping with
-  // overload resolution. Use this as a function parameter type instead
-  // of "object" or "argument" to restrict the parameter to Lua tables.
-  template <class Base = object>
-  struct table : Base
-  {
-      table(from_stack const& stack_reference)
-        : Base(stack_reference)
-      {}
-  };
-
-} // namespace adl
-
-using adl::table;
-
-template <class Base>
-struct value_wrapper_traits<adl::table<Base> >
-  : value_wrapper_traits<Base>
-{
-    static bool check(lua_State* L, int idx)
-    {
-        return value_wrapper_traits<Base>::check(L, idx) &&
-            lua_istable(L, idx);
-    }
-};
-
-inline object newtable(lua_State* interpreter)
-{
-    lua_newtable(interpreter);
-    detail::stack_pop pop(interpreter, 1);
-    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);
-    detail::stack_pop pop(interpreter, 1);
-    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)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-        table
-    );
-
-    value_wrapper_traits<ValueWrapper>::unwrap(interpreter, table);
-    detail::stack_pop pop(interpreter, 2);
-    detail::push(interpreter, key);
-    lua_gettable(interpreter, -2);
-    return object(from_stack(interpreter, -1));
-}
-
-template<class ValueWrapper, class K, class T>
-inline void settable(ValueWrapper const& table, K const& key, T const& value)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-        table
-    );
-
-    // TODO: Exception safe?
-    
-    value_wrapper_traits<ValueWrapper>::unwrap(interpreter, table);
-    detail::stack_pop pop(interpreter, 1);
-    detail::push(interpreter, key);
-    detail::push(interpreter, value);
-    lua_settable(interpreter, -3);
-}
-
-template<class ValueWrapper, class K>
-inline object rawget(ValueWrapper const& table, K const& key)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-        table
-    );
-
-    value_wrapper_traits<ValueWrapper>::unwrap(interpreter, table);
-    detail::stack_pop pop(interpreter, 2);
-    detail::push(interpreter, key);
-    lua_rawget(interpreter, -2);
-    return object(from_stack(interpreter, -1));
-}
-
-template<class ValueWrapper, class K, class T>
-inline void rawset(ValueWrapper const& table, K const& key, T const& value)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-        table
-    );
-
-    // TODO: Exception safe?
-    
-    value_wrapper_traits<ValueWrapper>::unwrap(interpreter, table);
-    detail::stack_pop pop(interpreter, 1);
-    detail::push(interpreter, key);
-    detail::push(interpreter, value);
-    lua_rawset(interpreter, -3);
-}
-
-template<class ValueWrapper>
-inline int type(ValueWrapper const& value)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-        value
-    );
-
-    value_wrapper_traits<ValueWrapper>::unwrap(interpreter, value);
-    detail::stack_pop pop(interpreter, 1);
-    return lua_type(interpreter, -1);
-}
-
-template <class ValueWrapper>
-inline object getmetatable(ValueWrapper const& obj)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-        obj
-    );
-
-    value_wrapper_traits<ValueWrapper>::unwrap(interpreter, obj);
-    detail::stack_pop pop(interpreter, 2);
-    lua_getmetatable(interpreter, -1);
-    return object(from_stack(interpreter, -1));
-}
-
-template <class ValueWrapper1, class ValueWrapper2>
-inline void setmetatable(
-    ValueWrapper1 const& obj, ValueWrapper2 const& metatable)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper1>::interpreter(
-        obj
-    );
-
-    value_wrapper_traits<ValueWrapper1>::unwrap(interpreter, obj);
-    detail::stack_pop pop(interpreter, 1);
-    value_wrapper_traits<ValueWrapper2>::unwrap(interpreter, metatable);
-    lua_setmetatable(interpreter, -2);
-}
-
-template <class ValueWrapper>
-inline lua_CFunction tocfunction(ValueWrapper const& value)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-        value
-    );
-
-    value_wrapper_traits<ValueWrapper>::unwrap(interpreter, value);
-    detail::stack_pop pop(interpreter, 1);
-    return lua_tocfunction(interpreter, -1);
-}
-
-template <class T, class ValueWrapper>
-inline T* touserdata(ValueWrapper const& value)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-        value
-    );
-
-    value_wrapper_traits<ValueWrapper>::unwrap(interpreter, value);
-    detail::stack_pop pop(interpreter, 1);
-    return static_cast<T*>(lua_touserdata(interpreter, -1));
-}
-
-template <class ValueWrapper>
-inline object getupvalue(ValueWrapper const& value, int index)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper>::interpreter(
-        value
-    );
-
-    value_wrapper_traits<ValueWrapper>::unwrap(interpreter, value);
-    detail::stack_pop pop(interpreter, 2);
-    lua_getupvalue(interpreter, -1, index);
-    return object(from_stack(interpreter, -1));
-}
-
-template <class ValueWrapper1, class ValueWrapper2>
-inline void setupvalue(
-    ValueWrapper1 const& function, int index, ValueWrapper2 const& value)
-{
-    lua_State* interpreter = value_wrapper_traits<ValueWrapper1>::interpreter(
-        function
-    );
-
-    value_wrapper_traits<ValueWrapper1>::unwrap(interpreter, function);
-    detail::stack_pop pop(interpreter, 1);
-    value_wrapper_traits<ValueWrapper2>::unwrap(interpreter, value);
-    lua_setupvalue(interpreter, -2, index);
-}
-
-template <class GetValueWrapper>
-object property(GetValueWrapper const& get)
-{
-    lua_State* interpreter = value_wrapper_traits<GetValueWrapper>::interpreter(
-        get
-    );
-
-    value_wrapper_traits<GetValueWrapper>::unwrap(interpreter, get);
-    lua_pushnil(interpreter);
-
-    lua_pushcclosure(interpreter, &detail::property_tag, 2);
-    detail::stack_pop pop(interpreter, 1);
-
-    return object(from_stack(interpreter, -1));
-}
-
-template <class GetValueWrapper, class SetValueWrapper>
-object property(GetValueWrapper const& get, SetValueWrapper const& set)
-{
-    lua_State* interpreter = value_wrapper_traits<GetValueWrapper>::interpreter(
-        get
-    );
-
-    value_wrapper_traits<GetValueWrapper>::unwrap(interpreter, get);
-    value_wrapper_traits<SetValueWrapper>::unwrap(interpreter, set);
-
-    lua_pushcclosure(interpreter, &detail::property_tag, 2);
-    detail::stack_pop pop(interpreter, 1);
-
-    return object(from_stack(interpreter, -1));
-
-}
-
-
-} // namespace luabind
-
-#endif // LUABIND_OBJECT_050419_HPP
-

+ 0 - 36
lib/luabind/luabind/open.hpp

@@ -1,36 +0,0 @@
-// Copyright (c) 2003 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_OPEN_HPP_INCLUDED
-#define LUABIND_OPEN_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-
-namespace luabind {
-
-	LUABIND_API void open(lua_State* L);
-
-}
-
-#endif // LUABIND_OPEN_HPP_INCLUDED
-

+ 0 - 403
lib/luabind/luabind/operator.hpp

@@ -1,403 +0,0 @@
-// 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 OPERATOR_040729_HPP
-#define OPERATOR_040729_HPP
-
-#include <boost/mpl/eval_if.hpp>
-#include <boost/mpl/identity.hpp>
-#include <boost/mpl/apply_wrap.hpp>
-#ifndef LUABIND_CPP0x
-#include <boost/preprocessor/repetition/enum_trailing.hpp>
-#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
-#endif
-#include <boost/type_traits/is_same.hpp>
-#include <luabind/detail/other.hpp>
-#include <luabind/raw_policy.hpp>
-
-#if defined(__GNUC__) && __GNUC__ < 3
-# define LUABIND_NO_STRINGSTREAM
-#else
-# if defined(BOOST_NO_STRINGSTREAM)
-#  define LUABIND_NO_STRINGSTREAM
-# endif
-#endif
-
-#ifdef LUABIND_NO_STRINGSTREAM
-#include <strstream>
-#else
-#include <sstream>
-#endif
-
-namespace luabind { namespace detail {
-
-    template<class W, class T> struct unwrap_parameter_type;
-    template<class Derived> struct operator_ {};
-
-    struct operator_void_return {};
-
-#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
-    template<class T>
-    inline T const& operator,(T const& x, operator_void_return)
-    {
-        return x;
-    }
-#endif
-    
-}} // namespace luabind
-
-namespace luabind { namespace operators {
-
-# ifdef LUABIND_CPP0x
-
-template <class Self, class... Args>
-struct call_operator
-  : detail::operator_<call_operator>
-{
-    call_operator(int)
-    {}
-
-    template <class T, class Policies>
-    struct apply
-    {
-        static void execute(
-            lua_State* L
-          , typename detail::unwrap_parameter_type<T, Self>::type self
-          , detail::unwrap_parameter_type<T, Args>::type args...
-        )
-        {
-            using namespace detail;
-            operator_result(
-                L
-              , (self(args...), detail::operator_void_return())
-              , (Policies*)0
-            );
-        }
-    };
-
-    static char const* name() { return "__call"; }
-};
-
-# else // LUABIND_CPP_0x
-   #define BOOST_PP_ITERATION_PARAMS_1 (3, \
-       (0, LUABIND_MAX_ARITY, <luabind/detail/call_operator_iterate.hpp>))
-   #include BOOST_PP_ITERATE()
-# endif // LUABIND_CPP_0x
-    
-}} // namespace luabind::operators
-
-#ifndef LUABIND_CPP0x
-# include <boost/preprocessor/iteration/local.hpp>
-#endif
-
-namespace luabind {
-
-    template<class Derived>
-    struct self_base
-    {
-# ifdef LUABIND_CPP0x
-
-        template <class... Args>
-        operators::call_operator<Derived, Args...> operator()(Args const&...) const
-        {
-            return 0;
-        }
-
-# else // LUABIND_CPP0x
-
-        operators::call_operator0<Derived> operator()() const
-        {
-            return 0;
-        }
-
-#define BOOST_PP_LOCAL_MACRO(n) \
-        template<BOOST_PP_ENUM_PARAMS(n, class A)> \
-        BOOST_PP_CAT(operators::call_operator, n)< \
-            Derived \
-            BOOST_PP_ENUM_TRAILING_PARAMS(n, A) \
-        >\
-        operator()( \
-            BOOST_PP_ENUM_BINARY_PARAMS(n, A, const& BOOST_PP_INTERCEPT) \
-        ) const \
-        { \
-            return 0; \
-        }
-
-#define BOOST_PP_LOCAL_LIMITS (1, LUABIND_MAX_ARITY)
-#include BOOST_PP_LOCAL_ITERATE()
-
-# endif // LUABIND_CPP0x
-
-    };
-
-    struct self_type : self_base<self_type>
-    {
-    };
-
-    struct const_self_type : self_base<const_self_type>
-    {
-    };
-
-namespace detail {
-
-    template<class W, class T>
-    struct unwrap_parameter_type
-    {
-        typedef typename boost::mpl::eval_if<
-            boost::is_same<T, self_type>
-          , boost::mpl::identity<W&>
-          , boost::mpl::eval_if<
-                boost::is_same<T, const_self_type>
-              , boost::mpl::identity<W const&>
-              , unwrap_other<T>
-            >
-        >::type type;
-    };
-
-    template<class Derived, class A, class B>
-    struct binary_operator 
-        : operator_<binary_operator<Derived, A, B> >
-    {
-        binary_operator(int) {}
-
-        template<class T, class Policies>
-        struct apply 
-        {
-            typedef typename unwrap_parameter_type<T, A>::type arg0;
-            typedef typename unwrap_parameter_type<T, B>::type arg1;
-
-            static void execute(lua_State* L, arg0 _0, arg1 _1)
-            {
-                Derived::template apply<arg0, arg1, Policies>::execute(
-                    L, _0, _1);
-            }
-        };
-
-        static char const* name()
-        {
-            return Derived::name();
-        }
-    };
-
-    template<class Derived, class A>
-    struct unary_operator 
-        : operator_<unary_operator<Derived, A> >
-    {
-        unary_operator(int) {}
-        
-        template<class T, class Policies>
-        struct apply
-        {
-            typedef typename unwrap_parameter_type<T, A>::type arg0;
-
-            static void execute(lua_State* L, arg0 _0)
-            {
-                Derived::template apply<arg0, Policies>::execute(L, _0);
-            }
-        };
-
-        static char const* name()
-        {
-            return Derived::name();
-        }
-    };
-
-    template<class Policies>
-    inline void operator_result(lua_State* L, operator_void_return, Policies*)
-    {
-    }
-
-    namespace mpl = boost::mpl;
-
-    template<class T, class Policies>
-    inline void operator_result(lua_State* L, T const& x, Policies*)
-    {
-        typedef typename find_conversion_policy<
-            0
-          , Policies
-        >::type cv_policy;
-
-        typename mpl::apply_wrap2<cv_policy,T,cpp_to_lua>::type cv;
-
-        cv.apply(L, x);
-    }
-
-}} // namespace detail::luabind
-
-namespace luabind {
-
-#define LUABIND_BINARY_OPERATOR(name_, op) \
-    namespace operators { \
-\
-        struct name_ \
-        { \
-            template<class T0, class T1, class Policies> \
-            struct apply \
-            { \
-                static void execute(lua_State* L, T0 _0, T1 _1) \
-                { \
-                    detail::operator_result(L, _0 op _1, (Policies*)0); \
-                } \
-            }; \
-\
-            static char const* name() \
-            { \
-                return "__" # name_; \
-            } \
-        }; \
-\
-    } \
-    \
-    template<class T, class U> \
-    detail::binary_operator< \
-        operators::name_ \
-      , U \
-      , T \
-    > \
-    inline operator op(self_base<U>, T const&) \
-    { \
-        return 0; \
-    } \
-    \
-    template<class T, class U> \
-    detail::binary_operator< \
-        operators::name_ \
-      , T \
-      , U \
-    > \
-    inline operator op(T const&, self_base<U>) \
-    { \
-        return 0; \
-    } \
-    \
-    detail::binary_operator< \
-        operators::name_ \
-      , self_type \
-      , self_type \
-    > \
-    inline operator op(self_type, self_type) \
-    { \
-        return 0; \
-    } \
-    \
-    detail::binary_operator< \
-        operators::name_ \
-      , self_type \
-      , const_self_type \
-    > \
-    inline operator op(self_type, const_self_type) \
-    { \
-        return 0; \
-    } \
-    \
-    detail::binary_operator< \
-        operators::name_ \
-      , const_self_type \
-      , self_type \
-    > \
-    inline operator op(const_self_type, self_type) \
-    { \
-        return 0; \
-    } \
-    \
-    detail::binary_operator< \
-        operators::name_ \
-      , const_self_type \
-      , const_self_type \
-    > \
-    inline operator op(const_self_type, const_self_type) \
-    { \
-        return 0; \
-    }
-
-    LUABIND_BINARY_OPERATOR(add, +)
-    LUABIND_BINARY_OPERATOR(sub, -)
-    LUABIND_BINARY_OPERATOR(mul, *)
-    LUABIND_BINARY_OPERATOR(div, /)
-    LUABIND_BINARY_OPERATOR(pow, ^)
-    LUABIND_BINARY_OPERATOR(lt, <)
-    LUABIND_BINARY_OPERATOR(le, <=)
-    LUABIND_BINARY_OPERATOR(eq, ==)
-
-#undef LUABIND_UNARY_OPERATOR
-
-#define LUABIND_UNARY_OPERATOR(name_, op, fn) \
-    namespace operators { \
-\
-        struct name_ \
-        { \
-            template<class T, class Policies> \
-            struct apply \
-            { \
-                static void execute(lua_State* L, T x) \
-                { \
-                    detail::operator_result(L, op(x), (Policies*)0); \
-                } \
-            }; \
-\
-            static char const* name() \
-            { \
-                return "__" # name_; \
-            } \
-        }; \
-\
-    } \
-    \
-    template<class T> \
-    detail::unary_operator< \
-        operators::name_ \
-      , T \
-    > \
-    inline fn(self_base<T>) \
-    { \
-        return 0; \
-    }
-
-    template<class T>
-    std::string tostring_operator(T const& x)
-    {
-#ifdef LUABIND_NO_STRINGSTREAM
-        std::strstream s;
-        s << x << std::ends;
-#else
-        std::stringstream s;
-        s << x;
-#endif
-        return s.str();
-    }
-    
-    LUABIND_UNARY_OPERATOR(tostring, tostring_operator, tostring)
-    LUABIND_UNARY_OPERATOR(unm, -, operator-)
-
-#undef LUABIND_BINARY_OPERATOR
-
-    namespace {
-
-        LUABIND_ANONYMOUS_FIX self_type self;
-        LUABIND_ANONYMOUS_FIX const_self_type const_self;
-
-    } // namespace unnamed
-    
-} // namespace luabind
-
-#endif // OPERATOR_040729_HPP
-

+ 0 - 280
lib/luabind/luabind/out_value_policy.hpp

@@ -1,280 +0,0 @@
-// Copyright (c) 2003 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_OUT_VALUE_POLICY_HPP_INCLUDED
-#define LUABIND_OUT_VALUE_POLICY_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/policy.hpp>
-#include <boost/mpl/apply_wrap.hpp>
-
-namespace luabind { namespace detail
-{
-	template<int N>
-	struct char_array
-	{
-		char storage[N];
-	};
-
-#if defined(__GNUC__) && ( __GNUC__ == 3 && __GNUC_MINOR__ == 1 )
-
-	template<class U>
-	char_array<sizeof(U)> indirect_sizeof_test(by_reference<U>);
-
-	template<class U>
-	char_array<sizeof(U)> indirect_sizeof_test(by_const_reference<U>);
-
-	template<class U>
-	char_array<sizeof(U)> indirect_sizeof_test(by_pointer<U>);
-
-	template<class U>
-	char_array<sizeof(U)> indirect_sizeof_test(by_const_pointer<U>);
-
-	template<class U>
-	char_array<sizeof(U)> indirect_sizeof_test(by_value<U>);
-
-#else
-
-	template<class U>
-	char_array<sizeof(typename identity<U>::type)> indirect_sizeof_test(by_reference<U>);
-
-	template<class U>
-	char_array<sizeof(typename identity<U>::type)> indirect_sizeof_test(by_const_reference<U>);
-
-	template<class U>
-	char_array<sizeof(typename identity<U>::type)> indirect_sizeof_test(by_pointer<U>);
-
-	template<class U>
-	char_array<sizeof(typename identity<U>::type)> indirect_sizeof_test(by_const_pointer<U>);
-
-	template<class U>
-	char_array<sizeof(typename identity<U>::type)> indirect_sizeof_test(by_value<U>);
-
-#endif
-
-	template<class T>
-	struct indirect_sizeof
-	{
-		BOOST_STATIC_CONSTANT(int, value = sizeof(indirect_sizeof_test(LUABIND_DECORATE_TYPE(T))));
-	};
-
-	namespace mpl = boost::mpl;
-	
-	template<int Size, class Policies = detail::null_type>
-	struct out_value_converter
-	{
-        int const consumed_args(...)
-        {
-            return 1;
-        }
-
-        template<class T>
-		T& apply(lua_State* L, by_reference<T>, int index)
-		{
-			typedef typename find_conversion_policy<1, Policies>::type converter_policy;
-			typename mpl::apply_wrap2<converter_policy,T,lua_to_cpp>::type converter;
-			new (m_storage) T(converter.apply(L, LUABIND_DECORATE_TYPE(T), index));
-			return *reinterpret_cast<T*>(m_storage);
-		}
-
-		template<class T>
-		static int match(lua_State* L, by_reference<T>, int index)
-		{
-			typedef typename find_conversion_policy<1, Policies>::type converter_policy;
-			typedef typename mpl::apply_wrap2<converter_policy,T,lua_to_cpp>::type converter;
-			return converter::match(L, LUABIND_DECORATE_TYPE(T), index);
-		}
-
-		template<class T>
-		void converter_postcall(lua_State* L, by_reference<T>, int) 
-		{
-			typedef typename find_conversion_policy<2, Policies>::type converter_policy;
-			typename mpl::apply_wrap2<converter_policy,T,cpp_to_lua>::type converter;
-			converter.apply(L, *reinterpret_cast<T*>(m_storage));
-			reinterpret_cast<T*>(m_storage)->~T();
-		}
-
-		template<class T>
-		T* apply(lua_State* L, by_pointer<T>, int index)
-		{
-			typedef typename find_conversion_policy<1, Policies>::type converter_policy;
-			typename mpl::apply_wrap2<converter_policy,T,lua_to_cpp>::type converter;
-			new (m_storage) T(converter.apply(L, LUABIND_DECORATE_TYPE(T), index));
-			return reinterpret_cast<T*>(m_storage);
-		}
-
-		template<class T>
-		static int match(lua_State* L, by_pointer<T>, int index)
-		{
-			typedef typename find_conversion_policy<1, Policies>::type converter_policy;
-			typedef typename mpl::apply_wrap2<converter_policy,T,lua_to_cpp>::type converter;
-			return converter::match(L, LUABIND_DECORATE_TYPE(T), index);
-		}
-
-		template<class T>
-		void converter_postcall(lua_State* L, by_pointer<T>, int)
-		{
-			typedef typename find_conversion_policy<2, Policies>::type converter_policy;
-			typename mpl::apply_wrap2<converter_policy,T,cpp_to_lua>::type converter;
-			converter.apply(L, *reinterpret_cast<T*>(m_storage));
-			reinterpret_cast<T*>(m_storage)->~T();
-		}
-
-		char m_storage[Size];
-	};
-
-	template<int N, class Policies = detail::null_type>
-	struct out_value_policy : conversion_policy<N>
-	{
-		static void precall(lua_State*, const index_map&) {}
-		static void postcall(lua_State*, const index_map&) {}
-
-		struct only_accepts_nonconst_references_or_pointers {};
-		struct can_only_convert_from_lua_to_cpp {};
-
-		template<class T, class Direction>
-		struct apply
-		{
-			typedef typename boost::mpl::if_<boost::is_same<lua_to_cpp, Direction>
-				, typename boost::mpl::if_<boost::mpl::or_<is_nonconst_reference<T>, is_nonconst_pointer<T> >
-					, out_value_converter<indirect_sizeof<T>::value, Policies>
-					, only_accepts_nonconst_references_or_pointers
-					>::type
-				, can_only_convert_from_lua_to_cpp
-			>::type type;
-		};
-	};
-
-	template<int Size, class Policies = detail::null_type>
-	struct pure_out_value_converter
-	{
-        int const consumed_args(...)
-        {
-            return 0;
-        }
-
-        template<class T>
-		T& apply(lua_State*, by_reference<T>, int)
-		{
-			new (m_storage) T();
-			return *reinterpret_cast<T*>(m_storage);
-		}
-
-		template<class T>
-		static int match(lua_State*, by_reference<T>, int)
-		{
-			return 0;
-		}
-
-		template<class T>
-		void converter_postcall(lua_State* L, by_reference<T>, int) 
-		{
-			typedef typename find_conversion_policy<1, Policies>::type converter_policy;
-			typename mpl::apply_wrap2<converter_policy,T,cpp_to_lua>::type converter;
-			converter.apply(L, *reinterpret_cast<T*>(m_storage));
-			reinterpret_cast<T*>(m_storage)->~T();
-		}
-
-		template<class T>
-		T* apply(lua_State*, by_pointer<T>, int)
-		{
-			new (m_storage) T();
-			return reinterpret_cast<T*>(m_storage);
-		}
-
-		template<class T>
-		static int match(lua_State*, by_pointer<T>, int)
-		{
-			return 0;
-		}
-
-		template<class T>
-		void converter_postcall(lua_State* L, by_pointer<T>, int) 
-		{
-			typedef typename find_conversion_policy<1, Policies>::type converter_policy;
-			typename mpl::apply_wrap2<converter_policy,T,cpp_to_lua>::type converter;
-			converter.apply(L, *reinterpret_cast<T*>(m_storage));
-			reinterpret_cast<T*>(m_storage)->~T();
-		}
-
-
-		char m_storage[Size];
-	};
-
-	template<int N, class Policies = detail::null_type>
-	struct pure_out_value_policy : conversion_policy<N, false>
-	{
-		static void precall(lua_State*, const index_map&) {}
-		static void postcall(lua_State*, const index_map&) {}
-
-		struct only_accepts_nonconst_references_or_pointers {};
-		struct can_only_convert_from_lua_to_cpp {};
-
-		template<class T, class Direction>
-		struct apply
-		{
-			typedef typename boost::mpl::if_<boost::is_same<lua_to_cpp, Direction>
-				, typename boost::mpl::if_<boost::mpl::or_<is_nonconst_reference<T>, is_nonconst_pointer<T> >
-					, pure_out_value_converter<indirect_sizeof<T>::value, Policies>
-					, only_accepts_nonconst_references_or_pointers
-					>::type
-				, can_only_convert_from_lua_to_cpp
-			>::type type;
-		};
-	};
-	
-}}
-
-namespace luabind
-{
-	template<int N>
-	detail::policy_cons<detail::out_value_policy<N>, detail::null_type> 
-	out_value(LUABIND_PLACEHOLDER_ARG(N)) 
-	{ 
-		return detail::policy_cons<detail::out_value_policy<N>, detail::null_type>(); 
-	}
-
-	template<int N, class Policies>
-	detail::policy_cons<detail::out_value_policy<N, Policies>, detail::null_type> 
-	out_value(LUABIND_PLACEHOLDER_ARG(N), const Policies&) 
-	{ 
-		return detail::policy_cons<detail::out_value_policy<N, Policies>, detail::null_type>(); 
-	}
-
-	template<int N>
-	detail::policy_cons<detail::pure_out_value_policy<N>, detail::null_type> 
-	pure_out_value(LUABIND_PLACEHOLDER_ARG(N)) 
-	{ 
-		return detail::policy_cons<detail::pure_out_value_policy<N>, detail::null_type>(); 
-	}
-
-	template<int N, class Policies>
-	detail::policy_cons<detail::pure_out_value_policy<N, Policies>, detail::null_type> 
-	pure_out_value(LUABIND_PLACEHOLDER_ARG(N), const Policies&) 
-	{ 
-		return detail::policy_cons<detail::pure_out_value_policy<N, Policies>, detail::null_type>(); 
-	}
-}
-
-#endif // LUABIND_OUT_VALUE_POLICY_HPP_INCLUDED
-

+ 0 - 31
lib/luabind/luabind/prefix.hpp

@@ -1,31 +0,0 @@
-// Copyright (c) 2004 Daniel Wallin
-
-// 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 PREFIX_040218_HPP
-#define PREFIX_040218_HPP
-
-#ifdef LUABIND_PREFIX_INCLUDE
-#  include LUABIND_PREFIX_INCLUDE
-#endif
-
-#endif // PREFIX_040218_HPP
-

+ 0 - 85
lib/luabind/luabind/raw_policy.hpp

@@ -1,85 +0,0 @@
-// Copyright (c) 2003 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_RAW_POLICY_HPP_INCLUDED
-#define LUABIND_RAW_POLICY_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/policy.hpp>
-
-namespace luabind { namespace detail  {
-
-	struct raw_converter
-	{
-        int const consumed_args(...)
-        {
-            return 0;
-        }
-
-        lua_State* apply(lua_State* L, by_pointer<lua_State>, int)
-		{
-			return L;
-		}
-
-		static int match(...)
-		{
-			return 0;
-		}
-
-		void converter_postcall(lua_State*, by_pointer<lua_State>, int) {}
-	};
-
-	template<int N>
-	struct raw_policy : conversion_policy<N, false>
-	{
-		static void precall(lua_State*, const index_map&) {}
-		static void postcall(lua_State*, const index_map&) {}
-
-		template<class T, class Direction>
-		struct apply
-		{
-			typedef raw_converter type;
-		};
-	};
-
-}} // namespace luabind::detail
-
-namespace luabind {
-
-	template<int N>
-	detail::policy_cons<
-		detail::raw_policy<N>
-	  , detail::null_type
-	>
-	inline raw(LUABIND_PLACEHOLDER_ARG(N))
-	{ 
-		return detail::policy_cons<
-			detail::raw_policy<N>
-		  , detail::null_type
-		>(); 
-	}
-
-} // namespace luabind
-
-#endif // LUABIND_RAW_POLICY_HPP_INCLUDED
-

+ 0 - 73
lib/luabind/luabind/return_reference_to_policy.hpp

@@ -1,73 +0,0 @@
-// Copyright (c) 2003 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_RETURN_REFERENCE_TO_POLICY_HPP_INCLUDED
-#define LUABIND_RETURN_REFERENCE_TO_POLICY_HPP_INCLUDED
-
-namespace luabind { namespace detail
-{
-	template<class T>
-	struct return_reference_to_converter;
-
-	template<>
-	struct return_reference_to_converter<cpp_to_lua>
-	{
-		template<class T>
-		void apply(lua_State* L, const T&)
-		{
-			lua_pushnil(L);
-		}
-	};
-
-	template<int N>
-	struct return_reference_to_policy : conversion_policy<0>
-	{
-		static void precall(lua_State*, const index_map&) {}
-		static void postcall(lua_State* L, const index_map& indices) 
-		{
-			int result_index = indices[0];
-			int ref_to_index = indices[N];
-
-			lua_pushvalue(L, ref_to_index);
-			lua_replace(L, result_index);
-		}
-
-		template<class T, class Direction>
-		struct apply
-		{
-			typedef return_reference_to_converter<Direction> type;
-		};
-	};
-}}
-
-namespace luabind
-{
-	template<int N>
-	detail::policy_cons<detail::return_reference_to_policy<N>, detail::null_type> 
-	return_reference_to(LUABIND_PLACEHOLDER_ARG(N)) 
-	{ 
-		return detail::policy_cons<detail::return_reference_to_policy<N>, detail::null_type>(); 
-	}
-}
-
-#endif // LUABIND_RETURN_REFERENCE_TO_POLICY_HPP_INCLUDED
-

+ 0 - 103
lib/luabind/luabind/scope.hpp

@@ -1,103 +0,0 @@
-// 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 NEW_SCOPE_040211_HPP
-#define NEW_SCOPE_040211_HPP
-
-#include <luabind/prefix.hpp>
-#include <luabind/config.hpp>
-#include <luabind/lua_include.hpp>
-#include <memory>
-
-namespace luabind { 
-    
-    struct scope; 
-
-} // namespace luabind
-
-namespace luabind { namespace detail {
-
-    struct LUABIND_API registration
-    {
-        registration();
-        virtual ~registration();
-
-    protected:
-        virtual void register_(lua_State*) const = 0;
-
-    private:
-        friend struct ::luabind::scope;
-        registration* m_next;
-    };
-
-}} // namespace luabind::detail
-
-namespace luabind {
-
-    struct LUABIND_API scope
-    {
-        scope();
-        explicit scope(std::auto_ptr<detail::registration> reg);
-        scope(scope const& other_);
-        ~scope();
-
-        scope& operator=(scope const& other_);
-
-        scope& operator,(scope s);
-
-        void register_(lua_State* L) const;
-
-    private:
-        detail::registration* m_chain;
-    };
-
-    class LUABIND_API namespace_ : public scope
-    {
-    public:
-        explicit namespace_(char const* name);
-        namespace_& operator[](scope s);
-
-    private:
-        struct registration_;
-        registration_* m_registration;
-    };
-
-    class LUABIND_API module_
-    {
-    public:
-        module_(lua_State* L_, char const* name);
-        void operator[](scope s);
-
-    private:
-        lua_State* m_state;
-        char const* name_;
-    };
-
-    inline module_ module(lua_State* L, char const* name = 0)
-    {
-        return module_(L, name);
-    }
-
-} // namespace luabind
-
-#endif // NEW_SCOPE_040211_HPP
-

+ 0 - 83
lib/luabind/luabind/shared_ptr_converter.hpp

@@ -1,83 +0,0 @@
-// Copyright Daniel Wallin 2009. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_SHARED_PTR_CONVERTER_090211_HPP
-# define LUABIND_SHARED_PTR_CONVERTER_090211_HPP
-
-# include <luabind/get_main_thread.hpp>
-# include <luabind/handle.hpp>
-# include <luabind/detail/policy.hpp>
-# include <boost/shared_ptr.hpp>
-
-namespace luabind {
-
-namespace detail
-{
-
-  struct shared_ptr_deleter
-  {
-      shared_ptr_deleter(lua_State* L, int index)
-        : life_support(get_main_thread(L), L, index)
-      {}
-
-      void operator()(void const*)
-      {
-          handle().swap(life_support);
-      }
-
-      handle life_support;
-  };
-
-} // namespace detail
-
-template <class T>
-struct default_converter<boost::shared_ptr<T> >
-  : default_converter<T*>
-{
-    typedef boost::mpl::false_ is_native;
-
-    template <class U>
-    int match(lua_State* L, U, int index)
-    {
-        return default_converter<T*>::match(
-            L, LUABIND_DECORATE_TYPE(T*), index);
-    }
-
-    template <class U>
-    boost::shared_ptr<T> apply(lua_State* L, U, int index)
-    {
-        T* raw_ptr = default_converter<T*>::apply(
-            L, LUABIND_DECORATE_TYPE(T*), index);
-        if (!raw_ptr)
-            return boost::shared_ptr<T>();
-        return boost::shared_ptr<T>(
-            raw_ptr, detail::shared_ptr_deleter(L, index));
-    }
-
-    void apply(lua_State* L, boost::shared_ptr<T> const& p)
-    {
-        if (detail::shared_ptr_deleter* d =
-                boost::get_deleter<detail::shared_ptr_deleter>(p))
-        {
-            d->life_support.push(L);
-        }
-        else
-        {
-            detail::value_converter().apply(L, p);
-        }
-    }
-
-    template <class U>
-    void converter_postcall(lua_State*, U const&, int)
-    {}
-};
-
-template <class T>
-struct default_converter<boost::shared_ptr<T> const&>
-  : default_converter<boost::shared_ptr<T> >
-{};
-
-} // namespace luabind
-
-#endif // LUABIND_SHARED_PTR_CONVERTER_090211_HPP

+ 0 - 111
lib/luabind/luabind/tag_function.hpp

@@ -1,111 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#if !BOOST_PP_IS_ITERATING
-
-# ifndef LUABIND_TAG_FUNCTION_081129_HPP
-#  define LUABIND_TAG_FUNCTION_081129_HPP
-
-#  ifndef LUABIND_CPP0x
-#   if LUABIND_MAX_ARITY <= 8
-#    include <boost/mpl/vector/vector10.hpp>
-#   else
-#    include <boost/mpl/vector/vector50.hpp>
-#   endif
-#   include <boost/preprocessor/cat.hpp>
-#   include <boost/preprocessor/iterate.hpp>
-#   include <boost/preprocessor/repetition/enum_params.hpp>
-#   include <boost/preprocessor/repetition/enum_trailing_params.hpp>
-#  endif
-
-namespace luabind {
-
-namespace detail
-{
-
-  template <class Signature, class F>
-  struct tagged_function
-  {
-      tagged_function(F f)
-        : f(f)
-      {}
-
-      F f;
-  };
-
-  template <class Signature, class F>
-  Signature deduce_signature(tagged_function<Signature, F> const&, ...)
-  {
-      return Signature();
-  }
-
-  template <class Function>
-  struct signature_from_function;
-
-#  ifdef LUABIND_CPP0x
-
-  template <class... Args, class F, class Policies>
-  int invoke(
-      lua_State* L, function_object const& self, invoke_context& ctx
-    , tagged_function<vector<Args...>, F> const& tagged
-    , vector<Args...>, Policies const& policies)
-  {
-      return invoke(L, self, ctx, tagged.f, vector<Args...>(), policies);
-  }
-
-  template <class R, class... Args>
-  struct signature_from_function<R(Args...)>
-  {
-      typedef vector<R, Args...> type;
-  };
-
-#  else // LUABIND_CPP0x
-
-  template <class Signature, class F, class Policies>
-  int invoke(
-      lua_State* L, function_object const& self, invoke_context& ctx
-    , tagged_function<Signature, F> const& tagged
-    , Signature, Policies const& policies)
-  {
-      return invoke(L, self, ctx, tagged.f, Signature(), policies);
-  }
-
-#   define BOOST_PP_ITERATION_PARAMS_1 \
-  (3, (0, LUABIND_MAX_ARITY, <luabind/tag_function.hpp>))
-#  include BOOST_PP_ITERATE()
-
-# endif // LUABIND_CPP0x
-
-} // namespace detail
-
-template <class Signature, class F>
-detail::tagged_function<
-    typename detail::signature_from_function<Signature>::type
-  , F
->
-tag_function(F f)
-{
-    return f;
-}
-
-} // namespace luabind
-
-# endif // LUABIND_TAG_FUNCTION_081129_HPP
-
-#else // BOOST_PP_IS_ITERATING
-
-# define N BOOST_PP_ITERATION()
-# define NPLUS1 BOOST_PP_INC(N)
-
-template <class R BOOST_PP_ENUM_TRAILING_PARAMS(N, class A)>
-struct signature_from_function<R(BOOST_PP_ENUM_PARAMS(N, A))>
-{
-    typedef BOOST_PP_CAT(mpl::vector, NPLUS1)<
-        R BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
-    > type;
-};
-
-#endif // BOOST_PP_IS_ITERATING
-
-

+ 0 - 65
lib/luabind/luabind/typeid.hpp

@@ -1,65 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_TYPEID_081227_HPP
-# define LUABIND_TYPEID_081227_HPP
-
-# include <boost/operators.hpp>
-# include <typeinfo>
-# include <luabind/detail/primitives.hpp>
-
-namespace luabind {
-
-# ifdef BOOST_MSVC
-#  pragma warning(push)
-// std::type_info::before() returns int, rather than bool.
-// At least on MSVC7.1, this is true for the comparison
-// operators as well.
-#  pragma warning(disable:4800)
-# endif
-
-class type_id
-  : public boost::less_than_comparable<type_id>
-{
-public:
-    type_id()
-      : id(&typeid(detail::null_type))
-    {}
-
-    type_id(std::type_info const& id)
-      : id(&id)
-    {}
-
-    bool operator!=(type_id const& other) const
-    {
-        return *id != *other.id;
-    }
-
-    bool operator==(type_id const& other) const
-    {
-        return *id == *other.id;
-    }
-
-    bool operator<(type_id const& other) const
-    {
-        return id->before(*other.id);
-    }
-
-    char const* name() const
-    {
-        return id->name();
-    }
-
-private:
-    std::type_info const* id;
-};
-
-# ifdef BOOST_MSVC
-#  pragma warning(pop)
-# endif
-
-} // namespace luabind
-
-#endif // LUABIND_TYPEID_081227_HPP
-

+ 0 - 168
lib/luabind/luabind/value_wrapper.hpp

@@ -1,168 +0,0 @@
-// Copyright (c) 2005 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_VALUE_WRAPPER_050419_HPP
-#define LUABIND_VALUE_WRAPPER_050419_HPP
-
-#include <boost/mpl/integral_c.hpp>
-#include <boost/mpl/bool.hpp>
-#include <boost/mpl/aux_/msvc_eti_base.hpp>
-
-#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-# define LUABIND_USE_VALUE_WRAPPER_TAG 
-#else
-#endif
-
-#ifdef LUABIND_USE_VALUE_WRAPPER_TAG
-# include <boost/mpl/identity.hpp>
-# include <boost/mpl/eval_if.hpp>
-# include <boost/mpl/has_xxx.hpp>
-# include <boost/mpl/not.hpp>
-# include <boost/mpl/and.hpp>
-# include <boost/mpl/or.hpp>
-# include <boost/type_traits/is_reference.hpp>
-# include <boost/type_traits/is_pointer.hpp>
-# include <boost/type_traits/is_array.hpp>
-#endif
-
-namespace luabind {
-
-//
-// Concept ``ValueWrapper``
-//
-
-#ifdef LUABIND_USE_VALUE_WRAPPER_TAG
-template<class T>
-struct value_wrapper_traits;
-    
-namespace detail 
-{ 
-
-  BOOST_MPL_HAS_XXX_TRAIT_DEF(value_wrapper_tag);
-
-  struct unspecialized_value_wrapper_traits
-  {
-      typedef boost::mpl::false_ is_specialized;
-  };
-
-  template<class T>
-  struct value_wrapper_traits_aux
-  {
-      typedef value_wrapper_traits<typename T::value_wrapper_tag> type;
-  };
-
-} // namespace detail
-#endif
-
-template<class T>
-struct value_wrapper_traits
-#ifdef LUABIND_USE_VALUE_WRAPPER_TAG
-  : boost::mpl::eval_if<
-        boost::mpl::and_<
-            boost::mpl::not_<
-                boost::mpl::or_<
-                    boost::is_reference<T>
-                  , boost::is_pointer<T>
-                  , boost::is_array<T>
-                >
-            >
-          , detail::has_value_wrapper_tag<T>
-        >
-      , detail::value_wrapper_traits_aux<T>
-      , boost::mpl::identity<detail::unspecialized_value_wrapper_traits>
-    >::type
-{};
-#else
-{
-    typedef boost::mpl::false_ is_specialized;
-};
-#endif
-
-template<class T>
-struct is_value_wrapper
-  : boost::mpl::aux::msvc_eti_base<
-        typename value_wrapper_traits<T>::is_specialized
-    >::type
-{};
-
-} // namespace luabind
-
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-# include <boost/type_traits/remove_const.hpp>
-# include <boost/type_traits/remove_reference.hpp>
-
-namespace luabind {
-
-template<class T>
-struct is_value_wrapper_arg
-  : is_value_wrapper<
-      typename boost::remove_const<
-          typename boost::remove_reference<T>::type
-      >::type
-    >
-{};
-
-} // namespace luabind
-
-#else
-
-# include <luabind/detail/yes_no.hpp>
-# include <boost/type_traits/add_reference.hpp>
-
-namespace luabind {
-
-namespace detail
-{
-  template<class T>
-  typename is_value_wrapper<T>::type is_value_wrapper_arg_check(T const*);
-  
-  yes_t to_yesno(boost::mpl::true_);
-  no_t to_yesno(boost::mpl::false_);
-
-  template<class T>
-  struct is_value_wrapper_arg_aux
-  {
-      static typename boost::add_reference<T>::type x;
-
-      BOOST_STATIC_CONSTANT(bool, value = 
-          sizeof(to_yesno(is_value_wrapper_arg_check(&x)))
-            == sizeof(yes_t)
-      );
-
-      typedef boost::mpl::bool_<value> type;
-  };
-
-} // namespace detail
-
-template<class T>
-struct is_value_wrapper_arg
-  : detail::is_value_wrapper_arg_aux<T>::type
-{
-};
-
-} // namespace luabind
-
-#endif
-
-#endif // LUABIND_VALUE_WRAPPER_050419_HPP
-

+ 0 - 125
lib/luabind/luabind/vector.hpp

@@ -1,125 +0,0 @@
-// Copyright Daniel Wallin 2010. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_VECTOR_100629_HPP
-# define LUABIND_VECTOR_100629_HPP
-
-# ifdef LUABIND_CPP0x
-
-#  include <boost/mpl/fold.hpp>
-#  include <boost/mpl/begin_end_fwd.hpp>
-#  include <boost/mpl/front_fwd.hpp>
-#  include <boost/mpl/size_fwd.hpp>
-
-namespace luabind {
-
-// This is used to specify function signatures, both in the user interface and
-// in the implementation. In the C++03 version this used to be any MPL forward
-// sequence. For backward compatibility reasons we provide a conversion layer
-// from an MPL sequence.
-template <class... Args>
-struct vector
-{};
-
-namespace detail
-{
-
-
-  template <class... Args>
-  struct vector_iterator;
-
-  template <class Head, class... Tail>
-  struct vector_iterator<Head, Tail...>
-  {
-      typedef Head type;
-      typedef vector_iterator<Tail...> next;
-  };
-
-  template <>
-  struct vector_iterator<>
-  {};
-
-} // namespace detail
-
-} // namespace luabind
-
-namespace boost { namespace mpl
-{
-
-  // MPL sequence adaption layer to ease the transition to C++0x.
-
-  template <class... Args>
-  struct begin<luabind::vector<Args...> >
-  {
-      typedef luabind::detail::vector_iterator<Args...> type;
-  };
-
-  template <class... Args>
-  struct end<luabind::vector<Args...> >
-  {
-      typedef luabind::detail::vector_iterator<> type;
-  };
-
-  template <class... Args>
-  struct size<luabind::vector<Args...> >
-    : long_<sizeof...(Args)>
-  {};
-
-  template <class Head, class... Tail>
-  struct front<luabind::vector<Head, Tail...> >
-  {
-      typedef Head type;
-  };
-
-  template <class Head, class... Tail>
-  struct deref<luabind::detail::vector_iterator<Head, Tail...> >
-  {
-      typedef Head type;
-  };
-
-}} // namespace boost::mpl
-
-# endif // LUABIND_CPP0x
-
-namespace luabind { namespace detail
-{
-
-# ifdef LUABIND_CPP0x
-
-  struct append_vector
-  {
-      template <class V, class T>
-      struct apply;
-
-      template <class... Args, class T>
-      struct apply<vector<Args...>, T>
-      {
-          typedef vector<Args..., T> type;
-      };
-  };
-
-  template <class Sequence>
-  struct as_vector
-    : boost::mpl::fold<Sequence, vector<>, append_vector>
-  {};
-
-  template <class... Args>
-  struct as_vector<vector<Args...> >
-  {
-      typedef vector<Args...> type;
-  };
-
-# else // LUABIND_CPP0x
-
-  template <class Sequence>
-  struct as_vector
-  {
-      typedef Sequence type;
-  };
-
-# endif
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_VECTOR_100629_HPP

+ 0 - 16
lib/luabind/luabind/version.hpp

@@ -1,16 +0,0 @@
-// Copyright Daniel Wallin 2009. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef LUABIND_VERSION_090216_HPP
-# define LUABIND_VERSION_090216_HPP
-
-# define LUABIND_VERSION 900
-
-// Each component uses two digits, so:
-//
-//   major = LUABIND_VERSION / 10000
-//   minor = LUABIND_VERSION / 100 % 100
-//   patch = LUABIND_VERSION % 100
-
-#endif // LUABIND_VERSION_090216_HPP

+ 0 - 59
lib/luabind/luabind/weak_ref.hpp

@@ -1,59 +0,0 @@
-// 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 WEAK_REF_040402_HPP
-#define WEAK_REF_040402_HPP
-
-#include <luabind/config.hpp>
-
-struct lua_State;
-
-namespace luabind {
-
-    class LUABIND_API weak_ref
-    {
-    public:
-        weak_ref();
-        weak_ref(lua_State* main, lua_State* L, int index);
-        weak_ref(weak_ref const&);
-        ~weak_ref();
-
-        weak_ref& operator=(weak_ref const&);
-
-        void swap(weak_ref&);
-
-		// returns a unique id that no
-		// other weak ref will return
-		int id() const;
-
-        lua_State* state() const;
-        void get(lua_State* L) const;
-
-    private:
-        struct impl;
-        impl* m_impl;
-    };
-
-} // namespace luabind
-
-#endif // WEAK_REF_040402_HPP
-

+ 0 - 236
lib/luabind/luabind/wrapper_base.hpp

@@ -1,236 +0,0 @@
-// Copyright (c) 2003 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.
-
-#if !BOOST_PP_IS_ITERATING
-
-#ifndef LUABIND_WRAPPER_BASE_HPP_INCLUDED
-#define LUABIND_WRAPPER_BASE_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/weak_ref.hpp>
-#include <luabind/detail/ref.hpp>
-#include <luabind/detail/call_member.hpp>
-
-#ifndef LUABIND_CPP0x
-# include <boost/preprocessor/repetition/enum_trailing_params.hpp>
-# include <boost/preprocessor/repetition/enum_trailing_binary_params.hpp>
-#endif
-
-#include <stdexcept>
-
-namespace luabind
-{
-	namespace detail
-	{
-		struct wrap_access;
-
-		// implements the selection between dynamic dispatch
-		// or default implementation calls from within a virtual
-		// function wrapper. The input is the self reference on
-		// the top of the stack. Output is the function to call
-		// on the top of the stack (the input self reference will
-		// be popped)
-		LUABIND_API void do_call_member_selection(lua_State* L, char const* name);
-	}
-
-	struct wrapped_self_t: weak_ref
-	{
-		detail::lua_reference m_strong_ref;
-	};
-
-	struct wrap_base
-	{
-		friend struct detail::wrap_access;
-		wrap_base() {}
-
-# ifdef LUABIND_CPP0x
-
-        template <class R, class... Args>
-        typename detail::make_member_proxy<R, Args...>::type call(
-            char const* name, Args const&... args) const
-        {
-            lua_State* L = m_self.state();
-            m_self.get(L);
-            assert(!lua_isnil(L, -1));
-            detail::do_call_member_selection(L, name);
-
-            if (lua_isnil(L, -1))
-            {
-                lua_pop(L, 1);
-                throw std::runtime_error("Attempt to call nonexistent function");
-            }
-
-            // push the self reference as the first parameter
-            m_self.get(L);
-
-            typedef typename detail::make_member_proxy<R, Args...>::type
-                proxy_type;
-            return proxy_type(L, std::tuple<Args const*...>(&args...));
-        }
-
-# else // LUABIND_CPP0x
-
-    #define BOOST_PP_ITERATION_PARAMS_1 (4, (0, LUABIND_MAX_ARITY, <luabind/wrapper_base.hpp>, 1))
-	#include BOOST_PP_ITERATE()
-
-# endif // LUABIND_CPP0x
-
-	private:
-		wrapped_self_t m_self;
-	};
-
-# ifdef LUABIND_CPP0x
-
-    template <class R, class... Args>
-    typename detail::make_member_proxy<R, Args...>::type call_member(
-        wrap_base const* self, char const* name, Args const&... args)
-    {
-        return self->call<R>(name, args...);
-    }
-
-# else // LUABIND_CPP0x
-
-#  define BOOST_PP_ITERATION_PARAMS_1 (4, (0, LUABIND_MAX_ARITY, <luabind/wrapper_base.hpp>, 2))
-#include BOOST_PP_ITERATE()
-
-# endif // LUABIND_CPP0x
-
-	namespace detail
-	{
-		struct wrap_access
-		{
-			static wrapped_self_t const& ref(wrap_base const& b)
-			{
-				return b.m_self;
-			}
-
-			static wrapped_self_t& ref(wrap_base& b)
-			{
-				return b.m_self;
-			}
-		};
-	}
-}
-
-#endif // LUABIND_WRAPPER_BASE_HPP_INCLUDED
-
-#else
-#if BOOST_PP_ITERATION_FLAGS() == 1
-
-#define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
-#define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
-
-	template<class R BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), class A)>
-		typename boost::mpl::if_<boost::is_void<R>
-				, luabind::detail::proxy_member_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-				, luabind::detail::proxy_member_caller<R, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type
-				call(char const* name BOOST_PP_COMMA_IF(BOOST_PP_ITERATION()) BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_OPERATOR_PARAMS, _), detail::type_<R>* = 0) const
-		{
-			typedef boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> tuple_t;
-	#if BOOST_PP_ITERATION() == 0
-			tuple_t args;
-	#else
-			tuple_t args(BOOST_PP_ENUM_PARAMS(BOOST_PP_ITERATION(), &a));
-	#endif
-
-			typedef typename boost::mpl::if_<boost::is_void<R>
-				, luabind::detail::proxy_member_void_caller<boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> >
-				, luabind::detail::proxy_member_caller<R, boost::tuples::tuple<BOOST_PP_ENUM(BOOST_PP_ITERATION(), LUABIND_TUPLE_PARAMS, _)> > >::type proxy_type;
-
-			// this will be cleaned up by the proxy object
-			// once the call has been made
-
-			// TODO: what happens if this virtual function is
-			// dispatched from a lua thread where the state
-			// pointer is different?
-
-			// get the function
-			lua_State* L = m_self.state();
-			m_self.get(L);
-			assert(!lua_isnil(L, -1));
-			detail::do_call_member_selection(L, name);
-
-			if (lua_isnil(L, -1))
-			{
-				lua_pop(L, 1);
-				throw std::runtime_error("Attempt to call nonexistent function");
-			}
-
-			// push the self reference as the first parameter
-			m_self.get(L);
-
-			// now the function and self objects
-			// are on the stack. These will both
-			// be popped by pcall
-			return proxy_type(L, args);
-		}
-
-#undef LUABIND_CALL_MEMBER_NAME
-#undef LUABIND_OPERATOR_PARAMS
-#undef LUABIND_TUPLE_PARAMS
-
-#else // free call_member forwardarding functions
-
-#define N BOOST_PP_ITERATION()
-
-#define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
-#define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
-
-    template<
-        class R 
-        BOOST_PP_ENUM_TRAILING_PARAMS(N, class A)
-    >
-    typename boost::mpl::if_<
-        boost::is_void<R>
-      , detail::proxy_member_void_caller<
-            boost::tuples::tuple<
-                BOOST_PP_ENUM(N, LUABIND_TUPLE_PARAMS, _)
-            >
-        >
-      , detail::proxy_member_caller<
-            R
-          , boost::tuples::tuple<
-                BOOST_PP_ENUM(N, LUABIND_TUPLE_PARAMS, _)
-            >
-        >
-    >::type
-    call_member(
-        wrap_base const* self
-      , char const* fn
-        BOOST_PP_ENUM_TRAILING_BINARY_PARAMS(N, A, &a)
-      , detail::type_<R>* = 0
-    )
-    {
-        return self->call(
-            fn
-            BOOST_PP_ENUM_TRAILING_PARAMS(N, a)
-         , (detail::type_<R>*)0
-        );
-    }
-
-#undef LUABIND_OPERATOR_PARAMS
-#undef LUABIND_TUPLE_PARAMS
-
-#undef N
-
-#endif
-#endif

+ 0 - 53
lib/luabind/luabind/yield_policy.hpp

@@ -1,53 +0,0 @@
-// Copyright (c) 2003 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_YIELD_POLICY_HPP_INCLUDED
-#define LUABIND_YIELD_POLICY_HPP_INCLUDED
-
-#include <luabind/config.hpp>
-#include <luabind/detail/policy.hpp>
-
-namespace luabind { namespace detail 
-{
-	struct yield_policy
-	{
-		static void precall(lua_State*, const index_map&) {}
-		static void postcall(lua_State*, const index_map&) {}
-	};
-}}
-
-namespace luabind
-{
-  detail::policy_cons<detail::yield_policy, detail::null_type> const yield = {};
-
-  namespace detail
-  {
-    inline void ignore_unused_yield()
-    {
-        (void)yield;
-    }
-  }
-}
-
-#endif // LUABIND_YIELD_POLICY_HPP_INCLUDED
-

+ 0 - 337
lib/luabind/src/class.cpp

@@ -1,337 +0,0 @@
-// 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.
-
-#define LUABIND_BUILDING
-
-#include <boost/foreach.hpp>
-
-#include <luabind/lua_include.hpp>
-
-#include <luabind/config.hpp>
-#include <luabind/class.hpp>
-#include <luabind/nil.hpp>
-
-#include <cstring>
-#include <iostream>
-
-namespace luabind
-{
-   LUABIND_API detail::nil_type nil;
-}
-
-namespace luabind { namespace detail {
-    
-
-    namespace
-    {
-      struct cast_entry
-      {
-          cast_entry(class_id src, class_id target, cast_function cast)
-            : src(src)
-            , target(target)
-            , cast(cast)
-          {}
-
-          class_id src;
-          class_id target;
-          cast_function cast;
-      };
-
-    } // namespace unnamed
-
-    struct class_registration : registration
-    {   
-        class_registration(char const* name);
-
-        void register_(lua_State* L) const;
-
-        const char* name_;
-
-        mutable std::map<const char*, int, detail::ltstr> m_static_constants;
-
-        typedef std::pair<type_id, cast_function> base_desc;
-        mutable std::vector<base_desc> m_bases;
-
-        type_id m_type;
-        class_id m_id;
-        class_id m_wrapper_id;
-        type_id m_wrapper_type;
-        std::vector<cast_entry> m_casts;
-
-        scope m_scope;
-        scope m_members;
-        scope m_default_members;
-    };
-
-    class_registration::class_registration(char const* name)
-    {
-        name_ = name;
-    }
-
-    void class_registration::register_(lua_State* L) const
-    {
-        LUABIND_CHECK_STACK(L);
-
-        assert(lua_type(L, -1) == LUA_TTABLE);
-
-        lua_pushstring(L, name_);
-
-        detail::class_rep* crep;
-
-        detail::class_registry* r = detail::class_registry::get_registry(L);
-        // create a class_rep structure for this class.
-        // allocate it within lua to let lua collect it on
-        // lua_close(). This is better than allocating it
-        // as a static, since it will then be destructed
-        // when the program exits instead.
-        // warning: we assume that lua will not
-        // move the userdata memory.
-        lua_newuserdata(L, sizeof(detail::class_rep));
-        crep = reinterpret_cast<detail::class_rep*>(lua_touserdata(L, -1));
-
-        new(crep) detail::class_rep(
-            m_type
-            , name_
-            , L
-		);
-
-        // register this new type in the class registry
-        r->add_class(m_type, crep);
-
-        lua_pushstring(L, "__luabind_class_map");
-        lua_rawget(L, LUA_REGISTRYINDEX);
-        class_map& classes = *static_cast<class_map*>(
-            lua_touserdata(L, -1));
-        lua_pop(L, 1);
-
-        classes.put(m_id, crep);
-
-        bool const has_wrapper = m_wrapper_id != registered_class<null_type>::id;
-
-        if (has_wrapper)
-            classes.put(m_wrapper_id, crep);
-
-        crep->m_static_constants.swap(m_static_constants);
-
-		detail::class_registry* registry = detail::class_registry::get_registry(L);
-
-        crep->get_default_table(L);
-        m_scope.register_(L);
-        m_default_members.register_(L);
-        lua_pop(L, 1);
-
-        crep->get_table(L);
-        m_members.register_(L);
-        lua_pop(L, 1);
-
-        lua_pushstring(L, "__luabind_cast_graph");
-        lua_gettable(L, LUA_REGISTRYINDEX);
-        cast_graph* const casts = static_cast<cast_graph*>(
-            lua_touserdata(L, -1));
-        lua_pop(L, 1);
-
-        lua_pushstring(L, "__luabind_class_id_map");
-        lua_gettable(L, LUA_REGISTRYINDEX);
-        class_id_map* const class_ids = static_cast<class_id_map*>(
-            lua_touserdata(L, -1));
-        lua_pop(L, 1);
-
-        class_ids->put(m_id, m_type);
-
-        if (has_wrapper)
-            class_ids->put(m_wrapper_id, m_wrapper_type);
-
-        BOOST_FOREACH(cast_entry const& e, m_casts)
-        {
-            casts->insert(e.src, e.target, e.cast);
-        }
-
-        for (std::vector<base_desc>::iterator i = m_bases.begin();
-            i != m_bases.end(); ++i)
-        {
-            LUABIND_CHECK_STACK(L);
-
-            // the baseclass' class_rep structure
-            detail::class_rep* bcrep = registry->find_class(i->first);
-
-            detail::class_rep::base_info base;
-            base.pointer_offset = 0;
-            base.base = bcrep;
-
-            crep->add_base_class(base);
-
-            // copy base class table
-			crep->get_table(L);
-			bcrep->get_table(L);
-            lua_pushnil(L);
-
-            while (lua_next(L, -2))
-            {
-                lua_pushvalue(L, -2); // copy key
-                lua_gettable(L, -5);
-
-                if (!lua_isnil(L, -1))
-                {
-                    lua_pop(L, 2);
-                    continue;
-                }
-
-                lua_pop(L, 1);
-                lua_pushvalue(L, -2); // copy key
-                lua_insert(L, -2);
-
-                lua_settable(L, -5);
-            }
-            lua_pop(L, 2);
-
-            // copy base class detaults table
-			crep->get_default_table(L);
-			bcrep->get_default_table(L);
-            lua_pushnil(L);
-
-            while (lua_next(L, -2))
-            {
-                lua_pushvalue(L, -2); // copy key
-                lua_gettable(L, -5);
-
-                if (!lua_isnil(L, -1))
-                {
-                    lua_pop(L, 2);
-                    continue;
-                }
-
-                lua_pop(L, 1);
-                lua_pushvalue(L, -2); // copy key
-                lua_insert(L, -2);
-
-                lua_settable(L, -5);
-            }
-            lua_pop(L, 2);
-
-		}
-
-        lua_settable(L, -3);
-    }
-    
-    // -- interface ---------------------------------------------------------
-
-    class_base::class_base(char const* name)
-        : scope(std::auto_ptr<registration>(
-                m_registration = new class_registration(name))
-          )
-    {
-    }
-
-    void class_base::init(
-        type_id const& type_id_, class_id id
-      , type_id const& wrapper_type, class_id wrapper_id)
-    {
-        m_registration->m_type = type_id_;
-        m_registration->m_id = id;
-        m_registration->m_wrapper_type = wrapper_type;
-        m_registration->m_wrapper_id = wrapper_id;
-    }
-
-    void class_base::add_base(type_id const& base, cast_function cast)
-    {
-        m_registration->m_bases.push_back(std::make_pair(base, cast));
-    }
-
-	void class_base::add_member(registration* member)
-	{
-		std::auto_ptr<registration> ptr(member);
-		m_registration->m_members.operator,(scope(ptr));
-	}
-
-	void class_base::add_default_member(registration* member)
-	{
-		std::auto_ptr<registration> ptr(member);
-		m_registration->m_default_members.operator,(scope(ptr));
-	}
-
-    const char* class_base::name() const 
-    { 
-        return m_registration->name_; 
-    }
-
-    void class_base::add_static_constant(const char* name, int val)
-    {
-        m_registration->m_static_constants[name] = val;
-    }
-
-    void class_base::add_inner_scope(scope& s)
-    {
-        m_registration->m_scope.operator,(s);
-    }
-
-    void class_base::add_cast(
-        class_id src, class_id target, cast_function cast)
-    {
-        m_registration->m_casts.push_back(cast_entry(src, target, cast));
-    }
-
-	void add_custom_name(type_id const& i, std::string& s)
-	{
-		s += " [";
-		s += i.name();
-		s += "]";
-	}
-
-    std::string get_class_name(lua_State* L, type_id const& i)
-    {
-        std::string ret;
-
-		assert(L);
-
-		class_registry* r = class_registry::get_registry(L);
-        class_rep* crep = r->find_class(i);
-
-        if (crep == 0)
-        {
-            ret = "custom";
-			add_custom_name(i, ret);
-        }
-        else
-        {
-            /* TODO reimplement this?
-            if (i == crep->holder_type())
-            {
-                ret += "smart_ptr<";
-                ret += crep->name();
-                ret += ">";
-            }
-            else if (i == crep->const_holder_type())
-            {
-                ret += "smart_ptr<const ";
-                ret += crep->name();
-                ret += ">";
-            }
-            else*/
-            {
-                ret += crep->name();
-            }
-        }
-        return ret;
-    }
-
-}} // namespace luabind::detail
-

+ 0 - 120
lib/luabind/src/class_info.cpp

@@ -1,120 +0,0 @@
-// Copyright (c) 2003 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.
-
-#define LUABIND_BUILDING
-
-#include <luabind/lua_include.hpp>
-
-#include <luabind/luabind.hpp>
-#include <luabind/class_info.hpp>
-#include <luabind/detail/class_registry.hpp>
-
-namespace luabind
-{
-	LUABIND_API class_info get_class_info(argument const& o)
-	{
-		lua_State* L = o.interpreter();
-	
-		o.push(L);
-        detail::object_rep* obj = detail::get_instance(L, -1);
-
-        if (!obj)
-        {
-            class_info result;
-            result.name = lua_typename(L, lua_type(L, -1));
-            lua_pop(L, 1);
-            result.methods = newtable(L);
-            result.attributes = newtable(L);
-            return result;
-        }
-
-        lua_pop(L, 1);
-
-        obj->crep()->get_table(L);
-        object table(from_stack(L, -1));
-        lua_pop(L, 1);
-
-        class_info result;
-        result.name = obj->crep()->name();
-        result.methods = newtable(L);
-        result.attributes = newtable(L);
-
-        std::size_t index = 1;
-
-        for (iterator i(table), e; i != e; ++i)
-        {
-            if (type(*i) != LUA_TFUNCTION)
-                continue;
-
-            // We have to create a temporary `object` here, otherwise the proxy
-            // returned by operator->() will mess up the stack. This is a known
-            // problem that probably doesn't show up in real code very often.
-            object member(*i);
-            member.push(L);
-            detail::stack_pop pop(L, 1);
-
-            if (lua_tocfunction(L, -1) == &detail::property_tag)
-            {
-                result.attributes[index++] = i.key();
-            }
-            else
-            {
-                result.methods[i.key()] = *i;
-            }
-        }
-
-        return result;
-	}
-
-    LUABIND_API object get_class_names(lua_State* L)
-    {
-        detail::class_registry* reg = detail::class_registry::get_registry(L);
-
-        std::map<type_id, detail::class_rep*> const& classes = reg->get_classes();
-
-        object result = newtable(L);
-        std::size_t index = 1;
-
-        for (std::map<type_id, detail::class_rep*>::const_iterator iter = classes.begin();
-            iter != classes.end(); ++iter)
-        {
-            result[index++] = iter->second->name();
-        }
-
-        return result;
-    }
-
-	LUABIND_API void bind_class_info(lua_State* L)
-	{
-		module(L)
-		[
-			class_<class_info>("class_info_data")
-				.def_readonly("name", &class_info::name)
-				.def_readonly("methods", &class_info::methods)
-				.def_readonly("attributes", &class_info::attributes),
-		
-            def("class_info", &get_class_info),
-            def("class_names", &get_class_names)
-		];
-	}
-}
-

+ 0 - 168
lib/luabind/src/class_registry.cpp

@@ -1,168 +0,0 @@
-// Copyright (c) 2004 Daniel Wallin
-
-// 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.
-
-#define LUABIND_BUILDING
-
-#include <luabind/lua_include.hpp>
-
-#include <luabind/luabind.hpp>
-#include <luabind/detail/class_registry.hpp>
-#include <luabind/detail/class_rep.hpp>
-#include <luabind/detail/operator_id.hpp>
-
-namespace luabind { namespace detail {
-
-    LUABIND_API void push_instance_metatable(lua_State* L);
-
-    namespace {
-
-        int create_cpp_class_metatable(lua_State* L)
-        {
-            lua_newtable(L);
-
-            // mark the table with our (hopefully) unique tag
-            // that says that the user data that has this
-            // metatable is a class_rep
-            lua_pushstring(L, "__luabind_classrep");
-            lua_pushboolean(L, 1);
-            lua_rawset(L, -3);
-
-            lua_pushstring(L, "__gc");
-            lua_pushcclosure(
-                L
-              , &garbage_collector_s<
-                    detail::class_rep
-                >::apply
-                , 0);
-
-            lua_rawset(L, -3);
-
-            lua_pushstring(L, "__call");
-            lua_pushcclosure(L, &class_rep::constructor_dispatcher, 0);
-            lua_rawset(L, -3);
-
-            lua_pushstring(L, "__index");
-            lua_pushcclosure(L, &class_rep::static_class_gettable, 0);
-            lua_rawset(L, -3);
-
-            lua_pushstring(L, "__newindex");
-            lua_pushcclosure(L, &class_rep::lua_settable_dispatcher, 0);
-            lua_rawset(L, -3);
-
-            return luaL_ref(L, LUA_REGISTRYINDEX);
-        }
-
-        int create_lua_class_metatable(lua_State* L)
-        {
-            lua_newtable(L);
-
-            lua_pushstring(L, "__luabind_classrep");
-            lua_pushboolean(L, 1);
-            lua_rawset(L, -3);
-
-            lua_pushstring(L, "__gc");
-            lua_pushcclosure(
-                L
-              , &detail::garbage_collector_s<
-                    detail::class_rep
-                >::apply
-                , 0);
-
-            lua_rawset(L, -3);
-
-            lua_pushstring(L, "__newindex");
-            lua_pushcclosure(L, &class_rep::lua_settable_dispatcher, 0);
-            lua_rawset(L, -3);
-
-            lua_pushstring(L, "__call");
-            lua_pushcclosure(L, &class_rep::constructor_dispatcher, 0);
-            lua_rawset(L, -3);
-
-            lua_pushstring(L, "__index");
-            lua_pushcclosure(L, &class_rep::static_class_gettable, 0);
-            lua_rawset(L, -3);
-
-            return luaL_ref(L, LUA_REGISTRYINDEX);
-        }
-
-    } // namespace unnamed
-
-    class class_rep;
-
-    class_registry::class_registry(lua_State* L)
-        : m_cpp_class_metatable(create_cpp_class_metatable(L))
-        , m_lua_class_metatable(create_lua_class_metatable(L))
-    {
-        push_instance_metatable(L);
-        m_instance_metatable = luaL_ref(L, LUA_REGISTRYINDEX);
-    }
-
-    class_registry* class_registry::get_registry(lua_State* L)
-    {
-
-#ifdef LUABIND_NOT_THREADSAFE
-
-        // if we don't have to be thread safe, we can keep a
-        // chache of the class_registry pointer without the
-        // need of a mutex
-        static lua_State* cache_key = 0;
-        static class_registry* registry_cache = 0;
-        if (cache_key == L) return registry_cache;
-
-#endif
-
-        lua_pushstring(L, "__luabind_classes");
-        lua_gettable(L, LUA_REGISTRYINDEX);
-        class_registry* p = static_cast<class_registry*>(lua_touserdata(L, -1));
-        lua_pop(L, 1);
-
-#ifdef LUABIND_NOT_THREADSAFE
-
-        cache_key = L;
-        registry_cache = p;
-
-#endif
-
-        return p;
-    }
-
-    void class_registry::add_class(type_id const& info, class_rep* crep)
-    {
-        // If the class is already registered, don't abort — a plugin or other
-        // component may attempt to register bindings for the same C++ type.
-        if (m_classes.find(info) != m_classes.end()){
-            return;
-        }
-        m_classes[info] = crep;
-    }
-
-    class_rep* class_registry::find_class(type_id const& info) const
-    {
-        std::map<type_id, class_rep*>::const_iterator i(
-            m_classes.find(info));
-
-        if (i == m_classes.end()) return 0; // the type is not registered
-        return i->second;
-    }
-
-}} // namespace luabind::detail
-

+ 0 - 395
lib/luabind/src/class_rep.cpp

@@ -1,395 +0,0 @@
-// Copyright (c) 2003 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.
-
-#define LUABIND_BUILDING
-
-#include <luabind/lua_include.hpp>
-
-#include <luabind/detail/stack_utils.hpp>
-#include <luabind/detail/conversion_storage.hpp>
-#include <luabind/luabind.hpp>
-#include <luabind/exception_handler.hpp>
-#include <luabind/get_main_thread.hpp>
-#include <utility>
-
-using namespace luabind::detail;
-
-namespace luabind { namespace detail
-{
-	LUABIND_API int property_tag(lua_State* L)
-	{
-		lua_pushstring(L, "luabind: property_tag function can't be called");
-		lua_error(L);
-		return 0;
-	}
-}}
-
-luabind::detail::class_rep::class_rep(type_id const& type
-	, const char* name
-	, lua_State* L
-)
-	: m_type(type)
-	, name_(name)
-	, m_class_type(cpp_class)
-	, m_operator_cache(0)
-{
-	lua_newtable(L);
-	handle(L, -1).swap(m_table);
-	lua_newtable(L);
-	handle(L, -1).swap(m_default_table);
-	lua_pop(L, 2);
-
-	class_registry* r = class_registry::get_registry(L);
-	assert((r->cpp_class() != LUA_NOREF) && "you must call luabind::open()");
-
-	lua_rawgeti(L, LUA_REGISTRYINDEX, r->cpp_class());
-	lua_setmetatable(L, -2);
-
-	lua_pushvalue(L, -1); // duplicate our user data
-	m_self_ref.set(L);
-
-	m_instance_metatable = r->cpp_instance();
-
-    lua_pushstring(L, "__luabind_cast_graph");
-    lua_gettable(L, LUA_REGISTRYINDEX);
-    m_casts = static_cast<cast_graph*>(lua_touserdata(L, -1));
-    lua_pop(L, 1);
-
-    lua_pushstring(L, "__luabind_class_id_map");
-    lua_gettable(L, LUA_REGISTRYINDEX);
-    m_classes = static_cast<class_id_map*>(lua_touserdata(L, -1));
-    lua_pop(L, 1);
-}
-
-luabind::detail::class_rep::class_rep(lua_State* L, const char* name)
-	: m_type(typeid(null_type))
-	, name_(name)
-	, m_class_type(lua_class)
-	, m_operator_cache(0)
-{
-	lua_newtable(L);
-	handle(L, -1).swap(m_table);
-	lua_newtable(L);
-	handle(L, -1).swap(m_default_table);
-	lua_pop(L, 2);
-
-	class_registry* r = class_registry::get_registry(L);
-	assert((r->cpp_class() != LUA_NOREF) && "you must call luabind::open()");
-
-	lua_rawgeti(L, LUA_REGISTRYINDEX, r->lua_class());
-	lua_setmetatable(L, -2);
-	lua_pushvalue(L, -1); // duplicate our user data
-	m_self_ref.set(L);
-
-	m_instance_metatable = r->lua_instance();
-
-    lua_pushstring(L, "__luabind_cast_graph");
-    lua_gettable(L, LUA_REGISTRYINDEX);
-    m_casts = static_cast<cast_graph*>(lua_touserdata(L, -1));
-    lua_pop(L, 1);
-
-    lua_pushstring(L, "__luabind_class_id_map");
-    lua_gettable(L, LUA_REGISTRYINDEX);
-    m_classes = static_cast<class_id_map*>(lua_touserdata(L, -1));
-    lua_pop(L, 1);
-}
-
-luabind::detail::class_rep::~class_rep()
-{
-}
-
-// leaves object on lua stack
-std::pair<void*,void*> 
-luabind::detail::class_rep::allocate(lua_State* L) const
-{
-	const int size = sizeof(object_rep);
-	char* mem = static_cast<char*>(lua_newuserdata(L, size));
-	return std::pair<void*,void*>(mem, (void*)0);
-}
-
-namespace
-{
-
-  bool super_deprecation_disabled = false;
-
-} // namespace unnamed
-
-// this is called as metamethod __call on the class_rep.
-int luabind::detail::class_rep::constructor_dispatcher(lua_State* L)
-{
-    class_rep* cls = static_cast<class_rep*>(lua_touserdata(L, 1));
-
-    int args = lua_gettop(L);
-
-    push_new_instance(L, cls);
-
-    if (super_deprecation_disabled
-        && cls->get_class_type() == class_rep::lua_class
-        && !cls->bases().empty())
-    {
-        lua_pushstring(L, "super");
-        lua_pushvalue(L, 1);
-        lua_pushvalue(L, -3);
-        lua_pushcclosure(L, super_callback, 2);
-        lua_settable(L, LUA_GLOBALSINDEX);
-    }
-
-    lua_pushvalue(L, -1);
-    lua_replace(L, 1);
-
-    cls->get_table(L);
-    lua_pushliteral(L, "__init");
-    lua_gettable(L, -2);
-
-    lua_insert(L, 1);
-
-    lua_pop(L, 1);
-    lua_insert(L, 1);
-
-    lua_call(L, args, 0);
-
-    if (super_deprecation_disabled)
-    {
-        lua_pushstring(L, "super");
-        lua_pushnil(L);
-        lua_settable(L, LUA_GLOBALSINDEX);
-    }
-
-    return 1;
-}
-
-void luabind::detail::class_rep::add_base_class(const luabind::detail::class_rep::base_info& binfo)
-{
-	// If you hit this assert you are deriving from a type that is not registered
-	// in lua. That is, in the class_<> you are giving a baseclass that isn't registered.
-	// Please note that if you don't need to have access to the base class or the
-	// conversion from the derived class to the base class, you don't need
-	// to tell luabind that it derives.
-	assert(binfo.base && "You cannot derive from an unregistered type");
-
-	class_rep* bcrep = binfo.base;
-
-	// import all static constants
-	for (std::map<const char*, int, ltstr>::const_iterator i = bcrep->m_static_constants.begin(); 
-			i != bcrep->m_static_constants.end(); ++i)
-	{
-		int& v = m_static_constants[i->first];
-		v = i->second;
-	}
-
-	// also, save the baseclass info to be used for typecasts
-	m_bases.push_back(binfo);
-}
-
-LUABIND_API void luabind::disable_super_deprecation()
-{
-    super_deprecation_disabled = true;
-}
-
-int luabind::detail::class_rep::super_callback(lua_State* L)
-{
-	int args = lua_gettop(L);
-		
-	class_rep* crep = static_cast<class_rep*>(lua_touserdata(L, lua_upvalueindex(1)));
-	class_rep* base = crep->bases()[0].base;
-
-	if (base->bases().empty())
-	{
-		lua_pushstring(L, "super");
-		lua_pushnil(L);
-		lua_settable(L, LUA_GLOBALSINDEX);
-	}
-	else
-	{
-		lua_pushstring(L, "super");
-		lua_pushlightuserdata(L, base);
-		lua_pushvalue(L, lua_upvalueindex(2));
-		lua_pushcclosure(L, super_callback, 2);
-		lua_settable(L, LUA_GLOBALSINDEX);
-	}
-
-	base->get_table(L);
-	lua_pushstring(L, "__init");
-	lua_gettable(L, -2);
-	lua_insert(L, 1);
-	lua_pop(L, 1);
-
-	lua_pushvalue(L, lua_upvalueindex(2));
-	lua_insert(L, 2);
-
-	lua_call(L, args + 1, 0);
-
-	// TODO: instead of clearing the global variable "super"
-	// store it temporarily in the registry. maybe we should
-	// have some kind of warning if the super global is used?
-	lua_pushstring(L, "super");
-	lua_pushnil(L);
-	lua_settable(L, LUA_GLOBALSINDEX);
-
-	return 0;
-}
-
-
-
-int luabind::detail::class_rep::lua_settable_dispatcher(lua_State* L)
-{
-	class_rep* crep = static_cast<class_rep*>(lua_touserdata(L, 1));
-
-	// get first table
-	crep->get_table(L);
-
-	// copy key, value
-	lua_pushvalue(L, -3);
-	lua_pushvalue(L, -3);
-	lua_rawset(L, -3);
-	// pop table
-	lua_pop(L, 1);
-
-	// get default table
-	crep->get_default_table(L);
-	lua_replace(L, 1);
-	lua_rawset(L, -3);
-
-	crep->m_operator_cache = 0; // invalidate cache
-	
-	return 0;
-}
-
-/*
-	stack:
-	1: class_rep
-	2: member name
-*/
-int luabind::detail::class_rep::static_class_gettable(lua_State* L)
-{
-	class_rep* crep = static_cast<class_rep*>(lua_touserdata(L, 1));
-
-	// look in the static function table
-	crep->get_default_table(L);
-	lua_pushvalue(L, 2);
-	lua_gettable(L, -2);
-	if (!lua_isnil(L, -1)) return 1;
-	else lua_pop(L, 2);
-
-	const char* key = lua_tostring(L, 2);
-
-	if (std::strlen(key) != lua_strlen(L, 2))
-	{
-		lua_pushnil(L);
-		return 1;
-	}
-
-	std::map<const char*, int, ltstr>::const_iterator j = crep->m_static_constants.find(key);
-
-	if (j != crep->m_static_constants.end())
-	{
-		lua_pushnumber(L, j->second);
-		return 1;
-	}
-
-#ifndef LUABIND_NO_ERROR_CHECKING
-
-	{
-		std::string msg = "no static '";
-		msg += key;
-		msg += "' in class '";
-		msg += crep->name();
-		msg += "'";
-		lua_pushstring(L, msg.c_str());
-	}
-	lua_error(L);
-
-#endif
-
-	lua_pushnil(L);
-
-	return 1;
-}
-
-bool luabind::detail::is_class_rep(lua_State* L, int index)
-{
-	if (lua_getmetatable(L, index) == 0) return false;
-
-	lua_pushstring(L, "__luabind_classrep");
-	lua_gettable(L, -2);
-	if (lua_toboolean(L, -1))
-	{
-		lua_pop(L, 2);
-		return true;
-	}
-
-	lua_pop(L, 2);
-	return false;
-}
-
-void luabind::detail::finalize(lua_State* L, class_rep* crep)
-{
-	if (crep->get_class_type() != class_rep::lua_class) return;
-
-//	lua_pushvalue(L, -1); // copy the object ref
-	crep->get_table(L);
-    lua_pushliteral(L, "__finalize");
-	lua_gettable(L, -2);
-	lua_remove(L, -2);
-
-	if (lua_isnil(L, -1))
-	{
-		lua_pop(L, 1);
-	}
-	else
-	{
-		lua_pushvalue(L, -2);
-		lua_call(L, 1, 0);
-	}
-
-	for (std::vector<class_rep::base_info>::const_iterator 
-			i = crep->bases().begin(); i != crep->bases().end(); ++i)
-	{
-		if (i->base) finalize(L, i->base);
-	}
-}
-
-void luabind::detail::class_rep::cache_operators(lua_State* L)
-{
-	m_operator_cache = 0x1;
-
-	for (int i = 0; i < number_of_operators; ++i)
-	{
-		get_table(L);
-		lua_pushstring(L, get_operator_name(i));
-		lua_rawget(L, -2);
-
-		if (lua_isfunction(L, -1)) m_operator_cache |= 1 << (i + 1);
-
-		lua_pop(L, 2);
-	}
-}
-
-bool luabind::detail::class_rep::has_operator_in_lua(lua_State* L, int id)
-{
-	if ((m_operator_cache & 0x1) == 0)
-		cache_operators(L);
-
-	const int mask = 1 << (id + 1);
-
-	return (m_operator_cache & mask) != 0;
-}

+ 0 - 140
lib/luabind/src/create_class.cpp

@@ -1,140 +0,0 @@
-// Copyright (c) 2003 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.
-
-#define LUABIND_BUILDING
-
-#include <luabind/lua_include.hpp>
-
-#include <luabind/luabind.hpp>
-
-namespace luabind { namespace detail
-{
-	namespace
-	{
-		// expects two tables on the lua stack:
-		// 1: destination
-		// 2: source
-		void copy_member_table(lua_State* L)
-		{
-			lua_pushnil(L);
-
-			while (lua_next(L, -2))
-			{
-				lua_pushstring(L, "__init");
-				if (lua_equal(L, -1, -3))
-				{
-					lua_pop(L, 2);
-					continue;
-				}
-				else lua_pop(L, 1); // __init string
-
-				lua_pushstring(L, "__finalize");
-				if (lua_equal(L, -1, -3))
-				{
-					lua_pop(L, 2);
-					continue;
-				}
-				else lua_pop(L, 1); // __finalize string
-
-				lua_pushvalue(L, -2); // copy key
-				lua_insert(L, -2);
-				lua_settable(L, -5);
-			}
-		}
-	}
-
-
-	int create_class::stage2(lua_State* L)
-	{
-		class_rep* crep = static_cast<class_rep*>(lua_touserdata(L, lua_upvalueindex(1)));
-		assert((crep != 0) && "internal error, please report");
-		assert((is_class_rep(L, lua_upvalueindex(1))) && "internal error, please report");
-
-	#ifndef LUABIND_NO_ERROR_CHECKING
-
-		if (!is_class_rep(L, 1))
-		{
-			lua_pushstring(L, "expected class to derive from or a newline");
-			lua_error(L);
-		}
-
-	#endif
-
-		class_rep* base = static_cast<class_rep*>(lua_touserdata(L, 1));
-		class_rep::base_info binfo;
-
-		binfo.pointer_offset = 0;
-		binfo.base = base;
-		crep->add_base_class(binfo);
-
-		// copy base class members
-
-		crep->get_table(L);
-		base->get_table(L);
-		copy_member_table(L);
-
-		crep->get_default_table(L);
-		base->get_default_table(L);
-		copy_member_table(L);
-
-		crep->set_type(base->type());
-
-		return 0;
-	}
-
-	int create_class::stage1(lua_State* L)
-	{
-
-	#ifndef LUABIND_NO_ERROR_CHECKING
-
-		if (lua_gettop(L) != 1 || lua_type(L, 1) != LUA_TSTRING || lua_isnumber(L, 1))
-		{
-			lua_pushstring(L, "invalid construct, expected class name");
-			lua_error(L);
-		}
-
-		if (std::strlen(lua_tostring(L, 1)) != lua_strlen(L, 1))
-		{
-			lua_pushstring(L, "luabind does not support class names with extra nulls");
-			lua_error(L);
-		}
-
-	#endif
-
-		const char* name = lua_tostring(L, 1);
-
-		void* c = lua_newuserdata(L, sizeof(class_rep));
-		new(c) class_rep(L, name);
-
-		// make the class globally available
-		lua_pushstring(L, name);
-		lua_pushvalue(L, -2);
-		lua_settable(L, LUA_GLOBALSINDEX);
-
-		// also add it to the closure as return value
-		lua_pushcclosure(L, &stage2, 1);
-
-		return 1;
-	}
-
-}}
-

+ 0 - 78
lib/luabind/src/error.cpp

@@ -1,78 +0,0 @@
-// Copyright (c) 2003 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.
-
-#define LUABIND_BUILDING
-
-#include <luabind/error.hpp>
-
-
-namespace luabind
-{
-
-	namespace
-	{
-		pcall_callback_fun pcall_callback = 0;
-#ifdef LUABIND_NO_EXCEPTIONS
-		error_callback_fun error_callback = 0;
-		cast_failed_callback_fun cast_failed_callback = 0;
-#endif
-	}
-
-
-#ifdef LUABIND_NO_EXCEPTIONS
-
-	typedef void(*error_callback_fun)(lua_State*);
-	typedef void(*cast_failed_callback_fun)(lua_State*, type_id const&);
-
-	void set_error_callback(error_callback_fun e)
-	{
-		error_callback = e;
-	}
-
-	void set_cast_failed_callback(cast_failed_callback_fun c)
-	{
-		cast_failed_callback = c;
-	}
-
-	error_callback_fun get_error_callback()
-	{
-		return error_callback;
-	}
-
-	cast_failed_callback_fun get_cast_failed_callback()
-	{
-		return cast_failed_callback;
-	}
-
-#endif
-
-	void set_pcall_callback(pcall_callback_fun e)
-	{
-		pcall_callback = e;
-	}
-
-	pcall_callback_fun get_pcall_callback()
-	{
-		return pcall_callback;
-	}
-
-}

+ 0 - 87
lib/luabind/src/exception_handler.cpp

@@ -1,87 +0,0 @@
-// Copyright Daniel Wallin 2005. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#define LUABIND_BUILDING
-
-#include <luabind/config.hpp>
-#include <luabind/exception_handler.hpp>
-#include <luabind/error.hpp>
-#include <stdexcept>
-
-#ifndef LUABIND_NO_EXCEPTIONS
-
-namespace luabind { namespace detail {
-
-namespace
-{
-  exception_handler_base* handler_chain = 0;
-
-  void push_exception_string(lua_State* L, char const* exception, char const* what)
-  {
-      lua_pushstring(L, exception);
-      lua_pushstring(L, ": '");
-      lua_pushstring(L, what);
-      lua_pushstring(L, "'");
-      lua_concat(L, 4);
-  }
-}
-
-void exception_handler_base::try_next(lua_State* L) const
-{
-    if (next)
-        next->handle(L);
-    else
-        throw;
-}
-
-LUABIND_API void handle_exception_aux(lua_State* L)
-{
-    try
-    {
-        if (handler_chain)
-            handler_chain->handle(L);
-        else
-            throw;
-    }
-    catch (error const&)
-    {}
-    catch (std::logic_error const& e)
-    {
-        push_exception_string(L, "std::logic_error", e.what());
-    }
-    catch (std::runtime_error const& e)
-    {
-        push_exception_string(L, "std::runtime_error", e.what());
-    }
-    catch (std::exception const& e)
-    {
-        push_exception_string(L, "std::exception", e.what());
-    }
-    catch (char const* str)
-    {
-        push_exception_string(L, "c-string", str);
-    }
-    catch (...)
-    {
-        lua_pushstring(L, "Unknown C++ exception");
-    }
-}
-
-LUABIND_API void register_exception_handler(exception_handler_base* handler)
-{
-    if (!handler_chain) handler_chain = handler;
-    else
-    {
-        exception_handler_base* p = handler_chain;
-
-        for (; p->next; p = p->next);
-
-        handler->next = 0;
-        p->next = handler;
-    }
-}
-
-}} // namespace luabind::detail
-
-#endif // LUABIND_NO_EXCEPTIONS

+ 0 - 136
lib/luabind/src/function.cpp

@@ -1,136 +0,0 @@
-// Copyright Daniel Wallin 2008. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#define LUABIND_BUILDING
-
-#include <luabind/make_function.hpp>
-
-namespace luabind { namespace detail {
-
-namespace
-{
-
-  int function_destroy(lua_State* L)
-  {
-      function_object* fn = *(function_object**)lua_touserdata(L, 1);
-      delete fn;
-      return 0;
-  }
-
-  void push_function_metatable(lua_State* L)
-  {
-      lua_pushstring(L, "luabind.function");
-      lua_rawget(L, LUA_REGISTRYINDEX);
-
-      if (lua_istable(L, -1))
-          return;
-
-      lua_pop(L, 1);
-
-      lua_newtable(L);
-
-      lua_pushstring(L, "__gc");
-      lua_pushcclosure(L, &function_destroy, 0);
-      lua_rawset(L, -3);
-
-      lua_pushstring(L, "luabind.function");
-      lua_pushvalue(L, -2);
-      lua_rawset(L, LUA_REGISTRYINDEX);
-  }
-
-  // A pointer to this is used as a tag value to identify functions exported
-  // by luabind.
-  int function_tag = 0;
-
-} // namespace unnamed
-
-LUABIND_API bool is_luabind_function(lua_State* L, int index)
-{
-    if (!lua_getupvalue(L, index, 2))
-        return false;
-    bool result = lua_touserdata(L, -1) == &function_tag;
-    lua_pop(L, 1);
-    return result;
-}
-
-namespace
-{
-
-  inline bool is_luabind_function(object const& obj)
-  {
-      obj.push(obj.interpreter());
-      bool result = detail::is_luabind_function(obj.interpreter(), -1);
-      lua_pop(obj.interpreter(), 1);
-      return result;
-  }
-
-} // namespace unnamed
-
-LUABIND_API void add_overload(
-    object const& context, char const* name, object const& fn)
-{
-    function_object* f = *touserdata<function_object*>(getupvalue(fn, 1));
-    f->name = name;
-
-    if (object overloads = context[name])
-    {
-        if (is_luabind_function(overloads) && is_luabind_function(fn))
-        {
-            f->next = *touserdata<function_object*>(getupvalue(overloads, 1));
-            f->keepalive = overloads;
-        }
-    }
-
-    context[name] = fn;
-}
-
-LUABIND_API object make_function_aux(lua_State* L, function_object* impl)
-{
-    void* storage = lua_newuserdata(L, sizeof(function_object*));
-    push_function_metatable(L);
-    *(function_object**)storage = impl;
-    lua_setmetatable(L, -2);
-
-    lua_pushlightuserdata(L, &function_tag);
-    lua_pushcclosure(L, impl->entry, 2);
-    stack_pop pop(L, 1);
-
-    return object(from_stack(L, -1));
-}
-
-void invoke_context::format_error(
-    lua_State* L, function_object const* overloads) const
-{
-    char const* function_name =
-        overloads->name.empty() ? "<unknown>" : overloads->name.c_str();
-
-    if (candidate_index == 0)
-    {
-        lua_pushstring(L, "No matching overload found, candidates:\n");
-        int count = 0;
-        for (function_object const* f = overloads; f != 0; f = f->next)
-        {
-            if (count != 0)
-                lua_pushstring(L, "\n");
-            f->format_signature(L, function_name);
-            ++count;
-        }
-        lua_concat(L, count * 2);
-    }
-    else
-    {
-        // Ambiguous
-        lua_pushstring(L, "Ambiguous, candidates:\n");
-        for (int i = 0; i < candidate_index; ++i)
-        {
-            if (i != 0)
-                lua_pushstring(L, "\n");
-            candidates[i]->format_signature(L, function_name);
-        }
-        lua_concat(L, candidate_index * 2);
-    }
-}
-
-}} // namespace luabind::detail
-

+ 0 - 258
lib/luabind/src/inheritance.cpp

@@ -1,258 +0,0 @@
-// Copyright Daniel Wallin 2009. Use, modification and distribution is
-// subject to the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-
-#define LUABIND_BUILDING
-
-#include <limits>
-#include <map>
-#include <vector>
-#include <queue>
-#include <boost/dynamic_bitset.hpp>
-#include <boost/foreach.hpp>
-#include <boost/tuple/tuple.hpp>
-#include <boost/tuple/tuple_comparison.hpp>
-#include <luabind/typeid.hpp>
-#include <luabind/detail/inheritance.hpp>
-
-namespace luabind { namespace detail {
-
-class_id const class_id_map::local_id_base =
-    std::numeric_limits<class_id>::max() / 2;
-
-namespace
-{
-
-  struct edge
-  {
-      edge(class_id target, cast_function cast)
-        : target(target)
-        , cast(cast)
-      {}
-
-      class_id target;
-      cast_function cast;
-  };
-
-  bool operator<(edge const& x, edge const& y)
-  {
-      return x.target < y.target;
-  }
-
-  struct vertex
-  {
-      vertex(class_id id)
-        : id(id)
-      {}
-
-      class_id id;
-      std::vector<edge> edges;
-  };
-
-  typedef std::pair<std::ptrdiff_t, int> cache_entry;
-
-  class cache
-  {
-  public:
-      static std::ptrdiff_t const unknown;
-      static std::ptrdiff_t const invalid;
-
-      cache_entry get(
-          class_id src, class_id target, class_id dynamic_id
-        , std::ptrdiff_t object_offset) const;
-
-      void put(
-          class_id src, class_id target, class_id dynamic_id
-        , std::ptrdiff_t object_offset
-        , std::size_t distance, std::ptrdiff_t offset);
-
-      void invalidate();
-
-  private:
-      typedef boost::tuple<
-          class_id, class_id, class_id, std::ptrdiff_t> key_type;
-      typedef std::map<key_type, cache_entry> map_type;
-      map_type m_cache;
-  };
-
-  std::ptrdiff_t const cache::unknown =
-      std::numeric_limits<std::ptrdiff_t>::max();
-  std::ptrdiff_t const cache::invalid = cache::unknown - 1;
-
-  cache_entry cache::get(
-      class_id src, class_id target, class_id dynamic_id
-    , std::ptrdiff_t object_offset) const
-  {
-      map_type::const_iterator i = m_cache.find(
-          key_type(src, target, dynamic_id, object_offset));
-      return i != m_cache.end() ? i->second : cache_entry(unknown, -1);
-  }
-
-  void cache::put(
-      class_id src, class_id target, class_id dynamic_id
-    , std::ptrdiff_t object_offset, std::size_t distance, std::ptrdiff_t offset)
-  {
-      m_cache.insert(std::make_pair(
-          key_type(src, target, dynamic_id, object_offset)
-        , cache_entry(offset, distance)
-      ));
-  }
-
-  void cache::invalidate()
-  {
-      m_cache.clear();
-  }
-
-} // namespace unnamed
-
-class cast_graph::impl
-{
-public:
-    std::pair<void*, int> cast(
-        void* p, class_id src, class_id target
-      , class_id dynamic_id, void const* dynamic_ptr) const;
-    void insert(class_id src, class_id target, cast_function cast);
-
-private:
-    std::vector<vertex> m_vertices;
-    mutable cache m_cache;
-};
-
-namespace
-{
-
-  struct queue_entry
-  {
-      queue_entry(void* p, class_id vertex_id, int distance)
-        : p(p)
-        , vertex_id(vertex_id)
-        , distance(distance)
-      {}
-
-      void* p;
-      class_id vertex_id;
-      int distance;
-  };
-
-} // namespace unnamed
-
-std::pair<void*, int> cast_graph::impl::cast(
-    void* const p, class_id src, class_id target
-  , class_id dynamic_id, void const* dynamic_ptr) const
-{
-    if (src == target)
-        return std::make_pair(p, 0);
-
-    if (src >= m_vertices.size() || target >= m_vertices.size())
-        return std::pair<void*, int>((void*)0, -1);
-
-    std::ptrdiff_t const object_offset =
-        (char const*)dynamic_ptr - (char const*)p;
-
-    cache_entry cached = m_cache.get(src, target, dynamic_id, object_offset);
-
-    if (cached.first != cache::unknown)
-    {
-        if (cached.first == cache::invalid)
-            return std::pair<void*, int>((void*)0, -1);
-        return std::make_pair((char*)p + cached.first, cached.second);
-    }
-
-    std::queue<queue_entry> q;
-    q.push(queue_entry(p, src, 0));
-
-    boost::dynamic_bitset<> visited(m_vertices.size());
-
-    while (!q.empty())
-    {
-        queue_entry const qe = q.front();
-        q.pop();
-
-        visited[qe.vertex_id] = true;
-        vertex const& v = m_vertices[qe.vertex_id];
-
-        if (v.id == target)
-        {
-            m_cache.put(
-                src, target, dynamic_id, object_offset
-              , qe.distance, (char*)qe.p - (char*)p
-            );
-
-            return std::make_pair(qe.p, qe.distance);
-        }
-
-        BOOST_FOREACH(edge const& e, v.edges)
-        {
-            if (visited[e.target])
-                continue;
-            if (void* casted = e.cast(qe.p))
-                q.push(queue_entry(casted, e.target, qe.distance + 1));
-        }
-    }
-
-    m_cache.put(src, target, dynamic_id, object_offset, cache::invalid, -1);
-
-    return std::pair<void*, int>((void*)0, -1);
-}
-
-void cast_graph::impl::insert(
-    class_id src, class_id target, cast_function cast)
-{
-    class_id const max_id = std::max(src, target);
-
-    if (max_id >= m_vertices.size())
-    {
-        m_vertices.reserve(max_id + 1);
-        for (class_id i = m_vertices.size(); i < max_id + 1; ++i)
-            m_vertices.push_back(vertex(i));
-    }
-
-    std::vector<edge>& edges = m_vertices[src].edges;
-
-    std::vector<edge>::iterator i = std::lower_bound(
-        edges.begin(), edges.end(), edge(target, 0)
-    );
-
-    if (i == edges.end() || i->target != target)
-    {
-        edges.insert(i, edge(target, cast));
-        m_cache.invalidate();
-    }
-}
-
-std::pair<void*, int> cast_graph::cast(
-    void* p, class_id src, class_id target
-  , class_id dynamic_id, void const* dynamic_ptr) const
-{
-    return m_impl->cast(p, src, target, dynamic_id, dynamic_ptr);
-}
-
-void cast_graph::insert(class_id src, class_id target, cast_function cast)
-{
-    m_impl->insert(src, target, cast);
-}
-
-cast_graph::cast_graph()
-  : m_impl(new impl)
-{}
-
-cast_graph::~cast_graph()
-{}
-
-LUABIND_API class_id allocate_class_id(type_id const& cls)
-{
-    typedef std::map<type_id, class_id> map_type;
-
-    static map_type registered;
-    static class_id id = 0;
-
-    std::pair<map_type::iterator, bool> inserted = registered.insert(
-        std::make_pair(cls, id));
-
-    if (inserted.second)
-        ++id;
-
-    return inserted.first->second;
-}
-
-}} // namespace luabind::detail

+ 0 - 43
lib/luabind/src/link_compatibility.cpp

@@ -1,43 +0,0 @@
-// Copyright (c) 2003 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.
-
-#define LUABIND_BUILDING
-
-#include <luabind/detail/link_compatibility.hpp>
-
-namespace luabind { namespace detail
-{
-
-#ifdef LUABIND_NOT_THREADSAFE
-	void not_threadsafe_defined_conflict() {}
-#else
-	void not_threadsafe_not_defined_conflict() {}
-#endif
-
-#ifdef LUABIND_NO_ERROR_CHECKING
-	void no_error_checking_defined_conflict() {}
-#else
-	void no_error_checking_not_defined_conflict() {}
-#endif
-
-}}
-

+ 0 - 267
lib/luabind/src/object_rep.cpp

@@ -1,267 +0,0 @@
-// Copyright (c) 2003 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.
-
-#define LUABIND_BUILDING
-
-#include <luabind/detail/object_rep.hpp>
-#include <luabind/detail/class_rep.hpp>
-
-namespace luabind { namespace detail
-{
-
-	// dest is a function that is called to delete the c++ object this struct holds
-	object_rep::object_rep(instance_holder* instance, class_rep* crep)
-		: m_instance(instance)
-		, m_classrep(crep)
-		, m_dependency_cnt(0)
-	{}
-
-	object_rep::~object_rep()
-	{
-        if (!m_instance)
-            return;
-        m_instance->~instance_holder();
-        deallocate(m_instance);
-	}
-
-	void object_rep::add_dependency(lua_State* L, int index)
-	{
-        assert(m_dependency_cnt < sizeof(object_rep));
-
-        void* key = (char*)this + m_dependency_cnt;
-
-        lua_pushlightuserdata(L, key);
-        lua_pushvalue(L, index);
-        lua_rawset(L, LUA_REGISTRYINDEX);
-
-        ++m_dependency_cnt;
-	}
-
-    void object_rep::release_dependency_refs(lua_State* L)
-    {
-        for (std::size_t i = 0; i < m_dependency_cnt; ++i)
-        {
-            void* key = (char*)this + i;
-            lua_pushlightuserdata(L, key);
-            lua_pushnil(L);
-            lua_rawset(L, LUA_REGISTRYINDEX);
-        }
-    }
-
-    int destroy_instance(lua_State* L)
-    {
-        object_rep* instance = static_cast<object_rep*>(lua_touserdata(L, 1));
-
-        lua_pushstring(L, "__finalize");
-        lua_gettable(L, 1);
-
-        if (lua_isnil(L, -1))
-        {
-            lua_pop(L, 1);
-        }
-        else
-        {
-            lua_pushvalue(L, 1);
-            lua_call(L, 1, 0);
-        }
-
-        instance->release_dependency_refs(L);
-        instance->~object_rep();
-        return 0;
-    }
-
-    namespace
-    {
-
-      int set_instance_value(lua_State* L)
-      {
-          lua_getfenv(L, 1);
-          lua_pushvalue(L, 2);
-          lua_rawget(L, -2);
-
-          if (lua_isnil(L, -1) && lua_getmetatable(L, -2))
-          {
-              lua_pushvalue(L, 2);
-              lua_rawget(L, -2);
-              lua_replace(L, -3);
-              lua_pop(L, 1);
-          }
-
-          if (lua_tocfunction(L, -1) == &property_tag)
-          {
-              // this member is a property, extract the "set" function and call it.
-              lua_getupvalue(L, -1, 2);
-
-              if (lua_isnil(L, -1))
-              {
-                  lua_pushfstring(L, "property '%s' is read only", lua_tostring(L, 2));
-                  lua_error(L);
-              }
-
-              lua_pushvalue(L, 1);
-              lua_pushvalue(L, 3);
-              lua_call(L, 2, 0);
-              return 0;
-          }
-
-          lua_pop(L, 1);
-
-          if (!lua_getmetatable(L, 4))
-          {
-              lua_newtable(L);
-              lua_pushvalue(L, -1);
-              lua_setfenv(L, 1);
-              lua_pushvalue(L, 4);
-              lua_setmetatable(L, -2);
-          }
-          else
-          {
-              lua_pop(L, 1);
-          }
-
-          lua_pushvalue(L, 2);
-          lua_pushvalue(L, 3);
-          lua_rawset(L, -3);
-
-          return 0;
-      }
-
-      int get_instance_value(lua_State* L)
-      {
-          lua_getfenv(L, 1);
-          lua_pushvalue(L, 2);
-          lua_rawget(L, -2);
-
-          if (lua_isnil(L, -1) && lua_getmetatable(L, -2))
-          {
-              lua_pushvalue(L, 2);
-              lua_rawget(L, -2);
-          }
-
-          if (lua_tocfunction(L, -1) == &property_tag)
-          {
-              // this member is a property, extract the "get" function and call it.
-              lua_getupvalue(L, -1, 1);
-              lua_pushvalue(L, 1);
-              lua_call(L, 1, 1);
-          }
-
-          return 1;
-      }
-
-      int dispatch_operator(lua_State* L)
-      {
-          for (int i = 0; i < 2; ++i)
-          {
-              if (get_instance(L, 1 + i))
-              {
-                  int nargs = lua_gettop(L);
-
-                  lua_pushvalue(L, lua_upvalueindex(1));
-                  lua_gettable(L, 1 + i);
-
-                  if (lua_isnil(L, -1))
-                  {
-                      lua_pop(L, 1);
-                      continue;
-                  }
-
-                  lua_insert(L, 1); // move the function to the bottom
-
-                  nargs = lua_toboolean(L, lua_upvalueindex(2)) ? 1 : nargs;
-
-                  if (lua_toboolean(L, lua_upvalueindex(2))) // remove trailing nil
-                  lua_remove(L, 3);
-
-                  lua_call(L, nargs, 1);
-                  return 1;
-              }
-          }
-
-          lua_pop(L, lua_gettop(L));
-          lua_pushstring(L, "No such operator defined");
-          lua_error(L);
-
-          return 0;
-      }
-
-    } // namespace unnamed
-
-    LUABIND_API void push_instance_metatable(lua_State* L)
-    {
-        lua_newtable(L);
-
-        // This is used as a tag to determine if a userdata is a luabind
-        // instance. We use a numeric key and a cclosure for fast comparision.
-        lua_pushnumber(L, 1);
-        lua_pushcclosure(L, get_instance_value, 0);
-        lua_rawset(L, -3);
-
-        lua_pushcclosure(L, destroy_instance, 0);
-        lua_setfield(L, -2, "__gc");
-
-        lua_pushcclosure(L, get_instance_value, 0);
-        lua_setfield(L, -2, "__index");
-
-        lua_pushcclosure(L, set_instance_value, 0);
-        lua_setfield(L, -2, "__newindex");
-
-        for (int op = 0; op < number_of_operators; ++op)
-        {
-            lua_pushstring(L, get_operator_name(op));
-            lua_pushvalue(L, -1);
-            lua_pushboolean(L, op == op_unm || op == op_len);
-            lua_pushcclosure(L, &dispatch_operator, 2);
-            lua_settable(L, -3);
-        }
-    }
-
-    LUABIND_API object_rep* get_instance(lua_State* L, int index)
-    {
-        object_rep* result = static_cast<object_rep*>(lua_touserdata(L, index));
-
-        if (!result || !lua_getmetatable(L, index))
-            return 0;
-
-        lua_rawgeti(L, -1, 1);
-
-        if (lua_tocfunction(L, -1) != &get_instance_value)
-            result = 0;
-
-        lua_pop(L, 2);
-
-        return result;
-    }
-
-    LUABIND_API object_rep* push_new_instance(lua_State* L, class_rep* cls)
-    {
-        void* storage = lua_newuserdata(L, sizeof(object_rep));
-        object_rep* result = new (storage) object_rep(0, cls);
-        cls->get_table(L);
-        lua_setfenv(L, -2);
-        lua_rawgeti(L, LUA_REGISTRYINDEX, cls->metatable_ref());
-        lua_setmetatable(L, -2);
-        return result;
-    }
-
-}}
-

Bu fark içinde çok fazla dosya değişikliği olduğu için bazı dosyalar gösterilmiyor