Method

GLibIOChannelread_line

Declaration

GIOStatus
g_io_channel_read_line (
  GIOChannel* channel,
  gchar** str_return,
  gsize* length,
  gsize* terminator_pos,
  GError** error
)

Description

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.

Parameters

str_return gchar**
 

The line read from the GIOChannel, including the line terminator. This data should be freed with g_free() when no longer needed. This is a nul-terminated string. If a length of zero is returned, this will be NULL instead.

 The argument will be set by the function.
 The instance takes ownership of the data, and is responsible for freeing it.
 The string is a NUL terminated UTF-8 string.
length gsize*
 

Location to store length of the read data, or NULL.

 The argument will be set by the function.
 The argument can be NULL.
 The instance takes ownership of the data, and is responsible for freeing it.
terminator_pos gsize*
 

Location to store position of line terminator, or NULL.

 The argument will be set by the function.
 The argument can be NULL.
 The instance takes ownership of the data, and is responsible for freeing it.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: GIOStatus
 

The status of the operation.