sqlite3-ruby 1.2.3-x86-mingw32 → 1.2.5-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/ChangeLog.cvs +88 -0
  2. data/History.txt +68 -0
  3. data/LICENSE +27 -0
  4. data/Manifest.txt +41 -0
  5. data/{README.rdoc → README.txt} +6 -1
  6. data/Rakefile +5 -0
  7. data/ext/sqlite3_api/extconf.rb +3 -9
  8. data/ext/sqlite3_api/sqlite3_api.i +4 -0
  9. data/ext/sqlite3_api/sqlite3_api_wrap.c +4977 -3053
  10. data/{doc/faq → faq}/faq.rb +0 -0
  11. data/{doc/faq → faq}/faq.yml +0 -0
  12. data/lib/1.8/sqlite3_api.so +0 -0
  13. data/lib/1.9/sqlite3_api.so +0 -0
  14. data/lib/sqlite3/database.rb +13 -7
  15. data/lib/sqlite3/driver/dl/api.rb +1 -1
  16. data/lib/sqlite3/driver/native/driver.rb +9 -1
  17. data/lib/sqlite3/resultset.rb +5 -1
  18. data/lib/sqlite3/statement.rb +3 -2
  19. data/lib/sqlite3/version.rb +4 -2
  20. data/setup.rb +1333 -0
  21. data/tasks/benchmark.rake +9 -0
  22. data/tasks/faq.rake +9 -0
  23. data/tasks/gem.rake +32 -0
  24. data/tasks/native.rake +35 -0
  25. data/tasks/vendor_sqlite3.rake +104 -0
  26. data/test/{mocks.rb → helper.rb} +23 -1
  27. data/test/{tc_database.rb → test_database.rb} +25 -6
  28. data/test/{tc_errors.rb → test_errors.rb} +1 -5
  29. data/test/test_integration.rb +542 -0
  30. data/test/test_integration_open_close.rb +30 -0
  31. data/test/test_integration_pending.rb +111 -0
  32. data/test/test_integration_resultset.rb +159 -0
  33. data/test/test_integration_statement.rb +195 -0
  34. metadata +90 -43
  35. data/doc/faq/faq.html +0 -408
  36. data/ext/sqlite3_api/MANIFEST +0 -4
  37. data/ext/sqlite3_api/Makefile +0 -142
  38. data/ext/sqlite3_api/mkmf.log +0 -66
  39. data/ext/sqlite3_api/sqlite3_api.so +0 -0
  40. data/ext/sqlite3_api/sqlite3_api_wrap.o +0 -0
  41. data/ext/sqlite3_api/win32/build.bat +0 -7
  42. data/test/tc_integration.rb +0 -1044
  43. data/test/tests.rb +0 -6
@@ -0,0 +1,88 @@
1
+ 2005-01-05 09:40 minam
2
+
3
+ * Rakefile, sqlite3-ruby-win32.gemspec, sqlite3-ruby.gemspec: Added
4
+ win32 gem.
5
+
6
+ 2005-01-05 07:31 minam
7
+
8
+ * Rakefile, test/tc_integration.rb, test/tests.rb: Added
9
+ native-vs-dl benchmark to Rakefile. Added SQLITE3_DRIVERS
10
+ environment variable to integration test to specify which
11
+ driver(s) should be tested (defaults to "Native").
12
+
13
+ 2005-01-04 14:26 minam
14
+
15
+ * ext/sqlite3_api/sqlite3_api.i, lib/sqlite3/database.rb,
16
+ lib/sqlite3/driver/native/driver.rb, test/tc_database.rb,
17
+ test/tc_integration.rb, test/tests.rb: Unit tests: done. Bugs:
18
+ fixed.
19
+
20
+ 2005-01-03 23:13 minam
21
+
22
+ * ext/sqlite3_api/sqlite3_api.i, lib/sqlite3/database.rb,
23
+ lib/sqlite3/driver/dl/driver.rb,
24
+ lib/sqlite3/driver/native/driver.rb, test/tc_integration.rb:
25
+ Custom functions (aggregate and otherwise) are supported by the
26
+ native driver now. Test cases for the same.
27
+
28
+ 2005-01-03 13:51 minam
29
+
30
+ * ext/sqlite3_api/MANIFEST, ext/sqlite3_api/extconf.rb,
31
+ ext/sqlite3_api/post-clean.rb, ext/sqlite3_api/post-distclean.rb,
32
+ ext/sqlite3_api/sqlite3_api.i, lib/sqlite3/database.rb,
33
+ lib/sqlite3/resultset.rb, lib/sqlite3/version.rb,
34
+ lib/sqlite3/driver/dl/driver.rb,
35
+ lib/sqlite3/driver/native/driver.rb, test/native-vs-dl.rb,
36
+ test/tc_integration.rb: Added preliminary implementation of
37
+ native driver (swig-based), and integration tests.
38
+
39
+ 2004-12-29 19:37 minam
40
+
41
+ * lib/sqlite3/driver/dl/driver.rb: Some fixes to allow the DL
42
+ driver to work with Ruby 1.8.1.
43
+
44
+ 2004-12-29 14:52 minam
45
+
46
+ * lib/sqlite3/: database.rb, version.rb: Made #quote a class method
47
+ (again). Bumped version to 0.6.
48
+
49
+ 2004-12-25 22:59 minam
50
+
51
+ * lib/sqlite3/driver/dl/api.rb: Added check for darwin in supported
52
+ platforms (thanks to bitsweat).
53
+
54
+ 2004-12-22 12:38 minam
55
+
56
+ * Rakefile: Rakefile wasn't packaging the README file.
57
+
58
+ 2004-12-21 22:28 minam
59
+
60
+ * Rakefile, sqlite3-ruby.gemspec, test/bm.rb: Packaging now works.
61
+ Added benchmarks.
62
+
63
+ 2004-12-21 21:45 minam
64
+
65
+ * LICENSE, README, Rakefile, setup.rb, sqlite3-ruby.gemspec,
66
+ doc/faq/faq.rb, doc/faq/faq.yml, lib/sqlite3.rb,
67
+ lib/sqlite3/statement.rb, lib/sqlite3/constants.rb,
68
+ lib/sqlite3/database.rb, lib/sqlite3/resultset.rb,
69
+ lib/sqlite3/translator.rb, lib/sqlite3/value.rb,
70
+ lib/sqlite3/version.rb, lib/sqlite3/errors.rb,
71
+ lib/sqlite3/pragmas.rb, lib/sqlite3/driver/dl/api.rb,
72
+ lib/sqlite3/driver/dl/driver.rb, test/mocks.rb,
73
+ test/tc_database.rb, test/tests.rb, test/driver/dl/tc_driver.rb:
74
+ Initial import
75
+
76
+ 2004-12-21 21:45 minam
77
+
78
+ * LICENSE, README, Rakefile, setup.rb, sqlite3-ruby.gemspec,
79
+ doc/faq/faq.rb, doc/faq/faq.yml, lib/sqlite3.rb,
80
+ lib/sqlite3/statement.rb, lib/sqlite3/constants.rb,
81
+ lib/sqlite3/database.rb, lib/sqlite3/resultset.rb,
82
+ lib/sqlite3/translator.rb, lib/sqlite3/value.rb,
83
+ lib/sqlite3/version.rb, lib/sqlite3/errors.rb,
84
+ lib/sqlite3/pragmas.rb, lib/sqlite3/driver/dl/api.rb,
85
+ lib/sqlite3/driver/dl/driver.rb, test/mocks.rb,
86
+ test/tc_database.rb, test/tests.rb, test/driver/dl/tc_driver.rb:
87
+ Initial revision
88
+
@@ -0,0 +1,68 @@
1
+ === 1.2.5 / 25 Jul 2009
2
+
3
+ * Check for illegal nil before executing SQL [Erik Veenstra]
4
+ * Switch to Hoe for gem task management and packaging.
5
+ * Advertise rake-compiler as development dependency.
6
+ * Build gem binaries for Windows.
7
+ * Improved Ruby 1.9 support compatibility.
8
+ * Taint returned values. Patch #20325.
9
+
10
+
11
+ === 1.2.4.1 (internal) / 5 Jul 2009
12
+
13
+ * Check for illegal nil before executing SQL [Erik Veenstra]
14
+ * Switch to Hoe for gem task management and packaging.
15
+ * Advertise rake-compiler as development dependency.
16
+ * Build gem binaries for Windows.
17
+ * Improved Ruby 1.9 support compatibility.
18
+
19
+
20
+ === 1.2.4 / 27 Aug 2008
21
+
22
+ * Package the updated C file for source builds. [Jamis Buck]
23
+
24
+
25
+ === 1.2.3 / 26 Aug 2008
26
+
27
+ * Fix incorrect permissions on database.rb and translator.rb [Various]
28
+
29
+ * Avoid using Object#extend for greater speedups [Erik Veenstra]
30
+
31
+ * Ruby 1.9 compatibility tweaks for Array#zip [jimmy88@gmail.com]
32
+
33
+ * Fix linking against Ruby 1.8.5 [Rob Holland <rob@inversepath.com>]
34
+
35
+
36
+ === 1.2.2 / 31 May 2008
37
+
38
+ * Make the table_info method adjust the returned default value for the rows
39
+ so that the sqlite3 change in 3.3.8 and greater can be handled
40
+ transparently [Jamis Buck <jamis@37signals.com>]
41
+
42
+ * Ruby 1.9 compatibility tweaks [Roman Le Negrate <roman2k@free.fr>]
43
+
44
+ * Various performance enhancements [thanks Erik Veenstra]
45
+
46
+ * Correct busy_handler documentation [Rob Holland <rob@inversepath.com>]
47
+
48
+ * Use int_bind64 on Fixnum values larger than a 32bit C int can take. [Rob Holland <rob@inversepath.com>]
49
+
50
+ * Work around a quirk in SQLite's error reporting by calling sqlite3_reset
51
+ to produce a more informative error code upon a failure from
52
+ sqlite3_step. [Rob Holland <rob@inversepath.com>]
53
+
54
+ * Various documentation, test, and style tweaks [Rob Holland <rob@inversepath.com>]
55
+
56
+ * Be more granular with time/data translation [Rob Holland <rob@inversepath.com>]
57
+
58
+ * Use Date directly for parsing rather than going via Time [Rob Holland <rob@inversepath.com>]
59
+
60
+ * Check for the rt library and fdatasync so we link against that when
61
+ needed [Rob Holland <rob@inversepath.com>]
62
+
63
+ * Rename data structures to avoid collision on win32. based on patch
64
+ by: Luis Lavena [Rob Holland <rob@inversepath.com>]
65
+
66
+ * Add test for defaults [Daniel Rodríguez Troitiño]
67
+
68
+ * Correctly unquote double-quoted pragma defaults [Łukasz Dargiewicz <lukasz.dargiewicz@gmail.com>]
data/LICENSE ADDED
@@ -0,0 +1,27 @@
1
+ Copyright (c) 2004, Jamis Buck (jamis@jamisbuck.org)
2
+ All rights reserved.
3
+
4
+ Redistribution and use in source and binary forms, with or without
5
+ modification, are permitted provided that the following conditions are met:
6
+
7
+ * Redistributions of source code must retain the above copyright notice,
8
+ this list of conditions and the following disclaimer.
9
+
10
+ * Redistributions in binary form must reproduce the above copyright
11
+ notice, this list of conditions and the following disclaimer in the
12
+ documentation and/or other materials provided with the distribution.
13
+
14
+ * The names of its contributors may not be used to endorse or promote
15
+ products derived from this software without specific prior written
16
+ permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
22
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,41 @@
1
+ ChangeLog.cvs
2
+ History.txt
3
+ LICENSE
4
+ Manifest.txt
5
+ README.txt
6
+ Rakefile
7
+ ext/sqlite3_api/extconf.rb
8
+ ext/sqlite3_api/sqlite3_api.i
9
+ ext/sqlite3_api/sqlite3_api_wrap.c
10
+ faq/faq.rb
11
+ faq/faq.yml
12
+ lib/sqlite3.rb
13
+ lib/sqlite3/constants.rb
14
+ lib/sqlite3/database.rb
15
+ lib/sqlite3/driver/dl/api.rb
16
+ lib/sqlite3/driver/dl/driver.rb
17
+ lib/sqlite3/driver/native/driver.rb
18
+ lib/sqlite3/errors.rb
19
+ lib/sqlite3/pragmas.rb
20
+ lib/sqlite3/resultset.rb
21
+ lib/sqlite3/statement.rb
22
+ lib/sqlite3/translator.rb
23
+ lib/sqlite3/value.rb
24
+ lib/sqlite3/version.rb
25
+ setup.rb
26
+ tasks/benchmark.rake
27
+ tasks/faq.rake
28
+ tasks/gem.rake
29
+ tasks/native.rake
30
+ tasks/vendor_sqlite3.rake
31
+ test/bm.rb
32
+ test/driver/dl/tc_driver.rb
33
+ test/helper.rb
34
+ test/native-vs-dl.rb
35
+ test/test_database.rb
36
+ test/test_errors.rb
37
+ test/test_integration.rb
38
+ test/test_integration_open_close.rb
39
+ test/test_integration_pending.rb
40
+ test/test_integration_resultset.rb
41
+ test/test_integration_statement.rb
@@ -1,12 +1,17 @@
1
1
  = SQLite3/Ruby Interface
