]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
enhance GIOChannel binding, based on patch by Nicolas Joseph, fixes bug
authorJuerg Billeter <j@bitron.ch>
Sun, 23 Mar 2008 09:07:10 +0000 (09:07 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Sun, 23 Mar 2008 09:07:10 +0000 (09:07 +0000)
2008-03-23  Juerg Billeter  <j@bitron.ch>

* vapi/glib-2.0.vapi: enhance GIOChannel binding,
  based on patch by Nicolas Joseph, fixes bug 523876

svn path=/trunk/; revision=1153

ChangeLog
vapi/glib-2.0.vapi

index 5e42f4d5b75193526254e5209b195bdfc7690a1e..94e3c455e7b7012a5e9399531d6a65b9e03359e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-23  Jürg Billeter  <j@bitron.ch>
+
+       * vapi/glib-2.0.vapi: enhance GIOChannel binding,
+         based on patch by Nicolas Joseph, fixes bug 523876
+
 2008-03-22  Jürg Billeter  <j@bitron.ch>
 
        * gobject/valaccodegenerator.vala: fix C declaration for delegates,
index 0ec9cdec655358f40183f28f136eaaab17ac7297..ca62fa782abd953c8d6cc3760480c35a7dd4f11b 100644 (file)
@@ -1315,32 +1315,40 @@ namespace GLib {
        
        [CCode (ref_function = "g_io_channel_ref", unref_function = "g_io_channel_unref")]
        public class IOChannel : Boxed {
-               public IOChannel.file (string filename, string mode) throws FileError;
                [CCode (cname = "g_io_channel_unix_new")]
                public IOChannel.unix_new (int fd);
                public int unix_get_fd ();
-               [NoArrayLength]
-               public IOStatus read_chars (char[] buf, size_t count, out size_t bytes_read) throws ConvertError, IOChannelError;
+               [CCode (cname = "g_io_channel_win32_new_fd")]
+               public IOChannel.win32_new_fd (int fd);
+               public void init ();
+               public IOChannel.file (string filename, string mode) throws FileError;
+               public IOStatus read_chars (char[] buf, out size_t bytes_read) throws ConvertError, IOChannelError;
                public IOStatus read_unichar (out unichar thechar) throws ConvertError, IOChannelError;
                public IOStatus read_line (out string str_return, out size_t length, out size_t terminator_pos) throws ConvertError, IOChannelError;
                public IOStatus read_line_string (String buffer, out size_t terminator_pos) throws ConvertError, IOChannelError;
                public IOStatus read_to_end (out string str_return, out size_t length) throws ConvertError, IOChannelError;
-               [NoArrayLength]
-               public IOStatus write_chars (char[] buf, ssize_t count, out size_t bytes_written) throws ConvertError, IOChannelError;
+               public IOStatus write_chars (char[] buf, out size_t bytes_written) throws ConvertError, IOChannelError;
                public IOStatus write_unichar (unichar thechar) throws ConvertError, IOChannelError;
                public IOStatus flush () throws IOChannelError;
                public IOStatus seek_position (int64 offset, SeekType type) throws IOChannelError;
                public IOStatus shutdown (bool flush) throws IOChannelError;
-       }
-
-       [CCode (cprefix = "G_IO_", type_id = "G_TYPE_IO_CONDITION")]
-       public enum IOCondition {
-               IN,
-               OUT,
-               PRI,
-               ERR,
-               HUP,
-               NVAL
+               [CCode (cname = "g_io_create_watch")]
+               public GLib.Source create_watch (IOCondition condition);
+               [CCode (cname = "g_io_add_watch")]
+               public uint add_watch (IOCondition condition, IOFunc func);
+               public size_t get_buffer_size ();
+               public void set_buffer_size (size_t size);
+               public IOCondition get_buffer_condition ();
+               public IOFlags get_flags ();
+               public IOStatus set_flags (IOFlags flags) throws IOChannelError;
+               public weak string get_line_term (out int length);
+               public void set_line_term (string line_term, int length);
+               public bool get_buffered ();
+               public void set_buffered (bool buffered);
+               public weak string get_encoding ();
+               public IOStatus set_encoding (string encoding) throws IOChannelError;
+               public bool get_close_on_unref ();
+               public void set_close_on_unref (bool do_close);
        }
 
        [CCode (cprefix = "G_SEEK_")]
@@ -1357,8 +1365,7 @@ namespace GLib {
                AGAIN
        }
 
-       [ErrorDomain]
-       public enum IOChannelError {
+       public errordomain IOChannelError {
                FBIG,
                INVAL,
                IO,
@@ -1370,6 +1377,30 @@ namespace GLib {
                FAILED
        }
 
+       [CCode (cprefix = "G_IO_", type_id = "G_TYPE_IO_CONDITION")]
+       public enum IOCondition {
+               IN,
+               OUT,
+               PRI,
+               ERR,
+               HUP,
+               NVAL
+       }
+
+       public delegate bool IOFunc (IOChannel source, IOCondition condition);
+
+       [CCode (cprefix = "G_IO_FLAG_")]
+       public enum IOFlags {
+               APPEND,
+               NONBLOCK,
+               READABLE,
+               WRITEABLE,
+               SEEKABLE,
+               MASK,
+               GET_MASK,
+               SET_MASK
+       }
+
        /* Error Reporting */
 
        [ErrorBase]