rhodes 3.1.0.beta.3 → 3.1.0.beta.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/Manifest.txt +4 -4
  2. data/platform/android/Rhodes/jni/include/rhodes/jni/com_rhomobile_rhodes_bluetooth_RhoBluetoothManager.h +9 -3
  3. data/platform/android/Rhodes/jni/src/bluetooth.cpp +63 -40
  4. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/IRhoBluetoothManager.java +2 -2
  5. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManager.java +13 -9
  6. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerNew.java +9 -9
  7. data/platform/android/Rhodes/src/com/rhomobile/rhodes/bluetooth/RhoBluetoothManagerOld.java +5 -5
  8. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/AnnotationsOverlay.java +8 -0
  9. data/platform/android/Rhodes/src/com/rhomobile/rhodes/mapview/GoogleMapView.java +38 -7
  10. data/platform/android/build/androidcommon.rb +0 -2
  11. data/platform/iphone/Classes/Bluetooth/Bluetooth.m +2 -2
  12. data/platform/shared/qt/rhodes/impl/BluetoothImpl.cpp +2 -2
  13. data/platform/shared/ruby/ext/bluetooth/bluetooth.i +2 -2
  14. data/platform/shared/ruby/ext/bluetooth/bluetooth_wrap.c +422 -144
  15. data/platform/wm/rhodes/bluetooth/Bluetooth.cpp +4 -4
  16. data/platform/wm/rhodes/bluetooth/Bluetooth.h +1 -1
  17. data/res/generators/templates/application/app/Settings/controller.rb +1 -0
  18. data/res/generators/templates/application/app/layout.erb +16 -4
  19. data/res/generators/templates/application/public/css/android.css +9 -0
  20. data/res/generators/templates/application/public/css/blackberry.css +9 -0
  21. data/res/generators/templates/application/public/css/iphone.css +55 -46
  22. data/res/generators/templates/application/public/css/jqmobile-patch.css +15 -2
  23. data/res/generators/templates/application/public/jqmobile/images/icons-18-black.png +0 -0
  24. data/res/generators/templates/application/public/jqmobile/images/icons-18-white.png +0 -0
  25. data/res/generators/templates/application/public/jqmobile/images/icons-36-black.png +0 -0
  26. data/res/generators/templates/application/public/jqmobile/images/icons-36-white.png +0 -0
  27. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0b1.css → jquery.mobile-1.0b2.css} +163 -184
  28. data/res/generators/templates/application/public/jqmobile/{jquery.mobile-1.0b1.js → jquery.mobile-1.0b2.js} +3405 -2772
  29. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b2.min.css +8 -0
  30. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b2.min.js +155 -0
  31. data/res/generators/templates/application/public/js/jqmobile-patch.js +58 -10
  32. data/rhodes.gemspec +1 -1
  33. metadata +10 -10
  34. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b1.min.css +0 -8
  35. data/res/generators/templates/application/public/jqmobile/jquery.mobile-1.0b1.min.js +0 -146
@@ -1,6 +1,6 @@
1
1
  /* ----------------------------------------------------------------------------
2
2
  * This file was automatically generated by SWIG (http://www.swig.org).
3
- * Version 1.3.31
3
+ * Version 2.0.1
4
4
  *
5
5
  * This file is not intended to be easily readable and contains a number of
6
6
  * coding conventions designed to improve portability and efficiency. Do not make
@@ -9,6 +9,7 @@
9
9
  * ----------------------------------------------------------------------------- */
10
10
 
11
11
  #define SWIGRUBY
12
+
12
13
  /* -----------------------------------------------------------------------------
13
14
  * This section contains generic SWIG labels for method/variable
14
15
  * declarations/attributes, and other compiler dependent labels.
@@ -16,14 +17,14 @@
16
17
 
17
18
  /* template workaround for compilers that cannot correctly implement the C++ standard */
18
19
  #ifndef SWIGTEMPLATEDISAMBIGUATOR
19
- # if defined(__SUNPRO_CC)
20
- # if (__SUNPRO_CC <= 0x560)
21
- # define SWIGTEMPLATEDISAMBIGUATOR template
22
- # else
23
- # define SWIGTEMPLATEDISAMBIGUATOR
24
- # endif
20
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
21
+ # define SWIGTEMPLATEDISAMBIGUATOR template
22
+ # elif defined(__HP_aCC)
23
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
24
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
25
+ # define SWIGTEMPLATEDISAMBIGUATOR template
25
26
  # else
26
- # define SWIGTEMPLATEDISAMBIGUATOR
27
+ # define SWIGTEMPLATEDISAMBIGUATOR
27
28
  # endif
28
29
  #endif
29
30
 
@@ -51,6 +52,12 @@
51
52
  # endif
52
53
  #endif
53
54
 
55
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
56
+ # if defined(_MSC_VER)
57
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
58
+ # endif
59
+ #endif
60
+
54
61
  #ifndef SWIGUNUSEDPARM
55
62
  # ifdef __cplusplus
56
63
  # define SWIGUNUSEDPARM(p)
@@ -106,6 +113,12 @@
106
113
  # define _CRT_SECURE_NO_DEPRECATE
107
114
  #endif
108
115
 
116
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
117
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
118
+ # define _SCL_SECURE_NO_DEPRECATE
119
+ #endif
120
+
121
+
109
122
  /* -----------------------------------------------------------------------------
110
123
  * This section contains generic SWIG labels for method/variable
111
124
  * declarations/attributes, and other compiler dependent labels.
@@ -113,14 +126,14 @@
113
126
 
114
127
  /* template workaround for compilers that cannot correctly implement the C++ standard */
115
128
  #ifndef SWIGTEMPLATEDISAMBIGUATOR
116
- # if defined(__SUNPRO_CC)
117
- # if (__SUNPRO_CC <= 0x560)
118
- # define SWIGTEMPLATEDISAMBIGUATOR template
119
- # else
120
- # define SWIGTEMPLATEDISAMBIGUATOR
121
- # endif
129
+ # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
130
+ # define SWIGTEMPLATEDISAMBIGUATOR template
131
+ # elif defined(__HP_aCC)
132
+ /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
133
+ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
134
+ # define SWIGTEMPLATEDISAMBIGUATOR template
122
135
  # else
123
- # define SWIGTEMPLATEDISAMBIGUATOR
136
+ # define SWIGTEMPLATEDISAMBIGUATOR
124
137
  # endif
125
138
  #endif
126
139
 
@@ -148,6 +161,12 @@
148
161
  # endif
149
162
  #endif
150
163
 
164
+ #ifndef SWIG_MSC_UNSUPPRESS_4505
165
+ # if defined(_MSC_VER)
166
+ # pragma warning(disable : 4505) /* unreferenced local function has been removed */
167
+ # endif
168
+ #endif
169
+
151
170
  #ifndef SWIGUNUSEDPARM
