Author: aschnell Date: Mon Jul 23 12:33:14 2007 New Revision: 6149 URL: http://svn.opensuse.org/viewcvs/zypp?rev=6149&view=rev Log: - define ruby typemaps only when generating ruby code Modified: trunk/libzypp-bindings/swig/ByteCount.i trunk/libzypp-bindings/swig/Date.i trunk/libzypp-bindings/swig/Pathname.i trunk/libzypp-bindings/swig/Url.i Modified: trunk/libzypp-bindings/swig/ByteCount.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/ByteCount.i?rev=6149&r1=6148&r2=6149&view=diff ============================================================================== --- trunk/libzypp-bindings/swig/ByteCount.i (original) +++ trunk/libzypp-bindings/swig/ByteCount.i Mon Jul 23 12:33:14 2007 @@ -1,4 +1,6 @@ +#ifdef SWIGRUBY + %typemap(in) ByteCount { ByteCount::SizeType bytes = (Date::SizeType) NUM2LONG( rb_funcall( $input, rb_intern("to_i"), 0, 0) ); $1 = ByteCount(bytes); @@ -9,3 +11,5 @@ return rbbytenum; } +#endif + Modified: trunk/libzypp-bindings/swig/Date.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Date.i?rev=6149&r1=6148&r2=6149&view=diff ============================================================================== --- trunk/libzypp-bindings/swig/Date.i (original) +++ trunk/libzypp-bindings/swig/Date.i Mon Jul 23 12:33:14 2007 @@ -1,4 +1,6 @@ +#ifdef SWIGRUBY + %typemap(in) Date { Date::ValueType seconds = (Date::ValueType) NUM2INT( rb_funcall( $input, rb_intern("to_i"), 0, 0) ); $1 = Date(seconds); @@ -11,3 +13,5 @@ $result = rb_funcall( klass, rb_intern("at"), 1, rbtimenum); } +#endif + Modified: trunk/libzypp-bindings/swig/Pathname.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Pathname.i?rev=6149&r1=6148&r2=6149&view=diff ============================================================================== --- trunk/libzypp-bindings/swig/Pathname.i (original) +++ trunk/libzypp-bindings/swig/Pathname.i Mon Jul 23 12:33:14 2007 @@ -1,4 +1,6 @@ +#ifdef SWIGRUBY + %typemap(in) const Pathname & { VALUE pathstring = rb_funcall( $input, rb_intern("to_s"), 0, 0); Pathname *p = new Pathname( (RSTRING(pathstring)->ptr) ); @@ -14,4 +16,7 @@ VALUE klass = rb_const_get( rb_cObject, rb_intern("Pathname")); VALUE rbpathstr = rb_str_new2($1.asString().c_str()); $result = rb_funcall( klass, rb_intern("new"), 1, rbpathstr); -} \ No newline at end of file +} + +#endif + Modified: trunk/libzypp-bindings/swig/Url.i URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp-bindings/swig/Url.i?rev=6149&r1=6148&r2=6149&view=diff ============================================================================== --- trunk/libzypp-bindings/swig/Url.i (original) +++ trunk/libzypp-bindings/swig/Url.i Mon Jul 23 12:33:14 2007 @@ -1,4 +1,6 @@ +#ifdef SWIGRUBY + /* new(scheme, userinfo, host, port, registry, path, opaque, query, fragment, arg_check = false) */ %typemap(in) const Url & { @@ -8,10 +10,13 @@ } %typemap(freearg) const Url & { - delete $1; + delete $1; } %typemap(out) Url { VALUE rburlstr = rb_str_new2($1.asString().c_str()); $result = rburlstr ; -} \ No newline at end of file +} + +#endif + -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org