[vala] glib-2.0: Add g_ascii_dtostr and g_ascii_formatd bindings



commit fb49ab888dc94d90c559c4e4e13110bf4bb3ee67
Author: Evan Nemerson <evan polussystems com>
Date:   Wed Jul 8 12:42:58 2009 -0700

    glib-2.0: Add g_ascii_dtostr and g_ascii_formatd bindings
    
    Fixes bug 541450.

 vapi/glib-2.0.vapi |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index fa225e0..773275b 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")]



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]