From 5ec6a8ea613b8e00f0af2ee31fce56336866d9bc Mon Sep 17 00:00:00 2001
From: William S Fulton
Sometimes, it may be neccesary to add your own special functions, which bypass the normal SWIG wrappering method, and just use the native lua-c API calls. These 'native' functions allow direct adding of your own code into the module. This is performed with the %native directive as follows:
This chapter describes SWIG's support of Ruby. SWIG 1.3 is known to work with Ruby versions 1.6 and later.
@@ -1060,10 +84,7 @@ of Ruby. To build a Ruby module, run SWIG using the -ruby
@@ -1691,10 +712,7 @@ declarations in your SWIG interface files to Ruby constructs. The SWIG %module directive specifies
@@ -1863,10 +881,7 @@ Ruby's built-in names. Global functions are wrapped as Ruby module methods. For
@@ -2033,10 +1048,7 @@ effect until it is explicitly disabled using %mutable.
- C/C++ constants are wrapped as module constants initialized
@@ -2080,10 +1092,7 @@ constant values, e.g. "Opaque" pointers to arbitrary C/C++ types (i.e. types that
@@ -2135,10 +1144,7 @@ the Ruby nil object. C/C++ structs are wrapped as Ruby classes, with accessor
@@ -2313,10 +1319,7 @@ pointers. For example, Like structs, C++ classes are wrapped by creating a new Ruby
@@ -3915,10 +2918,7 @@ caught here and a C++ exception is raised in its place. Ruby has several common naming conventions. Constants are
@@ -4203,10 +3203,7 @@ Features") for more details). Ruby methods that modify an object in-place and end in an
@@ -5726,10 +4723,7 @@ providing for a more natural integration between C++ code and Ruby code. This section describes how you can modify SWIG's default
@@ -8489,10 +7483,7 @@ for VALUE
- void rb_raise(VALUE exception, const char *fmt,
@@ -8659,10 +7650,7 @@ arguments are interpreted as with printf().
- void rb_iter_break()
-
diff --git a/Doc/Manual/Lua.html b/Doc/Manual/Lua.html
index ef311ce07..5abe6502a 100644
--- a/Doc/Manual/Lua.html
+++ b/Doc/Manual/Lua.html
@@ -954,6 +954,8 @@ If you ever need to access the underlying pointer returned by operator->(
22.3.15 Writing your own custom wrappers
+
+
30 SWIG and Ruby
-
-
-
-
-
+30 SWIG and Ruby
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
30.1 Preliminaries
-
-
-
+30.1 Preliminaries
30.1.1 Running SWIG
-
-
-
+30.1.1 Running SWIG
30.3.1 Modules
-
-
-
+30.1.2 Modules
30.3.2 Functions
-
-
-
+30.1.3 Functions
30.3.4 Constants
-
-
-
+30.1.4 Constants
30.3.5 Pointers
-
-
-
+30.1.5 Pointers
30.3.6 Structures
-
-
-
+30.1.6 Structures
30.3.7 C++ classes
-
-
-
+30.1.7 C++ classes
30.4 Naming
-
-
-
+30.2 Naming
30.4.3 Bang Methods
-
-
-
+30.2.1 Bang Methods
30.7 Typemaps
-
-
-
+30.3 Typemaps
30.7.8.4 Exceptions
-
-
-
+30.3.0.1 Exceptions
30.7.8.5 Iterators
-
-
-
+30.3.0.2 Iterators
As has been mentioned, when %rename includes parameters, the parameter types must match exactly (no typedef or namespace resolution is performed). SWIG treats templated types slightly differently and has an additional matching rule so unlike non-templated types, an exact match is not always required. @@ -4124,7 +4127,7 @@ namespace Space { -
@@ -4175,7 +4178,7 @@ Consult the "Exception handling with %exc The next section details a way of simulating an exception specification or replacing an existing one.
-@@ -4225,7 +4228,7 @@ just a single catch handler for the base class, EBase will be generated
-@@ -4275,7 +4278,7 @@ when checking types. However, no such support is currently provided for member pointers.
-@@ -4485,7 +4488,7 @@ p = f.__deref__() # Raw pointer from operator->
-@@ -4648,7 +4651,7 @@ public: -
@@ -4739,7 +4742,7 @@ typedef Outer::Inner Inner; The downside to this approach is having to maintain two definitions of Inner, the real one and the one in the interface file that SWIG parses.
-@@ -4797,7 +4800,7 @@ using another tool if maintaining constness is the most important part of your project.
-