qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mcpie...@apache.org
Subject svn commit: r1539430 - /qpid/proton/trunk/proton-c/bindings/ruby/ruby.i
Date Wed, 06 Nov 2013 19:06:21 GMT
Author: mcpierce
Date: Wed Nov  6 19:06:20 2013
New Revision: 1539430

URL: http://svn.apache.org/r1539430
Log:
PROTON-448: Added support for Data encode/decode to Ruby Swig.

Modified:
    qpid/proton/trunk/proton-c/bindings/ruby/ruby.i

Modified: qpid/proton/trunk/proton-c/bindings/ruby/ruby.i
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/ruby/ruby.i?rev=1539430&r1=1539429&r2=1539430&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/ruby/ruby.i (original)
+++ qpid/proton/trunk/proton-c/bindings/ruby/ruby.i Wed Nov  6 19:06:20 2013
@@ -345,4 +345,24 @@ bool pn_ssl_get_protocol_name(pn_ssl_t *
 %ignore pn_ssl_get_protocol_name;
 
 
+ssize_t pn_data_decode(pn_data_t *data, char *STRING, size_t LENGTH);
+%ignore pn_data_decode;
+
+%rename(pn_data_encode) wrap_pn_data_encode;
+%inline %{
+  int wrap_pn_data_encode(pn_data_t *data, char *OUTPUT, size_t *OUTPUT_SIZE) {
+    ssize_t sz = pn_data_encode(data, OUTPUT, *OUTPUT_SIZE);
+    if (sz >= 0) {
+      *OUTPUT_SIZE = sz;
+    } else {
+      *OUTPUT_SIZE = 0;
+    }
+    return sz;
+  }
+%}
+%ignore pn_data_encode;
+
+int pn_data_format(pn_data_t *data, char *OUTPUT, size_t *OUTPUT_SIZE);
+%ignore pn_data_format;
+
 %include "proton/cproton.i"



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message