~ubuntu-branches/debian/sid/glib2.0/sid

« back to all changes in this revision

Viewing changes to glib/giochannel.c

  • Committer: Package Import Robot
  • Author(s): Martin Pitt
  • Date: 2013-05-08 06:25:57 UTC
  • mfrom: (1.27.14) (3.1.181 experimental)
  • Revision ID: package-import@ubuntu.com-20130508062557-i7gbku66mls70gi2
Tags: 2.36.1-2
Merge experimental branch, upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
689
689
 * @source: the #GIOChannel event source
690
690
 * @condition: the condition which has been satisfied
691
691
 * @data: user data set in g_io_add_watch() or g_io_add_watch_full()
692
 
 * @Returns: the function should return %FALSE if the event source
693
 
 *           should be removed
694
692
 *
695
693
 * Specifies the type of function passed to g_io_add_watch() or
696
694
 * g_io_add_watch_full(), which is called when the requested condition
697
695
 * on a #GIOChannel is satisfied.
 
696
 *
 
697
 * Returns: the function should return %FALSE if the event source
 
698
 *          should be removed
698
699
 **/
699
700
/**
700
701
 * GIOCondition:
823
824
#endif
824
825
 
825
826
#ifdef EOVERFLOW
 
827
#if EOVERFLOW != EFBIG
826
828
    case EOVERFLOW:
827
829
      return G_IO_CHANNEL_ERROR_OVERFLOW;
828
830
#endif
 
831
#endif
829
832
 
830
833
#ifdef EPIPE
831
834
    case EPIPE:
878
881
/**
879
882
 * g_io_channel_set_line_term:
880
883
 * @channel: a #GIOChannel
881
 
 * @line_term: The line termination string. Use %NULL for autodetect.
882
 
 *             Autodetection breaks on "\n", "\r\n", "\r", "\0", and
883
 
 *             the Unicode paragraph separator. Autodetection should
884
 
 *             not be used for anything other than file-based channels.
 
884
 * @line_term: (allow-none): The line termination string. Use %NULL for
 
885
 *             autodetect.  Autodetection breaks on "\n", "\r\n", "\r", "\0",
 
886
 *             and the Unicode paragraph separator. Autodetection should not be
 
887
 *             used for anything other than file-based channels.
885
888
 * @length: The length of the termination string. If -1 is passed, the
886
889
 *          string is assumed to be nul-terminated. This option allows
887
890
 *          termination strings with embedded nuls.
1282
1285
/**
1283
1286
 * g_io_channel_set_encoding:
1284
1287
 * @channel: a #GIOChannel
1285
 
 * @encoding: the encoding type
 
1288
 * @encoding: (allow-none): the encoding type
1286
1289
 * @error: location to store an error of type #GConvertError
1287
1290
 *
1288
1291
 * Sets the encoding for the input/output of the channel. 
1649
1652
/**
1650
1653
 * g_io_channel_read_line:
1651
1654
 * @channel: a #GIOChannel
1652
 
 * @str_return: The line read from the #GIOChannel, including the
 
1655
 * @str_return: (out): The line read from the #GIOChannel, including the
1653
1656
 *              line terminator. This data should be freed with g_free()
1654
1657
 *              when no longer needed. This is a nul-terminated string. 
1655
1658
 *              If a @length of zero is returned, this will be %NULL instead.
1656
 
 * @length: (allow-none): location to store length of the read data, or %NULL
1657
 
 * @terminator_pos: (allow-none): location to store position of line terminator, or %NULL
 
1659
 * @length: (allow-none) (out): location to store length of the read data, or %NULL
 
1660
 * @terminator_pos: (allow-none) (out): location to store position of line terminator, or %NULL
1658
1661
 * @error: A location to return an error of type #GConvertError
1659
1662
 *         or #GIOChannelError
1660
1663
 *
1913
1916
/**
1914
1917
 * g_io_channel_read_to_end:
1915
1918
 * @channel: a #GIOChannel
1916
 
 * @str_return: Location to store a pointer to a string holding
1917
 
 *              the remaining data in the #GIOChannel. This data should
1918
 
 *              be freed with g_free() when no longer needed. This
1919
 
 *              data is terminated by an extra nul character, but there 
1920
 
 *              may be other nuls in the intervening data.
1921
 
 * @length: location to store length of the data
 
1919
 * @str_return:  (out) (array length=length) (element-type guint8): Location to
 
1920
 *              store a pointer to a string holding the remaining data in the
 
1921
 *              #GIOChannel. This data should be freed with g_free() when no
 
1922
 *              longer needed. This data is terminated by an extra nul
 
1923
 *              character, but there may be other nuls in the intervening data.
 
1924
 * @length: (out): location to store length of the data
1922
1925
 * @error: location to return an error of type #GConvertError
1923
1926
 *         or #GIOChannelError
1924
1927
 *
1994
1997
/**
1995
1998
 * g_io_channel_read_chars:
1996
1999
 * @channel: a #GIOChannel
1997
 
 * @buf: a buffer to read data into
1998
 
 * @count: the size of the buffer. Note that the buffer may not be
 
2000
 * @buf: (out caller-allocates) (array length=count) (element-type guint8):
 
2001
 *     a buffer to read data into
 
2002
 * @count: (in): the size of the buffer. Note that the buffer may not be
1999
2003
 *     complelely filled even if there is data in the buffer if the
2000
2004
 *     remaining data is not a complete character.
2001
 
 * @bytes_read: (allow-none): The number of bytes read. This may be
 
2005
 * @bytes_read: (allow-none) (out): The number of bytes read. This may be
2002
2006
 *     zero even on success if count < 6 and the channel's encoding
2003
2007
 *     is non-%NULL. This indicates that the next UTF-8 character is
2004
2008
 *     too wide for the buffer.
2174
2178
/**
2175
2179
 * g_io_channel_write_chars:
2176
2180
 * @channel: a #GIOChannel
2177
 
 * @buf: a buffer to write data from
 
2181
 * @buf: (array) (element-type guint8): a buffer to write data from
2178
2182
 * @count: the size of the buffer. If -1, the buffer
2179
2183
 *         is taken to be a nul-terminated string.
2180
 
 * @bytes_written: The number of bytes written. This can be nonzero
 
2184
 * @bytes_written: (out): The number of bytes written. This can be nonzero
2181
2185
 *                 even if the return value is not %G_IO_STATUS_NORMAL.
2182
2186
 *                 If the return value is %G_IO_STATUS_NORMAL and the
2183
2187
 *                 channel is blocking, this will always be equal
2580
2584
 *
2581
2585
 * Error codes returned by #GIOChannel operations.
2582
2586
 **/
2583
 
GQuark
2584
 
g_io_channel_error_quark (void)
2585
 
{
2586
 
  return g_quark_from_static_string ("g-io-channel-error-quark");
2587
 
}
 
2587
 
 
2588
G_DEFINE_QUARK (g-io-channel-error-quark, g_io_channel_error)