152
171
  # ifdef __cplusplus
153
172
  # define SWIGUNUSEDPARM(p)
@@ -203,16 +222,22 @@
203
222
  # define _CRT_SECURE_NO_DEPRECATE
204
223
  #endif
205
224
 
225
+ /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
226
+ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
227
+ # define _SCL_SECURE_NO_DEPRECATE
228
+ #endif
229
+
230
+
206
231
  /* -----------------------------------------------------------------------------
207
232
  * swigrun.swg
208
233
  *
209
- * This file contains generic CAPI SWIG runtime support for pointer
234
+ * This file contains generic C API SWIG runtime support for pointer
210
235
  * type checking.
211
236
  * ----------------------------------------------------------------------------- */
212
237
 
213
238
  /* This should only be incremented when either the layout of swig_type_info changes,
214
239
  or for whatever reason, the runtime changes incompatibly */
215
- #define SWIG_RUNTIME_VERSION "3"
240
+ #define SWIG_RUNTIME_VERSION "4"
216
241
 
217
242
  /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
218
243
  #ifdef SWIG_TYPE_TABLE
@@ -225,11 +250,11 @@
225
250
 
226
251
  /*
227
252
  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
228
- creating a static or dynamic library from the swig runtime code.
229
- In 99.9% of the cases, swig just needs to declare them as 'static'.
253
+ creating a static or dynamic library from the SWIG runtime code.
254
+ In 99.9% of the cases, SWIG just needs to declare them as 'static'.
230
255
 
231
- But only do this if is strictly necessary, ie, if you have problems
232
- with your compiler or so.
256
+ But only do this if strictly necessary, ie, if you have problems
257
+ with your compiler or suchlike.
233
258
  */
234
259
 
235
260
  #ifndef SWIGRUNTIME
@@ -247,6 +272,7 @@
247
272
 
248
273
  /* Flags for pointer conversions */
249
274
  #define SWIG_POINTER_DISOWN 0x1
275
+ #define SWIG_CAST_NEW_MEMORY 0x2
250
276
 
251
277
  /* Flags for new pointer objects */
252
278
  #define SWIG_POINTER_OWN 0x1
@@ -255,14 +281,14 @@
255
281
  /*
256
282
  Flags/methods for returning states.
257
283
 
258
- The swig conversion methods, as ConvertPtr, return and integer
284
+ The SWIG conversion methods, as ConvertPtr, return an integer
259
285
  that tells if the conversion was successful or not. And if not,
260
286
  an error code can be returned (see swigerrors.swg for the codes).
261
287
 
262
288
  Use the following macros/flags to set or process the returning
263
289
  states.
264
290
 
265
- In old swig versions, you usually write code as:
291
+ In old versions of SWIG, code such as the following was usually written:
266
292
 
267
293
  if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
268
294
  // success code
@@ -270,7 +296,7 @@
270
296
  //fail code
271
297
  }
272
298
 
273
- Now you can be more explicit as:
299
+ Now you can be more explicit:
274
300
 
275
301
  int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
276
302
  if (SWIG_IsOK(res)) {
@@ -279,7 +305,7 @@
279
305
  // fail code
280
306
  }
281
307
 
282
- that seems to be the same, but now you can also do
308
+ which is the same really, but now you can also do
283
309
 
284
310
  Type *ptr;
285
311
  int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
@@ -297,7 +323,7 @@
297
323
 
298
324
  I.e., now SWIG_ConvertPtr can return new objects and you can
299
325
  identify the case and take care of the deallocation. Of course that
300
- requires also to SWIG_ConvertPtr to return new result values, as
326
+ also requires SWIG_ConvertPtr to return new result values, such as
301
327
 
302
328
  int SWIG_ConvertPtr(obj, ptr,...) {
303
329
  if (<obj is ok>) {
@@ -315,7 +341,7 @@
315
341
 
316
342
  Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
317
343
  more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
318
- swig errors code.
344
+ SWIG errors code.
319
345
 
320
346
  Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
321
347
  allows to return the 'cast rank', for example, if you have this
@@ -329,9 +355,8 @@
329
355
  fooi(1) // cast rank '0'
330
356
 
331
357
  just use the SWIG_AddCast()/SWIG_CheckState()
358
+ */
332
359
 
333
-
334
- */
335
360
  #define SWIG_OK (0)
336
361
  #define SWIG_ERROR (-1)
337
362
  #define SWIG_IsOK(r) (r >= 0)
@@ -356,7 +381,6 @@
356
381
  #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
357
382
  #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
358
383
 
359
-
360
384
  /* Cast-Rank Mode */
361
385
  #if defined(SWIG_CASTRANK_MODE)
362
386
  # ifndef SWIG_TypeRank
