[vala] libosso: fix struct Rpc bindings
- From: Evan Nemerson <evann src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [vala] libosso: fix struct Rpc bindings
- Date: Sat, 7 Nov 2009 19:40:58 +0000 (UTC)
commit 765719558d6816a3ae35bb13beeaa20e633cb2a2
Author: Philipp Zabel <philipp zabel gmail com>
Date: Tue Oct 20 16:15:02 2009 +0200
libosso: fix struct Rpc bindings
osso_rpc_free_val should be destroy_function instead of unref_function.
The value union contained in osso_rpc_t is not a GLib.Value
Fixes bug 599052.
vapi/libosso.vapi | 28 ++++++++++++++++++++++++++--
1 files changed, 26 insertions(+), 2 deletions(-)
---
diff --git a/vapi/libosso.vapi b/vapi/libosso.vapi
index 1eaa7dc..d1bb35a 100644
--- a/vapi/libosso.vapi
+++ b/vapi/libosso.vapi
@@ -224,10 +224,34 @@ namespace Osso {
public DevMode sig_device_mode_ind;
}
- [CCode (unref_function = "osso_rpc_free_val", cname = "osso_rpc_t")]
+ [CCode (destroy_function = "osso_rpc_free_val", cname = "osso_rpc_t")]
public struct Rpc {
public int type;
- public GLib.Value value;
+ [CCode (cname = "value.u")]
+ private uint32 u;
+ [CCode (cname = "value.i")]
+ private int32 i;
+ [CCode (cname = "value.b")]
+ private bool b;
+ [CCode (cname = "value.d")]
+ private double d;
+ [CCode (cname = "value.s")]
+ private string s;
+ public uint32 to_uint32 () requires (type == 'u') {
+ return u;
+ }
+ public int32 to_int32 () requires (type == 'i') {
+ return i;
+ }
+ public bool to_bool () requires (type == 'b') {
+ return b;
+ }
+ public double to_double () requires (type == 'd') {
+ return d;
+ }
+ public unowned string to_string () requires (type == 's') {
+ return s;
+ }
}
/* Enums */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]