From 8b8ab34fff9c10cdbc65a14aab819351f4ad22ca Mon Sep 17 00:00:00 2001 From: Josef Reidinger Date: Mon, 4 Jun 2012 14:03:02 +0000 Subject: port ruby bindings to version 1.9 --- VERSION.cmake | 2 +- swig/ruby/std_list.i | 48 ++++++++++++++++++++++++------------------------ swig/ruby/std_set.i | 48 ++++++++++++++++++++++++------------------------ swig/zypp.i | 1 - 4 files changed, 49 insertions(+), 50 deletions(-) diff --git a/VERSION.cmake b/VERSION.cmake index 3ddd9bd..45b3cd2 100644 --- a/VERSION.cmake +++ b/VERSION.cmake @@ -1,3 +1,3 @@ SET(VERSION_MAJOR "0") SET(VERSION_MINOR "5") -SET(VERSION_PATCH "11") +SET(VERSION_PATCH "12") diff --git a/swig/ruby/std_list.i b/swig/ruby/std_list.i index f6d36e6..0d9515c 100644 --- a/swig/ruby/std_list.i +++ b/swig/ruby/std_list.i @@ -48,10 +48,10 @@ namespace std { template class list { %typemap(in) list { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); $1; for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; T* x; SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1); $1.push_back(*x); @@ -65,10 +65,10 @@ namespace std { %typemap(in) const list& (std::list temp), const list* (std::list temp) { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); $1 = &temp; for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; T* x; SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1); temp.push_back(*x); @@ -107,14 +107,14 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) list { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if ((SWIG_ConvertPtr(o,(void **) &x, $descriptor(T *),0)) != -1) $1 = 1; @@ -135,14 +135,14 @@ namespace std { const list* { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if ((SWIG_ConvertPtr(o,(void **) &x, $descriptor(T *),0)) != -1) $1 = 1; @@ -217,10 +217,10 @@ namespace std { template class list { %typemap(in) list { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); $1 = std::list(size); for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; T* x; SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1); (($1_type &)$1)[i] = x; @@ -234,11 +234,11 @@ namespace std { %typemap(in) const list& (std::list temp), const list* (std::list temp) { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); temp = std::list(size); $1 = &temp; for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; T* x; SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1); temp[i] = x; @@ -259,14 +259,14 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) list { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if ((SWIG_ConvertPtr(o,(void **) &x, $descriptor(T *),0)) != -1) $1 = 1; @@ -287,14 +287,14 @@ namespace std { const list* { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if ((SWIG_ConvertPtr(o,(void **) &x, $descriptor(T *),0)) != -1) $1 = 1; @@ -371,10 +371,10 @@ namespace std { template<> class list { %typemap(in) list { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); $1 = std::list(size); for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; if (CHECK(o)) (($1_type &)$1)[i] = (T)(CONVERT_FROM(o)); else @@ -391,11 +391,11 @@ namespace std { %typemap(in) const list& (std::list temp), const list* (std::list temp) { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); temp = std::list(size); $1 = &temp; for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; if (CHECK(o)) temp[i] = (T)(CONVERT_FROM(o)); else @@ -415,13 +415,13 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) list { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if (CHECK(o)) $1 = 1; else @@ -441,13 +441,13 @@ namespace std { const list* { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if (CHECK(o)) $1 = 1; else diff --git a/swig/ruby/std_set.i b/swig/ruby/std_set.i index af2a146..9c9544c 100644 --- a/swig/ruby/std_set.i +++ b/swig/ruby/std_set.i @@ -48,10 +48,10 @@ namespace std { template class set { %typemap(in) set { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); $1; for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; T* x; SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1); $1.insert(*x); @@ -65,10 +65,10 @@ namespace std { %typemap(in) const set& (std::set temp), const set* (std::set temp) { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); $1 = &temp; for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; T* x; SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1); temp.insert(*x); @@ -107,14 +107,14 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) set { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if ((SWIG_ConvertPtr(o,(void **) &x, $descriptor(T *),0)) != -1) $1 = 1; @@ -135,14 +135,14 @@ namespace std { const set* { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if ((SWIG_ConvertPtr(o,(void **) &x, $descriptor(T *),0)) != -1) $1 = 1; @@ -215,10 +215,10 @@ namespace std { template class set { %typemap(in) set { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); $1 = std::set(size); for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; T* x; SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1); (($1_type &)$1)[i] = x; @@ -232,11 +232,11 @@ namespace std { %typemap(in) const set& (std::set temp), const set* (std::set temp) { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); temp = std::set(size); $1 = &temp; for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; T* x; SWIG_ConvertPtr(o, (void **) &x, $descriptor(T *), 1); temp[i] = x; @@ -257,14 +257,14 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) set { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if ((SWIG_ConvertPtr(o,(void **) &x, $descriptor(T *),0)) != -1) $1 = 1; @@ -285,14 +285,14 @@ namespace std { const set* { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ T* x; - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if ((SWIG_ConvertPtr(o,(void **) &x, $descriptor(T *),0)) != -1) $1 = 1; @@ -367,10 +367,10 @@ namespace std { template<> class set { %typemap(in) set { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); $1 = std::set(size); for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; if (CHECK(o)) (($1_type &)$1)[i] = (T)(CONVERT_FROM(o)); else @@ -387,11 +387,11 @@ namespace std { %typemap(in) const set& (std::set temp), const set* (std::set temp) { if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); temp = std::set(size); $1 = &temp; for (unsigned int i=0; iptr[i]; + VALUE o = RARRAY_PTR($input)[i]; if (CHECK(o)) temp[i] = (T)(CONVERT_FROM(o)); else @@ -411,13 +411,13 @@ namespace std { %typecheck(SWIG_TYPECHECK_VECTOR) set { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if (CHECK(o)) $1 = 1; else @@ -437,13 +437,13 @@ namespace std { const set* { /* native sequence? */ if (rb_obj_is_kind_of($input,rb_cArray)) { - unsigned int size = RARRAY($input)->len; + unsigned int size = RARRAY_LEN($input); if (size == 0) { /* an empty sequence can be of any type */ $1 = 1; } else { /* check the first element only */ - VALUE o = RARRAY($input)->ptr[0]; + VALUE o = RARRAY_PTR($input)[0]; if (CHECK(o)) $1 = 1; else diff --git a/swig/zypp.i b/swig/zypp.i index a84ca38..69ff44a 100644 --- a/swig/zypp.i +++ b/swig/zypp.i @@ -74,7 +74,6 @@ #define TARGET_THREAD_BEGIN_ALLOW do {} while(0) #define TARGET_THREAD_END_ALLOW do {} while(0) #include -#include #endif #if defined(SWIGPERL) -- cgit v1.2.3