@@ -379,18 +403,16 @@ SWIGINTERNINLINE int SWIG_CheckState(int r) {
379
403
  #endif
380
404
 
381
405
 
382
-
383
-
384
406
  #include <string.h>
385
407
 
386
408
  #ifdef __cplusplus
387
409
  extern "C" {
388
410
  #endif
389
411
 
390
- typedef void *(*swig_converter_func)(void *);
412
+ typedef void *(*swig_converter_func)(void *, int *);
391
413
  typedef struct swig_type_info *(*swig_dycast_func)(void **);
392
414
 
393
- /* Structure to store inforomation on one type */
415
+ /* Structure to store information on one type */
394
416
  typedef struct swig_type_info {
395
417
  const char *name; /* mangled name of this type */
396
418
  const char *str; /* human readable name of this type */
@@ -435,7 +457,7 @@ SWIG_TypeNameComp(const char *f1, const char *l1,
435
457
  while ((*f2 == ' ') && (f2 != l2)) ++f2;
436
458
  if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
437
459
  }
438
- return (l1 - f1) - (l2 - f2);
460
+ return (int)((l1 - f1) - (l2 - f2));
439
461
  }
440
462
 
441
463
  /*
@@ -477,48 +499,66 @@ SWIG_TypeCompare(const char *nb, const char *tb) {
477
499
  }
478
500
 
479
501
 
480
- /* think of this as a c++ template<> or a scheme macro */
481
- #define SWIG_TypeCheck_Template(comparison, ty) \
482
- if (ty) { \
483
- swig_cast_info *iter = ty->cast; \
484
- while (iter) { \
485
- if (comparison) { \
486
- if (iter == ty->cast) return iter; \
487
- /* Move iter to the top of the linked list */ \
488
- iter->prev->next = iter->next; \
489
- if (iter->next) \
490
- iter->next->prev = iter->prev; \
491
- iter->next = ty->cast; \
492
- iter->prev = 0; \
493
- if (ty->cast) ty->cast->prev = iter; \
494
- ty->cast = iter; \
495
- return iter; \
496
- } \
497
- iter = iter->next; \
498
- } \
499
- } \
500
- return 0
501
-
502
502
  /*
503
503
  Check the typename
504
504
  */
505
505
  SWIGRUNTIME swig_cast_info *
506
506
  SWIG_TypeCheck(const char *c, swig_type_info *ty) {
507
- SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
507
+ if (ty) {
508
+ swig_cast_info *iter = ty->cast;
509
+ while (iter) {
510
+ if (strcmp(iter->type->name, c) == 0) {
511
+ if (iter == ty->cast)
512
+ return iter;
513
+ /* Move iter to the top of the linked list */
514
+ iter->prev->next = iter->next;
515
+ if (iter->next)
516
+ iter->next->prev = iter->prev;
517
+ iter->next = ty->cast;
518
+ iter->prev = 0;
519
+ if (ty->cast) ty->cast->prev = iter;
520
+ ty->cast = iter;
521
+ return iter;
522
+ }
523
+ iter = iter->next;
524
+ }
525
+ }
526
+ return 0;
508
527
  }
509
528
 
510
- /* Same as previous function, except strcmp is replaced with a pointer comparison */
529
+ /*
530
+ Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
531
+ */
511
532
  SWIGRUNTIME swig_cast_info *
512
- SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
513
- SWIG_TypeCheck_Template(iter->type == from, into);
533
+ SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
534
+ if (ty) {
535
+ swig_cast_info *iter = ty->cast;
536
+ while (iter) {
537
+ if (iter->type == from) {
538
+ if (iter == ty->cast)
539
+ return iter;
540
+ /* Move iter to the top of the linked list */
541
+ iter->prev->next = iter->next;
542
+ if (iter->next)
543
+ iter->next->prev = iter->prev;
544
+ iter->next = ty->cast;
545
+ iter->prev = 0;
546
+ if (ty->cast) ty->cast->prev = iter;
547
+ ty->cast = iter;
548
+ return iter;
549
+ }
550
+ iter = iter->next;
551
+ }
552
+ }
553
+ return 0;
514
554
  }
515
555
 
516
556
  /*
517
557
  Cast a pointer up an inheritance hierarchy
518
558
  */
519
559
  SWIGRUNTIMEINLINE void *
520
- SWIG_TypeCast(swig_cast_info *ty, void *ptr) {
521
- return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr);
560
+ SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
561
+ return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
522
562
  }
523
563
 
524
564
  /*
@@ -791,6 +831,33 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
791
831
 
792
832
  #include <ruby.h>
793
833
 
834
+ /* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
835
+ * breaks using rb_intern as an lvalue, as SWIG does. We work around this
836
+ * issue for now by disabling this.
837
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
838
+ */
839
+ #ifdef rb_intern
840
+ # undef rb_intern
841
+ #endif
842
+
843
+ /* Remove global macros defined in Ruby's win32.h */
844
+ #ifdef write
845
+ # undef write
846
+ #endif
847
+ #ifdef read
848
+ # undef read
849
+ #endif
850
+ #ifdef bind
851
+ # undef bind
852
+ #endif
853
+ #ifdef close
854
+ # undef close
855
+ #endif
856
+ #ifdef connect
857
+ # undef connect
858
+ #endif
859
+
860
+
794
861
  /* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
795
862
  #ifndef NUM2LL
796
863
  #define NUM2LL(x) NUM2LONG((x))
@@ -819,12 +886,44 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
819
886
  #ifndef RSTRING_PTR
820
887
  # define RSTRING_PTR(x) RSTRING(x)->ptr
821
888
  #endif
889
+ #ifndef RSTRING_END
890
+ # define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
891
+ #endif
822
892
  #ifndef RARRAY_LEN
823
893
  # define RARRAY_LEN(x) RARRAY(x)->len
824
894
  #endif
825
895
  #ifndef RARRAY_PTR
826
896
  # define RARRAY_PTR(x) RARRAY(x)->ptr
827
897
  #endif
898
+ #ifndef RFLOAT_VALUE
899
+ # define RFLOAT_VALUE(x) RFLOAT(x)->value
900
+ #endif
901
+ #ifndef DOUBLE2NUM
902
+ # define DOUBLE2NUM(x) rb_float_new(x)
903
+ #endif
904
+ #ifndef RHASH_TBL
905
+ # define RHASH_TBL(x) (RHASH(x)->tbl)
906
+ #endif
907
+ #ifndef RHASH_ITER_LEV
908
+ # define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
909
+ #endif
910
+ #ifndef RHASH_IFNONE
911
+ # define RHASH_IFNONE(x) (RHASH(x)->ifnone)
912
+ #endif
913
+ #ifndef RHASH_SIZE
914
+ # define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
915
+ #endif
916
+ #ifndef RHASH_EMPTY_P
917
+ # define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
918
+ #endif
919
+ #ifndef RSTRUCT_LEN
920
+ # define RSTRUCT_LEN(x) RSTRUCT(x)->len
921
+ #endif
922
+ #ifndef RSTRUCT_PTR
923
+ # define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
924
+ #endif
925
+
926
+
828
927
 
829
928
  /*
830
929
  * Need to be very careful about how these macros are defined, especially
@@ -886,6 +985,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
886
985
  #define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
887
986
  #endif
888
987
 
988
+ static VALUE _mSWIG = Qnil;
889
989
 
890
990
  /* -----------------------------------------------------------------------------
891
991
  * error manipulation
@@ -898,7 +998,7 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
898
998
 
899
999
  /* Define custom exceptions for errors that do not map to existing Ruby
900
1000
  exceptions. Note this only works for C++ since a global cannot be
901
- initialized by a funtion in C. For C, fallback to rb_eRuntimeError.*/
1001
+ initialized by a function in C. For C, fallback to rb_eRuntimeError.*/
902
1002
 
903
1003
  SWIGINTERN VALUE
904
1004
  getNullReferenceError(void) {
@@ -976,12 +1076,73 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
976
1076
  }
977
1077
 
978
1078
 
