]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: Add g_ascii_dtostr and g_ascii_formatd bindings
authorEvan Nemerson <evan@polussystems.com>
Wed, 8 Jul 2009 19:42:58 +0000 (12:42 -0700)
committerJürg Billeter <j@bitron.ch>
Fri, 10 Jul 2009 13:54:38 +0000 (14:54 +0100)
Fixes bug 541450.

vapi/glib-2.0.vapi

index fa225e020c099598f9b507c80827197934f99ea2..773275b146f353d57e3e9c0f3fe961a0d45f875f 100644 (file)
@@ -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")]