From: Evan Nemerson Date: Wed, 8 Jul 2009 19:42:58 +0000 (-0700) Subject: glib-2.0: Add g_ascii_dtostr and g_ascii_formatd bindings X-Git-Tag: 0.7.5~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb49ab888dc94d90c559c4e4e13110bf4bb3ee67;p=thirdparty%2Fvala.git glib-2.0: Add g_ascii_dtostr and g_ascii_formatd bindings Fixes bug 541450. --- diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi index fa225e020..773275b14 100644 --- a/vapi/glib-2.0.vapi +++ b/vapi/glib-2.0.vapi @@ -653,15 +653,23 @@ public struct double { [CCode (cname = "isinf")] public int is_infinity (); - [CCode (cname = "g_strdup_printf", instance_pos = -1)] - public string to_string (string format = "%g"); - [CCode (cname = "MIN")] public static double min (double a, double b); [CCode (cname = "MAX")] public static double max (double a, double b); [CCode (cname = "CLAMP")] public double clamp (double low, double high); + + [CCode (cname = "G_ASCII_DTOSTR_BUF_SIZE")] + public const int DTOSTR_BUF_SIZE; + [CCode (cname = "g_ascii_dtostr", instance_pos = -1)] + public weak string to_str (char[] buffer); + [CCode (cname = "g_ascii_formatd", instance_pos = -1)] + public weak string format (char[] buffer, string format = "%g"); + + public string to_string () { + return this.to_str(new char[DTOSTR_BUF_SIZE]); + } } [CCode (cheader_filename = "time.h")]