Struct

GLibIOChannel

Description [src]

struct GIOChannel {
  /* No available fields */
}

A data structure representing an IO Channel. The fields should be considered private and should only be accessed with the following functions.

Constructors

g_io_channel_new_file

Open a file filename as a GIOChannel using mode mode. This channel will be closed when the last reference to it is dropped, so there is no need to call g_io_channel_close() (though doing so will not cause problems, as long as no attempt is made to access the channel after it is closed).

g_io_channel_unix_new

Creates a new GIOChannel given a file descriptor. On UNIX systems this works for plain files, pipes, and sockets.

Functions

g_io_channel_error_from_errno

Converts an errno error number to a GIOChannelError.

g_io_channel_error_quark
No description available.

Instance methods

g_io_channel_close

Close an IO channel. Any pending data to be written will be flushed, ignoring errors. The channel will not be freed until the last reference is dropped using g_io_channel_unref().

Deprecated since: 2.2

g_io_channel_flush

Flushes the write buffer for the GIOChannel.

g_io_channel_get_buffer_condition

This function returns a GIOCondition depending on whether there is data to be read/space to write data in the internal buffers in the GIOChannel. Only the flags G_IO_IN and G_IO_OUT may be set.

g_io_channel_get_buffer_size

Gets the buffer size.

g_io_channel_get_buffered

Returns whether channel is buffered.

g_io_channel_get_close_on_unref

Returns whether the file/socket/whatever associated with channel will be closed when channel receives its final unref and is destroyed. The default value of this is TRUE for channels created by g_io_channel_new_file (), and FALSE for all other channels.

g_io_channel_get_encoding

Gets the encoding for the input/output of the channel. The internal encoding is always UTF-8. The encoding NULL makes the channel safe for binary data.

g_io_channel_get_flags

Gets the current flags for a GIOChannel, including read-only flags such as G_IO_FLAG_IS_READABLE.

g_io_channel_get_line_term

This returns the string that GIOChannel uses to determine where in the file a line break occurs. A value of NULL indicates autodetection.

g_io_channel_init

Initializes a GIOChannel struct.

g_io_channel_read

Reads data from a GIOChannel.

Deprecated since: 2.2

g_io_channel_read_chars

Replacement for g_io_channel_read() with the new API.

g_io_channel_read_line

Reads a line, including the terminating character(s), from a GIOChannel into a newly-allocated string. str_return will contain allocated memory if the return is G_IO_STATUS_NORMAL.

g_io_channel_read_line_string

Reads a line from a GIOChannel, using a GString as a buffer.

g_io_channel_read_to_end

Reads all the remaining data from the file.

g_io_channel_read_unichar

Reads a Unicode character from channel. This function cannot be called on a channel with NULL encoding.

g_io_channel_ref

Increments the reference count of a GIOChannel.

g_io_channel_seek

Sets the current position in the GIOChannel, similar to the standard library function fseek().

Deprecated since: 2.2

g_io_channel_seek_position

Replacement for g_io_channel_seek() with the new API.

g_io_channel_set_buffer_size

Sets the buffer size.

g_io_channel_set_buffered

The buffering state can only be set if the channel’s encoding is NULL. For any other encoding, the channel must be buffered.

g_io_channel_set_close_on_unref

Whether to close the channel on the final unref of the GIOChannel data structure. The default value of this is TRUE for channels created by g_io_channel_new_file (), and FALSE for all other channels.

g_io_channel_set_encoding

Sets the encoding for the input/output of the channel. The internal encoding is always UTF-8. The default encoding for the external file is UTF-8.

g_io_channel_set_flags

Sets the (writeable) flags in channel to (flags & G_IO_FLAG_SET_MASK).

g_io_channel_set_line_term

This sets the string that GIOChannel uses to determine where in the file a line break occurs.

g_io_channel_shutdown

Close an IO channel. Any pending data to be written will be flushed if flush is TRUE. The channel will not be freed until the last reference is dropped using g_io_channel_unref().

g_io_channel_unix_get_fd

Returns the file descriptor of the GIOChannel.

g_io_channel_unref

Decrements the reference count of a GIOChannel.

g_io_channel_write

Writes data to a GIOChannel.

Deprecated since: 2.2

g_io_channel_write_chars

Replacement for g_io_channel_write() with the new API.

g_io_channel_write_unichar

Writes a Unicode character to channel. This function cannot be called on a channel with NULL encoding.