1079
+ /* This function is called when a user inputs a wrong argument to
1080
+ a method.
1081
+ */
1082
+ SWIGINTERN
1083
+ const char* Ruby_Format_TypeError( const char* msg,
1084
+ const char* type,
1085
+ const char* name,
1086
+ const int argn,
1087
+ VALUE input )
1088
+ {
1089
+ char buf[128];
1090
+ VALUE str;
1091
+ VALUE asStr;
1092
+ if ( msg && *msg )
1093
+ {
1094
+ str = rb_str_new2(msg);
1095
+ }
1096
+ else
1097
+ {
1098
+ str = rb_str_new(NULL, 0);
1099
+ }
979
1100
 
1101
+ str = rb_str_cat2( str, "Expected argument " );
1102
+ sprintf( buf, "%d of type ", argn-1 );
1103
+ str = rb_str_cat2( str, buf );
1104
+ str = rb_str_cat2( str, type );
1105
+ str = rb_str_cat2( str, ", but got " );
1106
+ str = rb_str_cat2( str, rb_obj_classname(input) );
1107
+ str = rb_str_cat2( str, " " );
1108
+ asStr = rb_inspect(input);
1109
+ if ( RSTRING_LEN(asStr) > 30 )
1110
+ {
1111
+ str = rb_str_cat( str, StringValuePtr(asStr), 30 );
1112
+ str = rb_str_cat2( str, "..." );
1113
+ }
1114
+ else
1115
+ {
1116
+ str = rb_str_append( str, asStr );
1117
+ }
1118
+
1119
+ if ( name )
1120
+ {
1121
+ str = rb_str_cat2( str, "\n\tin SWIG method '" );
1122
+ str = rb_str_cat2( str, name );
1123
+ str = rb_str_cat2( str, "'" );
1124
+ }
1125
+
1126
+ return StringValuePtr( str );
1127
+ }
1128
+
1129
+ /* This function is called when an overloaded method fails */
1130
+ SWIGINTERN
1131
+ void Ruby_Format_OverloadedError(
1132
+ const int argc,
1133
+ const int maxargs,
1134
+ const char* method,
1135
+ const char* prototypes
1136
+ )
1137
+ {
1138
+ const char* msg = "Wrong # of arguments";
1139
+ if ( argc <= maxargs ) msg = "Wrong arguments";
1140
+ rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"
1141
+ "Possible C/C++ prototypes are:\n%s",
1142
+ msg, method, prototypes);
1143
+ }
980
1144
 
981
1145
  /* -----------------------------------------------------------------------------
982
- * See the LICENSE file for information on copyright, usage and redistribution
983
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
984
- *
985
1146
  * rubytracking.swg
986
1147
  *
987
1148
  * This file contains support for tracking mappings from
@@ -994,23 +1155,51 @@ SWIG_Ruby_ErrorType(int SWIG_code) {
994
1155
  extern "C" {
995
1156
  #endif
996
1157
 
1158
+ /* Ruby 1.8 actually assumes the first case. */
1159
+ #if SIZEOF_VOIDP == SIZEOF_LONG
1160
+ # define SWIG2NUM(v) LONG2NUM((unsigned long)v)
1161
+ # define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
1162
+ #elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
1163
+ # define SWIG2NUM(v) LL2NUM((unsigned long long)v)
1164
+ # define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
1165
+ #else
1166
+ # error sizeof(void*) is not the same as long or long long
1167
+ #endif
1168
+
997
1169
 
998
1170
  /* Global Ruby hash table to store Trackings from C/C++
999
- structs to Ruby Objects. */
1000
- static VALUE swig_ruby_trackings;
1171
+ structs to Ruby Objects.
1172
+ */
1173
+ static VALUE swig_ruby_trackings = Qnil;
1001
1174
 
1002
1175
  /* Global variable that stores a reference to the ruby
1003
1176
  hash table delete function. */
1004
- static ID swig_ruby_hash_delete = 0;
1177
+ static ID swig_ruby_hash_delete;
1005
1178
 
1006
1179
  /* Setup a Ruby hash table to store Trackings */
1007
1180
  SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
1008
1181
  /* Create a ruby hash table to store Trackings from C++
1009
- objects to Ruby objects. Also make sure to tell
1010
- the garabage collector about the hash table. */
1011
- swig_ruby_trackings = rb_hash_new();
1012
- rb_gc_register_address(&swig_ruby_trackings);
1013
-
1182
+ objects to Ruby objects. */
1183
+
1184
+ /* Try to see if some other .so has already created a
1185
+ tracking hash table, which we keep hidden in an instance var
1186
+ in the SWIG module.
1187
+ This is done to allow multiple DSOs to share the same
1188
+ tracking table.
1189
+ */
1190
+ ID trackings_id = rb_intern( "@__trackings__" );
1191
+ VALUE verbose = rb_gv_get("VERBOSE");
1192
+ rb_gv_set("VERBOSE", Qfalse);
1193
+ swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
1194
+ rb_gv_set("VERBOSE", verbose);
1195
+
1196
+ /* No, it hasn't. Create one ourselves */
1197
+ if ( swig_ruby_trackings == Qnil )
1198
+ {
1199
+ swig_ruby_trackings = rb_hash_new();
1200
+ rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
1201
+ }
1202
+
1014
1203
  /* Now store a reference to the hash table delete function
1015
1204
  so that we only have to look it up once.*/
1016
1205
  swig_ruby_hash_delete = rb_intern("delete");
@@ -1023,8 +1212,7 @@ SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
1023
1212
  a Ruby number object. */
1024
1213
 
1025
1214
  /* Convert the pointer to a Ruby number */
1026
- unsigned long value = (unsigned long) ptr;
1027
- return LONG2NUM(value);
1215
+ return SWIG2NUM(ptr);
1028
1216
  }
1029
1217
 
1030
1218
  /* Get a Ruby number to reference an object */
@@ -1034,8 +1222,7 @@ SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
1034
1222
  a Ruby number object. */
1035
1223
 
1036
1224
  /* Convert the Object to a Ruby number */
1037
- unsigned long value = (unsigned long) object;
1038
- return LONG2NUM(value);
1225
+ return SWIG2NUM(object);
1039
1226
  }
1040
1227
 
1041
1228
  /* Get a Ruby object from a previously stored reference */
@@ -1043,9 +1230,8 @@ SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
1043
1230
  /* The provided Ruby number object is a reference
1044
1231
  to the Ruby object we want.*/
1045
1232
 
1046
- /* First convert the Ruby number to a C number */
1047
- unsigned long value = NUM2LONG(reference);
1048
- return (VALUE) value;
1233
+ /* Convert the Ruby number to a Ruby object */
1234
+ return NUM2SWIG(reference);
1049
1235
  }
1050
1236
 
1051
1237
  /* Add a Tracking from a C/C++ struct to a Ruby object */
@@ -1137,15 +1323,21 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1137
1323
  return target;
1138
1324
  }
1139
1325
 
1326
+ /* For ruby1.8.4 and earlier. */
1327
+ #ifndef RUBY_INIT_STACK
1328
+ RUBY_EXTERN void Init_stack(VALUE* addr);
1329
+ # define RUBY_INIT_STACK \
1330
+ VALUE variable_in_this_stack_frame; \
1331
+ Init_stack(&variable_in_this_stack_frame);
1332
+ #endif
1333
+
1334
+
1140
1335
  #ifdef __cplusplus