2
2
 
3
+ * http://sqlite3-ruby.rubyforge.org
4
+ * http://rubyforge.org/projects/sqlite3-ruby
5
+ * http://github.com/jamis/sqlite3-ruby
6
+
7
+ == DESCRIPTION
8
+
3
9
  This module allows Ruby programs to interface with the SQLite3
4
10
  database engine (http://www.sqlite.org). You must have the
5
11
  SQLite engine installed in order to build this module.
6
12
 
7
13
  Note that this module is NOT compatible with SQLite 2.x.
8
14
 
9
-
10
15
  == Compilation and Installation
11
16
 
12
17
  Simply do the following, after installing SQLite3:
@@ -0,0 +1,5 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ # load rakefile extensions (tasks)
5
+ Dir['tasks/*.rake'].each { |f| import f }
@@ -1,16 +1,10 @@
1
1
  require 'mkmf'
2
2
 
3
- SWIG_WRAP = "sqlite3_api_wrap.c"
4
-
5
- dir_config( "sqlite3", "/usr/local" )
3
+ dir_config( "sqlite3" )
6
4
 
7
5
  have_library( "rt", "fdatasync" )
8
6
 
9
- if have_header( "sqlite3.h" ) && have_library( "sqlite3", "sqlite3_open" )
10
- if !File.exists?( SWIG_WRAP ) || with_config( "swig", false )
11
- puts "creating #{SWIG_WRAP}"
12
- system "swig -ruby sqlite3_api.i" or raise "could not build wrapper via swig (perhaps swig is not installed?)"
13
- end
14
-
7
+ if have_header( "sqlite3.h" ) && have_library( "sqlite3", "sqlite3_open" ) then
8
+ $CFLAGS << " -fno-strict-aliasing" unless RUBY_PLATFORM =~ /mswin/
15
9
  create_makefile( "sqlite3_api" )
16
10
  end
@@ -12,6 +12,10 @@
12
12
  #define RSTRING_LEN(s) (RSTRING(s)->len)
13
13
  #endif
14
14
 
15
+ #ifndef STR2CSTR
16
+ #define STR2CSTR StringValueCStr
17
+ #endif
18
+
15
19
  #define Init_API Init_sqlite3_api
16
20
 
17
21
  struct CallbackData {
@@ -1,3094 +1,5018 @@
1
- /* ----------------------------------------------------------------------------
2
- * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 1.3.27
4
- *
5
- * This file is not intended to be easily readable and contains a number of
6
- * coding conventions designed to improve portability and efficiency. Do not make
7
- * changes to this file unless you know what you are doing--modify the SWIG
8
- * interface file instead.
9
- * ----------------------------------------------------------------------------- */
10
-
11
- /***********************************************************************
12
- *
13
- * This section contains generic SWIG labels for method/variable
14
- * declarations/attributes, and other compiler dependent labels.
15
- *
16
- ************************************************************************/
17
-
18
- /* template workaround for compilers that cannot correctly implement the C++ standard */
19
- #ifndef SWIGTEMPLATEDISAMBIGUATOR
20
- # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21
- # define SWIGTEMPLATEDISAMBIGUATOR template
22
- # else
23
- # define SWIGTEMPLATEDISAMBIGUATOR
24
- # endif
25
- #endif
26
-
27
- /* inline attribute */
28
- #ifndef SWIGINLINE
29
- # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
30
- # define SWIGINLINE inline
31
- # else
32
- # define SWIGINLINE
33
- # endif
34
- #endif
35
-
36
- /* attribute recognised by some compilers to avoid 'unused' warnings */
37
- #ifndef SWIGUNUSED
38
- # if defined(__GNUC__) || defined(__ICC)
39
- # define SWIGUNUSED __attribute__ ((unused))
40
- # else
41
- # define SWIGUNUSED
42
- # endif
43
- #endif
44
-
45
- /* internal SWIG method */
46
- #ifndef SWIGINTERN
47
- # define SWIGINTERN static SWIGUNUSED
48
- #endif
49
-
50
- /* internal inline SWIG method */
51
- #ifndef SWIGINTERNINLINE
52
- # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
53
- #endif
54
-
55
- /* exporting methods for Windows DLLs */
56
- #ifndef SWIGEXPORT
57
- # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
58
- # if defined(STATIC_LINKED)
59
- # define SWIGEXPORT
60
- # else
61
- # define SWIGEXPORT __declspec(dllexport)
62
- # endif
63
- # else
64
- # define SWIGEXPORT
65
- # endif
66
- #endif
67
-
68
- /* calling conventions for Windows */
69
- #ifndef SWIGSTDCALL
70
- # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
71
- # define SWIGSTDCALL __stdcall
72
- # else
73
- # define SWIGSTDCALL
74
- # endif
75
- #endif
76
-
77
-
78
- /* ruby.swg */
79
- /* Implementation : RUBY */
80
- #define SWIGRUBY 1
81
-
82
- #include "ruby.h"
83
-
84
- /* Flags for pointer conversion */
85
- #define SWIG_POINTER_EXCEPTION 0x1
86
- #define SWIG_POINTER_OWN 0x1
87
- #define SWIG_POINTER_DISOWN 0x2
88
- #define SWIG_TRACK_OBJECTS 0x4
89
-
90
- #define NUM2USHRT(n) (\
91
- (0 <= NUM2UINT(n) && NUM2UINT(n) <= USHRT_MAX)\
92
- ? (unsigned short) NUM2UINT(n) \
93
- : (rb_raise(rb_eArgError, "integer %d out of range of `unsigned short'",\
94
- NUM2UINT(n)), (short)0)\
95
- )
96
-
97
- #define NUM2SHRT(n) (\
98
- (SHRT_MIN <= NUM2INT(n) && NUM2INT(n) <= SHRT_MAX)\
99
- ? (short)NUM2INT(n)\
100
- : (rb_raise(rb_eArgError, "integer %d out of range of `short'",\
101
- NUM2INT(n)), (short)0)\
102
- )
103
-
104
- /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
105
- #ifndef NUM2LL
106
- #define NUM2LL(x) NUM2LONG((x))
107
- #endif
108
- #ifndef LL2NUM
109
- #define LL2NUM(x) INT2NUM((long) (x))
110
- #endif
111
- #ifndef ULL2NUM
112
- #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
113
- #endif
114
-
115
- /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
116
- #ifndef NUM2ULL
117
- #ifdef HAVE_LONG_LONG
118
- #define NUM2ULL(x) rb_num2ull((x))
119
- #else
120
- #define NUM2ULL(x) NUM2ULONG(x)
121
- #endif
122
- #endif
123
-
124
- /*
125
- * Need to be very careful about how these macros are defined, especially
126
- * when compiling C++ code or C code with an ANSI C compiler.
127
- *
128
- * VALUEFUNC(f) is a macro used to typecast a C function that implements
129
- * a Ruby method so that it can be passed as an argument to API functions
130
- * like rb_define_method() and rb_define_singleton_method().
131
- *
132
- * VOIDFUNC(f) is a macro used to typecast a C function that implements
133
- * either the "mark" or "free" stuff for a Ruby Data object, so that it
134
- * can be passed as an argument to API functions like Data_Wrap_Struct()
135
- * and Data_Make_Struct().
136
- */
137
-
138
- #ifdef __cplusplus
139
- # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
140
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
141
- # define VALUEFUNC(f) ((VALUE (*)()) f)
142
- # define VOIDFUNC(f) ((void (*)()) f)
143
- # else
144
- # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
145
- # define PROTECTFUNC(f) ((VALUE (*)()) f)
146
- # define VALUEFUNC(f) ((VALUE (*)()) f)
147
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
148
- # else /* These definitions should work for Ruby 1.7+ */
149
- # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
150
- # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
151
- # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
152
- # endif
153
- # endif
154
- #else
155
- # define VALUEFUNC(f) (f)
156
- # define VOIDFUNC(f) (f)
157
- #endif
158
-
159
- typedef struct {
160
- VALUE klass;
161
- VALUE mImpl;
162
- void (*mark)(void *);
163
- void (*destroy)(void *);
164
- } swig_class;
165
-
166
- /* Don't use for expressions have side effect */
167
- #ifndef RB_STRING_VALUE
168
- #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
169
- #endif
170
- #ifndef StringValue
171
- #define StringValue(s) RB_STRING_VALUE(s)
172
- #endif
173
- #ifndef StringValuePtr
174
- #define StringValuePtr(s) RSTRING(RB_STRING_VALUE(s))->ptr
175
- #endif
176
- #ifndef StringValueLen
177
- #define StringValueLen(s) RSTRING(RB_STRING_VALUE(s))->len
178
- #endif
179
- #ifndef SafeStringValue
180
- #define SafeStringValue(v) do {\
181
- StringValue(v);\
182
- rb_check_safe_str(v);\
183
- } while (0)
184
- #endif
185
-
186
- #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
187
- #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
188
- #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
189
- #endif
190
-
191
- /* Contract support */
192
-
193
- #define SWIG_contract_assert(expr, msg) if (!(expr)) { rb_raise(rb_eRuntimeError, (char *) msg ); } else
194
-
195
-
196
- /***********************************************************************
197
- * swigrun.swg
198
- *
199
- * This file contains generic CAPI SWIG runtime support for pointer
200
- * type checking.
201
- *
202
- ************************************************************************/
203
-
204
- /* This should only be incremented when either the layout of swig_type_info changes,
205
- or for whatever reason, the runtime changes incompatibly */
206
- #define SWIG_RUNTIME_VERSION "2"
207
-
208
- /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
209
- #ifdef SWIG_TYPE_TABLE
210
- # define SWIG_QUOTE_STRING(x) #x
211
- # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
212
- # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
213
- #else
214
- # define SWIG_TYPE_TABLE_NAME
215
- #endif
216
-
217
- /*
218
- You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
219
- creating a static or dynamic library from the swig runtime code.
220
- In 99.9% of the cases, swig just needs to declare them as 'static'.
221
-
222
- But only do this if is strictly necessary, ie, if you have problems
223
- with your compiler or so.
224
- */
225
-
226
- #ifndef SWIGRUNTIME
227
- # define SWIGRUNTIME SWIGINTERN
228
- #endif
229
-
230
- #ifndef SWIGRUNTIMEINLINE
231
- # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
232
- #endif
233
-
234
- #include <string.h>
235
-
236
- #ifdef __cplusplus
237
- extern "C" {
238
- #endif
239
-
240
- typedef void *(*swig_converter_func)(void *);
241
- typedef struct swig_type_info *(*swig_dycast_func)(void **);
242
-
243
- /* Structure to store inforomation on one type */
244
- typedef struct swig_type_info {
245
- const char *name; /* mangled name of this type */
246
- const char *str; /* human readable name of this type */
247
- swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
248
- struct swig_cast_info *cast; /* linked list of types that can cast into this type */
249
- void *clientdata; /* language specific type data */
250
- } swig_type_info;
251
-
252
- /* Structure to store a type and conversion function used for casting */
253
- typedef struct swig_cast_info {
254
- swig_type_info *type; /* pointer to type that is equivalent to this type */
255
- swig_converter_func converter; /* function to cast the void pointers */
256
- struct swig_cast_info *next; /* pointer to next cast in linked list */
257
- struct swig_cast_info *prev; /* pointer to the previous cast */
258
- } swig_cast_info;
259
-
260
- /* Structure used to store module information
261
- * Each module generates one structure like this, and the runtime collects
262
- * all of these structures and stores them in a circularly linked list.*/
263
- typedef struct swig_module_info {
264
- swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
265
- size_t size; /* Number of types in this module */
266
- struct swig_module_info *next; /* Pointer to next element in circularly linked list */
267
- swig_type_info **type_initial; /* Array of initially generated type structures */
268
- swig_cast_info **cast_initial; /* Array of initially generated casting structures */
269
- void *clientdata; /* Language specific module data */
270
- } swig_module_info;
271
-
272
-
273
- /*
274
- Compare two type names skipping the space characters, therefore
275
- "char*" == "char *" and "Class<int>" == "Class<int >", etc.
276
-
277
- Return 0 when the two name types are equivalent, as in
278
- strncmp, but skipping ' '.
279
- */
280
- SWIGRUNTIME int
281
- SWIG_TypeNameComp(const char *f1, const char *l1,
282
- const char *f2, const char *l2) {
283
- for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
284
- while ((*f1 == ' ') && (f1 != l1)) ++f1;
285
- while ((*f2 == ' ') && (f2 != l2)) ++f2;
286
- if (*f1 != *f2) return (int)(*f1 - *f2);
287
- }
288
- return (l1 - f1) - (l2 - f2);
289
- }
290
-
291
- /*
292
- Check type equivalence in a name list like <name1>|<name2>|...
293
- Return 0 if not equal, 1 if equal
294
- */
295
- SWIGRUNTIME int
296
- SWIG_TypeEquiv(const char *nb, const char *tb) {
297
- int equiv = 0;
298
- const char* te = tb + strlen(tb);
299
- const char* ne = nb;
300
- while (!equiv && *ne) {
301
- for (nb = ne; *ne; ++ne) {
302
- if (*ne == '|') break;
303
- }
304
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
305
- if (*ne) ++ne;
306
- }
307
- return equiv;
308
- }
309
-
310
- /*
311
- Check type equivalence in a name list like <name1>|<name2>|...
312
- Return 0 if equal, -1 if nb < tb, 1 if nb > tb
313
- */
314
- SWIGRUNTIME int
315
- SWIG_TypeCompare(const char *nb, const char *tb) {
316
- int equiv = 0;
317
- const char* te = tb + strlen(tb);
318
- const char* ne = nb;
319
- while (!equiv && *ne) {
320
- for (nb = ne; *ne; ++ne) {
321
- if (*ne == '|') break;
322
- }
323
- equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
324
- if (*ne) ++ne;
325
- }
326
- return equiv;
327
- }
328
-
329
-
330
- /* think of this as a c++ template<> or a scheme macro */
331
- #define SWIG_TypeCheck_Template(comparison, ty) \
332
- if (ty) { \
333
- swig_cast_info *iter = ty->cast; \
334
- while (iter) { \
335
- if (comparison) { \
336
- if (iter == ty->cast) return iter; \
337
- /* Move iter to the top of the linked list */ \
338
- iter->prev->next = iter->next; \
339
- if (iter->next) \
340
- iter->next->prev = iter->prev; \
341
- iter->next = ty->cast; \
342
- iter->prev = 0; \
343
- if (ty->cast) ty->cast->prev = iter; \
344
- ty->cast = iter; \
345
- return iter; \
346
- } \
347
- iter = iter->next; \
348
- } \
349
- } \
350
- return 0
351
-
352
- /*
353
- Check the typename
354
- */
355
- SWIGRUNTIME swig_cast_info *
356
- SWIG_TypeCheck(const char *c, swig_type_info *ty) {
357
- SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
358
- }
359
-
360
- /* Same as previous function, except strcmp is replaced with a pointer comparison */
361
- SWIGRUNTIME swig_cast_info *
362
- SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
363
- SWIG_TypeCheck_Template(iter->type == from, into);
364
- }
365
-
366
- /*
367
- Cast a pointer up an inheritance hierarchy
368
- */
369
- SWIGRUNTIMEINLINE void *
370
- SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
371
- return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
372
- }
373
-
374
- /*
375
- Dynamic pointer casting. Down an inheritance hierarchy
376
- */
377
- SWIGRUNTIME swig_type_info *
378
- SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
379
- swig_type_info *lastty = ty;
380
- if (!ty || !ty->dcast) return ty;
381
- while (ty && (ty->dcast)) {
382
- ty = (*ty->dcast)(ptr);
383
- if (ty) lastty = ty;
384
- }
385
- return lastty;
386
- }
387
-
388
- /*
389
- Return the name associated with this type
390
- */
391
- SWIGRUNTIMEINLINE const char *
392
- SWIG_TypeName(const swig_type_info *ty) {
393
- return ty->name;
394
- }
395
-
396
- /*
397
- Return the pretty name associated with this type,
398
- that is an unmangled type name in a form presentable to the user.
399
- */
400
- SWIGRUNTIME const char *
401
- SWIG_TypePrettyName(const swig_type_info *type) {
402
- /* The "str" field contains the equivalent pretty names of the
403
- type, separated by vertical-bar characters. We choose
404
- to print the last name, as it is often (?) the most
405
- specific. */
406
- if (type->str != NULL) {
407
- const char *last_name = type->str;
408
- const char *s;
409
- for (s = type->str; *s; s++)
410
- if (*s == '|') last_name = s+1;
411
- return last_name;
412
- }
413
- else
414
- return type->name;
415
- }
416
-
417
- /*
418
- Set the clientdata field for a type
419
- */
420
- SWIGRUNTIME void
421
- SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
422
- swig_cast_info *cast = ti->cast;
423
- /* if (ti->clientdata == clientdata) return; */
424
- ti->clientdata = clientdata;
425
-
426
- while (cast) {
427
- if (!cast->converter) {
428
- swig_type_info *tc = cast->type;
429
- if (!tc->clientdata) {
430
- SWIG_TypeClientData(tc, clientdata);
431
- }
432
- }
433
- cast = cast->next;
434
- }
435
- }
436
-
437
- /*
438
- Search for a swig_type_info structure only by mangled name
439
- Search is a O(log #types)
440
-
441
- We start searching at module start, and finish searching when start == end.
442
- Note: if start == end at the beginning of the function, we go all the way around
443
- the circular list.
444
- */
445
- SWIGRUNTIME swig_type_info *
446
- SWIG_MangledTypeQueryModule(swig_module_info *start,
447
- swig_module_info *end,
448
- const char *name) {
449
- swig_module_info *iter = start;
450
- do {
451
- if (iter->size) {
452
- register size_t l = 0;
453
- register size_t r = iter->size - 1;
454
- do {
455
- /* since l+r >= 0, we can (>> 1) instead (/ 2) */
456
- register size_t i = (l + r) >> 1;
457
- const char *iname = iter->types[i]->name;
458
- if (iname) {
459
- register int compare = strcmp(name, iname);
460
- if (compare == 0) {
461
- return iter->types[i];
462
- } else if (compare < 0) {
463
- if (i) {
464
- r = i - 1;
465
- } else {
466
- break;
467
- }
468
- } else if (compare > 0) {
469
- l = i + 1;
470
- }
471
- } else {
472
- break; /* should never happen */
473
- }
474
- } while (l <= r);
475
- }
476
- iter = iter->next;
477
- } while (iter != end);
478
- return 0;
479
- }
480
-
481
- /*
482
- Search for a swig_type_info structure for either a mangled name or a human readable name.
483
- It first searches the mangled names of the types, which is a O(log #types)
484
- If a type is not found it then searches the human readable names, which is O(#types).
485
-
486
- We start searching at module start, and finish searching when start == end.
487
- Note: if start == end at the beginning of the function, we go all the way around
488
- the circular list.
489
- */
490
- SWIGRUNTIME swig_type_info *
491
- SWIG_TypeQueryModule(swig_module_info *start,
492
- swig_module_info *end,
493
- const char *name) {
494
- /* STEP 1: Search the name field using binary search */
495
- swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
496
- if (ret) {
497
- return ret;
498
- } else {
499
- /* STEP 2: If the type hasn't been found, do a complete search
500
- of the str field (the human readable name) */
501
- swig_module_info *iter = start;
502
- do {
503
- register size_t i = 0;
504
- for (; i < iter->size; ++i) {
505
- if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
506
- return iter->types[i];
507
- }
508
- iter = iter->next;
509
- } while (iter != end);
510
- }
511
-
512
- /* neither found a match */
513
- return 0;
514
- }
515
-
516
-
517
- /*
518
- Pack binary data into a string
519
- */
520
- SWIGRUNTIME char *
521
- SWIG_PackData(char *c, void *ptr, size_t sz) {
522
- static const char hex[17] = "0123456789abcdef";
523
- register const unsigned char *u = (unsigned char *) ptr;
524
- register const unsigned char *eu = u + sz;
525
- for (; u != eu; ++u) {
526
- register unsigned char uu = *u;
527
- *(c++) = hex[(uu & 0xf0) >> 4];
528
- *(c++) = hex[uu & 0xf];
529
- }
530
- return c;
531
- }
532
-
533
- /*
534
- Unpack binary data from a string
535
- */
536
- SWIGRUNTIME const char *
537
- SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
538
- register unsigned char *u = (unsigned char *) ptr;
539
- register const unsigned char *eu = u + sz;
540
- for (; u != eu; ++u) {
541
- register char d = *(c++);
542
- register unsigned char uu = 0;
543
- if ((d >= '0') && (d <= '9'))
544
- uu = ((d - '0') << 4);
545
- else if ((d >= 'a') && (d <= 'f'))
546
- uu = ((d - ('a'-10)) << 4);
547
- else
548
- return (char *) 0;
549
- d = *(c++);
550
- if ((d >= '0') && (d <= '9'))
551
- uu |= (d - '0');
552
- else if ((d >= 'a') && (d <= 'f'))
553
- uu |= (d - ('a'-10));
554
- else
555
- return (char *) 0;
556
- *u = uu;
557
- }
558
- return c;
559
- }
560
-
561
- /*
562
- Pack 'void *' into a string buffer.
563
- */
564
- SWIGRUNTIME char *
565
- SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
566
- char *r = buff;
567
- if ((2*sizeof(void *) + 2) > bsz) return 0;
568
- *(r++) = '_';
569
- r = SWIG_PackData(r,&ptr,sizeof(void *));
570
- if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
571
- strcpy(r,name);
572
- return buff;
573
- }
574
-
575
- SWIGRUNTIME const char *
576
- SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
577
- if (*c != '_') {
578
- if (strcmp(c,"NULL") == 0) {
579
- *ptr = (void *) 0;
580
- return name;
581
- } else {
582
- return 0;
583
- }
584
- }
585
- return SWIG_UnpackData(++c,ptr,sizeof(void *));
586
- }
587
-
588
- SWIGRUNTIME char *
589
- SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
590
- char *r = buff;
591
- size_t lname = (name ? strlen(name) : 0);
592
- if ((2*sz + 2 + lname) > bsz) return 0;
593
- *(r++) = '_';
594
- r = SWIG_PackData(r,ptr,sz);
595
- if (lname) {
596
- strncpy(r,name,lname+1);
597
- } else {
598
- *r = 0;
599
- }
600
- return buff;
601
- }
602
-
603
- SWIGRUNTIME const char *
604
- SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
605
- if (*c != '_') {
606
- if (strcmp(c,"NULL") == 0) {
607
- memset(ptr,0,sz);
608
- return name;
609
- } else {
610
- return 0;
611
- }
612
- }
613
- return SWIG_UnpackData(++c,ptr,sz);
614
- }
615
-
616
- #ifdef __cplusplus
617
- }
618
- #endif
619
-
620
- /***********************************************************************
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.39
4
+ *
5
+ * This file is not intended to be easily readable and contains a number of
6
+ * coding conventions designed to improve portability and efficiency. Do not make
7
+ * changes to this file unless you know what you are doing--modify the SWIG
8
+ * interface file instead.
9
+ * ----------------------------------------------------------------------------- */
10
+
11
+ #define SWIGRUBY
12
+
13
+ /* -----------------------------------------------------------------------------
14
+ * This section contains generic SWIG labels for method/variable
15
+ * declarations/attributes, and other compiler dependent labels.
16
+ * ----------------------------------------------------------------------------- */
17
+
18
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
19
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
20
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21
+ # define SWIGTEMPLATEDISAMBIGUATOR template
22
+ # elif defined(__HP_aCC)
23
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
24
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
25
+ # define SWIGTEMPLATEDISAMBIGUATOR template
26
+ # else
27
+ # define SWIGTEMPLATEDISAMBIGUATOR
28
+ # endif
29
+ #endif
30
+
31
+ /* inline attribute */
32
+ #ifndef SWIGINLINE
33
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
34
+ # define SWIGINLINE inline
35
+ # else
36
+ # define SWIGINLINE
37
+ # endif
38
+ #endif
39
+
40
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
41
+ #ifndef SWIGUNUSED
42
+ # if defined(__GNUC__)
43
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
44
+ # define SWIGUNUSED __attribute__ ((__unused__))
45
+ # else
46
+ # define SWIGUNUSED
47
+ # endif
48
+ # elif defined(__ICC)
49
+ # define SWIGUNUSED __attribute__ ((__unused__))
50
+ # else
51
+ # define SWIGUNUSED
52
+ # endif
53
+ #endif
54
+
55
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
56
+ # if defined(_MSC_VER)
57
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
58
+ # endif
59
+ #endif
60
+
61
+ #ifndef SWIGUNUSEDPARM
62
+ # ifdef __cplusplus
63
+ # define SWIGUNUSEDPARM(p)
64
+ # else
65
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
66
+ # endif
67
+ #endif
68
+
69
+ /* internal SWIG method */
70
+ #ifndef SWIGINTERN
71
+ # define SWIGINTERN static SWIGUNUSED
72
+ #endif
73
+
74
+ /* internal inline SWIG method */
75
+ #ifndef SWIGINTERNINLINE
76
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
77
+ #endif
78
+
79
+ /* exporting methods */
80
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
81
+ # ifndef GCC_HASCLASSVISIBILITY
82
+ # define GCC_HASCLASSVISIBILITY
83
+ # endif
84
+ #endif
85
+
86
+ #ifndef SWIGEXPORT
87
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
88
+ # if defined(STATIC_LINKED)
89
+ # define SWIGEXPORT
90
+ # else
91
+ # define SWIGEXPORT __declspec(dllexport)
92
+ # endif
93
+ # else
94
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
95
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
96
+ # else
97
+ # define SWIGEXPORT
98
+ # endif
99
+ # endif
100
+ #endif
101
+
102
+ /* calling conventions for Windows */
103
+ #ifndef SWIGSTDCALL
104
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
105
+ # define SWIGSTDCALL __stdcall
106
+ # else
107
+ # define SWIGSTDCALL
108
+ # endif
109
+ #endif
110
+
111
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
112
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
113
+ # define _CRT_SECURE_NO_DEPRECATE
114
+ #endif
115
+
116
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
117
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
118
+ # define _SCL_SECURE_NO_DEPRECATE
119
+ #endif
120
+
121
+
122
+ /* -----------------------------------------------------------------------------
123
+ * This section contains generic SWIG labels for method/variable
124
+ * declarations/attributes, and other compiler dependent labels.
125
+ * ----------------------------------------------------------------------------- */
126
+
127
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
128
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
129
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
130
+ # define SWIGTEMPLATEDISAMBIGUATOR template
131
+ # elif defined(__HP_aCC)
132
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
133
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
134
+ # define SWIGTEMPLATEDISAMBIGUATOR template
135
+ # else
136
+ # define SWIGTEMPLATEDISAMBIGUATOR
137
+ # endif
138
+ #endif
139
+
140
+ /* inline attribute */
141
+ #ifndef SWIGINLINE
142
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
143
+ # define SWIGINLINE inline
144
+ # else
145
+ # define SWIGINLINE
146
+ # endif
147
+ #endif
148
+
149
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
150
+ #ifndef SWIGUNUSED
151
+ # if defined(__GNUC__)
152
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
153
+ # define SWIGUNUSED __attribute__ ((__unused__))
154
+ # else
155
+ # define SWIGUNUSED
156
+ # endif
157
+ # elif defined(__ICC)
158
+ # define SWIGUNUSED __attribute__ ((__unused__))
159
+ # else
160
+ # define SWIGUNUSED
161
+ # endif
162
+ #endif
163
+
164
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
165
+ # if defined(_MSC_VER)
166
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
167
+ # endif
168
+ #endif
169
+
170
+ #ifndef SWIGUNUSEDPARM
171
+ # ifdef __cplusplus
172
+ # define SWIGUNUSEDPARM(p)
173
+ # else
174
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
175
+ # endif
176
+ #endif
177
+
178
+ /* internal SWIG method */
179
+ #ifndef SWIGINTERN
180
+ # define SWIGINTERN static SWIGUNUSED
181
+ #endif
182
+
183
+ /* internal inline SWIG method */
184
+ #ifndef SWIGINTERNINLINE
185
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
186
+ #endif
187
+
188
+ /* exporting methods */
189
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
190
+ # ifndef GCC_HASCLASSVISIBILITY
191
+ # define GCC_HASCLASSVISIBILITY
192
+ # endif
193
+ #endif
194
+
195
+ #ifndef SWIGEXPORT
196
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
197
+ # if defined(STATIC_LINKED)
198
+ # define SWIGEXPORT
199
+ # else
200
+ # define SWIGEXPORT __declspec(dllexport)
201
+ # endif
202
+ # else
203
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
204
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
205
+ # else
206
+ # define SWIGEXPORT
207
+ # endif
208
+ # endif
209
+ #endif
210
+
211
+ /* calling conventions for Windows */
212
+ #ifndef SWIGSTDCALL
213
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
214
+ # define SWIGSTDCALL __stdcall
215
+ # else
216
+ # define SWIGSTDCALL
217
+ # endif
218
+ #endif
219
+
220
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
221
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
222
+ # define _CRT_SECURE_NO_DEPRECATE
223
+ #endif
224
+
225
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
226
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
227
+ # define _SCL_SECURE_NO_DEPRECATE
228
+ #endif
229
+
230
+
231
+ /* -----------------------------------------------------------------------------
232
+ * swigrun.swg
233
+ *
234
+ * This file contains generic C API SWIG runtime support for pointer
235
+ * type checking.
236
+ * ----------------------------------------------------------------------------- */
237
+
238
+ /* This should only be incremented when either the layout of swig_type_info changes,
239
+ or for whatever reason, the runtime changes incompatibly */
240
+ #define SWIG_RUNTIME_VERSION "4"
241
+
242
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
243
+ #ifdef SWIG_TYPE_TABLE
244
+ # define SWIG_QUOTE_STRING(x) #x
245
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
246
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
247
+ #else
248
+ # define SWIG_TYPE_TABLE_NAME
249
+ #endif
250
+
251
+ /*
252
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
253
+ creating a static or dynamic library from the SWIG runtime code.
254
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
255
+
256
+ But only do this if strictly necessary, ie, if you have problems
257
+ with your compiler or suchlike.
258
+ */
259
+
260
+ #ifndef SWIGRUNTIME
261
+ # define SWIGRUNTIME SWIGINTERN
262
+ #endif
263
+
264
+ #ifndef SWIGRUNTIMEINLINE
265
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
266
+ #endif
267
+
268
+ /* Generic buffer size */
269
+ #ifndef SWIG_BUFFER_SIZE
270
+ # define SWIG_BUFFER_SIZE 1024
271
+ #endif
272
+
273
+ /* Flags for pointer conversions */
274
+ #define SWIG_POINTER_DISOWN 0x1
275
+ #define SWIG_CAST_NEW_MEMORY 0x2
276
+
277
+ /* Flags for new pointer objects */
278
+ #define SWIG_POINTER_OWN 0x1
279
+
280
+
281
+ /*
282
+ Flags/methods for returning states.
283
+
284
+ The SWIG conversion methods, as ConvertPtr, return and integer
285
+ that tells if the conversion was successful or not. And if not,
286
+ an error code can be returned (see swigerrors.swg for the codes).
287
+
288
+ Use the following macros/flags to set or process the returning
289
+ states.
290
+
291
+ In old versions of SWIG, code such as the following was usually written:
292
+
293
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
294
+ // success code
295
+ } else {
296
+ //fail code
297
+ }
298
+
299
+ Now you can be more explicit:
300
+
301
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
302
+ if (SWIG_IsOK(res)) {
303
+ // success code
304
+ } else {
305
+ // fail code
306
+ }
307
+
308
+ which is the same really, but now you can also do
309
+
310
+ Type *ptr;
311
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
312
+ if (SWIG_IsOK(res)) {
313
+ // success code
314
+ if (SWIG_IsNewObj(res) {
315
+ ...
316
+ delete *ptr;
317
+ } else {
318
+ ...
319
+ }
320
+ } else {
321
+ // fail code
322
+ }
323
+
324
+ I.e., now SWIG_ConvertPtr can return new objects and you can
325
+ identify the case and take care of the deallocation. Of course that
326
+ also requires SWIG_ConvertPtr to return new result values, such as
327
+
328
+ int SWIG_ConvertPtr(obj, ptr,...) {
329
+ if (<obj is ok>) {
330
+ if (<need new object>) {
331
+ *ptr = <ptr to new allocated object>;
332
+ return SWIG_NEWOBJ;
333
+ } else {
334
+ *ptr = <ptr to old object>;
335
+ return SWIG_OLDOBJ;
336
+ }
337
+ } else {
338
+ return SWIG_BADOBJ;
339
+ }
340
+ }
341
+
342
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
343
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
344
+ SWIG errors code.
345
+
346
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
347
+ allows to return the 'cast rank', for example, if you have this
348
+
349
+ int food(double)
350
+ int fooi(int);
351
+
352
+ and you call
353
+
354
+ food(1) // cast rank '1' (1 -> 1.0)
355
+ fooi(1) // cast rank '0'
356
+
357
+ just use the SWIG_AddCast()/SWIG_CheckState()
358
+ */
359
+
360
+ #define SWIG_OK (0)
361
+ #define SWIG_ERROR (-1)
362
+ #define SWIG_IsOK(r) (r >= 0)
363
+ #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError)
364
+
365
+ /* The CastRankLimit says how many bits are used for the cast rank */
366
+ #define SWIG_CASTRANKLIMIT (1 << 8)
367
+ /* The NewMask denotes the object was created (using new/malloc) */
368
+ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1)
369
+ /* The TmpMask is for in/out typemaps that use temporal objects */
370
+ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1)
371
+ /* Simple returning values */
372
+ #define SWIG_BADOBJ (SWIG_ERROR)
373
+ #define SWIG_OLDOBJ (SWIG_OK)
374
+ #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK)
375
+ #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK)
376
+ /* Check, add and del mask methods */
377
+ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
378
+ #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
379
+ #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
380
+ #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
381
+ #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
382
+ #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
383
+
384
+ /* Cast-Rank Mode */
385
+ #if defined(SWIG_CASTRANK_MODE)
386
+ # ifndef SWIG_TypeRank
387
+ # define SWIG_TypeRank unsigned long
388
+ # endif
389
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
390
+ # define SWIG_MAXCASTRANK (2)
391
+ # endif
392
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
393
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
394
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
395
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
396
+ }
397
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
398
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
399
+ }
400
+ #else /* no cast-rank mode */
401
+ # define SWIG_AddCast
402
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
403
+ #endif
404
+
405
+
406
+ #include <string.h>
407
+
408
+ #ifdef __cplusplus
409
+ extern "C" {
410
+ #endif
411
+
412
+ typedef void *(*swig_converter_func)(void *, int *);
413
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
414
+
415
+ /* Structure to store information on one type */
416
+ typedef struct swig_type_info {
417
+ const char *name; /* mangled name of this type */
418
+ const char *str; /* human readable name of this type */
419
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
420
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
421
+ void *clientdata; /* language specific type data */
422
+ int owndata; /* flag if the structure owns the clientdata */
423
+ } swig_type_info;
424
+
425
+ /* Structure to store a type and conversion function used for casting */
426
+ typedef struct swig_cast_info {
427
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
428
+ swig_converter_func converter; /* function to cast the void pointers */
429
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
430
+ struct swig_cast_info *prev; /* pointer to the previous cast */
431
+ } swig_cast_info;
432
+
433
+ /* Structure used to store module information
434
+ * Each module generates one structure like this, and the runtime collects
435
+ * all of these structures and stores them in a circularly linked list.*/
436
+ typedef struct swig_module_info {
437
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
438
+ size_t size; /* Number of types in this module */
439
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
440
+ swig_type_info **type_initial; /* Array of initially generated type structures */
441
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
442
+ void *clientdata; /* Language specific module data */
443
+ } swig_module_info;
444
+
445
+ /*
446
+ Compare two type names skipping the space characters, therefore
447
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
448
+
449
+ Return 0 when the two name types are equivalent, as in
450
+ strncmp, but skipping ' '.
451
+ */
452
+ SWIGRUNTIME int
453
+ SWIG_TypeNameComp(const char *f1, const char *l1,
454
+ const char *f2, const char *l2) {
455
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
456
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
457
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
458
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
459
+ }
460
+ return (int)((l1 - f1) - (l2 - f2));
461
+ }
462
+
463
+ /*
464
+ Check type equivalence in a name list like <name1>|<name2>|...
465
+ Return 0 if not equal, 1 if equal
466
+ */
467
+ SWIGRUNTIME int
468
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
469
+ int equiv = 0;
470
+ const char* te = tb + strlen(tb);
471
+ const char* ne = nb;
472
+ while (!equiv && *ne) {
473
+ for (nb = ne; *ne; ++ne) {
474
+ if (*ne == '|') break;
475
+ }
476
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
477
+ if (*ne) ++ne;
478
+ }
479
+ return equiv;
480
+ }
481
+
482
+ /*
483
+ Check type equivalence in a name list like <name1>|<name2>|...
484
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
485
+ */
486
+ SWIGRUNTIME int
487
+ SWIG_TypeCompare(const char *nb, const char *tb) {
488
+ int equiv = 0;
489
+ const char* te = tb + strlen(tb);
490
+ const char* ne = nb;
491
+ while (!equiv && *ne) {
492
+ for (nb = ne; *ne; ++ne) {
493
+ if (*ne == '|') break;
494
+ }
495
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
496
+ if (*ne) ++ne;
497
+ }
498
+ return equiv;
499
+ }
500
+
501
+
502
+ /*
503
+ Check the typename
504
+ */
505
+ SWIGRUNTIME swig_cast_info *
506
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
507
+ if (ty) {
508
+ swig_cast_info *iter = ty->cast;
509
+ while (iter) {
510
+ if (strcmp(iter->type->name, c) == 0) {
511
+ if (iter == ty->cast)
512
+ return iter;
513
+ /* Move iter to the top of the linked list */
514
+ iter->prev->next = iter->next;
515
+ if (iter->next)
516
+ iter->next->prev = iter->prev;
517
+ iter->next = ty->cast;
518
+ iter->prev = 0;
519
+ if (ty->cast) ty->cast->prev = iter;
520
+ ty->cast = iter;
521
+ return iter;
522
+ }
523
+ iter = iter->next;
524
+ }
525
+ }
526
+ return 0;
527
+ }
528
+
529
+ /*
530
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
531
+ */
532
+ SWIGRUNTIME swig_cast_info *
533
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
534
+ if (ty) {
535
+ swig_cast_info *iter = ty->cast;
536
+ while (iter) {
537
+ if (iter->type == from) {
538
+ if (iter == ty->cast)
539
+ return iter;
540
+ /* Move iter to the top of the linked list */
541
+ iter->prev->next = iter->next;
542
+ if (iter->next)
543
+ iter->next->prev = iter->prev;
544
+ iter->next = ty->cast;
545
+ iter->prev = 0;
546
+ if (ty->cast) ty->cast->prev = iter;
547
+ ty->cast = iter;
548
+ return iter;
549
+ }
550
+ iter = iter->next;
551
+ }
552
+ }
553
+ return 0;
554
+ }
555
+
556
+ /*
557
+ Cast a pointer up an inheritance hierarchy
558
+ */
559
+ SWIGRUNTIMEINLINE void *
560
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
561
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
562
+ }
563
+
564
+ /*
565
+ Dynamic pointer casting. Down an inheritance hierarchy
566
+ */
567
+ SWIGRUNTIME swig_type_info *
568
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
569
+ swig_type_info *lastty = ty;
570
+ if (!ty || !ty->dcast) return ty;
571
+ while (ty && (ty->dcast)) {
572
+ ty = (*ty->dcast)(ptr);
573
+ if (ty) lastty = ty;
574
+ }
575
+ return lastty;
576
+ }
577
+
578
+ /*
579
+ Return the name associated with this type
580
+ */
581
+ SWIGRUNTIMEINLINE const char *
582
+ SWIG_TypeName(const swig_type_info *ty) {
583
+ return ty->name;
584
+ }
585
+
586
+ /*
587
+ Return the pretty name associated with this type,
588
+ that is an unmangled type name in a form presentable to the user.
589
+ */
590
+ SWIGRUNTIME const char *
591
+ SWIG_TypePrettyName(const swig_type_info *type) {
592
+ /* The "str" field contains the equivalent pretty names of the
593
+ type, separated by vertical-bar characters. We choose
594
+ to print the last name, as it is often (?) the most
595
+ specific. */
596
+ if (!type) return NULL;
597
+ if (type->str != NULL) {
598
+ const char *last_name = type->str;
599
+ const char *s;
600
+ for (s = type->str; *s; s++)
601
+ if (*s == '|') last_name = s+1;
602
+ return last_name;
603
+ }
604
+ else
605
+ return type->name;
606
+ }
607
+
608
+ /*
609
+ Set the clientdata field for a type
610
+ */
611
+ SWIGRUNTIME void
612
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
613
+ swig_cast_info *cast = ti->cast;
614
+ /* if (ti->clientdata == clientdata) return; */
615
+ ti->clientdata = clientdata;
616
+
617
+ while (cast) {
618
+ if (!cast->converter) {
619
+ swig_type_info *tc = cast->type;
620
+ if (!tc->clientdata) {
621
+ SWIG_TypeClientData(tc, clientdata);
622
+ }
623
+ }
624
+ cast = cast->next;
625
+ }
626
+ }
627
+ SWIGRUNTIME void
628
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
629
+ SWIG_TypeClientData(ti, clientdata);
630
+ ti->owndata = 1;
631
+ }
632
+
633
+ /*
634
+ Search for a swig_type_info structure only by mangled name
635
+ Search is a O(log #types)
636
+
637
+ We start searching at module start, and finish searching when start == end.
638
+ Note: if start == end at the beginning of the function, we go all the way around
639
+ the circular list.
640
+ */
641
+ SWIGRUNTIME swig_type_info *
642
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
643
+ swig_module_info *end,
644
+ const char *name) {
645
+ swig_module_info *iter = start;
646
+ do {
647
+ if (iter->size) {
648
+ register size_t l = 0;
649
+ register size_t r = iter->size - 1;
650
+ do {
651
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
652
+ register size_t i = (l + r) >> 1;
653
+ const char *iname = iter->types[i]->name;
654
+ if (iname) {
655
+ register int compare = strcmp(name, iname);
656
+ if (compare == 0) {
657
+ return iter->types[i];
658
+ } else if (compare < 0) {
659
+ if (i) {
660
+ r = i - 1;
661
+ } else {
662
+ break;
663
+ }
664
+ } else if (compare > 0) {
665
+ l = i + 1;
666
+ }
667
+ } else {
668
+ break; /* should never happen */
669
+ }
670
+ } while (l <= r);
671
+ }
672
+ iter = iter->next;
673
+ } while (iter != end);
674
+ return 0;
675
+ }
676
+
677
+ /*
678
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
679
+ It first searches the mangled names of the types, which is a O(log #types)
680
+ If a type is not found it then searches the human readable names, which is O(#types).
681
+
682
+ We start searching at module start, and finish searching when start == end.
683
+ Note: if start == end at the beginning of the function, we go all the way around
684
+ the circular list.
685
+ */
686
+ SWIGRUNTIME swig_type_info *
687
+ SWIG_TypeQueryModule(swig_module_info *start,
688
+ swig_module_info *end,
689
+ const char *name) {
690
+ /* STEP 1: Search the name field using binary search */
691
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
692
+ if (ret) {
693
+ return ret;
694
+ } else {
695
+ /* STEP 2: If the type hasn't been found, do a complete search
696
+ of the str field (the human readable name) */
697
+ swig_module_info *iter = start;
698
+ do {
699
+ register size_t i = 0;
700
+ for (; i < iter->size; ++i) {
701
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
702
+ return iter->types[i];
703
+ }
704
+ iter = iter->next;
705
+ } while (iter != end);
706
+ }
707
+
708
+ /* neither found a match */
709
+ return 0;
710
+ }
711
+
712
+ /*
713
+ Pack binary data into a string
714
+ */
715
+ SWIGRUNTIME char *
716
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
717
+ static const char hex[17] = "0123456789abcdef";
718
+ register const unsigned char *u = (unsigned char *) ptr;
719
+ register const unsigned char *eu = u + sz;
720
+ for (; u != eu; ++u) {
721
+ register unsigned char uu = *u;
722
+ *(c++) = hex[(uu & 0xf0) >> 4];
723
+ *(c++) = hex[uu & 0xf];
724
+ }
725
+ return c;
726
+ }
727
+
728
+ /*
729
+ Unpack binary data from a string
730
+ */
731
+ SWIGRUNTIME const char *
732
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
733
+ register unsigned char *u = (unsigned char *) ptr;
734
+ register const unsigned char *eu = u + sz;
735
+ for (; u != eu; ++u) {
736
+ register char d = *(c++);
737
+ register unsigned char uu;
738
+ if ((d >= '0') && (d <= '9'))
739
+ uu = ((d - '0') << 4);
740
+ else if ((d >= 'a') && (d <= 'f'))
741
+ uu = ((d - ('a'-10)) << 4);
742
+ else
743
+ return (char *) 0;
744
+ d = *(c++);
745
+ if ((d >= '0') && (d <= '9'))
746
+ uu |= (d - '0');
747
+ else if ((d >= 'a') && (d <= 'f'))
748
+ uu |= (d - ('a'-10));
749
+ else
750
+ return (char *) 0;
751
+ *u = uu;
752
+ }
753
+ return c;
754
+ }
755
+
756
+ /*
757
+ Pack 'void *' into a string buffer.
758
+ */
759
+ SWIGRUNTIME char *
760
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
761
+ char *r = buff;
762
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
763
+ *(r++) = '_';
764
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
765
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
766
+ strcpy(r,name);
767
+ return buff;
768
+ }
769
+
770
+ SWIGRUNTIME const char *
771
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
772
+ if (*c != '_') {
773
+ if (strcmp(c,"NULL") == 0) {
774
+ *ptr = (void *) 0;
775
+ return name;
776
+ } else {
777
+ return 0;
778
+ }
779
+ }
780
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
781
+ }
782
+
783
+ SWIGRUNTIME char *
784
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
785
+ char *r = buff;
786
+ size_t lname = (name ? strlen(name) : 0);
787
+ if ((2*sz + 2 + lname) > bsz) return 0;
788
+ *(r++) = '_';
789
+ r = SWIG_PackData(r,ptr,sz);
790
+ if (lname) {
791
+ strncpy(r,name,lname+1);
792
+ } else {
793
+ *r = 0;
794
+ }
795
+ return buff;
796
+ }
797
+
798
+ SWIGRUNTIME const char *
799
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
800
+ if (*c != '_') {
801
+ if (strcmp(c,"NULL") == 0) {
802
+ memset(ptr,0,sz);
803
+ return name;
804
+ } else {
805
+ return 0;
806
+ }
807
+ }
808
+ return SWIG_UnpackData(++c,ptr,sz);
809
+ }
810
+
811
+ #ifdef __cplusplus
812
+ }
813
+ #endif
814
+
815
+ /* Errors in SWIG */
816
+ #define SWIG_UnknownError -1
817
+ #define SWIG_IOError -2
818
+ #define SWIG_RuntimeError -3
819
+ #define SWIG_IndexError -4
820
+ #define SWIG_TypeError -5
821
+ #define SWIG_DivisionByZero -6
822
+ #define SWIG_OverflowError -7
823
+ #define SWIG_SyntaxError -8
824
+ #define SWIG_ValueError -9
825
+ #define SWIG_SystemError -10
826
+ #define SWIG_AttributeError -11
827
+ #define SWIG_MemoryError -12
828
+ #define SWIG_NullReferenceError -13
829
+
830
+
831
+
832
+ #include <ruby.h>
833
+
834
+ /* Remove global macros defined in Ruby's win32.h */
835
+ #ifdef write
836
+ # undef write
837
+ #endif
838
+ #ifdef read
839
+ # undef read
840
+ #endif
841
+ #ifdef bind
842
+ # undef bind
843
+ #endif
844
+
845
+
846
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
847
+ #ifndef NUM2LL
848
+ #define NUM2LL(x) NUM2LONG((x))
849
+ #endif
850
+ #ifndef LL2NUM
851
+ #define LL2NUM(x) INT2NUM((long) (x))
852
+ #endif
853
+ #ifndef ULL2NUM
854
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
855
+ #endif
856
+
857
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
858
+ #ifndef NUM2ULL
859
+ #ifdef HAVE_LONG_LONG
860
+ #define NUM2ULL(x) rb_num2ull((x))
861
+ #else
862
+ #define NUM2ULL(x) NUM2ULONG(x)
863
+ #endif
864
+ #endif
865
+
866
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
867
+ /* Define these for older versions so we can just write code the new way */
868
+ #ifndef RSTRING_LEN
869
+ # define RSTRING_LEN(x) RSTRING(x)->len
870
+ #endif
871
+ #ifndef RSTRING_PTR
872
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
873
+ #endif
874
+ #ifndef RSTRING_END
875
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
876
+ #endif
877
+ #ifndef RARRAY_LEN
878
+ # define RARRAY_LEN(x) RARRAY(x)->len
879
+ #endif
880
+ #ifndef RARRAY_PTR
881
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
882
+ #endif
883
+ #ifndef RFLOAT_VALUE
884
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
885
+ #endif
886
+ #ifndef DOUBLE2NUM
887
+ # define DOUBLE2NUM(x) rb_float_new(x)
888
+ #endif
889
+ #ifndef RHASH_TBL
890
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
891
+ #endif
892
+ #ifndef RHASH_ITER_LEV
893
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
894
+ #endif
895
+ #ifndef RHASH_IFNONE
896
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
897
+ #endif
898
+ #ifndef RHASH_SIZE
899
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
900
+ #endif
901
+ #ifndef RHASH_EMPTY_P
902
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
903
+ #endif
904
+ #ifndef RSTRUCT_LEN
905
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
906
+ #endif
907
+ #ifndef RSTRUCT_PTR
908
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
909
+ #endif
910
+
911
+
912
+
913
+ /*
914
+ * Need to be very careful about how these macros are defined, especially
915
+ * when compiling C++ code or C code with an ANSI C compiler.
916
+ *
917
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
918
+ * a Ruby method so that it can be passed as an argument to API functions
919
+ * like rb_define_method() and rb_define_singleton_method().
920
+ *
921
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
922
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
923
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
924
+ * and Data_Make_Struct().
925
+ */
926
+
927
+ #ifdef __cplusplus
928
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
929
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
930
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
931
+ # define VOIDFUNC(f) ((void (*)()) f)
932
+ # else
933
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
934
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
935
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
936
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
937
+ # else /* These definitions should work for Ruby 1.7+ */
938
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
939
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
940
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
941
+ # endif
942
+ # endif
943
+ #else
944
+ # define VALUEFUNC(f) (f)
945
+ # define VOIDFUNC(f) (f)
946
+ #endif
947
+
948
+ /* Don't use for expressions have side effect */
949
+ #ifndef RB_STRING_VALUE
950
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
951
+ #endif
952
+ #ifndef StringValue
953
+ #define StringValue(s) RB_STRING_VALUE(s)
954
+ #endif
955
+ #ifndef StringValuePtr
956
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
957
+ #endif
958
+ #ifndef StringValueLen
959
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
960
+ #endif
961
+ #ifndef SafeStringValue
962
+ #define SafeStringValue(v) do {\
963
+ StringValue(v);\
964
+ rb_check_safe_str(v);\
965
+ } while (0)
966
+ #endif
967
+
968
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
969
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
970
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
971
+ #endif
972
+
973
+ static VALUE _mSWIG = Qnil;
974
+
975
+ /* -----------------------------------------------------------------------------
976
+ * error manipulation
977
+ * ----------------------------------------------------------------------------- */
978
+
979
+
980
+ /* Define some additional error types */
981
+ #define SWIG_ObjectPreviouslyDeletedError -100
982
+
983
+
984
+ /* Define custom exceptions for errors that do not map to existing Ruby
985
+ exceptions. Note this only works for C++ since a global cannot be
986
+ initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
987
+
988
+ SWIGINTERN VALUE
989
+ getNullReferenceError(void) {
990
+ static int init = 0;
991
+ static VALUE rb_eNullReferenceError ;
992
+ if (!init) {
993
+ init = 1;
994
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
995
+ }
996
+ return rb_eNullReferenceError;
997
+ }
998
+
999
+ SWIGINTERN VALUE
1000
+ getObjectPreviouslyDeletedError(void) {
1001
+ static int init = 0;
1002
+ static VALUE rb_eObjectPreviouslyDeleted ;
1003
+ if (!init) {
1004
+ init = 1;
1005
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
1006
+ }
1007
+ return rb_eObjectPreviouslyDeleted;
1008
+ }
1009
+
1010
+
1011
+ SWIGINTERN VALUE
1012
+ SWIG_Ruby_ErrorType(int SWIG_code) {
1013
+ VALUE type;
1014
+ switch (SWIG_code) {
1015
+ case SWIG_MemoryError:
1016
+ type = rb_eNoMemError;
1017
+ break;
1018
+ case SWIG_IOError:
1019
+ type = rb_eIOError;
1020
+ break;
1021
+ case SWIG_RuntimeError:
1022
+ type = rb_eRuntimeError;
1023
+ break;
1024
+ case SWIG_IndexError:
1025
+ type = rb_eIndexError;
1026
+ break;
1027
+ case SWIG_TypeError:
1028
+ type = rb_eTypeError;
1029
+ break;
1030
+ case SWIG_DivisionByZero:
1031
+ type = rb_eZeroDivError;
1032
+ break;
1033
+ case SWIG_OverflowError:
1034
+ type = rb_eRangeError;
1035
+ break;
1036
+ case SWIG_SyntaxError:
1037
+ type = rb_eSyntaxError;
1038
+ break;
1039
+ case SWIG_ValueError:
1040
+ type = rb_eArgError;
1041
+ break;
1042
+ case SWIG_SystemError:
1043
+ type = rb_eFatal;
1044
+ break;
1045
+ case SWIG_AttributeError:
1046
+ type = rb_eRuntimeError;
1047
+ break;
1048
+ case SWIG_NullReferenceError:
1049
+ type = getNullReferenceError();
1050
+ break;
1051
+ case SWIG_ObjectPreviouslyDeletedError:
1052
+ type = getObjectPreviouslyDeletedError();
1053
+ break;
1054
+ case SWIG_UnknownError:
1055
+ type = rb_eRuntimeError;
1056
+ break;
1057
+ default:
1058
+ type = rb_eRuntimeError;
1059
+ }
1060
+ return type;
1061
+ }
1062
+
1063
+
1064
+ /* This function is called when a user inputs a wrong argument to
1065
+ a method.
1066
+ */
1067
+ SWIGINTERN
1068
+ const char* Ruby_Format_TypeError( const char* msg,
1069
+ const char* type,
1070
+ const char* name,
1071
+ const int argn,
1072
+ VALUE input )
1073
+ {
1074
+ char buf[128];
1075
+ VALUE str;
1076
+ VALUE asStr;
1077
+ if ( msg && *msg )
1078
+ {
1079
+ str = rb_str_new2(msg);
1080
+ }
1081
+ else
1082
+ {
1083
+ str = rb_str_new(NULL, 0);
1084
+ }
1085
+
1086
+ str = rb_str_cat2( str, "Expected argument " );
1087
+ sprintf( buf, "%d of type ", argn-1 );
1088
+ str = rb_str_cat2( str, buf );
1089
+ str = rb_str_cat2( str, type );
1090
+ str = rb_str_cat2( str, ", but got " );
1091
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1092
+ str = rb_str_cat2( str, " " );
1093
+ asStr = rb_inspect(input);
1094
+ if ( RSTRING_LEN(asStr) > 30 )
1095
+ {
1096
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1097
+ str = rb_str_cat2( str, "..." );
1098
+ }
1099
+ else
1100
+ {
1101
+ str = rb_str_append( str, asStr );
1102
+ }
1103
+
1104
+ if ( name )
1105
+ {
1106
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1107
+ str = rb_str_cat2( str, name );
1108
+ str = rb_str_cat2( str, "'" );
1109
+ }
1110
+
1111
+ return StringValuePtr( str );
1112
+ }
1113
+
1114
+ /* This function is called when an overloaded method fails */
1115
+ SWIGINTERN
1116
+ void Ruby_Format_OverloadedError(
1117
+ const int argc,
1118
+ const int maxargs,
1119
+ const char* method,
1120
+ const char* prototypes
1121
+ )
1122
+ {
1123
+ const char* msg = "Wrong # of arguments";
1124
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1125
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1126
+ "Possible C/C++ prototypes are:\n%s",
1127
+ msg, method, prototypes);
1128
+ }
1129
+
1130
+ /* -----------------------------------------------------------------------------
1131
+ * See the LICENSE file for information on copyright, usage and redistribution
1132
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1133
+ *
621
1134
  * rubytracking.swg
622
1135
  *
623
1136
  * This file contains support for tracking mappings from
624
1137
  * Ruby objects to C++ objects. This functionality is needed
625
1138
  * to implement mark functions for Ruby's mark and sweep
626
1139
  * garbage collector.
627
- ************************************************************************/
1140
+ * ----------------------------------------------------------------------------- */
1141
+
1142
+ #ifdef __cplusplus
1143
+ extern "C" {
1144
+ #endif
1145
+
1146
+ /* Ruby 1.8 actually assumes the first case. */
1147
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1148
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1149
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1150
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1151
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1152
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1153
+ #else
1154
+ # error sizeof(void*) is not the same as long or long long
1155
+ #endif
1156
+
628
1157
 
629
1158
  /* Global Ruby hash table to store Trackings from C/C++
630
- structs to Ruby Objects. */
631
- static VALUE swig_ruby_trackings;
1159
+ structs to Ruby Objects.
1160
+ */
1161
+ static VALUE swig_ruby_trackings = Qnil;
1162
+
1163
+ /* Global variable that stores a reference to the ruby
1164
+ hash table delete function. */
1165
+ static ID swig_ruby_hash_delete;
632
1166
 
633
1167
  /* Setup a Ruby hash table to store Trackings */
634
- static void SWIG_RubyInitializeTrackings() {
635
- /* Create a ruby hash table to store Trackings from C++
636
- objects to Ruby objects. Also make sure to tell
637
- the garabage collector about the hash table. */
638
- swig_ruby_trackings = rb_hash_new();
639
- rb_gc_register_address(&swig_ruby_trackings);
1168
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1169
+ /* Create a ruby hash table to store Trackings from C++
1170
+ objects to Ruby objects. */
1171
+
1172
+ /* Try to see if some other .so has already created a
1173
+ tracking hash table, which we keep hidden in an instance var
1174
+ in the SWIG module.
1175
+ This is done to allow multiple DSOs to share the same
1176
+ tracking table.
1177
+ */
1178
+ ID trackings_id = rb_intern( "@__trackings__" );
1179
+ VALUE verbose = rb_gv_get("VERBOSE");
1180
+ rb_gv_set("VERBOSE", Qfalse);
1181
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1182
+ rb_gv_set("VERBOSE", verbose);
1183
+
1184
+ /* No, it hasn't. Create one ourselves */
1185
+ if ( swig_ruby_trackings == Qnil )
1186
+ {
1187
+ swig_ruby_trackings = rb_hash_new();
1188
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1189
+ }
1190
+
1191
+ /* Now store a reference to the hash table delete function
1192
+ so that we only have to look it up once.*/
1193
+ swig_ruby_hash_delete = rb_intern("delete");
640
1194
  }
641
1195
 
642
1196
  /* Get a Ruby number to reference a pointer */
643
- static VALUE SWIG_RubyPtrToReference(void* ptr) {
644
- /* We cast the pointer to an unsigned long
645
- and then store a reference to it using
646
- a Ruby number object. */
1197
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1198
+ /* We cast the pointer to an unsigned long
1199
+ and then store a reference to it using
1200
+ a Ruby number object. */
647
1201
 
648
- /* Convert the pointer to a Ruby number */
649
- unsigned long value = (unsigned long) ptr;
650
- return LONG2NUM(value);
1202
+ /* Convert the pointer to a Ruby number */
1203
+ return SWIG2NUM(ptr);
651
1204
  }
652
1205
 
653
1206
  /* Get a Ruby number to reference an object */
654
- static VALUE SWIG_RubyObjectToReference(VALUE object) {
655
- /* We cast the object to an unsigned long
656
- and then store a reference to it using
657
- a Ruby number object. */
1207
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1208
+ /* We cast the object to an unsigned long
1209
+ and then store a reference to it using
1210
+ a Ruby number object. */
658
1211
 
659
- /* Convert the Object to a Ruby number */
660
- unsigned long value = (unsigned long) object;
661
- return LONG2NUM(value);
1212
+ /* Convert the Object to a Ruby number */
1213
+ return SWIG2NUM(object);
662
1214
  }
663
1215
 
664
1216
  /* Get a Ruby object from a previously stored reference */
665
- static VALUE SWIG_RubyReferenceToObject(VALUE reference) {
666
- /* The provided Ruby number object is a reference
667
- to the Ruby object we want.*/
1217
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1218
+ /* The provided Ruby number object is a reference
1219
+ to the Ruby object we want.*/
668
1220
 
669
- /* First convert the Ruby number to a C number */
670
- unsigned long value = NUM2LONG(reference);
671
- return (VALUE) value;
1221
+ /* Convert the Ruby number to a Ruby object */
1222
+ return NUM2SWIG(reference);
672
1223
  }
673
1224
 
674
1225
  /* Add a Tracking from a C/C++ struct to a Ruby object */
675
- static void SWIG_RubyAddTracking(void* ptr, VALUE object) {
676
- /* In a Ruby hash table we store the pointer and
677
- the associated Ruby object. The trick here is
678
- that we cannot store the Ruby object directly - if
679
- we do then it cannot be garbage collected. So
680
- instead we typecast it as a unsigned long and
681
- convert it to a Ruby number object.*/
1226
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1227
+ /* In a Ruby hash table we store the pointer and
1228
+ the associated Ruby object. The trick here is
1229
+ that we cannot store the Ruby object directly - if
1230
+ we do then it cannot be garbage collected. So
1231
+ instead we typecast it as a unsigned long and
1232
+ convert it to a Ruby number object.*/
682
1233
 
683
- /* Get a reference to the pointer as a Ruby number */
684
- VALUE key = SWIG_RubyPtrToReference(ptr);
1234
+ /* Get a reference to the pointer as a Ruby number */
1235
+ VALUE key = SWIG_RubyPtrToReference(ptr);
685
1236
 
686
- /* Get a reference to the Ruby object as a Ruby number */
687
- VALUE value = SWIG_RubyObjectToReference(object);
1237
+ /* Get a reference to the Ruby object as a Ruby number */
1238
+ VALUE value = SWIG_RubyObjectToReference(object);
688
1239
 
689
1240
  /* Store the mapping to the global hash table. */
690
- rb_hash_aset(swig_ruby_trackings, key, value);
1241
+ rb_hash_aset(swig_ruby_trackings, key, value);
691
1242
  }
692
1243
 
693
1244
  /* Get the Ruby object that owns the specified C/C++ struct */
694
- static VALUE SWIG_RubyInstanceFor(void* ptr) {
695
- /* Get a reference to the pointer as a Ruby number */
696
- VALUE key = SWIG_RubyPtrToReference(ptr);
1245
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1246
+ /* Get a reference to the pointer as a Ruby number */
1247
+ VALUE key = SWIG_RubyPtrToReference(ptr);
697
1248
 
698
- /* Now lookup the value stored in the global hash table */
699
- VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1249
+ /* Now lookup the value stored in the global hash table */
1250
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
700
1251
 
701
- if (value == Qnil) {
702
- /* No object exists - return nil. */
703
- return Qnil;
704
- }
705
- else {
706
- /* Convert this value to Ruby object */
707
- return SWIG_RubyReferenceToObject(value);
708
- }
709
- }
710
-
711
- /* Remove a Tracking from a C/C++ struct to a Ruby object */
712
- static void SWIG_RubyRemoveTracking(void* ptr) {
713
- /* Get a reference to the pointer as a Ruby number */
714
- VALUE key = SWIG_RubyPtrToReference(ptr);
715
-
716
- /* Define delete method - in C++ this could be marked as
717
- static but unfortunately not in C. */
718
- VALUE delete_function = rb_intern("delete");
719
-
720
- /* Delete the object from the hash table by calling Ruby's
721
- do this we need to call the Hash.delete method.*/
722
- rb_funcall(swig_ruby_trackings, delete_function, 1, key);
1252
+ if (value == Qnil) {
1253
+ /* No object exists - return nil. */
1254
+ return Qnil;
1255
+ }
1256
+ else {
1257
+ /* Convert this value to Ruby object */
1258
+ return SWIG_RubyReferenceToObject(value);
1259
+ }
1260
+ }
1261
+
1262
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1263
+ is very important to remove objects once they are destroyed
1264
+ since the same memory address may be reused later to create
1265
+ a new object. */
1266
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1267
+ /* Get a reference to the pointer as a Ruby number */
1268
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1269
+
1270
+ /* Delete the object from the hash table by calling Ruby's
1271
+ do this we need to call the Hash.delete method.*/
1272
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
723
1273
  }
