Struct
GLibIOFuncs
since: 2.0
Description
struct GIOFuncs {
GIOStatus (* io_read) (
GIOChannel* channel,
gchar* buf,
gsize count,
gsize* bytes_read,
GError** error
);
GIOStatus (* io_write) (
GIOChannel* channel,
const gchar* buf,
gsize count,
gsize* bytes_written,
GError** error
);
GIOStatus (* io_seek) (
GIOChannel* channel,
gint64 offset,
GSeekType type,
GError** error
);
GIOStatus (* io_close) (
GIOChannel* channel,
GError** error
);
GSource* (* io_create_watch) (
GIOChannel* channel,
GIOCondition condition
);
void (* io_free) (
GIOChannel* channel
);
GIOStatus (* io_set_flags) (
GIOChannel* channel,
GIOFlags flags,
GError** error
);
GIOFlags (* io_get_flags) (
GIOChannel* channel
);
}
A table of functions used to handle different types of GIOChannel
in a generic way.
Structure members
io_readReads raw bytes from the channel. This is called from various functions such as
g_io_channel_read_chars()to read raw bytes from the channel. Encoding and buffering issues are dealt with at a higher level.io_writeWrites raw bytes to the channel. This is called from various functions such as
g_io_channel_write_chars()to write raw bytes to the channel. Encoding and buffering issues are dealt with at a higher level.io_seekSeeks the channel. This is called from
g_io_channel_seek()on channels that support it.io_closeCloses the channel. This is called from
g_io_channel_close()after flushing the buffers.io_create_watchCreates a watch on the channel. This call corresponds directly to g_io_create_watch().
io_freeCalled from
g_io_channel_unref()when the channel needs to be freed. This function must free the memory associated with the channel, including freeing theGIOChannelstructure itself. The channel buffers have been flushed and possiblyio_closehas been called by the time this function is called.io_set_flagsSets the
GIOFlagson the channel. This is called fromg_io_channel_set_flags()with all flags except forG_IO_FLAG_APPENDandG_IO_FLAG_NONBLOCKmasked out.io_get_flagsGets the
GIOFlagsfor the channel. This function need only return theG_IO_FLAG_APPENDandG_IO_FLAG_NONBLOCKflags;g_io_channel_get_flags()automatically adds the others as appropriate.
Available since: 2.0