diff options
author | Jürg Billeter <j@bitron.ch> | 2009-09-17 15:27:09 +0200 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2009-09-17 15:27:09 +0200 |
commit | 4759d601a6e8481a90ab33c1649aaecb5ad5d6b2 (patch) | |
tree | 5726c7e00b3b660e7845935d69e0885786e632ed /vapi | |
parent | a85486029c8040f293e38a0ebc13c74b86d67689 (diff) | |
download | vala-4759d601a6e8481a90ab33c1649aaecb5ad5d6b2.tar.gz |
Fix time_t binding
Diffstat (limited to 'vapi')
-rw-r--r-- | vapi/glib-2.0.vapi | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index 9b26eb82c..a06c271c5 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -673,11 +673,10 @@ public struct double { } [CCode (cheader_filename = "time.h", has_type_id = false)] -[ByRef] [IntegerType (rank = 8)] public struct time_t { [CCode (cname = "time")] - public time_t (); + public time_t (out time_t result = null); } [SimpleType] @@ -1941,10 +1940,21 @@ namespace GLib { [CCode (cname = "tm_isdst")] public int isdst; - [CCode (cname = "gmtime_r", instance_pos = -1)] - public Time.gm (time_t time); - [CCode (cname = "localtime_r", instance_pos = -1)] - public Time.local (time_t time); + [CCode (cname = "gmtime_r")] + static void gmtime_r (ref time_t time, out Time result); + [CCode (cname = "localtime_r")] + static void localtime_r (ref time_t time, out Time result); + + public static Time gm (time_t time) { + Time result; + gmtime_r (ref time, out result); + return result; + } + public static Time local (time_t time) { + Time result; + localtime_r (ref time, out result); + return result; + } public string to_string () { return "%04d-%02d-%02d %02d:%02d:%02d".printf (year + 1900, month + 1, day, hour, minute, second); |