smsRuby 1.0.0-x86-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.rdoc ADDED
@@ -0,0 +1,20 @@
1
+ = smsRuby/Ruby Interface
2
+
3
+ An SMS middleware using a Ruby wrapper for sending and receving SMS through cellphones connected to the computer.
4
+
5
+
6
+ == Installation
7
+
8
+ After you download the gem from RubyForge you can install using RubyGems commands, e.g
9
+
10
+ gem install smsRuby
11
+
12
+ Also, the gem ships with the C source-code pre-built, so (as of version 1.1.1)
13
+ you don't need to have SWIG installed. However, if you have SWIG installed
14
+ and you want to generate the C file yourself, you can specify the
15
+ <code>--with-swig</code> option.
16
+
17
+ == Usage
18
+
19
+ Use the FAQ .
20
+
data/ext/Makefile ADDED
@@ -0,0 +1,157 @@
1
+
2
+ SHELL = /bin/sh
3
+
4
+ #### Start of system configuration section. ####
5
+
6
+ srcdir = .
7
+ topdir = /usr/lib/ruby/1.8/i486-linux
8
+ hdrdir = $(topdir)
9
+ VPATH = $(srcdir):$(topdir):$(hdrdir)
10
+ exec_prefix = $(prefix)
11
+ prefix = $(DESTDIR)/usr
12
+ sharedstatedir = $(prefix)/com
13
+ mandir = $(prefix)/share/man
14
+ psdir = $(docdir)
15
+ oldincludedir = $(DESTDIR)/usr/include
16
+ localedir = $(datarootdir)/locale
17
+ bindir = $(exec_prefix)/bin
18
+ libexecdir = $(prefix)/lib/ruby1.8
19
+ sitedir = $(DESTDIR)/usr/local/lib/site_ruby
20
+ htmldir = $(docdir)
21
+ vendorarchdir = $(vendorlibdir)/$(sitearch)
22
+ includedir = $(prefix)/include
23
+ infodir = $(prefix)/share/info
24
+ vendorlibdir = $(vendordir)/$(ruby_version)
25
+ sysconfdir = $(DESTDIR)/etc
26
+ libdir = $(exec_prefix)/lib
27
+ sbindir = $(exec_prefix)/sbin
28
+ rubylibdir = $(libdir)/ruby/$(ruby_version)
29
+ docdir = $(datarootdir)/doc/$(PACKAGE)
30
+ dvidir = $(docdir)
31
+ vendordir = $(libdir)/ruby/vendor_ruby
32
+ datarootdir = $(prefix)/share
33
+ pdfdir = $(docdir)
34
+ archdir = $(rubylibdir)/$(arch)
35
+ sitearchdir = $(sitelibdir)/$(sitearch)
36
+ datadir = $(datarootdir)
37
+ localstatedir = $(DESTDIR)/var
38
+ sitelibdir = $(sitedir)/$(ruby_version)
39
+
40
+ CC = cc
41
+ LIBRUBY = $(LIBRUBY_SO)
42
+ LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
43
+ LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
44
+ LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
45
+
46
+ RUBY_EXTCONF_H =
47
+ CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC $(cflags)
48
+ INCFLAGS = -I. -I$(topdir) -I$(hdrdir) -I$(srcdir)
49
+ DEFS = -D_FILE_OFFSET_BITS=64
50
+ CPPFLAGS = $(DEFS) $(cppflags)
51
+ CXXFLAGS = $(CFLAGS)
52
+ ldflags = -L. -rdynamic -Wl,-export-dynamic
53
+ dldflags =
54
+ archflag =
55
+ DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
56
+ LDSHARED = $(CC) -shared
57
+ AR = ar
58
+ EXEEXT =
59
+
60
+ RUBY_INSTALL_NAME = ruby1.8
61
+ RUBY_SO_NAME = ruby1.8
62
+ arch = i486-linux
63
+ sitearch = i486-linux
64
+ ruby_version = 1.8
65
+ ruby = /usr/bin/ruby1.8
66
+ RUBY = $(ruby)
67
+ RM = rm -f
68
+ MAKEDIRS = mkdir -p
69
+ INSTALL = /usr/bin/install -c
70
+ INSTALL_PROG = $(INSTALL) -m 0755
71
+ INSTALL_DATA = $(INSTALL) -m 644
72
+ COPY = cp
73
+
74
+ #### End of system configuration section. ####
75
+
76
+ preload =
77
+
78
+ libpath = . $(libdir)
79
+ LIBPATH = -L. -L$(libdir)
80
+ DEFFILE =
81
+
82
+ CLEANFILES = mkmf.log
83
+ DISTCLEANFILES =
84
+
85
+ extout =
86
+ extout_prefix =
87
+ target_prefix =
88
+ LOCAL_LIBS =
89
+ LIBS = $(LIBRUBYARG_SHARED) -lpthread -ldl -lcrypt -lm -lc
90
+ SRCS = sms_wrap.c SendSMS.c sms.c RecieveSMS.c
91
+ OBJS = sms_wrap.o SendSMS.o sms.o RecieveSMS.o libgnokii.a
92
+ TARGET = sms
93
+ DLLIB = $(TARGET).so
94
+ EXTSTATIC =
95
+ STATIC_LIB =
96
+
97
+ BINDIR = $(bindir)
98
+ RUBYCOMMONDIR = $(sitedir)$(target_prefix)
99
+ RUBYLIBDIR = $(sitelibdir)$(target_prefix)
100
+ RUBYARCHDIR = $(sitearchdir)$(target_prefix)
101
+
102
+ TARGET_SO = $(DLLIB)
103
+ CLEANLIBS = $(TARGET).so $(TARGET).il? $(TARGET).tds $(TARGET).map
104
+ CLEANOBJS = *.o *.a *.s[ol] *.pdb *.exp *.bak
105
+
106
+ all: $(DLLIB)
107
+ static: $(STATIC_LIB)
108
+
109
+ clean:
110
+ @-$(RM) $(CLEANLIBS) $(CLEANOBJS) $(CLEANFILES)
111
+
112
+ distclean: clean
113
+ @-$(RM) Makefile $(RUBY_EXTCONF_H) conftest.* mkmf.log
114
+ @-$(RM) core ruby$(EXEEXT) *~ $(DISTCLEANFILES)
115
+
116
+ realclean: distclean
117
+ install: install-so install-rb
118
+
119
+ install-so: $(RUBYARCHDIR)
120
+ install-so: $(RUBYARCHDIR)/$(DLLIB)
121
+ $(RUBYARCHDIR)/$(DLLIB): $(DLLIB)
122
+ $(INSTALL_PROG) $(DLLIB) $(RUBYARCHDIR)
123
+ install-rb: pre-install-rb install-rb-default
124
+ install-rb-default: pre-install-rb-default
125
+ pre-install-rb: Makefile
126
+ pre-install-rb-default: Makefile
127
+ $(RUBYARCHDIR):
128
+ $(MAKEDIRS) $@
129
+
130
+ site-install: site-install-so site-install-rb
131
+ site-install-so: install-so
132
+ site-install-rb: install-rb
133
+
134
+ .SUFFIXES: .c .m .cc .cxx .cpp .C .o
135
+
136
+ .cc.o:
137
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
138
+
139
+ .cxx.o:
140
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
141
+
142
+ .cpp.o:
143
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
144
+
145
+ .C.o:
146
+ $(CXX) $(INCFLAGS) $(CPPFLAGS) $(CXXFLAGS) -c $<
147
+
148
+ .c.o:
149
+ $(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS) -c $<
150
+
151
+ $(DLLIB): $(OBJS)
152
+ @-$(RM) $@
153
+ $(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
154
+
155
+
156
+
157
+ $(OBJS): ruby.h defines.h
data/ext/RecieveSMS.o ADDED
Binary file
data/ext/SendSMS.o ADDED
Binary file
data/ext/extconf.rb ADDED
@@ -0,0 +1,6 @@
1
+ require 'mkmf'
2
+
3
+ #$LIBS += " -lgnokii"
4
+
5
+ create_makefile('sms')
6
+
data/ext/sms.i ADDED
@@ -0,0 +1,8 @@
1
+ /* modSend.i */
2
+ %module sms
3
+ %{
4
+ /* Put header files here or function declarations like below */
5
+ #include "smsr.h"
6
+ %}
7
+
8
+ %include<smsr.h>
data/ext/sms.o ADDED
Binary file
data/ext/sms.so ADDED
Binary file
data/ext/sms_wrap.c ADDED
@@ -0,0 +1,3606 @@
1
+ /* ----------------------------------------------------------------------------
2
+ * This file was automatically generated by SWIG (http://www.swig.org).
3
+ * Version 1.3.36
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
+ * This section contains generic SWIG labels for method/variable
14
+ * declarations/attributes, and other compiler dependent labels.
15
+ * ----------------------------------------------------------------------------- */
16
+
17
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
18
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
19
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
20
+ # define SWIGTEMPLATEDISAMBIGUATOR template
21
+ # elif defined(__HP_aCC)
22
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
23
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
24
+ # define SWIGTEMPLATEDISAMBIGUATOR template
25
+ # else
26
+ # define SWIGTEMPLATEDISAMBIGUATOR
27
+ # endif
28
+ #endif
29
+
30
+ /* inline attribute */
31
+ #ifndef SWIGINLINE
32
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
33
+ # define SWIGINLINE inline
34
+ # else
35
+ # define SWIGINLINE
36
+ # endif
37
+ #endif
38
+
39
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
40
+ #ifndef SWIGUNUSED
41
+ # if defined(__GNUC__)
42
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
43
+ # define SWIGUNUSED __attribute__ ((__unused__))
44
+ # else
45
+ # define SWIGUNUSED
46
+ # endif
47
+ # elif defined(__ICC)
48
+ # define SWIGUNUSED __attribute__ ((__unused__))
49
+ # else
50
+ # define SWIGUNUSED
51
+ # endif
52
+ #endif
53
+
54
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
55
+ # if defined(_MSC_VER)
56
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
57
+ # endif
58
+ #endif
59
+
60
+ #ifndef SWIGUNUSEDPARM
61
+ # ifdef __cplusplus
62
+ # define SWIGUNUSEDPARM(p)
63
+ # else
64
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
65
+ # endif
66
+ #endif
67
+
68
+ /* internal SWIG method */
69
+ #ifndef SWIGINTERN
70
+ # define SWIGINTERN static SWIGUNUSED
71
+ #endif
72
+
73
+ /* internal inline SWIG method */
74
+ #ifndef SWIGINTERNINLINE
75
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
76
+ #endif
77
+
78
+ /* exporting methods */
79
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
80
+ # ifndef GCC_HASCLASSVISIBILITY
81
+ # define GCC_HASCLASSVISIBILITY
82
+ # endif
83
+ #endif
84
+
85
+ #ifndef SWIGEXPORT
86
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
87
+ # if defined(STATIC_LINKED)
88
+ # define SWIGEXPORT
89
+ # else
90
+ # define SWIGEXPORT __declspec(dllexport)
91
+ # endif
92
+ # else
93
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
94
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
95
+ # else
96
+ # define SWIGEXPORT
97
+ # endif
98
+ # endif
99
+ #endif
100
+
101
+ /* calling conventions for Windows */
102
+ #ifndef SWIGSTDCALL
103
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
104
+ # define SWIGSTDCALL __stdcall
105
+ # else
106
+ # define SWIGSTDCALL
107
+ # endif
108
+ #endif
109
+
110
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
111
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
112
+ # define _CRT_SECURE_NO_DEPRECATE
113
+ #endif
114
+
115
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
116
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
117
+ # define _SCL_SECURE_NO_DEPRECATE
118
+ #endif
119
+
120
+
121
+ /* -----------------------------------------------------------------------------
122
+ * This section contains generic SWIG labels for method/variable
123
+ * declarations/attributes, and other compiler dependent labels.
124
+ * ----------------------------------------------------------------------------- */
125
+
126
+ /* template workaround for compilers that cannot correctly implement the C++ standard */
127
+ #ifndef SWIGTEMPLATEDISAMBIGUATOR
128
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
129
+ # define SWIGTEMPLATEDISAMBIGUATOR template
130
+ # elif defined(__HP_aCC)
131
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
132
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
133
+ # define SWIGTEMPLATEDISAMBIGUATOR template
134
+ # else
135
+ # define SWIGTEMPLATEDISAMBIGUATOR
136
+ # endif
137
+ #endif
138
+
139
+ /* inline attribute */
140
+ #ifndef SWIGINLINE
141
+ # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
142
+ # define SWIGINLINE inline
143
+ # else
144
+ # define SWIGINLINE
145
+ # endif
146
+ #endif
147
+
148
+ /* attribute recognised by some compilers to avoid 'unused' warnings */
149
+ #ifndef SWIGUNUSED
150
+ # if defined(__GNUC__)
151
+ # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
152
+ # define SWIGUNUSED __attribute__ ((__unused__))
153
+ # else
154
+ # define SWIGUNUSED
155
+ # endif
156
+ # elif defined(__ICC)
157
+ # define SWIGUNUSED __attribute__ ((__unused__))
158
+ # else
159
+ # define SWIGUNUSED
160
+ # endif
161
+ #endif
162
+
163
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
164
+ # if defined(_MSC_VER)
165
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
166
+ # endif
167
+ #endif
168
+
169
+ #ifndef SWIGUNUSEDPARM
170
+ # ifdef __cplusplus
171
+ # define SWIGUNUSEDPARM(p)
172
+ # else
173
+ # define SWIGUNUSEDPARM(p) p SWIGUNUSED
174
+ # endif
175
+ #endif
176
+
177
+ /* internal SWIG method */
178
+ #ifndef SWIGINTERN
179
+ # define SWIGINTERN static SWIGUNUSED
180
+ #endif
181
+
182
+ /* internal inline SWIG method */
183
+ #ifndef SWIGINTERNINLINE
184
+ # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
185
+ #endif
186
+
187
+ /* exporting methods */
188
+ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
189
+ # ifndef GCC_HASCLASSVISIBILITY
190
+ # define GCC_HASCLASSVISIBILITY
191
+ # endif
192
+ #endif
193
+
194
+ #ifndef SWIGEXPORT
195
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
196
+ # if defined(STATIC_LINKED)
197
+ # define SWIGEXPORT
198
+ # else
199
+ # define SWIGEXPORT __declspec(dllexport)
200
+ # endif
201
+ # else
202
+ # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
203
+ # define SWIGEXPORT __attribute__ ((visibility("default")))
204
+ # else
205
+ # define SWIGEXPORT
206
+ # endif
207
+ # endif
208
+ #endif
209
+
210
+ /* calling conventions for Windows */
211
+ #ifndef SWIGSTDCALL
212
+ # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
213
+ # define SWIGSTDCALL __stdcall
214
+ # else
215
+ # define SWIGSTDCALL
216
+ # endif
217
+ #endif
218
+
219
+ /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
220
+ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
221
+ # define _CRT_SECURE_NO_DEPRECATE
222
+ #endif
223
+
224
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
225
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
226
+ # define _SCL_SECURE_NO_DEPRECATE
227
+ #endif
228
+
229
+
230
+ /* -----------------------------------------------------------------------------
231
+ * swigrun.swg
232
+ *
233
+ * This file contains generic CAPI SWIG runtime support for pointer
234
+ * type checking.
235
+ * ----------------------------------------------------------------------------- */
236
+
237
+ /* This should only be incremented when either the layout of swig_type_info changes,
238
+ or for whatever reason, the runtime changes incompatibly */
239
+ #define SWIG_RUNTIME_VERSION "4"
240
+
241
+ /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
242
+ #ifdef SWIG_TYPE_TABLE
243
+ # define SWIG_QUOTE_STRING(x) #x
244
+ # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
245
+ # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
246
+ #else
247
+ # define SWIG_TYPE_TABLE_NAME
248
+ #endif
249
+
250
+ /*
251
+ You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
252
+ creating a static or dynamic library from the swig runtime code.
253
+ In 99.9% of the cases, swig just needs to declare them as 'static'.
254
+
255
+ But only do this if is strictly necessary, ie, if you have problems
256
+ with your compiler or so.
257
+ */
258
+
259
+ #ifndef SWIGRUNTIME
260
+ # define SWIGRUNTIME SWIGINTERN
261
+ #endif
262
+
263
+ #ifndef SWIGRUNTIMEINLINE
264
+ # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
265
+ #endif
266
+
267
+ /* Generic buffer size */
268
+ #ifndef SWIG_BUFFER_SIZE
269
+ # define SWIG_BUFFER_SIZE 1024
270
+ #endif
271
+
272
+ /* Flags for pointer conversions */
273
+ #define SWIG_POINTER_DISOWN 0x1
274
+ #define SWIG_CAST_NEW_MEMORY 0x2
275
+
276
+ /* Flags for new pointer objects */
277
+ #define SWIG_POINTER_OWN 0x1
278
+
279
+
280
+ /*
281
+ Flags/methods for returning states.
282
+
283
+ The swig conversion methods, as ConvertPtr, return and integer
284
+ that tells if the conversion was successful or not. And if not,
285
+ an error code can be returned (see swigerrors.swg for the codes).
286
+
287
+ Use the following macros/flags to set or process the returning
288
+ states.
289
+
290
+ In old swig versions, you usually write code as:
291
+
292
+ if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
293
+ // success code
294
+ } else {
295
+ //fail code
296
+ }
297
+
298
+ Now you can be more explicit as:
299
+
300
+ int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
301
+ if (SWIG_IsOK(res)) {
302
+ // success code
303
+ } else {
304
+ // fail code
305
+ }
306
+
307
+ that seems to be the same, but now you can also do
308
+
309
+ Type *ptr;
310
+ int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
311
+ if (SWIG_IsOK(res)) {
312
+ // success code
313
+ if (SWIG_IsNewObj(res) {
314
+ ...
315
+ delete *ptr;
316
+ } else {
317
+ ...
318
+ }
319
+ } else {
320
+ // fail code
321
+ }
322
+
323
+ I.e., now SWIG_ConvertPtr can return new objects and you can
324
+ identify the case and take care of the deallocation. Of course that
325
+ requires also to SWIG_ConvertPtr to return new result values, as
326
+
327
+ int SWIG_ConvertPtr(obj, ptr,...) {
328
+ if (<obj is ok>) {
329
+ if (<need new object>) {
330
+ *ptr = <ptr to new allocated object>;
331
+ return SWIG_NEWOBJ;
332
+ } else {
333
+ *ptr = <ptr to old object>;
334
+ return SWIG_OLDOBJ;
335
+ }
336
+ } else {
337
+ return SWIG_BADOBJ;
338
+ }
339
+ }
340
+
341
+ Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
342
+ more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
343
+ swig errors code.
344
+
345
+ Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
346
+ allows to return the 'cast rank', for example, if you have this
347
+
348
+ int food(double)
349
+ int fooi(int);
350
+
351
+ and you call
352
+
353
+ food(1) // cast rank '1' (1 -> 1.0)
354
+ fooi(1) // cast rank '0'
355
+
356
+ just use the SWIG_AddCast()/SWIG_CheckState()
357
+
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
+
385
+ /* Cast-Rank Mode */
386
+ #if defined(SWIG_CASTRANK_MODE)
387
+ # ifndef SWIG_TypeRank
388
+ # define SWIG_TypeRank unsigned long
389
+ # endif
390
+ # ifndef SWIG_MAXCASTRANK /* Default cast allowed */
391
+ # define SWIG_MAXCASTRANK (2)
392
+ # endif
393
+ # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1)
394
+ # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK)
395
+ SWIGINTERNINLINE int SWIG_AddCast(int r) {
396
+ return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
397
+ }
398
+ SWIGINTERNINLINE int SWIG_CheckState(int r) {
399
+ return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
400
+ }
401
+ #else /* no cast-rank mode */
402
+ # define SWIG_AddCast
403
+ # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
404
+ #endif
405
+
406
+
407
+
408
+
409
+ #include <string.h>
410
+
411
+ #ifdef __cplusplus
412
+ extern "C" {
413
+ #endif
414
+
415
+ typedef void *(*swig_converter_func)(void *, int *);
416
+ typedef struct swig_type_info *(*swig_dycast_func)(void **);
417
+
418
+ /* Structure to store information on one type */
419
+ typedef struct swig_type_info {
420
+ const char *name; /* mangled name of this type */
421
+ const char *str; /* human readable name of this type */
422
+ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */
423
+ struct swig_cast_info *cast; /* linked list of types that can cast into this type */
424
+ void *clientdata; /* language specific type data */
425
+ int owndata; /* flag if the structure owns the clientdata */
426
+ } swig_type_info;
427
+
428
+ /* Structure to store a type and conversion function used for casting */
429
+ typedef struct swig_cast_info {
430
+ swig_type_info *type; /* pointer to type that is equivalent to this type */
431
+ swig_converter_func converter; /* function to cast the void pointers */
432
+ struct swig_cast_info *next; /* pointer to next cast in linked list */
433
+ struct swig_cast_info *prev; /* pointer to the previous cast */
434
+ } swig_cast_info;
435
+
436
+ /* Structure used to store module information
437
+ * Each module generates one structure like this, and the runtime collects
438
+ * all of these structures and stores them in a circularly linked list.*/
439
+ typedef struct swig_module_info {
440
+ swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */
441
+ size_t size; /* Number of types in this module */
442
+ struct swig_module_info *next; /* Pointer to next element in circularly linked list */
443
+ swig_type_info **type_initial; /* Array of initially generated type structures */
444
+ swig_cast_info **cast_initial; /* Array of initially generated casting structures */
445
+ void *clientdata; /* Language specific module data */
446
+ } swig_module_info;
447
+
448
+ /*
449
+ Compare two type names skipping the space characters, therefore
450
+ "char*" == "char *" and "Class<int>" == "Class<int >", etc.
451
+
452
+ Return 0 when the two name types are equivalent, as in
453
+ strncmp, but skipping ' '.
454
+ */
455
+ SWIGRUNTIME int
456
+ SWIG_TypeNameComp(const char *f1, const char *l1,
457
+ const char *f2, const char *l2) {
458
+ for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
459
+ while ((*f1 == ' ') && (f1 != l1)) ++f1;
460
+ while ((*f2 == ' ') && (f2 != l2)) ++f2;
461
+ if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
462
+ }
463
+ return (int)((l1 - f1) - (l2 - f2));
464
+ }
465
+
466
+ /*
467
+ Check type equivalence in a name list like <name1>|<name2>|...
468
+ Return 0 if not equal, 1 if equal
469
+ */
470
+ SWIGRUNTIME int
471
+ SWIG_TypeEquiv(const char *nb, const char *tb) {
472
+ int equiv = 0;
473
+ const char* te = tb + strlen(tb);
474
+ const char* ne = nb;
475
+ while (!equiv && *ne) {
476
+ for (nb = ne; *ne; ++ne) {
477
+ if (*ne == '|') break;
478
+ }
479
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
480
+ if (*ne) ++ne;
481
+ }
482
+ return equiv;
483
+ }
484
+
485
+ /*
486
+ Check type equivalence in a name list like <name1>|<name2>|...
487
+ Return 0 if equal, -1 if nb < tb, 1 if nb > tb
488
+ */
489
+ SWIGRUNTIME int
490
+ SWIG_TypeCompare(const char *nb, const char *tb) {
491
+ int equiv = 0;
492
+ const char* te = tb + strlen(tb);
493
+ const char* ne = nb;
494
+ while (!equiv && *ne) {
495
+ for (nb = ne; *ne; ++ne) {
496
+ if (*ne == '|') break;
497
+ }
498
+ equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
499
+ if (*ne) ++ne;
500
+ }
501
+ return equiv;
502
+ }
503
+
504
+
505
+ /* think of this as a c++ template<> or a scheme macro */
506
+ #define SWIG_TypeCheck_Template(comparison, ty) \
507
+ if (ty) { \
508
+ swig_cast_info *iter = ty->cast; \
509
+ while (iter) { \
510
+ if (comparison) { \
511
+ if (iter == ty->cast) return iter; \
512
+ /* Move iter to the top of the linked list */ \
513
+ iter->prev->next = iter->next; \
514
+ if (iter->next) \
515
+ iter->next->prev = iter->prev; \
516
+ iter->next = ty->cast; \
517
+ iter->prev = 0; \
518
+ if (ty->cast) ty->cast->prev = iter; \
519
+ ty->cast = iter; \
520
+ return iter; \
521
+ } \
522
+ iter = iter->next; \
523
+ } \
524
+ } \
525
+ return 0
526
+
527
+ /*
528
+ Check the typename
529
+ */
530
+ SWIGRUNTIME swig_cast_info *
531
+ SWIG_TypeCheck(const char *c, swig_type_info *ty) {
532
+ SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
533
+ }
534
+
535
+ /* Same as previous function, except strcmp is replaced with a pointer comparison */
536
+ SWIGRUNTIME swig_cast_info *
537
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
538
+ SWIG_TypeCheck_Template(iter->type == from, into);
539
+ }
540
+
541
+ /*
542
+ Cast a pointer up an inheritance hierarchy
543
+ */
544
+ SWIGRUNTIMEINLINE void *
545
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
546
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
547
+ }
548
+
549
+ /*
550
+ Dynamic pointer casting. Down an inheritance hierarchy
551
+ */
552
+ SWIGRUNTIME swig_type_info *
553
+ SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
554
+ swig_type_info *lastty = ty;
555
+ if (!ty || !ty->dcast) return ty;
556
+ while (ty && (ty->dcast)) {
557
+ ty = (*ty->dcast)(ptr);
558
+ if (ty) lastty = ty;
559
+ }
560
+ return lastty;
561
+ }
562
+
563
+ /*
564
+ Return the name associated with this type
565
+ */
566
+ SWIGRUNTIMEINLINE const char *
567
+ SWIG_TypeName(const swig_type_info *ty) {
568
+ return ty->name;
569
+ }
570
+
571
+ /*
572
+ Return the pretty name associated with this type,
573
+ that is an unmangled type name in a form presentable to the user.
574
+ */
575
+ SWIGRUNTIME const char *
576
+ SWIG_TypePrettyName(const swig_type_info *type) {
577
+ /* The "str" field contains the equivalent pretty names of the
578
+ type, separated by vertical-bar characters. We choose
579
+ to print the last name, as it is often (?) the most
580
+ specific. */
581
+ if (!type) return NULL;
582
+ if (type->str != NULL) {
583
+ const char *last_name = type->str;
584
+ const char *s;
585
+ for (s = type->str; *s; s++)
586
+ if (*s == '|') last_name = s+1;
587
+ return last_name;
588
+ }
589
+ else
590
+ return type->name;
591
+ }
592
+
593
+ /*
594
+ Set the clientdata field for a type
595
+ */
596
+ SWIGRUNTIME void
597
+ SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
598
+ swig_cast_info *cast = ti->cast;
599
+ /* if (ti->clientdata == clientdata) return; */
600
+ ti->clientdata = clientdata;
601
+
602
+ while (cast) {
603
+ if (!cast->converter) {
604
+ swig_type_info *tc = cast->type;
605
+ if (!tc->clientdata) {
606
+ SWIG_TypeClientData(tc, clientdata);
607
+ }
608
+ }
609
+ cast = cast->next;
610
+ }
611
+ }
612
+ SWIGRUNTIME void
613
+ SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
614
+ SWIG_TypeClientData(ti, clientdata);
615
+ ti->owndata = 1;
616
+ }
617
+
618
+ /*
619
+ Search for a swig_type_info structure only by mangled name
620
+ Search is a O(log #types)
621
+
622
+ We start searching at module start, and finish searching when start == end.
623
+ Note: if start == end at the beginning of the function, we go all the way around
624
+ the circular list.
625
+ */
626
+ SWIGRUNTIME swig_type_info *
627
+ SWIG_MangledTypeQueryModule(swig_module_info *start,
628
+ swig_module_info *end,
629
+ const char *name) {
630
+ swig_module_info *iter = start;
631
+ do {
632
+ if (iter->size) {
633
+ register size_t l = 0;
634
+ register size_t r = iter->size - 1;
635
+ do {
636
+ /* since l+r >= 0, we can (>> 1) instead (/ 2) */
637
+ register size_t i = (l + r) >> 1;
638
+ const char *iname = iter->types[i]->name;
639
+ if (iname) {
640
+ register int compare = strcmp(name, iname);
641
+ if (compare == 0) {
642
+ return iter->types[i];
643
+ } else if (compare < 0) {
644
+ if (i) {
645
+ r = i - 1;
646
+ } else {
647
+ break;
648
+ }
649
+ } else if (compare > 0) {
650
+ l = i + 1;
651
+ }
652
+ } else {
653
+ break; /* should never happen */
654
+ }
655
+ } while (l <= r);
656
+ }
657
+ iter = iter->next;
658
+ } while (iter != end);
659
+ return 0;
660
+ }
661
+
662
+ /*
663
+ Search for a swig_type_info structure for either a mangled name or a human readable name.
664
+ It first searches the mangled names of the types, which is a O(log #types)
665
+ If a type is not found it then searches the human readable names, which is O(#types).
666
+
667
+ We start searching at module start, and finish searching when start == end.
668
+ Note: if start == end at the beginning of the function, we go all the way around
669
+ the circular list.
670
+ */
671
+ SWIGRUNTIME swig_type_info *
672
+ SWIG_TypeQueryModule(swig_module_info *start,
673
+ swig_module_info *end,
674
+ const char *name) {
675
+ /* STEP 1: Search the name field using binary search */
676
+ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
677
+ if (ret) {
678
+ return ret;
679
+ } else {
680
+ /* STEP 2: If the type hasn't been found, do a complete search
681
+ of the str field (the human readable name) */
682
+ swig_module_info *iter = start;
683
+ do {
684
+ register size_t i = 0;
685
+ for (; i < iter->size; ++i) {
686
+ if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
687
+ return iter->types[i];
688
+ }
689
+ iter = iter->next;
690
+ } while (iter != end);
691
+ }
692
+
693
+ /* neither found a match */
694
+ return 0;
695
+ }
696
+
697
+ /*
698
+ Pack binary data into a string
699
+ */
700
+ SWIGRUNTIME char *
701
+ SWIG_PackData(char *c, void *ptr, size_t sz) {
702
+ static const char hex[17] = "0123456789abcdef";
703
+ register const unsigned char *u = (unsigned char *) ptr;
704
+ register const unsigned char *eu = u + sz;
705
+ for (; u != eu; ++u) {
706
+ register unsigned char uu = *u;
707
+ *(c++) = hex[(uu & 0xf0) >> 4];
708
+ *(c++) = hex[uu & 0xf];
709
+ }
710
+ return c;
711
+ }
712
+
713
+ /*
714
+ Unpack binary data from a string
715
+ */
716
+ SWIGRUNTIME const char *
717
+ SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
718
+ register unsigned char *u = (unsigned char *) ptr;
719
+ register const unsigned char *eu = u + sz;
720
+ for (; u != eu; ++u) {
721
+ register char d = *(c++);
722
+ register unsigned char uu;
723
+ if ((d >= '0') && (d <= '9'))
724
+ uu = ((d - '0') << 4);
725
+ else if ((d >= 'a') && (d <= 'f'))
726
+ uu = ((d - ('a'-10)) << 4);
727
+ else
728
+ return (char *) 0;
729
+ d = *(c++);
730
+ if ((d >= '0') && (d <= '9'))
731
+ uu |= (d - '0');
732
+ else if ((d >= 'a') && (d <= 'f'))
733
+ uu |= (d - ('a'-10));
734
+ else
735
+ return (char *) 0;
736
+ *u = uu;
737
+ }
738
+ return c;
739
+ }
740
+
741
+ /*
742
+ Pack 'void *' into a string buffer.
743
+ */
744
+ SWIGRUNTIME char *
745
+ SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
746
+ char *r = buff;
747
+ if ((2*sizeof(void *) + 2) > bsz) return 0;
748
+ *(r++) = '_';
749
+ r = SWIG_PackData(r,&ptr,sizeof(void *));
750
+ if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
751
+ strcpy(r,name);
752
+ return buff;
753
+ }
754
+
755
+ SWIGRUNTIME const char *
756
+ SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
757
+ if (*c != '_') {
758
+ if (strcmp(c,"NULL") == 0) {
759
+ *ptr = (void *) 0;
760
+ return name;
761
+ } else {
762
+ return 0;
763
+ }
764
+ }
765
+ return SWIG_UnpackData(++c,ptr,sizeof(void *));
766
+ }
767
+
768
+ SWIGRUNTIME char *
769
+ SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
770
+ char *r = buff;
771
+ size_t lname = (name ? strlen(name) : 0);
772
+ if ((2*sz + 2 + lname) > bsz) return 0;
773
+ *(r++) = '_';
774
+ r = SWIG_PackData(r,ptr,sz);
775
+ if (lname) {
776
+ strncpy(r,name,lname+1);
777
+ } else {
778
+ *r = 0;
779
+ }
780
+ return buff;
781
+ }
782
+
783
+ SWIGRUNTIME const char *
784
+ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
785
+ if (*c != '_') {
786
+ if (strcmp(c,"NULL") == 0) {
787
+ memset(ptr,0,sz);
788
+ return name;
789
+ } else {
790
+ return 0;
791
+ }
792
+ }
793
+ return SWIG_UnpackData(++c,ptr,sz);
794
+ }
795
+
796
+ #ifdef __cplusplus
797
+ }
798
+ #endif
799
+
800
+ /* Errors in SWIG */
801
+ #define SWIG_UnknownError -1
802
+ #define SWIG_IOError -2
803
+ #define SWIG_RuntimeError -3
804
+ #define SWIG_IndexError -4
805
+ #define SWIG_TypeError -5
806
+ #define SWIG_DivisionByZero -6
807
+ #define SWIG_OverflowError -7
808
+ #define SWIG_SyntaxError -8
809
+ #define SWIG_ValueError -9
810
+ #define SWIG_SystemError -10
811
+ #define SWIG_AttributeError -11
812
+ #define SWIG_MemoryError -12
813
+ #define SWIG_NullReferenceError -13
814
+
815
+
816
+
817
+ #include <ruby.h>
818
+
819
+ /* Remove global macros defined in Ruby's win32.h */
820
+ #ifdef write
821
+ # undef write
822
+ #endif
823
+ #ifdef read
824
+ # undef read
825
+ #endif
826
+
827
+
828
+ /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
829
+ #ifndef NUM2LL
830
+ #define NUM2LL(x) NUM2LONG((x))
831
+ #endif
832
+ #ifndef LL2NUM
833
+ #define LL2NUM(x) INT2NUM((long) (x))
834
+ #endif
835
+ #ifndef ULL2NUM
836
+ #define ULL2NUM(x) UINT2NUM((unsigned long) (x))
837
+ #endif
838
+
839
+ /* Ruby 1.7 doesn't (yet) define NUM2ULL() */
840
+ #ifndef NUM2ULL
841
+ #ifdef HAVE_LONG_LONG
842
+ #define NUM2ULL(x) rb_num2ull((x))
843
+ #else
844
+ #define NUM2ULL(x) NUM2ULONG(x)
845
+ #endif
846
+ #endif
847
+
848
+ /* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
849
+ /* Define these for older versions so we can just write code the new way */
850
+ #ifndef RSTRING_LEN
851
+ # define RSTRING_LEN(x) RSTRING(x)->len
852
+ #endif
853
+ #ifndef RSTRING_PTR
854
+ # define RSTRING_PTR(x) RSTRING(x)->ptr
855
+ #endif
856
+ #ifndef RSTRING_END
857
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
858
+ #endif
859
+ #ifndef RARRAY_LEN
860
+ # define RARRAY_LEN(x) RARRAY(x)->len
861
+ #endif
862
+ #ifndef RARRAY_PTR
863
+ # define RARRAY_PTR(x) RARRAY(x)->ptr
864
+ #endif
865
+ #ifndef RFLOAT_VALUE
866
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
867
+ #endif
868
+ #ifndef DOUBLE2NUM
869
+ # define DOUBLE2NUM(x) rb_float_new(x)
870
+ #endif
871
+ #ifndef RHASH_TBL
872
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
873
+ #endif
874
+ #ifndef RHASH_ITER_LEV
875
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
876
+ #endif
877
+ #ifndef RHASH_IFNONE
878
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
879
+ #endif
880
+ #ifndef RHASH_SIZE
881
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
882
+ #endif
883
+ #ifndef RHASH_EMPTY_P
884
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
885
+ #endif
886
+ #ifndef RSTRUCT_LEN
887
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
888
+ #endif
889
+ #ifndef RSTRUCT_PTR
890
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
891
+ #endif
892
+
893
+
894
+
895
+ /*
896
+ * Need to be very careful about how these macros are defined, especially
897
+ * when compiling C++ code or C code with an ANSI C compiler.
898
+ *
899
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
900
+ * a Ruby method so that it can be passed as an argument to API functions
901
+ * like rb_define_method() and rb_define_singleton_method().
902
+ *
903
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
904
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
905
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
906
+ * and Data_Make_Struct().
907
+ */
908
+
909
+ #ifdef __cplusplus
910
+ # ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
911
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
912
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
913
+ # define VOIDFUNC(f) ((void (*)()) f)
914
+ # else
915
+ # ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
916
+ # define PROTECTFUNC(f) ((VALUE (*)()) f)
917
+ # define VALUEFUNC(f) ((VALUE (*)()) f)
918
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
919
+ # else /* These definitions should work for Ruby 1.7+ */
920
+ # define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
921
+ # define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
922
+ # define VOIDFUNC(f) ((RUBY_DATA_FUNC) f)
923
+ # endif
924
+ # endif
925
+ #else
926
+ # define VALUEFUNC(f) (f)
927
+ # define VOIDFUNC(f) (f)
928
+ #endif
929
+
930
+ /* Don't use for expressions have side effect */
931
+ #ifndef RB_STRING_VALUE
932
+ #define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
933
+ #endif
934
+ #ifndef StringValue
935
+ #define StringValue(s) RB_STRING_VALUE(s)
936
+ #endif
937
+ #ifndef StringValuePtr
938
+ #define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
939
+ #endif
940
+ #ifndef StringValueLen
941
+ #define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
942
+ #endif
943
+ #ifndef SafeStringValue
944
+ #define SafeStringValue(v) do {\
945
+ StringValue(v);\
946
+ rb_check_safe_str(v);\
947
+ } while (0)
948
+ #endif
949
+
950
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
951
+ #define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
952
+ #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
953
+ #endif
954
+
955
+ static VALUE _mSWIG = Qnil;
956
+
957
+ /* -----------------------------------------------------------------------------
958
+ * error manipulation
959
+ * ----------------------------------------------------------------------------- */
960
+
961
+
962
+ /* Define some additional error types */
963
+ #define SWIG_ObjectPreviouslyDeletedError -100
964
+
965
+
966
+ /* Define custom exceptions for errors that do not map to existing Ruby
967
+ exceptions. Note this only works for C++ since a global cannot be
968
+ initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
969
+
970
+ SWIGINTERN VALUE
971
+ getNullReferenceError(void) {
972
+ static int init = 0;
973
+ static VALUE rb_eNullReferenceError ;
974
+ if (!init) {
975
+ init = 1;
976
+ rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
977
+ }
978
+ return rb_eNullReferenceError;
979
+ }
980
+
981
+ SWIGINTERN VALUE
982
+ getObjectPreviouslyDeletedError(void) {
983
+ static int init = 0;
984
+ static VALUE rb_eObjectPreviouslyDeleted ;
985
+ if (!init) {
986
+ init = 1;
987
+ rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
988
+ }
989
+ return rb_eObjectPreviouslyDeleted;
990
+ }
991
+
992
+
993
+ SWIGINTERN VALUE
994
+ SWIG_Ruby_ErrorType(int SWIG_code) {
995
+ VALUE type;
996
+ switch (SWIG_code) {
997
+ case SWIG_MemoryError:
998
+ type = rb_eNoMemError;
999
+ break;
1000
+ case SWIG_IOError:
1001
+ type = rb_eIOError;
1002
+ break;
1003
+ case SWIG_RuntimeError:
1004
+ type = rb_eRuntimeError;
1005
+ break;
1006
+ case SWIG_IndexError:
1007
+ type = rb_eIndexError;
1008
+ break;
1009
+ case SWIG_TypeError:
1010
+ type = rb_eTypeError;
1011
+ break;
1012
+ case SWIG_DivisionByZero:
1013
+ type = rb_eZeroDivError;
1014
+ break;
1015
+ case SWIG_OverflowError:
1016
+ type = rb_eRangeError;
1017
+ break;
1018
+ case SWIG_SyntaxError:
1019
+ type = rb_eSyntaxError;
1020
+ break;
1021
+ case SWIG_ValueError:
1022
+ type = rb_eArgError;
1023
+ break;
1024
+ case SWIG_SystemError:
1025
+ type = rb_eFatal;
1026
+ break;
1027
+ case SWIG_AttributeError:
1028
+ type = rb_eRuntimeError;
1029
+ break;
1030
+ case SWIG_NullReferenceError:
1031
+ type = getNullReferenceError();
1032
+ break;
1033
+ case SWIG_ObjectPreviouslyDeletedError:
1034
+ type = getObjectPreviouslyDeletedError();
1035
+ break;
1036
+ case SWIG_UnknownError:
1037
+ type = rb_eRuntimeError;
1038
+ break;
1039
+ default:
1040
+ type = rb_eRuntimeError;
1041
+ }
1042
+ return type;
1043
+ }
1044
+
1045
+
1046
+ /* This function is called when a user inputs a wrong argument to
1047
+ a method.
1048
+ */
1049
+ SWIGINTERN
1050
+ const char* Ruby_Format_TypeError( const char* msg,
1051
+ const char* type,
1052
+ const char* name,
1053
+ const int argn,
1054
+ VALUE input )
1055
+ {
1056
+ char buf[128];
1057
+ VALUE str;
1058
+ VALUE asStr;
1059
+ if ( msg && *msg )
1060
+ {
1061
+ str = rb_str_new2(msg);
1062
+ }
1063
+ else
1064
+ {
1065
+ str = rb_str_new(NULL, 0);
1066
+ }
1067
+
1068
+ str = rb_str_cat2( str, "Expected argument " );
1069
+ sprintf( buf, "%d of type ", argn-1 );
1070
+ str = rb_str_cat2( str, buf );
1071
+ str = rb_str_cat2( str, type );
1072
+ str = rb_str_cat2( str, ", but got " );
1073
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1074
+ str = rb_str_cat2( str, " " );
1075
+ asStr = rb_inspect(input);
1076
+ if ( RSTRING_LEN(asStr) > 30 )
1077
+ {
1078
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1079
+ str = rb_str_cat2( str, "..." );
1080
+ }
1081
+ else
1082
+ {
1083
+ str = rb_str_append( str, asStr );
1084
+ }
1085
+
1086
+ if ( name )
1087
+ {
1088
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1089
+ str = rb_str_cat2( str, name );
1090
+ str = rb_str_cat2( str, "'" );
1091
+ }
1092
+
1093
+ return StringValuePtr( str );
1094
+ }
1095
+
1096
+ /* This function is called when an overloaded method fails */
1097
+ SWIGINTERN
1098
+ void Ruby_Format_OverloadedError(
1099
+ const int argc,
1100
+ const int maxargs,
1101
+ const char* method,
1102
+ const char* prototypes
1103
+ )
1104
+ {
1105
+ const char* msg = "Wrong # of arguments";
1106
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1107
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1108
+ "Possible C/C++ prototypes are:\n%s",
1109
+ msg, method, prototypes);
1110
+ }
1111
+
1112
+ /* -----------------------------------------------------------------------------
1113
+ * See the LICENSE file for information on copyright, usage and redistribution
1114
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1115
+ *
1116
+ * rubytracking.swg
1117
+ *
1118
+ * This file contains support for tracking mappings from
1119
+ * Ruby objects to C++ objects. This functionality is needed
1120
+ * to implement mark functions for Ruby's mark and sweep
1121
+ * garbage collector.
1122
+ * ----------------------------------------------------------------------------- */
1123
+
1124
+ #ifdef __cplusplus
1125
+ extern "C" {
1126
+ #endif
1127
+
1128
+ /* Ruby 1.8 actually assumes the first case. */
1129
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1130
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1131
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1132
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1133
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1134
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1135
+ #else
1136
+ # error sizeof(void*) is not the same as long or long long
1137
+ #endif
1138
+
1139
+
1140
+ /* Global Ruby hash table to store Trackings from C/C++
1141
+ structs to Ruby Objects.
1142
+ */
1143
+ static VALUE swig_ruby_trackings = Qnil;
1144
+
1145
+ /* Global variable that stores a reference to the ruby
1146
+ hash table delete function. */
1147
+ static ID swig_ruby_hash_delete;
1148
+
1149
+ /* Setup a Ruby hash table to store Trackings */
1150
+ SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1151
+ /* Create a ruby hash table to store Trackings from C++
1152
+ objects to Ruby objects. */
1153
+
1154
+ /* Try to see if some other .so has already created a
1155
+ tracking hash table, which we keep hidden in an instance var
1156
+ in the SWIG module.
1157
+ This is done to allow multiple DSOs to share the same
1158
+ tracking table.
1159
+ */
1160
+ ID trackings_id = rb_intern( "@__trackings__" );
1161
+ VALUE verbose = rb_gv_get("VERBOSE");
1162
+ rb_gv_set("VERBOSE", Qfalse);
1163
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1164
+ rb_gv_set("VERBOSE", verbose);
1165
+
1166
+ /* No, it hasn't. Create one ourselves */
1167
+ if ( swig_ruby_trackings == Qnil )
1168
+ {
1169
+ swig_ruby_trackings = rb_hash_new();
1170
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1171
+ }
1172
+
1173
+ /* Now store a reference to the hash table delete function
1174
+ so that we only have to look it up once.*/
1175
+ swig_ruby_hash_delete = rb_intern("delete");
1176
+ }
1177
+
1178
+ /* Get a Ruby number to reference a pointer */
1179
+ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1180
+ /* We cast the pointer to an unsigned long
1181
+ and then store a reference to it using
1182
+ a Ruby number object. */
1183
+
1184
+ /* Convert the pointer to a Ruby number */
1185
+ return SWIG2NUM(ptr);
1186
+ }
1187
+
1188
+ /* Get a Ruby number to reference an object */
1189
+ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1190
+ /* We cast the object to an unsigned long
1191
+ and then store a reference to it using
1192
+ a Ruby number object. */
1193
+
1194
+ /* Convert the Object to a Ruby number */
1195
+ return SWIG2NUM(object);
1196
+ }
1197
+
1198
+ /* Get a Ruby object from a previously stored reference */
1199
+ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1200
+ /* The provided Ruby number object is a reference
1201
+ to the Ruby object we want.*/
1202
+
1203
+ /* Convert the Ruby number to a Ruby object */
1204
+ return NUM2SWIG(reference);
1205
+ }
1206
+
1207
+ /* Add a Tracking from a C/C++ struct to a Ruby object */
1208
+ SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
1209
+ /* In a Ruby hash table we store the pointer and
1210
+ the associated Ruby object. The trick here is
1211
+ that we cannot store the Ruby object directly - if
1212
+ we do then it cannot be garbage collected. So
1213
+ instead we typecast it as a unsigned long and
1214
+ convert it to a Ruby number object.*/
1215
+
1216
+ /* Get a reference to the pointer as a Ruby number */
1217
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1218
+
1219
+ /* Get a reference to the Ruby object as a Ruby number */
1220
+ VALUE value = SWIG_RubyObjectToReference(object);
1221
+
1222
+ /* Store the mapping to the global hash table. */
1223
+ rb_hash_aset(swig_ruby_trackings, key, value);
1224
+ }
1225
+
1226
+ /* Get the Ruby object that owns the specified C/C++ struct */
1227
+ SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
1228
+ /* Get a reference to the pointer as a Ruby number */
1229
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1230
+
1231
+ /* Now lookup the value stored in the global hash table */
1232
+ VALUE value = rb_hash_aref(swig_ruby_trackings, key);
1233
+
1234
+ if (value == Qnil) {
1235
+ /* No object exists - return nil. */
1236
+ return Qnil;
1237
+ }
1238
+ else {
1239
+ /* Convert this value to Ruby object */
1240
+ return SWIG_RubyReferenceToObject(value);
1241
+ }
1242
+ }
1243
+
1244
+ /* Remove a Tracking from a C/C++ struct to a Ruby object. It
1245
+ is very important to remove objects once they are destroyed
1246
+ since the same memory address may be reused later to create
1247
+ a new object. */
1248
+ SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
1249
+ /* Get a reference to the pointer as a Ruby number */
1250
+ VALUE key = SWIG_RubyPtrToReference(ptr);
1251
+
1252
+ /* Delete the object from the hash table by calling Ruby's
1253
+ do this we need to call the Hash.delete method.*/
1254
+ rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
1255
+ }
1256
+
1257
+ /* This is a helper method that unlinks a Ruby object from its
1258
+ underlying C++ object. This is needed if the lifetime of the
1259
+ Ruby object is longer than the C++ object */
1260
+ SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
1261
+ VALUE object = SWIG_RubyInstanceFor(ptr);
1262
+
1263
+ if (object != Qnil) {
1264
+ DATA_PTR(object) = 0;
1265
+ }
1266
+ }
1267
+
1268
+
1269
+ #ifdef __cplusplus
1270
+ }
1271
+ #endif
1272
+
1273
+ /* -----------------------------------------------------------------------------
1274
+ * Ruby API portion that goes into the runtime
1275
+ * ----------------------------------------------------------------------------- */
1276
+
1277
+ #ifdef __cplusplus
1278
+ extern "C" {
1279
+ #endif
1280
+
1281
+ SWIGINTERN VALUE
1282
+ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1283
+ if (NIL_P(target)) {
1284
+ target = o;
1285
+ } else {
1286
+ if (TYPE(target) != T_ARRAY) {
1287
+ VALUE o2 = target;
1288
+ target = rb_ary_new();
1289
+ rb_ary_push(target, o2);
1290
+ }
1291
+ rb_ary_push(target, o);
1292
+ }
1293
+ return target;
1294
+ }
1295
+
1296
+ /* For ruby1.8.4 and earlier. */
1297
+ #ifndef RUBY_INIT_STACK
1298
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1299
+ # define RUBY_INIT_STACK \
1300
+ VALUE variable_in_this_stack_frame; \
1301
+ Init_stack(&variable_in_this_stack_frame);
1302
+ #endif
1303
+
1304
+
1305
+ #ifdef __cplusplus
1306
+ }
1307
+ #endif
1308
+
1309
+
1310
+ /* -----------------------------------------------------------------------------
1311
+ * See the LICENSE file for information on copyright, usage and redistribution
1312
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1313
+ *
1314
+ * rubyrun.swg
1315
+ *
1316
+ * This file contains the runtime support for Ruby modules
1317
+ * and includes code for managing global variables and pointer
1318
+ * type checking.
1319
+ * ----------------------------------------------------------------------------- */
1320
+
1321
+ /* For backward compatibility only */
1322
+ #define SWIG_POINTER_EXCEPTION 0
1323
+
1324
+ /* for raw pointers */
1325
+ #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1326
+ #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1327
+ #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Ruby_NewPointerObj(ptr, type, flags)
1328
+ #define SWIG_AcquirePtr(ptr, own) SWIG_Ruby_AcquirePtr(ptr, own)
1329
+ #define swig_owntype ruby_owntype
1330
+
1331
+ /* for raw packed data */
1332
+ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
1333
+ #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1334
+
1335
+ /* for class or struct pointers */
1336
+ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags)
1337
+ #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags)
1338
+
1339
+ /* for C or C++ function pointers */
1340
+ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_ConvertPtr(obj, pptr, type, 0)
1341
+ #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_NewPointerObj(ptr, type, 0)
1342
+
1343
+ /* for C++ member pointers, ie, member methods */
1344
+ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
1345
+ #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Ruby_NewPackedObj(ptr, sz, type)
1346
+
1347
+
1348
+ /* Runtime API */
1349
+
1350
+ #define SWIG_GetModule(clientdata) SWIG_Ruby_GetModule()
1351
+ #define SWIG_SetModule(clientdata, pointer) SWIG_Ruby_SetModule(pointer)
1352
+
1353
+
1354
+ /* Error manipulation */
1355
+
1356
+ #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1357
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1358
+ #define SWIG_fail goto fail
1359
+
1360
+
1361
+ /* Ruby-specific SWIG API */
1362
+
1363
+ #define SWIG_InitRuntime() SWIG_Ruby_InitRuntime()
1364
+ #define SWIG_define_class(ty) SWIG_Ruby_define_class(ty)
1365
+ #define SWIG_NewClassInstance(value, ty) SWIG_Ruby_NewClassInstance(value, ty)
1366
+ #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1367
+ #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1368
+
1369
+ #include "assert.h"
1370
+
1371
+ /* -----------------------------------------------------------------------------
1372
+ * pointers/data manipulation
1373
+ * ----------------------------------------------------------------------------- */
1374
+
1375
+ #ifdef __cplusplus
1376
+ extern "C" {
1377
+ #endif
1378
+
1379
+ typedef struct {
1380
+ VALUE klass;
1381
+ VALUE mImpl;
1382
+ void (*mark)(void *);
1383
+ void (*destroy)(void *);
1384
+ int trackObjects;
1385
+ } swig_class;
1386
+
1387
+
1388
+ /* Global pointer used to keep some internal SWIG stuff */
1389
+ static VALUE _cSWIG_Pointer = Qnil;
1390
+ static VALUE swig_runtime_data_type_pointer = Qnil;
1391
+
1392
+ /* Global IDs used to keep some internal SWIG stuff */
1393
+ static ID swig_arity_id = 0;
1394
+ static ID swig_call_id = 0;
1395
+
1396
+ /*
1397
+ If your swig extension is to be run within an embedded ruby and has
1398
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1399
+ This will reset ruby's stack frame on each entry point from the main
1400
+ program the first time a virtual director function is invoked (in a
1401
+ non-recursive way).
1402
+ If this is not done, you run the risk of Ruby trashing the stack.
1403
+ */
1404
+
1405
+ #ifdef RUBY_EMBEDDED
1406
+
1407
+ # define SWIG_INIT_STACK \
1408
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1409
+ ++swig_virtual_calls;
1410
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1411
+ # define Ruby_DirectorTypeMismatchException(x) \
1412
+ rb_raise( rb_eTypeError, x ); return c_result;
1413
+
1414
+ static unsigned int swig_virtual_calls = 0;
1415
+
1416
+ #else /* normal non-embedded extension */
1417
+
1418
+ # define SWIG_INIT_STACK
1419
+ # define SWIG_RELEASE_STACK
1420
+ # define Ruby_DirectorTypeMismatchException(x) \
1421
+ throw Swig::DirectorTypeMismatchException( x );
1422
+
1423
+ #endif /* RUBY_EMBEDDED */
1424
+
1425
+
1426
+ SWIGRUNTIME VALUE
1427
+ getExceptionClass(void) {
1428
+ static int init = 0;
1429
+ static VALUE rubyExceptionClass ;
1430
+ if (!init) {
1431
+ init = 1;
1432
+ rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
1433
+ }
1434
+ return rubyExceptionClass;
1435
+ }
1436
+
1437
+ /* This code checks to see if the Ruby object being raised as part
1438
+ of an exception inherits from the Ruby class Exception. If so,
1439
+ the object is simply returned. If not, then a new Ruby exception
1440
+ object is created and that will be returned to Ruby.*/
1441
+ SWIGRUNTIME VALUE
1442
+ SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
1443
+ VALUE exceptionClass = getExceptionClass();
1444
+ if (rb_obj_is_kind_of(obj, exceptionClass)) {
1445
+ return obj;
1446
+ } else {
1447
+ return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
1448
+ }
1449
+ }
1450
+
1451
+ /* Initialize Ruby runtime support */
1452
+ SWIGRUNTIME void
1453
+ SWIG_Ruby_InitRuntime(void)
1454
+ {
1455
+ if (_mSWIG == Qnil) {
1456
+ _mSWIG = rb_define_module("SWIG");
1457
+ swig_call_id = rb_intern("call");
1458
+ swig_arity_id = rb_intern("arity");
1459
+ }
1460
+ }
1461
+
1462
+ /* Define Ruby class for C type */
1463
+ SWIGRUNTIME void
1464
+ SWIG_Ruby_define_class(swig_type_info *type)
1465
+ {
1466
+ VALUE klass;
1467
+ char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1468
+ sprintf(klass_name, "TYPE%s", type->name);
1469
+ if (NIL_P(_cSWIG_Pointer)) {
1470
+ _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
1471
+ rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
1472
+ }
1473
+ klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
1474
+ free((void *) klass_name);
1475
+ }
1476
+
1477
+ /* Create a new pointer object */
1478
+ SWIGRUNTIME VALUE
1479
+ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1480
+ {
1481
+ int own = flags & SWIG_POINTER_OWN;
1482
+ int track;
1483
+ char *klass_name;
1484
+ swig_class *sklass;
1485
+ VALUE klass;
1486
+ VALUE obj;
1487
+
1488
+ if (!ptr)
1489
+ return Qnil;
1490
+
1491
+ if (type->clientdata) {
1492
+ sklass = (swig_class *) type->clientdata;
1493
+
1494
+ /* Are we tracking this class and have we already returned this Ruby object? */
1495
+ track = sklass->trackObjects;
1496
+ if (track) {
1497
+ obj = SWIG_RubyInstanceFor(ptr);
1498
+
1499
+ /* Check the object's type and make sure it has the correct type.
1500
+ It might not in cases where methods do things like
1501
+ downcast methods. */
1502
+ if (obj != Qnil) {
1503
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1504
+ char* type_name = RSTRING_PTR(value);
1505
+
1506
+ if (strcmp(type->name, type_name) == 0) {
1507
+ return obj;
1508
+ }
1509
+ }
1510
+ }
1511
+
1512
+ /* Create a new Ruby object */
1513
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1514
+ ( own ? VOIDFUNC(sklass->destroy) :
1515
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1516
+ ), ptr);
1517
+
1518
+ /* If tracking is on for this class then track this object. */
1519
+ if (track) {
1520
+ SWIG_RubyAddTracking(ptr, obj);
1521
+ }
1522
+ } else {
1523
+ klass_name = (char *) malloc(4 + strlen(type->name) + 1);
1524
+ sprintf(klass_name, "TYPE%s", type->name);
1525
+ klass = rb_const_get(_mSWIG, rb_intern(klass_name));
1526
+ free((void *) klass_name);
1527
+ obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1528
+ }
1529
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1530
+
1531
+ return obj;
1532
+ }
1533
+
1534
+ /* Create a new class instance (always owned) */
1535
+ SWIGRUNTIME VALUE
1536
+ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1537
+ {
1538
+ VALUE obj;
1539
+ swig_class *sklass = (swig_class *) type->clientdata;
1540
+ obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1541
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1542
+ return obj;
1543
+ }
1544
+
1545
+ /* Get type mangle from class name */
1546
+ SWIGRUNTIMEINLINE char *
1547
+ SWIG_Ruby_MangleStr(VALUE obj)
1548
+ {
1549
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1550
+ return StringValuePtr(stype);
1551
+ }
1552
+
1553
+ /* Acquire a pointer value */
1554
+ typedef void (*ruby_owntype)(void*);
1555
+
1556
+ SWIGRUNTIME ruby_owntype
1557
+ SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
1558
+ if (obj) {
1559
+ ruby_owntype oldown = RDATA(obj)->dfree;
1560
+ RDATA(obj)->dfree = own;
1561
+ return oldown;
1562
+ } else {
1563
+ return 0;
1564
+ }
1565
+ }
1566
+
1567
+ /* Convert a pointer value */
1568
+ SWIGRUNTIME int
1569
+ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
1570
+ {
1571
+ char *c;
1572
+ swig_cast_info *tc;
1573
+ void *vptr = 0;
1574
+
1575
+ /* Grab the pointer */
1576
+ if (NIL_P(obj)) {
1577
+ *ptr = 0;
1578
+ return SWIG_OK;
1579
+ } else {
1580
+ if (TYPE(obj) != T_DATA) {
1581
+ return SWIG_ERROR;
1582
+ }
1583
+ Data_Get_Struct(obj, void, vptr);
1584
+ }
1585
+
1586
+ if (own) *own = RDATA(obj)->dfree;
1587
+
1588
+ /* Check to see if the input object is giving up ownership
1589
+ of the underlying C struct or C++ object. If so then we
1590
+ need to reset the destructor since the Ruby object no
1591
+ longer owns the underlying C++ object.*/
1592
+ if (flags & SWIG_POINTER_DISOWN) {
1593
+ /* Is tracking on for this class? */
1594
+ int track = 0;
1595
+ if (ty && ty->clientdata) {
1596
+ swig_class *sklass = (swig_class *) ty->clientdata;
1597
+ track = sklass->trackObjects;
1598
+ }
1599
+
1600
+ if (track) {
1601
+ /* We are tracking objects for this class. Thus we change the destructor
1602
+ * to SWIG_RubyRemoveTracking. This allows us to
1603
+ * remove the mapping from the C++ to Ruby object
1604
+ * when the Ruby object is garbage collected. If we don't
1605
+ * do this, then it is possible we will return a reference
1606
+ * to a Ruby object that no longer exists thereby crashing Ruby. */
1607
+ RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
1608
+ } else {
1609
+ RDATA(obj)->dfree = 0;
1610
+ }
1611
+ }
1612
+
1613
+ /* Do type-checking if type info was provided */
1614
+ if (ty) {
1615
+ if (ty->clientdata) {
1616
+ if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
1617
+ if (vptr == 0) {
1618
+ /* The object has already been deleted */
1619
+ return SWIG_ObjectPreviouslyDeletedError;
1620
+ }
1621
+ *ptr = vptr;
1622
+ return SWIG_OK;
1623
+ }
1624
+ }
1625
+ if ((c = SWIG_MangleStr(obj)) == NULL) {
1626
+ return SWIG_ERROR;
1627
+ }
1628
+ tc = SWIG_TypeCheck(c, ty);
1629
+ if (!tc) {
1630
+ return SWIG_ERROR;
1631
+ } else {
1632
+ int newmemory = 0;
1633
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1634
+ assert(!newmemory); /* newmemory handling not yet implemented */
1635
+ }
1636
+ } else {
1637
+ *ptr = vptr;
1638
+ }
1639
+
1640
+ return SWIG_OK;
1641
+ }
1642
+
1643
+ /* Check convert */
1644
+ SWIGRUNTIMEINLINE int
1645
+ SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
1646
+ {
1647
+ char *c = SWIG_MangleStr(obj);
1648
+ if (!c) return 0;
1649
+ return SWIG_TypeCheck(c,ty) != 0;
1650
+ }
1651
+
1652
+ SWIGRUNTIME VALUE
1653
+ SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
1654
+ char result[1024];
1655
+ char *r = result;
1656
+ if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
1657
+ *(r++) = '_';
1658
+ r = SWIG_PackData(r, ptr, sz);
1659
+ strcpy(r, type->name);
1660
+ return rb_str_new2(result);
1661
+ }
1662
+
1663
+ /* Convert a packed value value */
1664
+ SWIGRUNTIME int
1665
+ SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
1666
+ swig_cast_info *tc;
1667
+ const char *c;
1668
+
1669
+ if (TYPE(obj) != T_STRING) goto type_error;
1670
+ c = StringValuePtr(obj);
1671
+ /* Pointer values must start with leading underscore */
1672
+ if (*c != '_') goto type_error;
1673
+ c++;
1674
+ c = SWIG_UnpackData(c, ptr, sz);
1675
+ if (ty) {
1676
+ tc = SWIG_TypeCheck(c, ty);
1677
+ if (!tc) goto type_error;
1678
+ }
1679
+ return SWIG_OK;
1680
+
1681
+ type_error:
1682
+ return SWIG_ERROR;
1683
+ }
1684
+
1685
+ SWIGRUNTIME swig_module_info *
1686
+ SWIG_Ruby_GetModule(void)
1687
+ {
1688
+ VALUE pointer;
1689
+ swig_module_info *ret = 0;
1690
+ VALUE verbose = rb_gv_get("VERBOSE");
1691
+
1692
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
1693
+ rb_gv_set("VERBOSE", Qfalse);
1694
+
1695
+ /* first check if pointer already created */
1696
+ pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
1697
+ if (pointer != Qnil) {
1698
+ Data_Get_Struct(pointer, swig_module_info, ret);
1699
+ }
1700
+
1701
+ /* reinstate warnings */
1702
+ rb_gv_set("VERBOSE", verbose);
1703
+ return ret;
1704
+ }
1705
+
1706
+ SWIGRUNTIME void
1707
+ SWIG_Ruby_SetModule(swig_module_info *pointer)
1708
+ {
1709
+ /* register a new class */
1710
+ VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
1711
+ /* create and store the structure pointer to a global variable */
1712
+ swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
1713
+ rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1714
+ }
1715
+
1716
+ /* This function can be used to check whether a proc or method or similarly
1717
+ callable function has been passed. Usually used in a %typecheck, like:
1718
+
1719
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1720
+ $result = SWIG_Ruby_isCallable( $input );
1721
+ }
1722
+ */
1723
+ SWIGINTERN
1724
+ int SWIG_Ruby_isCallable( VALUE proc )
1725
+ {
1726
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1727
+ return 1;
1728
+ return 0;
1729
+ }
1730
+
1731
+ /* This function can be used to check the arity (number of arguments)
1732
+ a proc or method can take. Usually used in a %typecheck.
1733
+ Valid arities will be that equal to minimal or those < 0
1734
+ which indicate a variable number of parameters at the end.
1735
+ */
1736
+ SWIGINTERN
1737
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1738
+ {
1739
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1740
+ {
1741
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1742
+ int arity = NUM2INT(num);
1743
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1744
+ if ( arity == minimal ) return 1;
1745
+ return 1;
1746
+ }
1747
+ return 0;
1748
+ }
1749
+
1750
+
1751
+ #ifdef __cplusplus
1752
+ }
1753
+ #endif
1754
+
1755
+
1756
+
1757
+ #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
1758
+
1759
+ #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
1760
+
1761
+
1762
+
1763
+ /* -------- TYPES TABLE (BEGIN) -------- */
1764
+
1765
+ #define SWIGTYPE_p_char swig_types[0]
1766
+ #define SWIGTYPE_p_gn_connection swig_types[1]
1767
+ #define SWIGTYPE_p_gn_message swig_types[2]
1768
+ #define SWIGTYPE_p_gn_statemachine swig_types[3]
1769
+ #define SWIGTYPE_p_p_gn_data swig_types[4]
1770
+ #define SWIGTYPE_p_p_gn_statemachine swig_types[5]
1771
+ static swig_type_info *swig_types[7];
1772
+ static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0};
1773
+ #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
1774
+ #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
1775
+
1776
+ /* -------- TYPES TABLE (END) -------- */
1777
+
1778
+ #define SWIG_init Init_sms
1779
+ #define SWIG_name "Sms"
1780
+
1781
+ static VALUE mSms;
1782
+
1783
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1784
+ #define SWIG_RUBY_THREAD_END_BLOCK
1785
+
1786
+
1787
+ #define SWIGVERSION 0x010336
1788
+ #define SWIG_VERSION SWIGVERSION
1789
+
1790
+
1791
+ #define SWIG_as_voidptr(a) (void *)((const void *)(a))
1792
+ #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
1793
+
1794
+
1795
+ /* Put header files here or function declarations like below */
1796
+ #include "smsr.h"
1797
+
1798
+
1799
+ #include <limits.h>
1800
+ #if !defined(SWIG_NO_LLONG_MAX)
1801
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1802
+ # define LLONG_MAX __LONG_LONG_MAX__
1803
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1804
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1805
+ # endif
1806
+ #endif
1807
+
1808
+
1809
+ #define SWIG_From_long LONG2NUM
1810
+
1811
+
1812
+ SWIGINTERNINLINE VALUE
1813
+ SWIG_From_int (int value)
1814
+ {
1815
+ return SWIG_From_long (value);
1816
+ }
1817
+
1818
+
1819
+ SWIGINTERN VALUE
1820
+ SWIG_ruby_failed(void)
1821
+ {
1822
+ return Qnil;
1823
+ }
1824
+
1825
+
1826
+ /*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
1827
+ SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1828
+ {
1829
+ VALUE obj = args[0];
1830
+ VALUE type = TYPE(obj);
1831
+ long *res = (long *)(args[1]);
1832
+ *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
1833
+ return obj;
1834
+ }
1835
+ /*@SWIG@*/
1836
+
1837
+ SWIGINTERN int
1838
+ SWIG_AsVal_long (VALUE obj, long* val)
1839
+ {
1840
+ VALUE type = TYPE(obj);
1841
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1842
+ long v;
1843
+ VALUE a[2];
1844
+ a[0] = obj;
1845
+ a[1] = (VALUE)(&v);
1846
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1847
+ if (val) *val = v;
1848
+ return SWIG_OK;
1849
+ }
1850
+ }
1851
+ return SWIG_TypeError;
1852
+ }
1853
+
1854
+
1855
+ SWIGINTERN int
1856
+ SWIG_AsVal_int (VALUE obj, int *val)
1857
+ {
1858
+ long v;
1859
+ int res = SWIG_AsVal_long (obj, &v);
1860
+ if (SWIG_IsOK(res)) {
1861
+ if ((v < INT_MIN || v > INT_MAX)) {
1862
+ return SWIG_OverflowError;
1863
+ } else {
1864
+ if (val) *val = (int)(v);
1865
+ }
1866
+ }
1867
+ return res;
1868
+ }
1869
+
1870
+
1871
+ SWIGINTERN swig_type_info*
1872
+ SWIG_pchar_descriptor(void)
1873
+ {
1874
+ static int init = 0;
1875
+ static swig_type_info* info = 0;
1876
+ if (!init) {
1877
+ info = SWIG_TypeQuery("_p_char");
1878
+ init = 1;
1879
+ }
1880
+ return info;
1881
+ }
1882
+
1883
+
1884
+ SWIGINTERN int
1885
+ SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1886
+ {
1887
+ if (TYPE(obj) == T_STRING) {
1888
+ #if defined(StringValuePtr)
1889
+ char *cstr = StringValuePtr(obj);
1890
+ #else
1891
+ char *cstr = STR2CSTR(obj);
1892
+ #endif
1893
+ size_t size = RSTRING_LEN(obj) + 1;
1894
+ if (cptr) {
1895
+ if (alloc) {
1896
+ if (*alloc == SWIG_NEWOBJ) {
1897
+ *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
1898
+ } else {
1899
+ *cptr = cstr;
1900
+ *alloc = SWIG_OLDOBJ;
1901
+ }
1902
+ }
1903
+ }
1904
+ if (psize) *psize = size;
1905
+ return SWIG_OK;
1906
+ } else {
1907
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1908
+ if (pchar_descriptor) {
1909
+ void* vptr = 0;
1910
+ if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
1911
+ if (cptr) *cptr = (char *)vptr;
1912
+ if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
1913
+ if (alloc) *alloc = SWIG_OLDOBJ;
1914
+ return SWIG_OK;
1915
+ }
1916
+ }
1917
+ }
1918
+ return SWIG_TypeError;
1919
+ }
1920
+
1921
+
1922
+
1923
+
1924
+
1925
+ SWIGINTERNINLINE VALUE
1926
+ SWIG_FromCharPtrAndSize(const char* carray, size_t size)
1927
+ {
1928
+ if (carray) {
1929
+ if (size > LONG_MAX) {
1930
+ swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
1931
+ return pchar_descriptor ?
1932
+ SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : Qnil;
1933
+ } else {
1934
+ return rb_str_new(carray, (long)(size));
1935
+ }
1936
+ } else {
1937
+ return Qnil;
1938
+ }
1939
+ }
1940
+
1941
+
1942
+ SWIGINTERNINLINE VALUE
1943
+ SWIG_FromCharPtr(const char *cptr)
1944
+ {
1945
+ return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
1946
+ }
1947
+
1948
+
1949
+ #define SWIG_From_double rb_float_new
1950
+
1951
+
1952
+ SWIGINTERNINLINE VALUE
1953
+ SWIG_From_float (float value)
1954
+ {
1955
+ return SWIG_From_double (value);
1956
+ }
1957
+
1958
+
1959
+ /*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
1960
+ SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
1961
+ {
1962
+ VALUE obj = args[0];
1963
+ VALUE type = TYPE(obj);
1964
+ unsigned long *res = (unsigned long *)(args[1]);
1965
+ *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
1966
+ return obj;
1967
+ }
1968
+ /*@SWIG@*/
1969
+
1970
+ SWIGINTERN int
1971
+ SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val)
1972
+ {
1973
+ VALUE type = TYPE(obj);
1974
+ if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
1975
+ unsigned long v;
1976
+ VALUE a[2];
1977
+ a[0] = obj;
1978
+ a[1] = (VALUE)(&v);
1979
+ if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
1980
+ if (val) *val = v;
1981
+ return SWIG_OK;
1982
+ }
1983
+ }
1984
+ return SWIG_TypeError;
1985
+ }
1986
+
1987
+
1988
+ SWIGINTERNINLINE int
1989
+ SWIG_AsVal_size_t (VALUE obj, size_t *val)
1990
+ {
1991
+ unsigned long v;
1992
+ int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
1993
+ if (SWIG_IsOK(res) && val) *val = (size_t)(v);
1994
+ return res;
1995
+ }
1996
+
1997
+ swig_class cGn_connection;
1998
+
1999
+ SWIGINTERN VALUE
2000
+ _wrap_gn_connection_activeconnect_set(int argc, VALUE *argv, VALUE self) {
2001
+ gn_connection *arg1 = (gn_connection *) 0 ;
2002
+ int arg2 ;
2003
+ void *argp1 = 0 ;
2004
+ int res1 = 0 ;
2005
+ int val2 ;
2006
+ int ecode2 = 0 ;
2007
+
2008
+ if ((argc < 1) || (argc > 1)) {
2009
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2010
+ }
2011
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_connection, 0 | 0 );
2012
+ if (!SWIG_IsOK(res1)) {
2013
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_connection *","activeconnect", 1, self ));
2014
+ }
2015
+ arg1 = (gn_connection *)(argp1);
2016
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2017
+ if (!SWIG_IsOK(ecode2)) {
2018
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","activeconnect", 2, argv[0] ));
2019
+ }
2020
+ arg2 = (int)(val2);
2021
+ if (arg1) (arg1)->activeconnect = arg2;
2022
+ return Qnil;
2023
+ fail:
2024
+ return Qnil;
2025
+ }
2026
+
2027
+
2028
+ SWIGINTERN VALUE
2029
+ _wrap_gn_connection_activeconnect_get(int argc, VALUE *argv, VALUE self) {
2030
+ gn_connection *arg1 = (gn_connection *) 0 ;
2031
+ void *argp1 = 0 ;
2032
+ int res1 = 0 ;
2033
+ int result;
2034
+ VALUE vresult = Qnil;
2035
+
2036
+ if ((argc < 0) || (argc > 0)) {
2037
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2038
+ }
2039
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_connection, 0 | 0 );
2040
+ if (!SWIG_IsOK(res1)) {
2041
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_connection *","activeconnect", 1, self ));
2042
+ }
2043
+ arg1 = (gn_connection *)(argp1);
2044
+ result = (int) ((arg1)->activeconnect);
2045
+ vresult = SWIG_From_int((int)(result));
2046
+ return vresult;
2047
+ fail:
2048
+ return Qnil;
2049
+ }
2050
+
2051
+
2052
+ SWIGINTERN VALUE
2053
+ _wrap_gn_connection_connections_set(int argc, VALUE *argv, VALUE self) {
2054
+ gn_connection *arg1 = (gn_connection *) 0 ;
2055
+ struct gn_statemachine **arg2 ;
2056
+ void *argp1 = 0 ;
2057
+ int res1 = 0 ;
2058
+ void *argp2 = 0 ;
2059
+ int res2 = 0 ;
2060
+
2061
+ if ((argc < 1) || (argc > 1)) {
2062
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2063
+ }
2064
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_connection, 0 | 0 );
2065
+ if (!SWIG_IsOK(res1)) {
2066
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_connection *","connections", 1, self ));
2067
+ }
2068
+ arg1 = (gn_connection *)(argp1);
2069
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_p_gn_statemachine, 0 | 0 );
2070
+ if (!SWIG_IsOK(res2)) {
2071
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "struct gn_statemachine *[500]","connections", 2, argv[0] ));
2072
+ }
2073
+ arg2 = (struct gn_statemachine **)(argp2);
2074
+ {
2075
+ if (arg2) {
2076
+ size_t ii = 0;
2077
+ for (; ii < (size_t)500; ++ii) arg1->connections[ii] = arg2[ii];
2078
+ } else {
2079
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""connections""' of type '""struct gn_statemachine *[500]""'");
2080
+ }
2081
+ }
2082
+ return Qnil;
2083
+ fail:
2084
+ return Qnil;
2085
+ }
2086
+
2087
+
2088
+ SWIGINTERN VALUE
2089
+ _wrap_gn_connection_connections_get(int argc, VALUE *argv, VALUE self) {
2090
+ gn_connection *arg1 = (gn_connection *) 0 ;
2091
+ void *argp1 = 0 ;
2092
+ int res1 = 0 ;
2093
+ struct gn_statemachine **result = 0 ;
2094
+ VALUE vresult = Qnil;
2095
+
2096
+ if ((argc < 0) || (argc > 0)) {
2097
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2098
+ }
2099
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_connection, 0 | 0 );
2100
+ if (!SWIG_IsOK(res1)) {
2101
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_connection *","connections", 1, self ));
2102
+ }
2103
+ arg1 = (gn_connection *)(argp1);
2104
+ result = (struct gn_statemachine **)(struct gn_statemachine **) ((arg1)->connections);
2105
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_gn_statemachine, 0 | 0 );
2106
+ return vresult;
2107
+ fail:
2108
+ return Qnil;
2109
+ }
2110
+
2111
+
2112
+ SWIGINTERN VALUE
2113
+ _wrap_gn_connection_datag_set(int argc, VALUE *argv, VALUE self) {
2114
+ gn_connection *arg1 = (gn_connection *) 0 ;
2115
+ gn_data **arg2 ;
2116
+ void *argp1 = 0 ;
2117
+ int res1 = 0 ;
2118
+ void *argp2 = 0 ;
2119
+ int res2 = 0 ;
2120
+
2121
+ if ((argc < 1) || (argc > 1)) {
2122
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2123
+ }
2124
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_connection, 0 | 0 );
2125
+ if (!SWIG_IsOK(res1)) {
2126
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_connection *","datag", 1, self ));
2127
+ }
2128
+ arg1 = (gn_connection *)(argp1);
2129
+ res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_p_gn_data, 0 | 0 );
2130
+ if (!SWIG_IsOK(res2)) {
2131
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "gn_data *[500]","datag", 2, argv[0] ));
2132
+ }
2133
+ arg2 = (gn_data **)(argp2);
2134
+ {
2135
+ if (arg2) {
2136
+ size_t ii = 0;
2137
+ for (; ii < (size_t)500; ++ii) arg1->datag[ii] = arg2[ii];
2138
+ } else {
2139
+ SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in variable '""datag""' of type '""gn_data *[500]""'");
2140
+ }
2141
+ }
2142
+ return Qnil;
2143
+ fail:
2144
+ return Qnil;
2145
+ }
2146
+
2147
+
2148
+ SWIGINTERN VALUE
2149
+ _wrap_gn_connection_datag_get(int argc, VALUE *argv, VALUE self) {
2150
+ gn_connection *arg1 = (gn_connection *) 0 ;
2151
+ void *argp1 = 0 ;
2152
+ int res1 = 0 ;
2153
+ gn_data **result = 0 ;
2154
+ VALUE vresult = Qnil;
2155
+
2156
+ if ((argc < 0) || (argc > 0)) {
2157
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2158
+ }
2159
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_connection, 0 | 0 );
2160
+ if (!SWIG_IsOK(res1)) {
2161
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_connection *","datag", 1, self ));
2162
+ }
2163
+ arg1 = (gn_connection *)(argp1);
2164
+ result = (gn_data **)(gn_data **) ((arg1)->datag);
2165
+ vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_gn_data, 0 | 0 );
2166
+ return vresult;
2167
+ fail:
2168
+ return Qnil;
2169
+ }
2170
+
2171
+
2172
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2173
+ SWIGINTERN VALUE
2174
+ _wrap_gn_connection_allocate(VALUE self) {
2175
+ #else
2176
+ SWIGINTERN VALUE
2177
+ _wrap_gn_connection_allocate(int argc, VALUE *argv, VALUE self) {
2178
+ #endif
2179
+
2180
+
2181
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_gn_connection);
2182
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2183
+ rb_obj_call_init(vresult, argc, argv);
2184
+ #endif
2185
+ return vresult;
2186
+ }
2187
+
2188
+
2189
+ SWIGINTERN VALUE
2190
+ _wrap_new_gn_connection(int argc, VALUE *argv, VALUE self) {
2191
+ gn_connection *result = 0 ;
2192
+
2193
+ if ((argc < 0) || (argc > 0)) {
2194
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2195
+ }
2196
+ result = (gn_connection *)calloc(1, sizeof(gn_connection));
2197
+ DATA_PTR(self) = result;
2198
+ return self;
2199
+ fail:
2200
+ return Qnil;
2201
+ }
2202
+
2203
+
2204
+ SWIGINTERN void
2205
+ free_gn_connection(gn_connection *arg1) {
2206
+ free((char *) arg1);
2207
+ }
2208
+
2209
+ swig_class cGn_message;
2210
+
2211
+ SWIGINTERN VALUE
2212
+ _wrap_gn_message_error_set(int argc, VALUE *argv, VALUE self) {
2213
+ gn_message *arg1 = (gn_message *) 0 ;
2214
+ int arg2 ;
2215
+ void *argp1 = 0 ;
2216
+ int res1 = 0 ;
2217
+ int val2 ;
2218
+ int ecode2 = 0 ;
2219
+
2220
+ if ((argc < 1) || (argc > 1)) {
2221
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2222
+ }
2223
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2224
+ if (!SWIG_IsOK(res1)) {
2225
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","error", 1, self ));
2226
+ }
2227
+ arg1 = (gn_message *)(argp1);
2228
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2229
+ if (!SWIG_IsOK(ecode2)) {
2230
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","error", 2, argv[0] ));
2231
+ }
2232
+ arg2 = (int)(val2);
2233
+ if (arg1) (arg1)->error = arg2;
2234
+ return Qnil;
2235
+ fail:
2236
+ return Qnil;
2237
+ }
2238
+
2239
+
2240
+ SWIGINTERN VALUE
2241
+ _wrap_gn_message_error_get(int argc, VALUE *argv, VALUE self) {
2242
+ gn_message *arg1 = (gn_message *) 0 ;
2243
+ void *argp1 = 0 ;
2244
+ int res1 = 0 ;
2245
+ int result;
2246
+ VALUE vresult = Qnil;
2247
+
2248
+ if ((argc < 0) || (argc > 0)) {
2249
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2250
+ }
2251
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2252
+ if (!SWIG_IsOK(res1)) {
2253
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","error", 1, self ));
2254
+ }
2255
+ arg1 = (gn_message *)(argp1);
2256
+ result = (int) ((arg1)->error);
2257
+ vresult = SWIG_From_int((int)(result));
2258
+ return vresult;
2259
+ fail:
2260
+ return Qnil;
2261
+ }
2262
+
2263
+
2264
+ SWIGINTERN VALUE
2265
+ _wrap_gn_message_index_set(int argc, VALUE *argv, VALUE self) {
2266
+ gn_message *arg1 = (gn_message *) 0 ;
2267
+ int arg2 ;
2268
+ void *argp1 = 0 ;
2269
+ int res1 = 0 ;
2270
+ int val2 ;
2271
+ int ecode2 = 0 ;
2272
+
2273
+ if ((argc < 1) || (argc > 1)) {
2274
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2275
+ }
2276
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2277
+ if (!SWIG_IsOK(res1)) {
2278
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","index", 1, self ));
2279
+ }
2280
+ arg1 = (gn_message *)(argp1);
2281
+ ecode2 = SWIG_AsVal_int(argv[0], &val2);
2282
+ if (!SWIG_IsOK(ecode2)) {
2283
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","index", 2, argv[0] ));
2284
+ }
2285
+ arg2 = (int)(val2);
2286
+ if (arg1) (arg1)->index = arg2;
2287
+ return Qnil;
2288
+ fail:
2289
+ return Qnil;
2290
+ }
2291
+
2292
+
2293
+ SWIGINTERN VALUE
2294
+ _wrap_gn_message_index_get(int argc, VALUE *argv, VALUE self) {
2295
+ gn_message *arg1 = (gn_message *) 0 ;
2296
+ void *argp1 = 0 ;
2297
+ int res1 = 0 ;
2298
+ int result;
2299
+ VALUE vresult = Qnil;
2300
+
2301
+ if ((argc < 0) || (argc > 0)) {
2302
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2303
+ }
2304
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2305
+ if (!SWIG_IsOK(res1)) {
2306
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","index", 1, self ));
2307
+ }
2308
+ arg1 = (gn_message *)(argp1);
2309
+ result = (int) ((arg1)->index);
2310
+ vresult = SWIG_From_int((int)(result));
2311
+ return vresult;
2312
+ fail:
2313
+ return Qnil;
2314
+ }
2315
+
2316
+
2317
+ SWIGINTERN VALUE
2318
+ _wrap_gn_message_date_set(int argc, VALUE *argv, VALUE self) {
2319
+ gn_message *arg1 = (gn_message *) 0 ;
2320
+ char *arg2 = (char *) 0 ;
2321
+ void *argp1 = 0 ;
2322
+ int res1 = 0 ;
2323
+ int res2 ;
2324
+ char *buf2 = 0 ;
2325
+ int alloc2 = 0 ;
2326
+
2327
+ if ((argc < 1) || (argc > 1)) {
2328
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2329
+ }
2330
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2331
+ if (!SWIG_IsOK(res1)) {
2332
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","date", 1, self ));
2333
+ }
2334
+ arg1 = (gn_message *)(argp1);
2335
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2336
+ if (!SWIG_IsOK(res2)) {
2337
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","date", 2, argv[0] ));
2338
+ }
2339
+ arg2 = (char *)(buf2);
2340
+ if (arg1->date) free((char*)arg1->date);
2341
+ if (arg2) {
2342
+ size_t size = strlen((const char *)(arg2)) + 1;
2343
+ arg1->date = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
2344
+ } else {
2345
+ arg1->date = 0;
2346
+ }
2347
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2348
+ return Qnil;
2349
+ fail:
2350
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2351
+ return Qnil;
2352
+ }
2353
+
2354
+
2355
+ SWIGINTERN VALUE
2356
+ _wrap_gn_message_date_get(int argc, VALUE *argv, VALUE self) {
2357
+ gn_message *arg1 = (gn_message *) 0 ;
2358
+ void *argp1 = 0 ;
2359
+ int res1 = 0 ;
2360
+ char *result = 0 ;
2361
+ VALUE vresult = Qnil;
2362
+
2363
+ if ((argc < 0) || (argc > 0)) {
2364
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2365
+ }
2366
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2367
+ if (!SWIG_IsOK(res1)) {
2368
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","date", 1, self ));
2369
+ }
2370
+ arg1 = (gn_message *)(argp1);
2371
+ result = (char *) ((arg1)->date);
2372
+ vresult = SWIG_FromCharPtr((const char *)result);
2373
+ return vresult;
2374
+ fail:
2375
+ return Qnil;
2376
+ }
2377
+
2378
+
2379
+ SWIGINTERN VALUE
2380
+ _wrap_gn_message_status_set(int argc, VALUE *argv, VALUE self) {
2381
+ gn_message *arg1 = (gn_message *) 0 ;
2382
+ char *arg2 = (char *) 0 ;
2383
+ void *argp1 = 0 ;
2384
+ int res1 = 0 ;
2385
+ int res2 ;
2386
+ char *buf2 = 0 ;
2387
+ int alloc2 = 0 ;
2388
+
2389
+ if ((argc < 1) || (argc > 1)) {
2390
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2391
+ }
2392
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2393
+ if (!SWIG_IsOK(res1)) {
2394
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","status", 1, self ));
2395
+ }
2396
+ arg1 = (gn_message *)(argp1);
2397
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2398
+ if (!SWIG_IsOK(res2)) {
2399
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","status", 2, argv[0] ));
2400
+ }
2401
+ arg2 = (char *)(buf2);
2402
+ if (arg1->status) free((char*)arg1->status);
2403
+ if (arg2) {
2404
+ size_t size = strlen((const char *)(arg2)) + 1;
2405
+ arg1->status = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
2406
+ } else {
2407
+ arg1->status = 0;
2408
+ }
2409
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2410
+ return Qnil;
2411
+ fail:
2412
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2413
+ return Qnil;
2414
+ }
2415
+
2416
+
2417
+ SWIGINTERN VALUE
2418
+ _wrap_gn_message_status_get(int argc, VALUE *argv, VALUE self) {
2419
+ gn_message *arg1 = (gn_message *) 0 ;
2420
+ void *argp1 = 0 ;
2421
+ int res1 = 0 ;
2422
+ char *result = 0 ;
2423
+ VALUE vresult = Qnil;
2424
+
2425
+ if ((argc < 0) || (argc > 0)) {
2426
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2427
+ }
2428
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2429
+ if (!SWIG_IsOK(res1)) {
2430
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","status", 1, self ));
2431
+ }
2432
+ arg1 = (gn_message *)(argp1);
2433
+ result = (char *) ((arg1)->status);
2434
+ vresult = SWIG_FromCharPtr((const char *)result);
2435
+ return vresult;
2436
+ fail:
2437
+ return Qnil;
2438
+ }
2439
+
2440
+
2441
+ SWIGINTERN VALUE
2442
+ _wrap_gn_message_source_number_set(int argc, VALUE *argv, VALUE self) {
2443
+ gn_message *arg1 = (gn_message *) 0 ;
2444
+ char *arg2 = (char *) 0 ;
2445
+ void *argp1 = 0 ;
2446
+ int res1 = 0 ;
2447
+ int res2 ;
2448
+ char *buf2 = 0 ;
2449
+ int alloc2 = 0 ;
2450
+
2451
+ if ((argc < 1) || (argc > 1)) {
2452
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2453
+ }
2454
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2455
+ if (!SWIG_IsOK(res1)) {
2456
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","source_number", 1, self ));
2457
+ }
2458
+ arg1 = (gn_message *)(argp1);
2459
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2460
+ if (!SWIG_IsOK(res2)) {
2461
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","source_number", 2, argv[0] ));
2462
+ }
2463
+ arg2 = (char *)(buf2);
2464
+ if (arg1->source_number) free((char*)arg1->source_number);
2465
+ if (arg2) {
2466
+ size_t size = strlen((const char *)(arg2)) + 1;
2467
+ arg1->source_number = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
2468
+ } else {
2469
+ arg1->source_number = 0;
2470
+ }
2471
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2472
+ return Qnil;
2473
+ fail:
2474
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2475
+ return Qnil;
2476
+ }
2477
+
2478
+
2479
+ SWIGINTERN VALUE
2480
+ _wrap_gn_message_source_number_get(int argc, VALUE *argv, VALUE self) {
2481
+ gn_message *arg1 = (gn_message *) 0 ;
2482
+ void *argp1 = 0 ;
2483
+ int res1 = 0 ;
2484
+ char *result = 0 ;
2485
+ VALUE vresult = Qnil;
2486
+
2487
+ if ((argc < 0) || (argc > 0)) {
2488
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2489
+ }
2490
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2491
+ if (!SWIG_IsOK(res1)) {
2492
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","source_number", 1, self ));
2493
+ }
2494
+ arg1 = (gn_message *)(argp1);
2495
+ result = (char *) ((arg1)->source_number);
2496
+ vresult = SWIG_FromCharPtr((const char *)result);
2497
+ return vresult;
2498
+ fail:
2499
+ return Qnil;
2500
+ }
2501
+
2502
+
2503
+ SWIGINTERN VALUE
2504
+ _wrap_gn_message_text_set(int argc, VALUE *argv, VALUE self) {
2505
+ gn_message *arg1 = (gn_message *) 0 ;
2506
+ char *arg2 = (char *) 0 ;
2507
+ void *argp1 = 0 ;
2508
+ int res1 = 0 ;
2509
+ int res2 ;
2510
+ char *buf2 = 0 ;
2511
+ int alloc2 = 0 ;
2512
+
2513
+ if ((argc < 1) || (argc > 1)) {
2514
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2515
+ }
2516
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2517
+ if (!SWIG_IsOK(res1)) {
2518
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","text", 1, self ));
2519
+ }
2520
+ arg1 = (gn_message *)(argp1);
2521
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2522
+ if (!SWIG_IsOK(res2)) {
2523
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","text", 2, argv[0] ));
2524
+ }
2525
+ arg2 = (char *)(buf2);
2526
+ if (arg1->text) free((char*)arg1->text);
2527
+ if (arg2) {
2528
+ size_t size = strlen((const char *)(arg2)) + 1;
2529
+ arg1->text = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
2530
+ } else {
2531
+ arg1->text = 0;
2532
+ }
2533
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2534
+ return Qnil;
2535
+ fail:
2536
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2537
+ return Qnil;
2538
+ }
2539
+
2540
+
2541
+ SWIGINTERN VALUE
2542
+ _wrap_gn_message_text_get(int argc, VALUE *argv, VALUE self) {
2543
+ gn_message *arg1 = (gn_message *) 0 ;
2544
+ void *argp1 = 0 ;
2545
+ int res1 = 0 ;
2546
+ char *result = 0 ;
2547
+ VALUE vresult = Qnil;
2548
+
2549
+ if ((argc < 0) || (argc > 0)) {
2550
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2551
+ }
2552
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2553
+ if (!SWIG_IsOK(res1)) {
2554
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","text", 1, self ));
2555
+ }
2556
+ arg1 = (gn_message *)(argp1);
2557
+ result = (char *) ((arg1)->text);
2558
+ vresult = SWIG_FromCharPtr((const char *)result);
2559
+ return vresult;
2560
+ fail:
2561
+ return Qnil;
2562
+ }
2563
+
2564
+
2565
+ SWIGINTERN VALUE
2566
+ _wrap_gn_message_type_sms_set(int argc, VALUE *argv, VALUE self) {
2567
+ gn_message *arg1 = (gn_message *) 0 ;
2568
+ char *arg2 = (char *) 0 ;
2569
+ void *argp1 = 0 ;
2570
+ int res1 = 0 ;
2571
+ int res2 ;
2572
+ char *buf2 = 0 ;
2573
+ int alloc2 = 0 ;
2574
+
2575
+ if ((argc < 1) || (argc > 1)) {
2576
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2577
+ }
2578
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2579
+ if (!SWIG_IsOK(res1)) {
2580
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","type_sms", 1, self ));
2581
+ }
2582
+ arg1 = (gn_message *)(argp1);
2583
+ res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
2584
+ if (!SWIG_IsOK(res2)) {
2585
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","type_sms", 2, argv[0] ));
2586
+ }
2587
+ arg2 = (char *)(buf2);
2588
+ if (arg1->type_sms) free((char*)arg1->type_sms);
2589
+ if (arg2) {
2590
+ size_t size = strlen((const char *)(arg2)) + 1;
2591
+ arg1->type_sms = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
2592
+ } else {
2593
+ arg1->type_sms = 0;
2594
+ }
2595
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2596
+ return Qnil;
2597
+ fail:
2598
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2599
+ return Qnil;
2600
+ }
2601
+
2602
+
2603
+ SWIGINTERN VALUE
2604
+ _wrap_gn_message_type_sms_get(int argc, VALUE *argv, VALUE self) {
2605
+ gn_message *arg1 = (gn_message *) 0 ;
2606
+ void *argp1 = 0 ;
2607
+ int res1 = 0 ;
2608
+ char *result = 0 ;
2609
+ VALUE vresult = Qnil;
2610
+
2611
+ if ((argc < 0) || (argc > 0)) {
2612
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2613
+ }
2614
+ res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_gn_message, 0 | 0 );
2615
+ if (!SWIG_IsOK(res1)) {
2616
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_message *","type_sms", 1, self ));
2617
+ }
2618
+ arg1 = (gn_message *)(argp1);
2619
+ result = (char *) ((arg1)->type_sms);
2620
+ vresult = SWIG_FromCharPtr((const char *)result);
2621
+ return vresult;
2622
+ fail:
2623
+ return Qnil;
2624
+ }
2625
+
2626
+
2627
+ #ifdef HAVE_RB_DEFINE_ALLOC_FUNC
2628
+ SWIGINTERN VALUE
2629
+ _wrap_gn_message_allocate(VALUE self) {
2630
+ #else
2631
+ SWIGINTERN VALUE
2632
+ _wrap_gn_message_allocate(int argc, VALUE *argv, VALUE self) {
2633
+ #endif
2634
+
2635
+
2636
+ VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_gn_message);
2637
+ #ifndef HAVE_RB_DEFINE_ALLOC_FUNC
2638
+ rb_obj_call_init(vresult, argc, argv);
2639
+ #endif
2640
+ return vresult;
2641
+ }
2642
+
2643
+
2644
+ SWIGINTERN VALUE
2645
+ _wrap_new_gn_message(int argc, VALUE *argv, VALUE self) {
2646
+ gn_message *result = 0 ;
2647
+
2648
+ if ((argc < 0) || (argc > 0)) {
2649
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
2650
+ }
2651
+ result = (gn_message *)calloc(1, sizeof(gn_message));
2652
+ DATA_PTR(self) = result;
2653
+ return self;
2654
+ fail:
2655
+ return Qnil;
2656
+ }
2657
+
2658
+
2659
+ SWIGINTERN void
2660
+ free_gn_message(gn_message *arg1) {
2661
+ free((char *) arg1);
2662
+ }
2663
+
2664
+ SWIGINTERN VALUE
2665
+ _wrap_busterminate(int argc, VALUE *argv, VALUE self) {
2666
+ int arg1 ;
2667
+ int val1 ;
2668
+ int ecode1 = 0 ;
2669
+
2670
+ if ((argc < 1) || (argc > 1)) {
2671
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2672
+ }
2673
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2674
+ if (!SWIG_IsOK(ecode1)) {
2675
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","busterminate", 1, argv[0] ));
2676
+ }
2677
+ arg1 = (int)(val1);
2678
+ busterminate(arg1);
2679
+ return Qnil;
2680
+ fail:
2681
+ return Qnil;
2682
+ }
2683
+
2684
+
2685
+ SWIGINTERN VALUE
2686
+ _wrap_businit(int argc, VALUE *argv, VALUE self) {
2687
+ char *arg1 = (char *) 0 ;
2688
+ char *arg2 = (char *) 0 ;
2689
+ int res1 ;
2690
+ char *buf1 = 0 ;
2691
+ int alloc1 = 0 ;
2692
+ int res2 ;
2693
+ char *buf2 = 0 ;
2694
+ int alloc2 = 0 ;
2695
+ int result;
2696
+ VALUE vresult = Qnil;
2697
+
2698
+ if ((argc < 2) || (argc > 2)) {
2699
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2700
+ }
2701
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2702
+ if (!SWIG_IsOK(res1)) {
2703
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char *","businit", 1, argv[0] ));
2704
+ }
2705
+ arg1 = (char *)(buf1);
2706
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
2707
+ if (!SWIG_IsOK(res2)) {
2708
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","businit", 2, argv[1] ));
2709
+ }
2710
+ arg2 = (char *)(buf2);
2711
+ result = (int)businit(arg1,arg2);
2712
+ vresult = SWIG_From_int((int)(result));
2713
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2714
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2715
+ return vresult;
2716
+ fail:
2717
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2718
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2719
+ return Qnil;
2720
+ }
2721
+
2722
+
2723
+ SWIGINTERN VALUE
2724
+ _wrap_send_sms(int argc, VALUE *argv, VALUE self) {
2725
+ char *arg1 = (char *) 0 ;
2726
+ char *arg2 = (char *) 0 ;
2727
+ char *arg3 = (char *) 0 ;
2728
+ int arg4 ;
2729
+ char *arg5 = (char *) 0 ;
2730
+ int arg6 ;
2731
+ int res1 ;
2732
+ char *buf1 = 0 ;
2733
+ int alloc1 = 0 ;
2734
+ int res2 ;
2735
+ char *buf2 = 0 ;
2736
+ int alloc2 = 0 ;
2737
+ int res3 ;
2738
+ char *buf3 = 0 ;
2739
+ int alloc3 = 0 ;
2740
+ int val4 ;
2741
+ int ecode4 = 0 ;
2742
+ int res5 ;
2743
+ char *buf5 = 0 ;
2744
+ int alloc5 = 0 ;
2745
+ int val6 ;
2746
+ int ecode6 = 0 ;
2747
+ int result;
2748
+ VALUE vresult = Qnil;
2749
+
2750
+ if ((argc < 6) || (argc > 6)) {
2751
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
2752
+ }
2753
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2754
+ if (!SWIG_IsOK(res1)) {
2755
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char *","send_sms", 1, argv[0] ));
2756
+ }
2757
+ arg1 = (char *)(buf1);
2758
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
2759
+ if (!SWIG_IsOK(res2)) {
2760
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","send_sms", 2, argv[1] ));
2761
+ }
2762
+ arg2 = (char *)(buf2);
2763
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
2764
+ if (!SWIG_IsOK(res3)) {
2765
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","send_sms", 3, argv[2] ));
2766
+ }
2767
+ arg3 = (char *)(buf3);
2768
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
2769
+ if (!SWIG_IsOK(ecode4)) {
2770
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","send_sms", 4, argv[3] ));
2771
+ }
2772
+ arg4 = (int)(val4);
2773
+ res5 = SWIG_AsCharPtrAndSize(argv[4], &buf5, NULL, &alloc5);
2774
+ if (!SWIG_IsOK(res5)) {
2775
+ SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char *","send_sms", 5, argv[4] ));
2776
+ }
2777
+ arg5 = (char *)(buf5);
2778
+ ecode6 = SWIG_AsVal_int(argv[5], &val6);
2779
+ if (!SWIG_IsOK(ecode6)) {
2780
+ SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "int","send_sms", 6, argv[5] ));
2781
+ }
2782
+ arg6 = (int)(val6);
2783
+ result = (int)send_sms(arg1,arg2,arg3,arg4,arg5,arg6);
2784
+ vresult = SWIG_From_int((int)(result));
2785
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2786
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2787
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2788
+ if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
2789
+ return vresult;
2790
+ fail:
2791
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2792
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2793
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2794
+ if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
2795
+ return Qnil;
2796
+ }
2797
+
2798
+
2799
+ SWIGINTERN VALUE
2800
+ _wrap_send_smsi(int argc, VALUE *argv, VALUE self) {
2801
+ char *arg1 = (char *) 0 ;
2802
+ char *arg2 = (char *) 0 ;
2803
+ char *arg3 = (char *) 0 ;
2804
+ int arg4 ;
2805
+ char *arg5 = (char *) 0 ;
2806
+ struct gn_statemachine *arg6 = (struct gn_statemachine *) 0 ;
2807
+ int res1 ;
2808
+ char *buf1 = 0 ;
2809
+ int alloc1 = 0 ;
2810
+ int res2 ;
2811
+ char *buf2 = 0 ;
2812
+ int alloc2 = 0 ;
2813
+ int res3 ;
2814
+ char *buf3 = 0 ;
2815
+ int alloc3 = 0 ;
2816
+ int val4 ;
2817
+ int ecode4 = 0 ;
2818
+ int res5 ;
2819
+ char *buf5 = 0 ;
2820
+ int alloc5 = 0 ;
2821
+ void *argp6 = 0 ;
2822
+ int res6 = 0 ;
2823
+ int result;
2824
+ VALUE vresult = Qnil;
2825
+
2826
+ if ((argc < 6) || (argc > 6)) {
2827
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
2828
+ }
2829
+ res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2830
+ if (!SWIG_IsOK(res1)) {
2831
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char *","send_smsi", 1, argv[0] ));
2832
+ }
2833
+ arg1 = (char *)(buf1);
2834
+ res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
2835
+ if (!SWIG_IsOK(res2)) {
2836
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","send_smsi", 2, argv[1] ));
2837
+ }
2838
+ arg2 = (char *)(buf2);
2839
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
2840
+ if (!SWIG_IsOK(res3)) {
2841
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","send_smsi", 3, argv[2] ));
2842
+ }
2843
+ arg3 = (char *)(buf3);
2844
+ ecode4 = SWIG_AsVal_int(argv[3], &val4);
2845
+ if (!SWIG_IsOK(ecode4)) {
2846
+ SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","send_smsi", 4, argv[3] ));
2847
+ }
2848
+ arg4 = (int)(val4);
2849
+ res5 = SWIG_AsCharPtrAndSize(argv[4], &buf5, NULL, &alloc5);
2850
+ if (!SWIG_IsOK(res5)) {
2851
+ SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char *","send_smsi", 5, argv[4] ));
2852
+ }
2853
+ arg5 = (char *)(buf5);
2854
+ res6 = SWIG_ConvertPtr(argv[5], &argp6,SWIGTYPE_p_gn_statemachine, 0 | 0 );
2855
+ if (!SWIG_IsOK(res6)) {
2856
+ SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "struct gn_statemachine *","send_smsi", 6, argv[5] ));
2857
+ }
2858
+ arg6 = (struct gn_statemachine *)(argp6);
2859
+ result = (int)send_smsi(arg1,arg2,arg3,arg4,arg5,arg6);
2860
+ vresult = SWIG_From_int((int)(result));
2861
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2862
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2863
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2864
+ if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
2865
+ return vresult;
2866
+ fail:
2867
+ if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
2868
+ if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
2869
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
2870
+ if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
2871
+ return Qnil;
2872
+ }
2873
+
2874
+
2875
+ SWIGINTERN VALUE
2876
+ _wrap_get_msj(int argc, VALUE *argv, VALUE self) {
2877
+ int arg1 ;
2878
+ int arg2 ;
2879
+ int val1 ;
2880
+ int ecode1 = 0 ;
2881
+ int val2 ;
2882
+ int ecode2 = 0 ;
2883
+ gn_message result;
2884
+ VALUE vresult = Qnil;
2885
+
2886
+ if ((argc < 2) || (argc > 2)) {
2887
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2888
+ }
2889
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2890
+ if (!SWIG_IsOK(ecode1)) {
2891
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","get_msj", 1, argv[0] ));
2892
+ }
2893
+ arg1 = (int)(val1);
2894
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2895
+ if (!SWIG_IsOK(ecode2)) {
2896
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","get_msj", 2, argv[1] ));
2897
+ }
2898
+ arg2 = (int)(val2);
2899
+ result = get_msj(arg1,arg2);
2900
+ vresult = SWIG_NewPointerObj((gn_message *)memcpy((gn_message *)malloc(sizeof(gn_message)),&result,sizeof(gn_message)), SWIGTYPE_p_gn_message, SWIG_POINTER_OWN | 0 );
2901
+ return vresult;
2902
+ fail:
2903
+ return Qnil;
2904
+ }
2905
+
2906
+
2907
+ SWIGINTERN VALUE
2908
+ _wrap_get_msji(int argc, VALUE *argv, VALUE self) {
2909
+ int arg1 ;
2910
+ gn_connection *arg2 = (gn_connection *) 0 ;
2911
+ int arg3 ;
2912
+ int val1 ;
2913
+ int ecode1 = 0 ;
2914
+ void *argp2 = 0 ;
2915
+ int res2 = 0 ;
2916
+ int val3 ;
2917
+ int ecode3 = 0 ;
2918
+ gn_message result;
2919
+ VALUE vresult = Qnil;
2920
+
2921
+ if ((argc < 3) || (argc > 3)) {
2922
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
2923
+ }
2924
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2925
+ if (!SWIG_IsOK(ecode1)) {
2926
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","get_msji", 1, argv[0] ));
2927
+ }
2928
+ arg1 = (int)(val1);
2929
+ res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_gn_connection, 0 | 0 );
2930
+ if (!SWIG_IsOK(res2)) {
2931
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "gn_connection *","get_msji", 2, argv[1] ));
2932
+ }
2933
+ arg2 = (gn_connection *)(argp2);
2934
+ ecode3 = SWIG_AsVal_int(argv[2], &val3);
2935
+ if (!SWIG_IsOK(ecode3)) {
2936
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","get_msji", 3, argv[2] ));
2937
+ }
2938
+ arg3 = (int)(val3);
2939
+ result = get_msji(arg1,arg2,arg3);
2940
+ vresult = SWIG_NewPointerObj((gn_message *)memcpy((gn_message *)malloc(sizeof(gn_message)),&result,sizeof(gn_message)), SWIGTYPE_p_gn_message, SWIG_POINTER_OWN | 0 );
2941
+ return vresult;
2942
+ fail:
2943
+ return Qnil;
2944
+ }
2945
+
2946
+
2947
+ SWIGINTERN VALUE
2948
+ _wrap_get_sms(int argc, VALUE *argv, VALUE self) {
2949
+ int arg1 ;
2950
+ int val1 ;
2951
+ int ecode1 = 0 ;
2952
+ int result;
2953
+ VALUE vresult = Qnil;
2954
+
2955
+ if ((argc < 1) || (argc > 1)) {
2956
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
2957
+ }
2958
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
2959
+ if (!SWIG_IsOK(ecode1)) {
2960
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","get_sms", 1, argv[0] ));
2961
+ }
2962
+ arg1 = (int)(val1);
2963
+ result = (int)get_sms(arg1);
2964
+ vresult = SWIG_From_int((int)(result));
2965
+ return vresult;
2966
+ fail:
2967
+ return Qnil;
2968
+ }
2969
+
2970
+
2971
+ SWIGINTERN VALUE
2972
+ _wrap_get_smsi(int argc, VALUE *argv, VALUE self) {
2973
+ gn_connection *arg1 = (gn_connection *) 0 ;
2974
+ int arg2 ;
2975
+ void *argp1 = 0 ;
2976
+ int res1 = 0 ;
2977
+ int val2 ;
2978
+ int ecode2 = 0 ;
2979
+ int result;
2980
+ VALUE vresult = Qnil;
2981
+
2982
+ if ((argc < 2) || (argc > 2)) {
2983
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
2984
+ }
2985
+ res1 = SWIG_ConvertPtr(argv[0], &argp1,SWIGTYPE_p_gn_connection, 0 | 0 );
2986
+ if (!SWIG_IsOK(res1)) {
2987
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "gn_connection *","get_smsi", 1, argv[0] ));
2988
+ }
2989
+ arg1 = (gn_connection *)(argp1);
2990
+ ecode2 = SWIG_AsVal_int(argv[1], &val2);
2991
+ if (!SWIG_IsOK(ecode2)) {
2992
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","get_smsi", 2, argv[1] ));
2993
+ }
2994
+ arg2 = (int)(val2);
2995
+ result = (int)get_smsi(arg1,arg2);
2996
+ vresult = SWIG_From_int((int)(result));
2997
+ return vresult;
2998
+ fail:
2999
+ return Qnil;
3000
+ }
3001
+
3002
+
3003
+ SWIGINTERN VALUE
3004
+ _wrap_rf_level(int argc, VALUE *argv, VALUE self) {
3005
+ int arg1 ;
3006
+ int val1 ;
3007
+ int ecode1 = 0 ;
3008
+ float result;
3009
+ VALUE vresult = Qnil;
3010
+
3011
+ if ((argc < 1) || (argc > 1)) {
3012
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3013
+ }
3014
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3015
+ if (!SWIG_IsOK(ecode1)) {
3016
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","rf_level", 1, argv[0] ));
3017
+ }
3018
+ arg1 = (int)(val1);
3019
+ result = (float)rf_level(arg1);
3020
+ vresult = SWIG_From_float((float)(result));
3021
+ return vresult;
3022
+ fail:
3023
+ return Qnil;
3024
+ }
3025
+
3026
+
3027
+ SWIGINTERN VALUE
3028
+ _wrap_bat_level(int argc, VALUE *argv, VALUE self) {
3029
+ int arg1 ;
3030
+ int val1 ;
3031
+ int ecode1 = 0 ;
3032
+ float result;
3033
+ VALUE vresult = Qnil;
3034
+
3035
+ if ((argc < 1) || (argc > 1)) {
3036
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3037
+ }
3038
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3039
+ if (!SWIG_IsOK(ecode1)) {
3040
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","bat_level", 1, argv[0] ));
3041
+ }
3042
+ arg1 = (int)(val1);
3043
+ result = (float)bat_level(arg1);
3044
+ vresult = SWIG_From_float((float)(result));
3045
+ return vresult;
3046
+ fail:
3047
+ return Qnil;
3048
+ }
3049
+
3050
+
3051
+ SWIGINTERN VALUE
3052
+ _wrap_substring(int argc, VALUE *argv, VALUE self) {
3053
+ size_t arg1 ;
3054
+ size_t arg2 ;
3055
+ char *arg3 = (char *) 0 ;
3056
+ char *arg4 = (char *) 0 ;
3057
+ size_t arg5 ;
3058
+ size_t val1 ;
3059
+ int ecode1 = 0 ;
3060
+ size_t val2 ;
3061
+ int ecode2 = 0 ;
3062
+ int res3 ;
3063
+ char *buf3 = 0 ;
3064
+ int alloc3 = 0 ;
3065
+ int res4 ;
3066
+ char *buf4 = 0 ;
3067
+ int alloc4 = 0 ;
3068
+ size_t val5 ;
3069
+ int ecode5 = 0 ;
3070
+ char *result = 0 ;
3071
+ VALUE vresult = Qnil;
3072
+
3073
+ if ((argc < 5) || (argc > 5)) {
3074
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
3075
+ }
3076
+ ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
3077
+ if (!SWIG_IsOK(ecode1)) {
3078
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "size_t","substring", 1, argv[0] ));
3079
+ }
3080
+ arg1 = (size_t)(val1);
3081
+ ecode2 = SWIG_AsVal_size_t(argv[1], &val2);
3082
+ if (!SWIG_IsOK(ecode2)) {
3083
+ SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","substring", 2, argv[1] ));
3084
+ }
3085
+ arg2 = (size_t)(val2);
3086
+ res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
3087
+ if (!SWIG_IsOK(res3)) {
3088
+ SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","substring", 3, argv[2] ));
3089
+ }
3090
+ arg3 = (char *)(buf3);
3091
+ res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
3092
+ if (!SWIG_IsOK(res4)) {
3093
+ SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char *","substring", 4, argv[3] ));
3094
+ }
3095
+ arg4 = (char *)(buf4);
3096
+ ecode5 = SWIG_AsVal_size_t(argv[4], &val5);
3097
+ if (!SWIG_IsOK(ecode5)) {
3098
+ SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "size_t","substring", 5, argv[4] ));
3099
+ }
3100
+ arg5 = (size_t)(val5);
3101
+ result = (char *)substring(arg1,arg2,(char const *)arg3,arg4,arg5);
3102
+ vresult = SWIG_FromCharPtr((const char *)result);
3103
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3104
+ if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3105
+ return vresult;
3106
+ fail:
3107
+ if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
3108
+ if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
3109
+ return Qnil;
3110
+ }
3111
+
3112
+
3113
+ SWIGINTERN VALUE
3114
+ _wrap_phoneModel(int argc, VALUE *argv, VALUE self) {
3115
+ int arg1 ;
3116
+ int val1 ;
3117
+ int ecode1 = 0 ;
3118
+ char *result = 0 ;
3119
+ VALUE vresult = Qnil;
3120
+
3121
+ if ((argc < 1) || (argc > 1)) {
3122
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3123
+ }
3124
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3125
+ if (!SWIG_IsOK(ecode1)) {
3126
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","phoneModel", 1, argv[0] ));
3127
+ }
3128
+ arg1 = (int)(val1);
3129
+ result = (char *)phoneModel(arg1);
3130
+ vresult = SWIG_FromCharPtr((const char *)result);
3131
+ return vresult;
3132
+ fail:
3133
+ return Qnil;
3134
+ }
3135
+
3136
+
3137
+ SWIGINTERN VALUE
3138
+ _wrap_phoneManufacter(int argc, VALUE *argv, VALUE self) {
3139
+ int arg1 ;
3140
+ int val1 ;
3141
+ int ecode1 = 0 ;
3142
+ char *result = 0 ;
3143
+ VALUE vresult = Qnil;
3144
+
3145
+ if ((argc < 1) || (argc > 1)) {
3146
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3147
+ }
3148
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3149
+ if (!SWIG_IsOK(ecode1)) {
3150
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","phoneManufacter", 1, argv[0] ));
3151
+ }
3152
+ arg1 = (int)(val1);
3153
+ result = (char *)phoneManufacter(arg1);
3154
+ vresult = SWIG_FromCharPtr((const char *)result);
3155
+ return vresult;
3156
+ fail:
3157
+ return Qnil;
3158
+ }
3159
+
3160
+
3161
+ SWIGINTERN VALUE
3162
+ _wrap_phoneRevSoft(int argc, VALUE *argv, VALUE self) {
3163
+ int arg1 ;
3164
+ int val1 ;
3165
+ int ecode1 = 0 ;
3166
+ char *result = 0 ;
3167
+ VALUE vresult = Qnil;
3168
+
3169
+ if ((argc < 1) || (argc > 1)) {
3170
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3171
+ }
3172
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3173
+ if (!SWIG_IsOK(ecode1)) {
3174
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","phoneRevSoft", 1, argv[0] ));
3175
+ }
3176
+ arg1 = (int)(val1);
3177
+ result = (char *)phoneRevSoft(arg1);
3178
+ vresult = SWIG_FromCharPtr((const char *)result);
3179
+ return vresult;
3180
+ fail:
3181
+ return Qnil;
3182
+ }
3183
+
3184
+
3185
+ SWIGINTERN VALUE
3186
+ _wrap_phoneImei(int argc, VALUE *argv, VALUE self) {
3187
+ int arg1 ;
3188
+ int val1 ;
3189
+ int ecode1 = 0 ;
3190
+ char *result = 0 ;
3191
+ VALUE vresult = Qnil;
3192
+
3193
+ if ((argc < 1) || (argc > 1)) {
3194
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3195
+ }
3196
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3197
+ if (!SWIG_IsOK(ecode1)) {
3198
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","phoneImei", 1, argv[0] ));
3199
+ }
3200
+ arg1 = (int)(val1);
3201
+ result = (char *)phoneImei(arg1);
3202
+ vresult = SWIG_FromCharPtr((const char *)result);
3203
+ return vresult;
3204
+ fail:
3205
+ return Qnil;
3206
+ }
3207
+
3208
+
3209
+ SWIGINTERN VALUE
3210
+ _wrap_testconn(int argc, VALUE *argv, VALUE self) {
3211
+ int arg1 ;
3212
+ int val1 ;
3213
+ int ecode1 = 0 ;
3214
+ int result;
3215
+ VALUE vresult = Qnil;
3216
+
3217
+ if ((argc < 1) || (argc > 1)) {
3218
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3219
+ }
3220
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3221
+ if (!SWIG_IsOK(ecode1)) {
3222
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","testconn", 1, argv[0] ));
3223
+ }
3224
+ arg1 = (int)(val1);
3225
+ result = (int)testconn(arg1);
3226
+ vresult = SWIG_From_int((int)(result));
3227
+ return vresult;
3228
+ fail:
3229
+ return Qnil;
3230
+ }
3231
+
3232
+
3233
+ SWIGINTERN VALUE
3234
+ _wrap_printError(int argc, VALUE *argv, VALUE self) {
3235
+ int arg1 ;
3236
+ int val1 ;
3237
+ int ecode1 = 0 ;
3238
+ char *result = 0 ;
3239
+ VALUE vresult = Qnil;
3240
+
3241
+ if ((argc < 1) || (argc > 1)) {
3242
+ rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
3243
+ }
3244
+ ecode1 = SWIG_AsVal_int(argv[0], &val1);
3245
+ if (!SWIG_IsOK(ecode1)) {
3246
+ SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","printError", 1, argv[0] ));
3247
+ }
3248
+ arg1 = (int)(val1);
3249
+ result = (char *)printError(arg1);
3250
+ vresult = SWIG_FromCharPtr((const char *)result);
3251
+ return vresult;
3252
+ fail:
3253
+ return Qnil;
3254
+ }
3255
+
3256
+
3257
+
3258
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
3259
+
3260
+ static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
3261
+ static swig_type_info _swigt__p_gn_connection = {"_p_gn_connection", "gn_connection *", 0, 0, (void*)0, 0};
3262
+ static swig_type_info _swigt__p_gn_message = {"_p_gn_message", "gn_message *", 0, 0, (void*)0, 0};
3263
+ static swig_type_info _swigt__p_gn_statemachine = {"_p_gn_statemachine", "struct gn_statemachine *", 0, 0, (void*)0, 0};
3264
+ static swig_type_info _swigt__p_p_gn_data = {"_p_p_gn_data", "gn_data **", 0, 0, (void*)0, 0};
3265
+ static swig_type_info _swigt__p_p_gn_statemachine = {"_p_p_gn_statemachine", "struct gn_statemachine **", 0, 0, (void*)0, 0};
3266
+
3267
+ static swig_type_info *swig_type_initial[] = {
3268
+ &_swigt__p_char,
3269
+ &_swigt__p_gn_connection,
3270
+ &_swigt__p_gn_message,
3271
+ &_swigt__p_gn_statemachine,
3272
+ &_swigt__p_p_gn_data,
3273
+ &_swigt__p_p_gn_statemachine,
3274
+ };
3275
+
3276
+ static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
3277
+ static swig_cast_info _swigc__p_gn_connection[] = { {&_swigt__p_gn_connection, 0, 0, 0},{0, 0, 0, 0}};
3278
+ static swig_cast_info _swigc__p_gn_message[] = { {&_swigt__p_gn_message, 0, 0, 0},{0, 0, 0, 0}};
3279
+ static swig_cast_info _swigc__p_gn_statemachine[] = { {&_swigt__p_gn_statemachine, 0, 0, 0},{0, 0, 0, 0}};
3280
+ static swig_cast_info _swigc__p_p_gn_data[] = { {&_swigt__p_p_gn_data, 0, 0, 0},{0, 0, 0, 0}};
3281
+ static swig_cast_info _swigc__p_p_gn_statemachine[] = { {&_swigt__p_p_gn_statemachine, 0, 0, 0},{0, 0, 0, 0}};
3282
+
3283
+ static swig_cast_info *swig_cast_initial[] = {
3284
+ _swigc__p_char,
3285
+ _swigc__p_gn_connection,
3286
+ _swigc__p_gn_message,
3287
+ _swigc__p_gn_statemachine,
3288
+ _swigc__p_p_gn_data,
3289
+ _swigc__p_p_gn_statemachine,
3290
+ };
3291
+
3292
+
3293
+ /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
3294
+
3295
+ /* -----------------------------------------------------------------------------
3296
+ * Type initialization:
3297
+ * This problem is tough by the requirement that no dynamic
3298
+ * memory is used. Also, since swig_type_info structures store pointers to
3299
+ * swig_cast_info structures and swig_cast_info structures store pointers back
3300
+ * to swig_type_info structures, we need some lookup code at initialization.
3301
+ * The idea is that swig generates all the structures that are needed.
3302
+ * The runtime then collects these partially filled structures.
3303
+ * The SWIG_InitializeModule function takes these initial arrays out of
3304
+ * swig_module, and does all the lookup, filling in the swig_module.types
3305
+ * array with the correct data and linking the correct swig_cast_info
3306
+ * structures together.
3307
+ *
3308
+ * The generated swig_type_info structures are assigned staticly to an initial
3309
+ * array. We just loop through that array, and handle each type individually.
3310
+ * First we lookup if this type has been already loaded, and if so, use the
3311
+ * loaded structure instead of the generated one. Then we have to fill in the
3312
+ * cast linked list. The cast data is initially stored in something like a
3313
+ * two-dimensional array. Each row corresponds to a type (there are the same
3314
+ * number of rows as there are in the swig_type_initial array). Each entry in
3315
+ * a column is one of the swig_cast_info structures for that type.
3316
+ * The cast_initial array is actually an array of arrays, because each row has
3317
+ * a variable number of columns. So to actually build the cast linked list,
3318
+ * we find the array of casts associated with the type, and loop through it
3319
+ * adding the casts to the list. The one last trick we need to do is making
3320
+ * sure the type pointer in the swig_cast_info struct is correct.
3321
+ *
3322
+ * First off, we lookup the cast->type name to see if it is already loaded.
3323
+ * There are three cases to handle:
3324
+ * 1) If the cast->type has already been loaded AND the type we are adding
3325
+ * casting info to has not been loaded (it is in this module), THEN we
3326
+ * replace the cast->type pointer with the type pointer that has already
3327
+ * been loaded.
3328
+ * 2) If BOTH types (the one we are adding casting info to, and the
3329
+ * cast->type) are loaded, THEN the cast info has already been loaded by
3330
+ * the previous module so we just ignore it.
3331
+ * 3) Finally, if cast->type has not already been loaded, then we add that
3332
+ * swig_cast_info to the linked list (because the cast->type) pointer will
3333
+ * be correct.
3334
+ * ----------------------------------------------------------------------------- */
3335
+
3336
+ #ifdef __cplusplus
3337
+ extern "C" {
3338
+ #if 0
3339
+ } /* c-mode */
3340
+ #endif
3341
+ #endif
3342
+
3343
+ #if 0
3344
+ #define SWIGRUNTIME_DEBUG
3345
+ #endif
3346
+
3347
+
3348
+ SWIGRUNTIME void
3349
+ SWIG_InitializeModule(void *clientdata) {
3350
+ size_t i;
3351
+ swig_module_info *module_head, *iter;
3352
+ int found, init;
3353
+
3354
+ clientdata = clientdata;
3355
+
3356
+ /* check to see if the circular list has been setup, if not, set it up */
3357
+ if (swig_module.next==0) {
3358
+ /* Initialize the swig_module */
3359
+ swig_module.type_initial = swig_type_initial;
3360
+ swig_module.cast_initial = swig_cast_initial;
3361
+ swig_module.next = &swig_module;
3362
+ init = 1;
3363
+ } else {
3364
+ init = 0;
3365
+ }
3366
+
3367
+ /* Try and load any already created modules */
3368
+ module_head = SWIG_GetModule(clientdata);
3369
+ if (!module_head) {
3370
+ /* This is the first module loaded for this interpreter */
3371
+ /* so set the swig module into the interpreter */
3372
+ SWIG_SetModule(clientdata, &swig_module);
3373
+ module_head = &swig_module;
3374
+ } else {
3375
+ /* the interpreter has loaded a SWIG module, but has it loaded this one? */
3376
+ found=0;
3377
+ iter=module_head;
3378
+ do {
3379
+ if (iter==&swig_module) {
3380
+ found=1;
3381
+ break;
3382
+ }
3383
+ iter=iter->next;
3384
+ } while (iter!= module_head);
3385
+
3386
+ /* if the is found in the list, then all is done and we may leave */
3387
+ if (found) return;
3388
+ /* otherwise we must add out module into the list */
3389
+ swig_module.next = module_head->next;
3390
+ module_head->next = &swig_module;
3391
+ }
3392
+
3393
+ /* When multiple interpeters are used, a module could have already been initialized in
3394
+ a different interpreter, but not yet have a pointer in this interpreter.
3395
+ In this case, we do not want to continue adding types... everything should be
3396
+ set up already */
3397
+ if (init == 0) return;
3398
+
3399
+ /* Now work on filling in swig_module.types */
3400
+ #ifdef SWIGRUNTIME_DEBUG
3401
+ printf("SWIG_InitializeModule: size %d\n", swig_module.size);
3402
+ #endif
3403
+ for (i = 0; i < swig_module.size; ++i) {
3404
+ swig_type_info *type = 0;
3405
+ swig_type_info *ret;
3406
+ swig_cast_info *cast;
3407
+
3408
+ #ifdef SWIGRUNTIME_DEBUG
3409
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3410
+ #endif
3411
+
3412
+ /* if there is another module already loaded */
3413
+ if (swig_module.next != &swig_module) {
3414
+ type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
3415
+ }
3416
+ if (type) {
3417
+ /* Overwrite clientdata field */
3418
+ #ifdef SWIGRUNTIME_DEBUG
3419
+ printf("SWIG_InitializeModule: found type %s\n", type->name);
3420
+ #endif
3421
+ if (swig_module.type_initial[i]->clientdata) {
3422
+ type->clientdata = swig_module.type_initial[i]->clientdata;
3423
+ #ifdef SWIGRUNTIME_DEBUG
3424
+ printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
3425
+ #endif
3426
+ }
3427
+ } else {
3428
+ type = swig_module.type_initial[i];
3429
+ }
3430
+
3431
+ /* Insert casting types */
3432
+ cast = swig_module.cast_initial[i];
3433
+ while (cast->type) {
3434
+
3435
+ /* Don't need to add information already in the list */
3436
+ ret = 0;
3437
+ #ifdef SWIGRUNTIME_DEBUG
3438
+ printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
3439
+ #endif
3440
+ if (swig_module.next != &swig_module) {
3441
+ ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
3442
+ #ifdef SWIGRUNTIME_DEBUG
3443
+ if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
3444
+ #endif
3445
+ }
3446
+ if (ret) {
3447
+ if (type == swig_module.type_initial[i]) {
3448
+ #ifdef SWIGRUNTIME_DEBUG
3449
+ printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
3450
+ #endif
3451
+ cast->type = ret;
3452
+ ret = 0;
3453
+ } else {
3454
+ /* Check for casting already in the list */
3455
+ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
3456
+ #ifdef SWIGRUNTIME_DEBUG
3457
+ if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
3458
+ #endif
3459
+ if (!ocast) ret = 0;
3460
+ }
3461
+ }
3462
+
3463
+ if (!ret) {
3464
+ #ifdef SWIGRUNTIME_DEBUG
3465
+ printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
3466
+ #endif
3467
+ if (type->cast) {
3468
+ type->cast->prev = cast;
3469
+ cast->next = type->cast;
3470
+ }
3471
+ type->cast = cast;
3472
+ }
3473
+ cast++;
3474
+ }
3475
+ /* Set entry in modules->types array equal to the type */
3476
+ swig_module.types[i] = type;
3477
+ }
3478
+ swig_module.types[i] = 0;
3479
+
3480
+ #ifdef SWIGRUNTIME_DEBUG
3481
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3482
+ for (i = 0; i < swig_module.size; ++i) {
3483
+ int j = 0;
3484
+ swig_cast_info *cast = swig_module.cast_initial[i];
3485
+ printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
3486
+ while (cast->type) {
3487
+ printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
3488
+ cast++;
3489
+ ++j;
3490
+ }
3491
+ printf("---- Total casts: %d\n",j);
3492
+ }
3493
+ printf("**** SWIG_InitializeModule: Cast List ******\n");
3494
+ #endif
3495
+ }
3496
+
3497
+ /* This function will propagate the clientdata field of type to
3498
+ * any new swig_type_info structures that have been added into the list
3499
+ * of equivalent types. It is like calling
3500
+ * SWIG_TypeClientData(type, clientdata) a second time.
3501
+ */
3502
+ SWIGRUNTIME void
3503
+ SWIG_PropagateClientData(void) {
3504
+ size_t i;
3505
+ swig_cast_info *equiv;
3506
+ static int init_run = 0;
3507
+
3508
+ if (init_run) return;
3509
+ init_run = 1;
3510
+
3511
+ for (i = 0; i < swig_module.size; i++) {
3512
+ if (swig_module.types[i]->clientdata) {
3513
+ equiv = swig_module.types[i]->cast;
3514
+ while (equiv) {
3515
+ if (!equiv->converter) {
3516
+ if (equiv->type && !equiv->type->clientdata)
3517
+ SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
3518
+ }
3519
+ equiv = equiv->next;
3520
+ }
3521
+ }
3522
+ }
3523
+ }
3524
+
3525
+ #ifdef __cplusplus
3526
+ #if 0
3527
+ { /* c-mode */
3528
+ #endif
3529
+ }
3530
+ #endif
3531
+
3532
+ /*
3533
+
3534
+ */
3535
+ #ifdef __cplusplus
3536
+ extern "C"
3537
+ #endif
3538
+ SWIGEXPORT void Init_sms(void) {
3539
+ size_t i;
3540
+
3541
+ SWIG_InitRuntime();
3542
+ mSms = rb_define_module("Sms");
3543
+
3544
+ SWIG_InitializeModule(0);
3545
+ for (i = 0; i < swig_module.size; i++) {
3546
+ SWIG_define_class(swig_module.types[i]);
3547
+ }
3548
+
3549
+ SWIG_RubyInitializeTrackings();
3550
+ rb_define_const(mSms, "CONNECTIONS_MAX_LENGTH", SWIG_From_int((int)(500)));
3551
+ rb_define_const(mSms, "MESSAGE_QTY_MAX", SWIG_From_int((int)(50)));
3552
+
3553
+ cGn_connection.klass = rb_define_class_under(mSms, "Gn_connection", rb_cObject);
3554
+ SWIG_TypeClientData(SWIGTYPE_p_gn_connection, (void *) &cGn_connection);
3555
+ rb_define_alloc_func(cGn_connection.klass, _wrap_gn_connection_allocate);
3556
+ rb_define_method(cGn_connection.klass, "initialize", _wrap_new_gn_connection, -1);
3557
+ rb_define_method(cGn_connection.klass, "activeconnect=", _wrap_gn_connection_activeconnect_set, -1);
3558
+ rb_define_method(cGn_connection.klass, "activeconnect", _wrap_gn_connection_activeconnect_get, -1);
3559
+ rb_define_method(cGn_connection.klass, "connections=", _wrap_gn_connection_connections_set, -1);
3560
+ rb_define_method(cGn_connection.klass, "connections", _wrap_gn_connection_connections_get, -1);
3561
+ rb_define_method(cGn_connection.klass, "datag=", _wrap_gn_connection_datag_set, -1);
3562
+ rb_define_method(cGn_connection.klass, "datag", _wrap_gn_connection_datag_get, -1);
3563
+ cGn_connection.mark = 0;
3564
+ cGn_connection.destroy = (void (*)(void *)) free_gn_connection;
3565
+ cGn_connection.trackObjects = 0;
3566
+
3567
+ cGn_message.klass = rb_define_class_under(mSms, "Gn_message", rb_cObject);
3568
+ SWIG_TypeClientData(SWIGTYPE_p_gn_message, (void *) &cGn_message);
3569
+ rb_define_alloc_func(cGn_message.klass, _wrap_gn_message_allocate);
3570
+ rb_define_method(cGn_message.klass, "initialize", _wrap_new_gn_message, -1);
3571
+ rb_define_method(cGn_message.klass, "error=", _wrap_gn_message_error_set, -1);
3572
+ rb_define_method(cGn_message.klass, "error", _wrap_gn_message_error_get, -1);
3573
+ rb_define_method(cGn_message.klass, "index=", _wrap_gn_message_index_set, -1);
3574
+ rb_define_method(cGn_message.klass, "index", _wrap_gn_message_index_get, -1);
3575
+ rb_define_method(cGn_message.klass, "date=", _wrap_gn_message_date_set, -1);
3576
+ rb_define_method(cGn_message.klass, "date", _wrap_gn_message_date_get, -1);
3577
+ rb_define_method(cGn_message.klass, "status=", _wrap_gn_message_status_set, -1);
3578
+ rb_define_method(cGn_message.klass, "status", _wrap_gn_message_status_get, -1);
3579
+ rb_define_method(cGn_message.klass, "source_number=", _wrap_gn_message_source_number_set, -1);
3580
+ rb_define_method(cGn_message.klass, "source_number", _wrap_gn_message_source_number_get, -1);
3581
+ rb_define_method(cGn_message.klass, "text=", _wrap_gn_message_text_set, -1);
3582
+ rb_define_method(cGn_message.klass, "text", _wrap_gn_message_text_get, -1);
3583
+ rb_define_method(cGn_message.klass, "type_sms=", _wrap_gn_message_type_sms_set, -1);
3584
+ rb_define_method(cGn_message.klass, "type_sms", _wrap_gn_message_type_sms_get, -1);
3585
+ cGn_message.mark = 0;
3586
+ cGn_message.destroy = (void (*)(void *)) free_gn_message;
3587
+ cGn_message.trackObjects = 0;
3588
+ rb_define_module_function(mSms, "busterminate", _wrap_busterminate, -1);
3589
+ rb_define_module_function(mSms, "businit", _wrap_businit, -1);
3590
+ rb_define_module_function(mSms, "send_sms", _wrap_send_sms, -1);
3591
+ rb_define_module_function(mSms, "send_smsi", _wrap_send_smsi, -1);
3592
+ rb_define_module_function(mSms, "get_msj", _wrap_get_msj, -1);
3593
+ rb_define_module_function(mSms, "get_msji", _wrap_get_msji, -1);
3594
+ rb_define_module_function(mSms, "get_sms", _wrap_get_sms, -1);
3595
+ rb_define_module_function(mSms, "get_smsi", _wrap_get_smsi, -1);
3596
+ rb_define_module_function(mSms, "rf_level", _wrap_rf_level, -1);
3597
+ rb_define_module_function(mSms, "bat_level", _wrap_bat_level, -1);
3598
+ rb_define_module_function(mSms, "substring", _wrap_substring, -1);
3599
+ rb_define_module_function(mSms, "phoneModel", _wrap_phoneModel, -1);
3600
+ rb_define_module_function(mSms, "phoneManufacter", _wrap_phoneManufacter, -1);
3601
+ rb_define_module_function(mSms, "phoneRevSoft", _wrap_phoneRevSoft, -1);
3602
+ rb_define_module_function(mSms, "phoneImei", _wrap_phoneImei, -1);
3603
+ rb_define_module_function(mSms, "testconn", _wrap_testconn, -1);
3604
+ rb_define_module_function(mSms, "printError", _wrap_printError, -1);
3605
+ }
3606
+