[Vala] patch to add read/write to FileStream



The below patch adds read/write to FileStream:

Index: vala-0.3.5/vapi/glib-2.0.vapi
===================================================================
--- vala-0.3.5.orig/vapi/glib-2.0.vapi  2008-08-29 17:39:43.000000000 -0400
+++ vala-0.3.5/vapi/glib-2.0.vapi       2008-09-04 17:05:11.000000000 -0400
@@ -2426,6 +2426,10 @@
                public int scanf (string format, ...);
                [CCode (cname = "fflush")]
                public int flush ();
+               [CCode (cname = "fread", instance_pos = -1)]
+               public int read (char[] buf, int nmemb);
+               [CCode (cname = "fwrite", instance_pos = -1)]
+               public int write (char[] buf, int nmemb);
        }

        [CCode (lower_case_cprefix = "g_file_", cheader_filename =
"glib/gstdio.h")]


Question:  is there any way I can always set nmemb=1 so the caller
does not have to set that variable?  In vala, I would just do:

read(buf), instead of read(buf, 1)


Thanks,
Cliff

-- 
=======================
Cliff Brake
http://bec-systems.com



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