1141
1336
  }
1142
1337
  #endif
1143
1338
 
1144
1339
 
1145
1340
  /* -----------------------------------------------------------------------------
1146
- * See the LICENSE file for information on copyright, usage and redistribution
1147
- * of SWIG, and the README file for authors - http://www.swig.org/release.html.
1148
- *
1149
1341
  * rubyrun.swg
1150
1342
  *
1151
1343
  * This file contains the runtime support for Ruby modules
@@ -1189,7 +1381,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1189
1381
  /* Error manipulation */
1190
1382
 
1191
1383
  #define SWIG_ErrorType(code) SWIG_Ruby_ErrorType(code)
1192
- #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), msg)
1384
+ #define SWIG_Error(code, msg) rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
1193
1385
  #define SWIG_fail goto fail
1194
1386
 
1195
1387
 
@@ -1201,6 +1393,7 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1201
1393
  #define SWIG_MangleStr(value) SWIG_Ruby_MangleStr(value)
1202
1394
  #define SWIG_CheckConvert(value, ty) SWIG_Ruby_CheckConvert(value, ty)
1203
1395
 
1396
+ #include "assert.h"
1204
1397
 
1205
1398
  /* -----------------------------------------------------------------------------
1206
1399
  * pointers/data manipulation
@@ -1208,9 +1401,6 @@ SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
1208
1401
 
1209
1402
  #ifdef __cplusplus
1210
1403
  extern "C" {
1211
- #if 0
1212
- } /* cc-mode */
1213
- #endif
1214
1404
  #endif
1215
1405
 
1216
1406
  typedef struct {
@@ -1222,10 +1412,44 @@ typedef struct {
1222
1412
  } swig_class;
1223
1413
 
1224
1414
 
1225
- static VALUE _mSWIG = Qnil;
1415
+ /* Global pointer used to keep some internal SWIG stuff */
1226
1416
  static VALUE _cSWIG_Pointer = Qnil;
1227
1417
  static VALUE swig_runtime_data_type_pointer = Qnil;
1228
1418
 
1419
+ /* Global IDs used to keep some internal SWIG stuff */
1420
+ static ID swig_arity_id = 0;
1421
+ static ID swig_call_id = 0;
1422
+
1423
+ /*
1424
+ If your swig extension is to be run within an embedded ruby and has
1425
+ director callbacks, you should set -DRUBY_EMBEDDED during compilation.
1426
+ This will reset ruby's stack frame on each entry point from the main
1427
+ program the first time a virtual director function is invoked (in a
1428
+ non-recursive way).
1429
+ If this is not done, you run the risk of Ruby trashing the stack.
1430
+ */
1431
+
1432
+ #ifdef RUBY_EMBEDDED
1433
+
1434
+ # define SWIG_INIT_STACK \
1435
+ if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
1436
+ ++swig_virtual_calls;
1437
+ # define SWIG_RELEASE_STACK --swig_virtual_calls;
1438
+ # define Ruby_DirectorTypeMismatchException(x) \
1439
+ rb_raise( rb_eTypeError, "%s", x ); return c_result;
1440
+
1441
+ static unsigned int swig_virtual_calls = 0;
1442
+
1443
+ #else /* normal non-embedded extension */
1444
+
1445
+ # define SWIG_INIT_STACK
1446
+ # define SWIG_RELEASE_STACK
1447
+ # define Ruby_DirectorTypeMismatchException(x) \
1448
+ throw Swig::DirectorTypeMismatchException( x );
1449
+
1450
+ #endif /* RUBY_EMBEDDED */
1451
+
1452
+
1229
1453
  SWIGRUNTIME VALUE
1230
1454
  getExceptionClass(void) {
1231
1455
  static int init = 0;
@@ -1257,6 +1481,8 @@ SWIG_Ruby_InitRuntime(void)
1257
1481
  {
1258
1482
  if (_mSWIG == Qnil) {
1259
1483
  _mSWIG = rb_define_module("SWIG");
1484
+ swig_call_id = rb_intern("call");
1485
+ swig_arity_id = rb_intern("arity");
1260
1486
  }
1261
1487
  }
1262
1488
 
@@ -1280,7 +1506,7 @@ SWIGRUNTIME VALUE
1280
1506
  SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1281
1507
  {
1282
1508
  int own = flags & SWIG_POINTER_OWN;
1283
-
1509
+ int track;
1284
1510
  char *klass_name;
1285
1511
  swig_class *sklass;
1286
1512
  VALUE klass;
@@ -1293,14 +1519,15 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1293
1519
  sklass = (swig_class *) type->clientdata;
1294
1520
 
1295
1521
  /* Are we tracking this class and have we already returned this Ruby object? */
1296
- if (sklass->trackObjects) {
1522
+ track = sklass->trackObjects;
1523
+ if (track) {
1297
1524
  obj = SWIG_RubyInstanceFor(ptr);
1298
1525
 
1299
1526
  /* Check the object's type and make sure it has the correct type.
1300
1527
  It might not in cases where methods do things like
1301
1528
  downcast methods. */
1302
1529
  if (obj != Qnil) {
1303
- VALUE value = rb_iv_get(obj, "__swigtype__");
1530
+ VALUE value = rb_iv_get(obj, "@__swigtype__");
1304
1531
  char* type_name = RSTRING_PTR(value);
1305
1532
 
1306
1533
  if (strcmp(type->name, type_name) == 0) {
@@ -1310,10 +1537,13 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1310
1537
  }
1311
1538
 
1312
1539
  /* Create a new Ruby object */
1313
- obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), (own ? VOIDFUNC(sklass->destroy) : 0), ptr);
1540
+ obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark),
1541
+ ( own ? VOIDFUNC(sklass->destroy) :
1542
+ (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
1543
+ ), ptr);
1314
1544
 
1315
1545
  /* If tracking is on for this class then track this object. */
1316
- if (sklass->trackObjects) {
1546
+ if (track) {
1317
1547
  SWIG_RubyAddTracking(ptr, obj);
1318
1548
  }
1319
1549
  } else {
@@ -1323,7 +1553,7 @@ SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
1323
1553
  free((void *) klass_name);
1324
1554
  obj = Data_Wrap_Struct(klass, 0, 0, ptr);
1325
1555
  }
1326
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1556
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1327
1557
 
1328
1558
  return obj;
1329
1559
  }
@@ -1335,7 +1565,7 @@ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1335
1565
  VALUE obj;
1336
1566
  swig_class *sklass = (swig_class *) type->clientdata;
1337
1567
  obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
1338
- rb_iv_set(obj, "__swigtype__", rb_str_new2(type->name));
1568
+ rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
1339
1569
  return obj;
1340
1570
  }
1341
1571
 
@@ -1343,7 +1573,7 @@ SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
1343
1573
  SWIGRUNTIMEINLINE char *
1344
1574
  SWIG_Ruby_MangleStr(VALUE obj)
1345
1575
  {
1346
- VALUE stype = rb_iv_get(obj, "__swigtype__");
1576
+ VALUE stype = rb_iv_get(obj, "@__swigtype__");
1347
1577
  return StringValuePtr(stype);
1348
1578
  }
1349
1579
 
@@ -1425,8 +1655,11 @@ SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags,
1425
1655
  tc = SWIG_TypeCheck(c, ty);
1426
1656
  if (!tc) {
1427
1657
  return SWIG_ERROR;
1658
+ } else {
1659
+ int newmemory = 0;
1660
+ *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
1661
+ assert(!newmemory); /* newmemory handling not yet implemented */
1428
1662
  }
1429
- *ptr = SWIG_TypeCast(tc, vptr);
1430
1663
  } else {
1431
1664
  *ptr = vptr;
1432
1665
  }
