Modified Files: glib/ChangeLog glib/glib/giochannel.h

Modified Files:
	glib/ChangeLog glib/glib/giochannel.h glib/glib/giochannel.c

	* glib/giochannel.h glib/giochannel.c: Added a length argument
	to g_io_channel_[set,get]_line_term(), allowing embeded nulls
	and binary safe line termination strings

	* glib/giochannel.c: Got rid of a compile warning in
	g_io_channel_write_chars()
This commit is contained in:
Ron Steinke
2001-09-10 23:59:33 +00:00
parent 7ca6b00d0e
commit d5485ef31b
10 changed files with 113 additions and 28 deletions

View File

@@ -111,6 +111,7 @@ struct _GIOChannel
GIConv read_cd;
GIConv write_cd;
gchar *line_term; /* String which indicates the end of a line of text */
guint line_term_len; /* So we can have null in the line term */
gsize buf_size;
GString *read_buf; /* Raw data from the channel */
@@ -205,8 +206,10 @@ GIOStatus g_io_channel_set_flags (GIOChannel *channel,
GError **error);
GIOFlags g_io_channel_get_flags (GIOChannel *channel);
void g_io_channel_set_line_term (GIOChannel *channel,
const gchar *line_term);
G_CONST_RETURN gchar* g_io_channel_get_line_term (GIOChannel *channel);
const gchar *line_term,
gint length);
G_CONST_RETURN gchar* g_io_channel_get_line_term (GIOChannel *channel,
gint *length);
void g_io_channel_set_buffered (GIOChannel *channel,
gboolean buffered);
gboolean g_io_channel_get_buffered (GIOChannel *channel);