724
1274
 
725
1275
  /* This is a helper method that unlinks a Ruby object from its
726
1276
  underlying C++ object. This is needed if the lifetime of the
727
1277
  Ruby object is longer than the C++ object */
728
- static void SWIG_RubyUnlinkObjects(void* ptr) {
729
- VALUE object = SWIG_RubyInstanceFor(ptr);
1278
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1279
+ VALUE object = SWIG_RubyInstanceFor(ptr);
730
1280
 
731
- if (object != Qnil) {
732
- DATA_PTR(object) = 0;
733
- }
1281
+ if (object != Qnil) {
1282
+ DATA_PTR(object) = 0;
1283
+ }
1284
+ }
1285
+
1286
+
1287
+ #ifdef __cplusplus
1288
+ }
1289
+ #endif
1290
+
1291
+ /* -----------------------------------------------------------------------------
1292
+ * Ruby API portion that goes into the runtime
1293
+ * ----------------------------------------------------------------------------- */
1294
+
1295
+ #ifdef __cplusplus
1296
+ extern "C" {
1297
+ #endif
1298
+
1299
+ SWIGINTERN VALUE
1300
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1301
+ if (NIL_P(target)) {
1302
+ target = o;
1303
+ } else {
1304
+ if (TYPE(target) != T_ARRAY) {
1305
+ VALUE o2 = target;
1306
+ target = rb_ary_new();
1307
+ rb_ary_push(target, o2);
1308
+ }
1309
+ rb_ary_push(target, o);
1310
+ }
1311
+ return target;
1312
+ }
1313
+
1314
+ /* For ruby1.8.4 and earlier. */
1315
+ #ifndef RUBY_INIT_STACK
1316
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1317
+ # define RUBY_INIT_STACK \
1318
+ VALUE variable_in_this_stack_frame; \
1319
+ Init_stack(&variable_in_this_stack_frame);
1320
+ #endif
1321
+
1322
+
1323
+ #ifdef __cplusplus
1324
+ }
1325
+ #endif
1326
+
1327
+
1328
+ /* -----------------------------------------------------------------------------
1329
+ * See the LICENSE file for information on copyright, usage and redistribution
1330
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1331
+ *
1332
+ * rubyrun.swg
1333
+ *
1334
+ * This file contains the runtime support for Ruby modules
1335
+ * and includes code for managing global variables and pointer
1336
+ * type checking.
1337
+ * ----------------------------------------------------------------------------- */
1338
+
1339
+ /* For backward compatibility only */
1340
+ #define SWIG_POINTER_EXCEPTION 0
1341
+
1342
+ /* for raw pointers */
1343
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1344
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1345
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1346
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1347
+ #define swig_owntype ruby_owntype
1348
+
1349
+ /* for raw packed data */
1350
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1351
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1352
+
1353
+ /* for class or struct pointers */
1354
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1355
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1356
+
1357
+ /* for C or C++ function pointers */
1358
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1359
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1360
+
1361
+ /* for C++ member pointers, ie, member methods */
1362
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1363
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1364
+
1365
+
1366
+ /* Runtime API */
1367
+
1368
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1369
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1370
+
1371
+
1372
+ /* Error manipulation */
1373
+
1374
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1375
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1376
+ #define SWIG_fail goto fail
1377
+
1378
+
1379
+ /* Ruby-specific SWIG API */
1380
+
1381
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1382
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1383
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1384
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1385
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1386
+
1387
+ #include "assert.h"
1388
+
1389
+ /* -----------------------------------------------------------------------------
1390
+ * pointers/data manipulation
1391
+ * ----------------------------------------------------------------------------- */