@@ -1507,10 +1740,42 @@ SWIG_Ruby_SetModule(swig_module_info *pointer)
1507
1740
  rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
1508
1741
  }
1509
1742
 
1743
+ /* This function can be used to check whether a proc or method or similarly
1744
+ callable function has been passed. Usually used in a %typecheck, like:
1745
+
1746
+ %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
1747
+ $result = SWIG_Ruby_isCallable( $input );
1748
+ }
1749
+ */
1750
+ SWIGINTERN
1751
+ int SWIG_Ruby_isCallable( VALUE proc )
1752
+ {
1753
+ if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
1754
+ return 1;
1755
+ return 0;
1756
+ }
1757
+
1758
+ /* This function can be used to check the arity (number of arguments)
1759
+ a proc or method can take. Usually used in a %typecheck.
1760
+ Valid arities will be that equal to minimal or those < 0
1761
+ which indicate a variable number of parameters at the end.
1762
+ */
1763
+ SWIGINTERN
1764
+ int SWIG_Ruby_arity( VALUE proc, int minimal )
1765
+ {
1766
+ if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
1767
+ {
1768
+ VALUE num = rb_funcall( proc, swig_arity_id, 0 );
1769
+ int arity = NUM2INT(num);
1770
+ if ( arity < 0 && (arity+1) < -minimal ) return 1;
1771
+ if ( arity == minimal ) return 1;
1772
+ return 1;
1773
+ }
1774
+ return 0;
1775
+ }
1776
+
1777
+
1510
1778
  #ifdef __cplusplus
1511
- #if 0
1512
- { /* cc-mode */
1513
- #endif
1514
1779
  }
1515
1780
  #endif
1516
1781
 
@@ -1537,7 +1802,11 @@ static swig_module_info swig_module = {swig_types, 1, 0, 0, 0, 0};
1537
1802
 
1538
1803
  static VALUE mRhoBluetooth;
1539
1804
 
1540
- #define SWIGVERSION 0x010331
1805
+ #define SWIG_RUBY_THREAD_BEGIN_BLOCK
1806
+ #define SWIG_RUBY_THREAD_END_BLOCK
1807
+
1808
+
1809
+ #define SWIGVERSION 0x020001
1541
1810
  #define SWIG_VERSION SWIGVERSION
1542
1811
 
1543
1812
 
@@ -1548,7 +1817,7 @@ static VALUE mRhoBluetooth;
1548
1817
  extern int rho_bluetooth_is_bluetooth_available();
1549
1818
  extern void rho_bluetooth_off_bluetooth();
1550
1819
  extern void rho_bluetooth_set_device_name(const char* device_name);
1551
- extern const char* rho_bluetooth_get_device_name();
1820
+ extern VALUE rho_bluetooth_get_device_name();
1552
1821
  extern const char* rho_bluetooth_get_last_error();
1553
1822
  extern const char* rho_bluetooth_create_session(const char* role, const char* callback_url);
1554
1823
 
