summaryrefslogtreecommitdiff
path: root/gio/gpollableinputstream.h
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2012-04-01 14:47:19 -0400
committerDan Winship <danw@gnome.org>2012-04-17 12:33:12 -0400
commit7e95777a6a46ef40b1a175e95136942b4eed4d75 (patch)
tree02a33811f94f865a13ab8726174640c7fd1ec8ad /gio/gpollableinputstream.h
parentadea9fb25210f2d04bcf2453c18847fb965927f7 (diff)
downloadglib-7e95777a6a46ef40b1a175e95136942b4eed4d75.tar.gz
gio: minor GPollableInputStream / GPollableOutputStream fixes
Make g_pollable_input_stream_read() and g_pollable_output_stream_write() look a little bit more like the non-pollable versions in terms of error handling, etc. Also, use the read_fn and write_fn virtual methods directly rather than calling g_input_stream_read()/g_output_stream_write(), to avoid problems with re-entrancy involving the "pending" flag. Also belatedly add single-include guards to the header files. https://bugzilla.gnome.org/show_bug.cgi?id=673997
Diffstat (limited to 'gio/gpollableinputstream.h')
-rw-r--r--gio/gpollableinputstream.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gio/gpollableinputstream.h b/gio/gpollableinputstream.h
index 3b57460fd..634ff2aeb 100644
--- a/gio/gpollableinputstream.h
+++ b/gio/gpollableinputstream.h
@@ -18,6 +18,10 @@
* Boston, MA 02111-1307, USA.
*/
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
#ifndef __G_POLLABLE_INPUT_STREAM_H__
#define __G_POLLABLE_INPUT_STREAM_H__
@@ -73,7 +77,7 @@ struct _GPollableInputStreamInterface
GCancellable *cancellable);
gssize (*read_nonblocking) (GPollableInputStream *stream,
void *buffer,
- gsize size,
+ gsize count,
GError **error);
};
@@ -87,7 +91,7 @@ GSource *g_pollable_input_stream_create_source (GPollableInputStream *stream
gssize g_pollable_input_stream_read_nonblocking (GPollableInputStream *stream,
void *buffer,
- gsize size,
+ gsize count,
GCancellable *cancellable,
GError **error);