@@ -1595,14 +1864,12 @@ extern void rho_bluetooth_session_write_data(const char* connected_device_name,
1595
1864
 
1596
1865
 
1597
1866
  #include <limits.h>
1598
- #ifndef LLONG_MIN
1599
- # define LLONG_MIN LONG_LONG_MIN
1600
- #endif
1601
- #ifndef LLONG_MAX
1602
- # define LLONG_MAX LONG_LONG_MAX
1603
- #endif
1604
- #ifndef ULLONG_MAX
1605
- # define ULLONG_MAX ULONG_LONG_MAX
1867
+ #if !defined(SWIG_NO_LLONG_MAX)
1868
+ # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
1869
+ # define LLONG_MAX __LONG_LONG_MAX__
1870
+ # define LLONG_MIN (-LLONG_MAX - 1LL)
1871
+ # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
1872
+ # endif
1606
1873
  #endif
1607
1874
 
1608
1875
 
@@ -1633,11 +1900,11 @@ SWIGINTERN int
1633
1900
  SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
1634
1901
  {
1635
1902
  if (TYPE(obj) == T_STRING) {
1636
-
1637
-
1638
-
1903
+ #if defined(StringValuePtr)
1904
+ char *cstr = StringValuePtr(obj);
1905
+ #else
1639
1906
  char *cstr = STR2CSTR(obj);
1640
-
1907
+ #endif
1641
1908
  size_t size = RSTRING_LEN(obj) + 1;
1642
1909
  if (cptr) {
1643
1910
  if (alloc) {
@@ -1701,7 +1968,7 @@ SWIG_ruby_failed(void)
1701
1968
  }
1702
1969
 
1703
1970
 
1704
- /*@SWIG:%ruby_aux_method@*/
1971
+ /*@SWIG:/usr/share/swig2.0/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
1705
1972
  SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
1706
1973
  {
1707
1974
  VALUE obj = args[0];
@@ -1785,7 +2052,7 @@ _wrap_set_device_name(int argc, VALUE *argv, VALUE self) {
1785
2052
  }
1786
2053
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1787
2054
  if (!SWIG_IsOK(res1)) {
1788
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_device_name" "', argument " "1"" of type '" "char const *""'");
2055
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","set_device_name", 1, argv[0] ));
1789
2056
  }
1790
2057
  arg1 = (char *)(buf1);
1791
2058
  set_device_name((char const *)arg1);
@@ -1799,14 +2066,14 @@ fail:
1799
2066
 
1800
2067
  SWIGINTERN VALUE
1801
2068
  _wrap_get_device_name(int argc, VALUE *argv, VALUE self) {
1802
- char *result = 0 ;
2069
+ VALUE result;
1803
2070
  VALUE vresult = Qnil;
1804
2071
 
1805
2072
  if ((argc < 0) || (argc > 0)) {
1806
2073
  rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
1807
2074
  }
1808
- result = (char *)get_device_name();
1809
- vresult = SWIG_FromCharPtr((const char *)result);
2075
+ result = (VALUE)get_device_name();
2076
+ vresult = result;
1810
2077
  return vresult;
1811
2078
  fail:
1812
2079
  return Qnil;
@@ -1833,13 +2100,13 @@ SWIGINTERN VALUE
1833
2100
  _wrap_create_session(int argc, VALUE *argv, VALUE self) {
1834
2101
  char *arg1 = (char *) 0 ;
1835
2102
  char *arg2 = (char *) 0 ;
1836
- char *result = 0 ;
1837
2103
  int res1 ;
1838
2104
  char *buf1 = 0 ;
1839
2105
  int alloc1 = 0 ;
1840
2106
  int res2 ;
1841
2107
  char *buf2 = 0 ;
1842
2108
  int alloc2 = 0 ;
2109
+ char *result = 0 ;
1843
2110
  VALUE vresult = Qnil;
1844
2111
 
1845
2112
  if ((argc < 2) || (argc > 2)) {
@@ -1847,12 +2114,12 @@ _wrap_create_session(int argc, VALUE *argv, VALUE self) {
1847
2114
  }
1848
2115
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1849
2116
  if (!SWIG_IsOK(res1)) {
1850
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "create_session" "', argument " "1"" of type '" "char const *""'");
2117
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","create_session", 1, argv[0] ));
1851
2118
  }
1852
2119
  arg1 = (char *)(buf1);
1853
2120
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
1854
2121
  if (!SWIG_IsOK(res2)) {
1855
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "create_session" "', argument " "2"" of type '" "char const *""'");
2122
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","create_session", 2, argv[1] ));
1856
2123
  }
1857
2124
  arg2 = (char *)(buf2);
1858
2125
  result = (char *)create_session((char const *)arg1,(char const *)arg2);
@@ -1872,7 +2139,6 @@ _wrap_create_custom_server_session(int argc, VALUE *argv, VALUE self) {
1872
2139
  char *arg1 = (char *) 0 ;
1873
2140
  char *arg2 = (char *) 0 ;
1874
2141
  int arg3 ;
1875
- char *result = 0 ;
1876
2142
  int res1 ;
1877
2143
  char *buf1 = 0 ;
1878
2144
  int alloc1 = 0 ;
@@ -1881,6 +2147,7 @@ _wrap_create_custom_server_session(int argc, VALUE *argv, VALUE self) {
1881
2147
  int alloc2 = 0 ;
1882
2148
  int val3 ;
1883
2149
  int ecode3 = 0 ;
2150
+ char *result = 0 ;
1884
2151
  VALUE vresult = Qnil;
1885
2152
 
1886
2153
  if ((argc < 3) || (argc > 3)) {
@@ -1888,17 +2155,17 @@ _wrap_create_custom_server_session(int argc, VALUE *argv, VALUE self) {
1888
2155
  }
1889
2156
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1890
2157
  if (!SWIG_IsOK(res1)) {
1891
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "create_custom_server_session" "', argument " "1"" of type '" "char const *""'");
2158
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","create_custom_server_session", 1, argv[0] ));
1892
2159
  }
1893
2160
  arg1 = (char *)(buf1);
1894
2161
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
1895
2162
  if (!SWIG_IsOK(res2)) {
1896
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "create_custom_server_session" "', argument " "2"" of type '" "char const *""'");
2163
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","create_custom_server_session", 2, argv[1] ));
1897
2164
  }
1898
2165
  arg2 = (char *)(buf2);
1899
2166
  ecode3 = SWIG_AsVal_int(argv[2], &val3);
1900
2167
  if (!SWIG_IsOK(ecode3)) {
1901
- SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "create_custom_server_session" "', argument " "3"" of type '" "int""'");
2168
+ SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","create_custom_server_session", 3, argv[2] ));
1902
2169
  }
1903
2170
  arg3 = (int)(val3);
1904
2171
  result = (char *)create_custom_server_session((char const *)arg1,(char const *)arg2,arg3);
@@ -1917,13 +2184,13 @@ SWIGINTERN VALUE
1917
2184
  _wrap_create_custom_client_session(int argc, VALUE *argv, VALUE self) {
1918
2185
  char *arg1 = (char *) 0 ;
1919
2186
  char *arg2 = (char *) 0 ;
1920
- char *result = 0 ;
1921
2187
  int res1 ;
1922
2188
  char *buf1 = 0 ;
1923
2189
  int alloc1 = 0 ;
1924
2190
  int res2 ;
1925
2191
  char *buf2 = 0 ;
1926
2192
  int alloc2 = 0 ;
2193
+ char *result = 0 ;
1927
2194
  VALUE vresult = Qnil;
1928
2195
 
1929
2196
  if ((argc < 2) || (argc > 2)) {
@@ -1931,12 +2198,12 @@ _wrap_create_custom_client_session(int argc, VALUE *argv, VALUE self) {
1931
2198
  }
1932
2199
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1933
2200
  if (!SWIG_IsOK(res1)) {
1934
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "create_custom_client_session" "', argument " "1"" of type '" "char const *""'");
2201
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","create_custom_client_session", 1, argv[0] ));
1935
2202
  }
1936
2203
  arg1 = (char *)(buf1);
1937
2204
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
1938
2205
  if (!SWIG_IsOK(res2)) {
1939
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "create_custom_client_session" "', argument " "2"" of type '" "char const *""'");
2206
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","create_custom_client_session", 2, argv[1] ));
1940
2207
  }
1941
2208
  arg2 = (char *)(buf2);
1942
2209
  result = (char *)create_custom_client_session((char const *)arg1,(char const *)arg2);
@@ -1983,12 +2250,12 @@ _wrap_session_set_callback(int argc, VALUE *argv, VALUE self) {
1983
2250
  }
1984
2251
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
1985
2252
  if (!SWIG_IsOK(res1)) {
1986
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "session_set_callback" "', argument " "1"" of type '" "char const *""'");
2253
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","session_set_callback", 1, argv[0] ));
1987
2254
  }
1988
2255
  arg1 = (char *)(buf1);
1989
2256
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
1990
2257
  if (!SWIG_IsOK(res2)) {
1991
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "session_set_callback" "', argument " "2"" of type '" "char const *""'");
2258
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","session_set_callback", 2, argv[1] ));
1992
2259
  }
1993
2260
  arg2 = (char *)(buf2);
1994
2261
  session_set_callback((char const *)arg1,(char const *)arg2);
@@ -2014,7 +2281,7 @@ _wrap_session_disconnect(int argc, VALUE *argv, VALUE self) {
2014
2281
  }
2015
2282
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2016
2283
  if (!SWIG_IsOK(res1)) {
2017
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "session_disconnect" "', argument " "1"" of type '" "char const *""'");
2284
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","session_disconnect", 1, argv[0] ));
2018
2285
  }
2019
2286
  arg1 = (char *)(buf1);
2020
2287
  session_disconnect((char const *)arg1);
@@ -2029,10 +2296,10 @@ fail:
2029
2296
  SWIGINTERN VALUE
2030
2297
  _wrap_session_get_status(int argc, VALUE *argv, VALUE self) {
2031
2298
  char *arg1 = (char *) 0 ;
2032
- int result;
2033
2299
  int res1 ;
2034
2300
  char *buf1 = 0 ;
2035
2301
  int alloc1 = 0 ;
2302
+ int result;
2036
2303
  VALUE vresult = Qnil;
2037
2304
 
2038
2305
  if ((argc < 1) || (argc > 1)) {
@@ -2040,7 +2307,7 @@ _wrap_session_get_status(int argc, VALUE *argv, VALUE self) {
2040
2307
  }
2041
2308
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2042
2309
  if (!SWIG_IsOK(res1)) {
2043
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "session_get_status" "', argument " "1"" of type '" "char const *""'");
2310
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","session_get_status", 1, argv[0] ));
2044
2311
  }
2045
2312
  arg1 = (char *)(buf1);
2046
2313
  result = (int)session_get_status((char const *)arg1);
@@ -2056,10 +2323,10 @@ fail:
2056
2323
  SWIGINTERN VALUE
2057
2324
  _wrap_session_read_string(int argc, VALUE *argv, VALUE self) {
2058
2325
  char *arg1 = (char *) 0 ;
2059
- VALUE result;
2060
2326
  int res1 ;
2061
2327
  char *buf1 = 0 ;
2062
2328
  int alloc1 = 0 ;
2329
+ VALUE result;
2063
2330
  VALUE vresult = Qnil;
2064
2331
 
2065
2332
  if ((argc < 1) || (argc > 1)) {
@@ -2067,7 +2334,7 @@ _wrap_session_read_string(int argc, VALUE *argv, VALUE self) {
2067
2334
  }
2068
2335
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2069
2336
  if (!SWIG_IsOK(res1)) {
2070
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "session_read_string" "', argument " "1"" of type '" "char const *""'");
2337
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","session_read_string", 1, argv[0] ));
2071
2338
  }
2072
2339
  arg1 = (char *)(buf1);
2073
2340
  result = (VALUE)session_read_string((char const *)arg1);
@@ -2096,12 +2363,12 @@ _wrap_session_write_string(int argc, VALUE *argv, VALUE self) {
2096
2363
  }
2097
2364
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2098
2365
  if (!SWIG_IsOK(res1)) {
2099
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "session_write_string" "', argument " "1"" of type '" "char const *""'");
2366
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","session_write_string", 1, argv[0] ));
2100
2367
  }
2101
2368
  arg1 = (char *)(buf1);
2102
2369
  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
2103
2370
  if (!SWIG_IsOK(res2)) {
2104
- SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "session_write_string" "', argument " "2"" of type '" "char const *""'");
2371
+ SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","session_write_string", 2, argv[1] ));
2105
2372
  }
2106
2373
  arg2 = (char *)(buf2);
2107
2374
  session_write_string((char const *)arg1,(char const *)arg2);
@@ -2118,10 +2385,10 @@ fail:
2118
2385
  SWIGINTERN VALUE
2119
2386
  _wrap_session_read_data(int argc, VALUE *argv, VALUE self) {
2120
2387
  char *arg1 = (char *) 0 ;
2121
- VALUE result;
2122
2388
  int res1 ;
2123
2389
  char *buf1 = 0 ;
2124
2390
  int alloc1 = 0 ;
2391
+ VALUE result;
2125
2392
  VALUE vresult = Qnil;
2126
2393
 
2127
2394
  if ((argc < 1) || (argc > 1)) {
@@ -2129,7 +2396,7 @@ _wrap_session_read_data(int argc, VALUE *argv, VALUE self) {
2129
2396
  }
2130
2397
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2131
2398
  if (!SWIG_IsOK(res1)) {
2132
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "session_read_data" "', argument " "1"" of type '" "char const *""'");
2399
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","session_read_data", 1, argv[0] ));
2133
2400
  }
2134
2401
  arg1 = (char *)(buf1);
2135
2402
  result = (VALUE)session_read_data((char const *)arg1);
@@ -2155,7 +2422,7 @@ _wrap_session_write_data(int argc, VALUE *argv, VALUE self) {
2155
2422
  }
2156
2423
  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
2157
2424
  if (!SWIG_IsOK(res1)) {
2158
- SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "session_write_data" "', argument " "1"" of type '" "char const *""'");
2425
+ SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","session_write_data", 1, argv[0] ));
2159
2426
  }
2160
2427
  arg1 = (char *)(buf1);
2161
2428
  arg2 = argv[1];
@@ -2243,7 +2510,7 @@ SWIGRUNTIME void
2243
2510
  SWIG_InitializeModule(void *clientdata) {
2244
2511
  size_t i;
2245
2512
  swig_module_info *module_head, *iter;
2246
- int found;
2513
+ int found, init;
2247
2514
 
2248
2515
  clientdata = clientdata;
2249
2516
 
@@ -2253,6 +2520,9 @@ SWIG_InitializeModule(void *clientdata) {
2253
2520
  swig_module.type_initial = swig_type_initial;
2254
2521
  swig_module.cast_initial = swig_cast_initial;
2255
2522
  swig_module.next = &swig_module;
2523
+ init = 1;
2524
+ } else {
2525
+ init = 0;
2256
2526
  }
2257
2527
 
2258
2528
  /* Try and load any already created modules */
@@ -2281,6 +2551,12 @@ SWIG_InitializeModule(void *clientdata) {
2281
2551
  module_head->next = &swig_module;
2282
2552
  }
2283
2553
 
2554
+ /* When multiple interpeters are used, a module could have already been initialized in
2555
+ a different interpreter, but not yet have a pointer in this interpreter.
2556
+ In this case, we do not want to continue adding types... everything should be
2557
+ set up already */
2558
+ if (init == 0) return;
2559
+
2284
2560
  /* Now work on filling in swig_module.types */
2285
2561
  #ifdef SWIGRUNTIME_DEBUG
2286
2562
  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
@@ -2414,7 +2690,9 @@ SWIG_PropagateClientData(void) {
2414
2690
  }
2415
2691
  #endif
2416
2692
 
2693
+ /*
2417
2694
 
2695
+ */
2418
2696
  #ifdef __cplusplus
2419
2697
  extern "C"
2420
2698
  #endif