Rename all struct members named: read, write, close, truncate, or mount to

2007-12-05  Alexander Larsson  <alexl@redhat.com>

        * gbufferedinputstream.c:
        * gbufferedoutputstream.c:
        * gdrive.[ch]:
        * gfile.[ch]:
        * gfileenumerator.[ch]:
        * gfileinputstream.c:
        * gfileoutputstream.[ch]:
        * gfilterinputstream.c:
        * gfilteroutputstream.c:
        * ginputstream.[ch]:
        * glocalfile.c:
        * glocalfileenumerator.c:
        * glocalfileinputstream.c:
        * glocalfileoutputstream.c:
        * gmemoryinputstream.c:
        * gmemoryoutputstream.c:
        * goutputstream.[ch]:
        * gseekable.[ch]:
        * gunixdrive.c:
        * gunixinputstream.c:
        * gunixoutputstream.c:
	Rename all struct members named:
	read, write, close, truncate, or mount
	to foo_fn, as these are reserved names
	and could be defined as macros in libc.
	(#501645)


svn path=/trunk/; revision=6048
This commit is contained in:
Alexander Larsson 2007-12-05 10:38:03 +00:00 committed by Alexander Larsson
parent a8a42c8b15
commit 2c362b7f9e
29 changed files with 114 additions and 85 deletions

View File

@ -1,3 +1,32 @@
2007-12-05 Alexander Larsson <alexl@redhat.com>
* gbufferedinputstream.c:
* gbufferedoutputstream.c:
* gdrive.[ch]:
* gfile.[ch]:
* gfileenumerator.[ch]:
* gfileinputstream.c:
* gfileoutputstream.[ch]:
* gfilterinputstream.c:
* gfilteroutputstream.c:
* ginputstream.[ch]:
* glocalfile.c:
* glocalfileenumerator.c:
* glocalfileinputstream.c:
* glocalfileoutputstream.c:
* gmemoryinputstream.c:
* gmemoryoutputstream.c:
* goutputstream.[ch]:
* gseekable.[ch]:
* gunixdrive.c:
* gunixinputstream.c:
* gunixoutputstream.c:
Rename all struct members named:
read, write, close, truncate, or mount
to foo_fn, as these are reserved names
and could be defined as macros in libc.
(#501645)
2007-12-04 Alexander Larsson <alexl@redhat.com> 2007-12-04 Alexander Larsson <alexl@redhat.com>
* goutputstream.c: * goutputstream.c:

View File

@ -148,7 +148,7 @@ g_buffered_input_stream_class_init (GBufferedInputStreamClass *klass)
istream_class->skip = g_buffered_input_stream_skip; istream_class->skip = g_buffered_input_stream_skip;
istream_class->skip_async = g_buffered_input_stream_skip_async; istream_class->skip_async = g_buffered_input_stream_skip_async;
istream_class->skip_finish = g_buffered_input_stream_skip_finish; istream_class->skip_finish = g_buffered_input_stream_skip_finish;
istream_class->read = g_buffered_input_stream_read; istream_class->read_fn = g_buffered_input_stream_read;
istream_class->read_async = g_buffered_input_stream_read_async; istream_class->read_async = g_buffered_input_stream_read_async;
istream_class->read_finish = g_buffered_input_stream_read_finish; istream_class->read_finish = g_buffered_input_stream_read_finish;

View File

@ -135,9 +135,9 @@ g_buffered_output_stream_class_init (GBufferedOutputStreamClass *klass)
object_class->finalize = g_buffered_output_stream_finalize; object_class->finalize = g_buffered_output_stream_finalize;
ostream_class = G_OUTPUT_STREAM_CLASS (klass); ostream_class = G_OUTPUT_STREAM_CLASS (klass);
ostream_class->write = g_buffered_output_stream_write; ostream_class->write_fn = g_buffered_output_stream_write;
ostream_class->flush = g_buffered_output_stream_flush; ostream_class->flush = g_buffered_output_stream_flush;
ostream_class->close = g_buffered_output_stream_close; ostream_class->close_fn = g_buffered_output_stream_close;
ostream_class->write_async = g_buffered_output_stream_write_async; ostream_class->write_async = g_buffered_output_stream_write_async;
ostream_class->write_finish = g_buffered_output_stream_write_finish; ostream_class->write_finish = g_buffered_output_stream_write_finish;
ostream_class->flush_async = g_buffered_output_stream_flush_async; ostream_class->flush_async = g_buffered_output_stream_flush_async;

View File

@ -275,7 +275,7 @@ g_drive_mount (GDrive *drive,
iface = G_DRIVE_GET_IFACE (drive); iface = G_DRIVE_GET_IFACE (drive);
if (iface->mount == NULL) if (iface->mount_fn == NULL)
{ {
g_simple_async_report_error_in_idle (G_OBJECT (drive), callback, user_data, g_simple_async_report_error_in_idle (G_OBJECT (drive), callback, user_data,
G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
@ -284,7 +284,7 @@ g_drive_mount (GDrive *drive,
return; return;
} }
(* iface->mount) (drive, mount_operation, cancellable, callback, user_data); (* iface->mount_fn) (drive, mount_operation, cancellable, callback, user_data);
} }
/** /**

View File

@ -70,7 +70,7 @@ struct _GDriveIface
gboolean (*is_automounted)(GDrive *drive); gboolean (*is_automounted)(GDrive *drive);
gboolean (*can_mount) (GDrive *drive); gboolean (*can_mount) (GDrive *drive);
gboolean (*can_eject) (GDrive *drive); gboolean (*can_eject) (GDrive *drive);
void (*mount) (GDrive *drive, void (*mount_fn) (GDrive *drive,
GMountOperation *mount_operation, GMountOperation *mount_operation,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,

View File

@ -999,7 +999,7 @@ g_file_read (GFile *file,
iface = G_FILE_GET_IFACE (file); iface = G_FILE_GET_IFACE (file);
if (iface->read == NULL) if (iface->read_fn == NULL)
{ {
g_set_error (error, G_IO_ERROR, g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED, G_IO_ERROR_NOT_SUPPORTED,
@ -1007,7 +1007,7 @@ g_file_read (GFile *file,
return NULL; return NULL;
} }
return (* iface->read) (file, cancellable, error); return (* iface->read_fn) (file, cancellable, error);
} }
/** /**
@ -3369,7 +3369,7 @@ open_read_async_thread (GSimpleAsyncResult *res,
iface = G_FILE_GET_IFACE (object); iface = G_FILE_GET_IFACE (object);
stream = iface->read (G_FILE (object), cancellable, &error); stream = iface->read_fn (G_FILE (object), cancellable, &error);
if (stream == NULL) if (stream == NULL)
{ {

View File

@ -352,7 +352,7 @@ struct _GFileIface
GFileInfo **info, GFileInfo **info,
GError **error); GError **error);
GFileInputStream * (*read) (GFile *file, GFileInputStream * (*read_fn) (GFile *file,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
void (*read_async) (GFile *file, void (*read_async) (GFile *file,
@ -378,7 +378,7 @@ struct _GFileIface
GAsyncResult *res, GAsyncResult *res,
GError **error); GError **error);
GFileOutputStream * (*create) (GFile *file, GFileOutputStream * (*create) (GFile *file,
GFileCreateFlags flags, GFileCreateFlags flags,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);

View File

@ -204,7 +204,7 @@ g_file_enumerator_close (GFileEnumerator *enumerator,
g_push_current_cancellable (cancellable); g_push_current_cancellable (cancellable);
enumerator->priv->pending = TRUE; enumerator->priv->pending = TRUE;
(* class->close) (enumerator, cancellable, error); (* class->close_fn) (enumerator, cancellable, error);
enumerator->priv->pending = FALSE; enumerator->priv->pending = FALSE;
enumerator->priv->closed = TRUE; enumerator->priv->closed = TRUE;
@ -590,7 +590,7 @@ close_async_thread (GSimpleAsyncResult *res,
open handles */ open handles */
class = G_FILE_ENUMERATOR_GET_CLASS (object); class = G_FILE_ENUMERATOR_GET_CLASS (object);
result = class->close (G_FILE_ENUMERATOR (object), cancellable, &error); result = class->close_fn (G_FILE_ENUMERATOR (object), cancellable, &error);
if (!result) if (!result)
{ {
g_simple_async_result_set_from_error (res, error); g_simple_async_result_set_from_error (res, error);

View File

@ -67,7 +67,7 @@ struct _GFileEnumeratorClass
GFileInfo *(*next_file) (GFileEnumerator *enumerator, GFileInfo *(*next_file) (GFileEnumerator *enumerator,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
gboolean (*close) (GFileEnumerator *enumerator, gboolean (*close_fn) (GFileEnumerator *enumerator,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);

View File

@ -87,7 +87,7 @@ g_file_input_stream_seekable_iface_init (GSeekableIface *iface)
iface->can_seek = g_file_input_stream_seekable_can_seek; iface->can_seek = g_file_input_stream_seekable_can_seek;
iface->seek = g_file_input_stream_seekable_seek; iface->seek = g_file_input_stream_seekable_seek;
iface->can_truncate = g_file_input_stream_seekable_can_truncate; iface->can_truncate = g_file_input_stream_seekable_can_truncate;
iface->truncate = g_file_input_stream_seekable_truncate; iface->truncate_fn = g_file_input_stream_seekable_truncate;
} }
static void static void

View File

@ -86,7 +86,7 @@ g_file_output_stream_seekable_iface_init (GSeekableIface *iface)
iface->can_seek = g_file_output_stream_seekable_can_seek; iface->can_seek = g_file_output_stream_seekable_can_seek;
iface->seek = g_file_output_stream_seekable_seek; iface->seek = g_file_output_stream_seekable_seek;
iface->can_truncate = g_file_output_stream_seekable_can_truncate; iface->can_truncate = g_file_output_stream_seekable_can_truncate;
iface->truncate = g_file_output_stream_seekable_truncate; iface->truncate_fn = g_file_output_stream_seekable_truncate;
} }
static void static void
@ -440,7 +440,7 @@ g_file_output_stream_can_truncate (GFileOutputStream *stream)
class = G_FILE_OUTPUT_STREAM_GET_CLASS (stream); class = G_FILE_OUTPUT_STREAM_GET_CLASS (stream);
can_truncate = FALSE; can_truncate = FALSE;
if (class->truncate) if (class->truncate_fn)
{ {
can_truncate = TRUE; can_truncate = TRUE;
if (class->can_truncate) if (class->can_truncate)
@ -482,7 +482,7 @@ g_file_output_stream_truncate (GFileOutputStream *stream,
output_stream = G_OUTPUT_STREAM (stream); output_stream = G_OUTPUT_STREAM (stream);
class = G_FILE_OUTPUT_STREAM_GET_CLASS (stream); class = G_FILE_OUTPUT_STREAM_GET_CLASS (stream);
if (!class->truncate) if (!class->truncate_fn)
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Truncate not supported on stream")); _("Truncate not supported on stream"));
@ -495,7 +495,7 @@ g_file_output_stream_truncate (GFileOutputStream *stream,
if (cancellable) if (cancellable)
g_push_current_cancellable (cancellable); g_push_current_cancellable (cancellable);
res = class->truncate (stream, size, cancellable, error); res = class->truncate_fn (stream, size, cancellable, error);
if (cancellable) if (cancellable)
g_pop_current_cancellable (cancellable); g_pop_current_cancellable (cancellable);

View File

@ -65,7 +65,7 @@ struct _GFileOutputStreamClass
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
gboolean (*can_truncate) (GFileOutputStream *stream); gboolean (*can_truncate) (GFileOutputStream *stream);
gboolean (*truncate) (GFileOutputStream *stream, gboolean (*truncate_fn) (GFileOutputStream *stream,
goffset size, goffset size,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);

View File

@ -105,9 +105,9 @@ g_filter_input_stream_class_init (GFilterInputStreamClass *klass)
object_class->finalize = g_filter_input_stream_finalize; object_class->finalize = g_filter_input_stream_finalize;
istream_class = G_INPUT_STREAM_CLASS (klass); istream_class = G_INPUT_STREAM_CLASS (klass);
istream_class->read = g_filter_input_stream_read; istream_class->read_fn = g_filter_input_stream_read;
istream_class->skip = g_filter_input_stream_skip; istream_class->skip = g_filter_input_stream_skip;
istream_class->close = g_filter_input_stream_close; istream_class->close_fn = g_filter_input_stream_close;
istream_class->read_async = g_filter_input_stream_read_async; istream_class->read_async = g_filter_input_stream_read_async;
istream_class->read_finish = g_filter_input_stream_read_finish; istream_class->read_finish = g_filter_input_stream_read_finish;

View File

@ -106,9 +106,9 @@ g_filter_output_stream_class_init (GFilterOutputStreamClass *klass)
object_class->dispose = g_filter_output_stream_dispose; object_class->dispose = g_filter_output_stream_dispose;
ostream_class = G_OUTPUT_STREAM_CLASS (klass); ostream_class = G_OUTPUT_STREAM_CLASS (klass);
ostream_class->write = g_filter_output_stream_write; ostream_class->write_fn = g_filter_output_stream_write;
ostream_class->flush = g_filter_output_stream_flush; ostream_class->flush = g_filter_output_stream_flush;
ostream_class->close = g_filter_output_stream_close; ostream_class->close_fn = g_filter_output_stream_close;
ostream_class->write_async = g_filter_output_stream_write_async; ostream_class->write_async = g_filter_output_stream_write_async;
ostream_class->write_finish = g_filter_output_stream_write_finish; ostream_class->write_finish = g_filter_output_stream_write_finish;
ostream_class->flush_async = g_filter_output_stream_flush_async; ostream_class->flush_async = g_filter_output_stream_flush_async;

View File

@ -188,7 +188,7 @@ g_input_stream_read (GInputStream *stream,
class = G_INPUT_STREAM_GET_CLASS (stream); class = G_INPUT_STREAM_GET_CLASS (stream);
if (class->read == NULL) if (class->read_fn == NULL)
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Input stream doesn't implement read")); _("Input stream doesn't implement read"));
@ -201,7 +201,7 @@ g_input_stream_read (GInputStream *stream,
if (cancellable) if (cancellable)
g_push_current_cancellable (cancellable); g_push_current_cancellable (cancellable);
res = class->read (stream, buffer, count, cancellable, error); res = class->read_fn (stream, buffer, count, cancellable, error);
if (cancellable) if (cancellable)
g_pop_current_cancellable (cancellable); g_pop_current_cancellable (cancellable);
@ -368,7 +368,7 @@ g_input_stream_real_skip (GInputStream *stream,
{ {
my_error = NULL; my_error = NULL;
ret = class->read (stream, buffer, MIN (sizeof (buffer), count), ret = class->read_fn (stream, buffer, MIN (sizeof (buffer), count),
cancellable, &my_error); cancellable, &my_error);
if (ret == -1) if (ret == -1)
{ {
@ -447,8 +447,8 @@ g_input_stream_close (GInputStream *stream,
if (cancellable) if (cancellable)
g_push_current_cancellable (cancellable); g_push_current_cancellable (cancellable);
if (class->close) if (class->close_fn)
res = class->close (stream, cancellable, error); res = class->close_fn (stream, cancellable, error);
if (cancellable) if (cancellable)
g_pop_current_cancellable (cancellable); g_pop_current_cancellable (cancellable);
@ -936,9 +936,9 @@ read_async_thread (GSimpleAsyncResult *res,
class = G_INPUT_STREAM_GET_CLASS (object); class = G_INPUT_STREAM_GET_CLASS (object);
op->count_read = class->read (G_INPUT_STREAM (object), op->count_read = class->read_fn (G_INPUT_STREAM (object),
op->buffer, op->count_requested, op->buffer, op->count_requested,
cancellable, &error); cancellable, &error);
if (op->count_read == -1) if (op->count_read == -1)
{ {
g_simple_async_result_set_from_error (res, error); g_simple_async_result_set_from_error (res, error);
@ -1153,7 +1153,7 @@ close_async_thread (GSimpleAsyncResult *res,
open handles */ open handles */
class = G_INPUT_STREAM_GET_CLASS (object); class = G_INPUT_STREAM_GET_CLASS (object);
result = class->close (G_INPUT_STREAM (object), cancellable, &error); result = class->close_fn (G_INPUT_STREAM (object), cancellable, &error);
if (!result) if (!result)
{ {
g_simple_async_result_set_from_error (res, error); g_simple_async_result_set_from_error (res, error);

View File

@ -60,7 +60,7 @@ struct _GInputStreamClass
/* Sync ops: */ /* Sync ops: */
gssize (* read) (GInputStream *stream, gssize (* read_fn) (GInputStream *stream,
void *buffer, void *buffer,
gsize count, gsize count,
GCancellable *cancellable, GCancellable *cancellable,
@ -69,7 +69,7 @@ struct _GInputStreamClass
gsize count, gsize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
gboolean (* close) (GInputStream *stream, gboolean (* close_fn) (GInputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);

View File

@ -1815,7 +1815,7 @@ g_local_file_file_iface_init (GFileIface *iface)
iface->query_writable_namespaces = g_local_file_query_writable_namespaces; iface->query_writable_namespaces = g_local_file_query_writable_namespaces;
iface->set_attribute = g_local_file_set_attribute; iface->set_attribute = g_local_file_set_attribute;
iface->set_attributes_from_info = g_local_file_set_attributes_from_info; iface->set_attributes_from_info = g_local_file_set_attributes_from_info;
iface->read = g_local_file_read; iface->read_fn = g_local_file_read;
iface->append_to = g_local_file_append_to; iface->append_to = g_local_file_append_to;
iface->create = g_local_file_create; iface->create = g_local_file_create;
iface->replace = g_local_file_replace; iface->replace = g_local_file_replace;

View File

@ -92,7 +92,7 @@ g_local_file_enumerator_class_init (GLocalFileEnumeratorClass *klass)
gobject_class->finalize = g_local_file_enumerator_finalize; gobject_class->finalize = g_local_file_enumerator_finalize;
enumerator_class->next_file = g_local_file_enumerator_next_file; enumerator_class->next_file = g_local_file_enumerator_next_file;
enumerator_class->close = g_local_file_enumerator_close; enumerator_class->close_fn = g_local_file_enumerator_close;
} }
static void static void

View File

@ -92,9 +92,9 @@ g_local_file_input_stream_class_init (GLocalFileInputStreamClass *klass)
gobject_class->finalize = g_local_file_input_stream_finalize; gobject_class->finalize = g_local_file_input_stream_finalize;
stream_class->read = g_local_file_input_stream_read; stream_class->read_fn = g_local_file_input_stream_read;
stream_class->skip = g_local_file_input_stream_skip; stream_class->skip = g_local_file_input_stream_skip;
stream_class->close = g_local_file_input_stream_close; stream_class->close_fn = g_local_file_input_stream_close;
file_stream_class->tell = g_local_file_input_stream_tell; file_stream_class->tell = g_local_file_input_stream_tell;
file_stream_class->can_seek = g_local_file_input_stream_can_seek; file_stream_class->can_seek = g_local_file_input_stream_can_seek;
file_stream_class->seek = g_local_file_input_stream_seek; file_stream_class->seek = g_local_file_input_stream_seek;

View File

@ -110,15 +110,15 @@ g_local_file_output_stream_class_init (GLocalFileOutputStreamClass *klass)
gobject_class->finalize = g_local_file_output_stream_finalize; gobject_class->finalize = g_local_file_output_stream_finalize;
stream_class->write = g_local_file_output_stream_write; stream_class->write_fn = g_local_file_output_stream_write;
stream_class->close = g_local_file_output_stream_close; stream_class->close_fn = g_local_file_output_stream_close;
file_stream_class->query_info = g_local_file_output_stream_query_info; file_stream_class->query_info = g_local_file_output_stream_query_info;
file_stream_class->get_etag = g_local_file_output_stream_get_etag; file_stream_class->get_etag = g_local_file_output_stream_get_etag;
file_stream_class->tell = g_local_file_output_stream_tell; file_stream_class->tell = g_local_file_output_stream_tell;
file_stream_class->can_seek = g_local_file_output_stream_can_seek; file_stream_class->can_seek = g_local_file_output_stream_can_seek;
file_stream_class->seek = g_local_file_output_stream_seek; file_stream_class->seek = g_local_file_output_stream_seek;
file_stream_class->can_truncate = g_local_file_output_stream_can_truncate; file_stream_class->can_truncate = g_local_file_output_stream_can_truncate;
file_stream_class->truncate = g_local_file_output_stream_truncate; file_stream_class->truncate_fn = g_local_file_output_stream_truncate;
} }
static void static void

View File

@ -119,9 +119,9 @@ g_memory_input_stream_class_init (GMemoryInputStreamClass *klass)
object_class->finalize = g_memory_input_stream_finalize; object_class->finalize = g_memory_input_stream_finalize;
istream_class = G_INPUT_STREAM_CLASS (klass); istream_class = G_INPUT_STREAM_CLASS (klass);
istream_class->read = g_memory_input_stream_read; istream_class->read_fn = g_memory_input_stream_read;
istream_class->skip = g_memory_input_stream_skip; istream_class->skip = g_memory_input_stream_skip;
istream_class->close = g_memory_input_stream_close; istream_class->close_fn = g_memory_input_stream_close;
istream_class->read_async = g_memory_input_stream_read_async; istream_class->read_async = g_memory_input_stream_read_async;
istream_class->read_finish = g_memory_input_stream_read_finish; istream_class->read_finish = g_memory_input_stream_read_finish;
@ -152,7 +152,7 @@ g_memory_input_stream_seekable_iface_init (GSeekableIface *iface)
iface->can_seek = g_memory_input_stream_can_seek; iface->can_seek = g_memory_input_stream_can_seek;
iface->seek = g_memory_input_stream_seek; iface->seek = g_memory_input_stream_seek;
iface->can_truncate = g_memory_input_stream_can_truncate; iface->can_truncate = g_memory_input_stream_can_truncate;
iface->truncate = g_memory_input_stream_truncate; iface->truncate_fn = g_memory_input_stream_truncate;
} }
static void static void

View File

@ -131,8 +131,8 @@ g_memory_output_stream_class_init (GMemoryOutputStreamClass *klass)
ostream_class = G_OUTPUT_STREAM_CLASS (klass); ostream_class = G_OUTPUT_STREAM_CLASS (klass);
ostream_class->write = g_memory_output_stream_write; ostream_class->write_fn = g_memory_output_stream_write;
ostream_class->close = g_memory_output_stream_close; ostream_class->close_fn = g_memory_output_stream_close;
ostream_class->write_async = g_memory_output_stream_write_async; ostream_class->write_async = g_memory_output_stream_write_async;
ostream_class->write_finish = g_memory_output_stream_write_finish; ostream_class->write_finish = g_memory_output_stream_write_finish;
ostream_class->close_async = g_memory_output_stream_close_async; ostream_class->close_async = g_memory_output_stream_close_async;
@ -189,7 +189,7 @@ g_memory_output_stream_seekable_iface_init (GSeekableIface *iface)
iface->can_seek = g_memory_output_stream_can_seek; iface->can_seek = g_memory_output_stream_can_seek;
iface->seek = g_memory_output_stream_seek; iface->seek = g_memory_output_stream_seek;
iface->can_truncate = g_memory_output_stream_can_truncate; iface->can_truncate = g_memory_output_stream_can_truncate;
iface->truncate = g_memory_output_stream_truncate; iface->truncate_fn = g_memory_output_stream_truncate;
} }

View File

@ -196,7 +196,7 @@ g_output_stream_write (GOutputStream *stream,
class = G_OUTPUT_STREAM_GET_CLASS (stream); class = G_OUTPUT_STREAM_GET_CLASS (stream);
if (class->write == NULL) if (class->write_fn == NULL)
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Output stream doesn't implement write")); _("Output stream doesn't implement write"));
@ -209,7 +209,7 @@ g_output_stream_write (GOutputStream *stream,
if (cancellable) if (cancellable)
g_push_current_cancellable (cancellable); g_push_current_cancellable (cancellable);
res = class->write (stream, buffer, count, cancellable, error); res = class->write_fn (stream, buffer, count, cancellable, error);
if (cancellable) if (cancellable)
g_pop_current_cancellable (cancellable); g_pop_current_cancellable (cancellable);
@ -396,7 +396,8 @@ g_output_stream_real_splice (GOutputStream *stream,
char buffer[8192], *p; char buffer[8192], *p;
gboolean res; gboolean res;
if (class->write == NULL) bytes_copied = 0;
if (class->write_fn == NULL)
{ {
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Output stream doesn't implement write")); _("Output stream doesn't implement write"));
@ -404,7 +405,6 @@ g_output_stream_real_splice (GOutputStream *stream,
goto notsupported; goto notsupported;
} }
bytes_copied = 0;
res = TRUE; res = TRUE;
do do
{ {
@ -421,7 +421,7 @@ g_output_stream_real_splice (GOutputStream *stream,
p = buffer; p = buffer;
while (n_read > 0) while (n_read > 0)
{ {
n_written = class->write (stream, p, n_read, cancellable, error); n_written = class->write_fn (stream, p, n_read, cancellable, error);
if (n_written == -1) if (n_written == -1)
{ {
res = FALSE; res = FALSE;
@ -448,7 +448,7 @@ g_output_stream_real_splice (GOutputStream *stream,
if (flags & G_OUTPUT_STREAM_SPLICE_FLAGS_CLOSE_TARGET) if (flags & G_OUTPUT_STREAM_SPLICE_FLAGS_CLOSE_TARGET)
{ {
/* But write errors on close are bad! */ /* But write errors on close are bad! */
if (!class->close (stream, cancellable, error)) if (!class->close_fn (stream, cancellable, error))
res = FALSE; res = FALSE;
} }
@ -528,14 +528,14 @@ g_output_stream_close (GOutputStream *stream,
/* flushing caused the error that we want to return, /* flushing caused the error that we want to return,
* but we still want to close the underlying stream if possible * but we still want to close the underlying stream if possible
*/ */
if (class->close) if (class->close_fn)
class->close (stream, cancellable, NULL); class->close_fn (stream, cancellable, NULL);
} }
else else
{ {
res = TRUE; res = TRUE;
if (class->close) if (class->close_fn)
res = class->close (stream, cancellable, error); res = class->close_fn (stream, cancellable, error);
} }
if (cancellable) if (cancellable)
@ -1112,8 +1112,8 @@ write_async_thread (GSimpleAsyncResult *res,
class = G_OUTPUT_STREAM_GET_CLASS (object); class = G_OUTPUT_STREAM_GET_CLASS (object);
op = g_simple_async_result_get_op_res_gpointer (res); op = g_simple_async_result_get_op_res_gpointer (res);
op->count_written = class->write (G_OUTPUT_STREAM (object), op->buffer, op->count_requested, op->count_written = class->write_fn (G_OUTPUT_STREAM (object), op->buffer, op->count_requested,
cancellable, &error); cancellable, &error);
if (op->count_written == -1) if (op->count_written == -1)
{ {
g_simple_async_result_set_from_error (res, error); g_simple_async_result_set_from_error (res, error);
@ -1286,7 +1286,7 @@ close_async_thread (GSimpleAsyncResult *res,
open handles */ open handles */
class = G_OUTPUT_STREAM_GET_CLASS (object); class = G_OUTPUT_STREAM_GET_CLASS (object);
result = class->close (G_OUTPUT_STREAM (object), cancellable, &error); result = class->close_fn (G_OUTPUT_STREAM (object), cancellable, &error);
if (!result) if (!result)
{ {
g_simple_async_result_set_from_error (res, error); g_simple_async_result_set_from_error (res, error);

View File

@ -80,22 +80,22 @@ struct _GOutputStreamClass
/* Sync ops: */ /* Sync ops: */
gssize (* write) (GOutputStream *stream, gssize (* write_fn)(GOutputStream *stream,
const void *buffer, const void *buffer,
gsize count, gsize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
gssize (* splice) (GOutputStream *stream, gssize (* splice) (GOutputStream *stream,
GInputStream *source, GInputStream *source,
GOutputStreamSpliceFlags flags, GOutputStreamSpliceFlags flags,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
gboolean (* flush) (GOutputStream *stream, gboolean (* flush) (GOutputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
gboolean (* close) (GOutputStream *stream, gboolean (* close_fn)(GOutputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);
/* Async ops: (optional in derived classes) */ /* Async ops: (optional in derived classes) */

View File

@ -202,7 +202,7 @@ g_seekable_truncate (GSeekable *seekable,
iface = G_SEEKABLE_GET_IFACE (seekable); iface = G_SEEKABLE_GET_IFACE (seekable);
return (* iface->truncate) (seekable, offset, cancellable, error); return (* iface->truncate_fn) (seekable, offset, cancellable, error);
} }
#define __G_SEEKABLE_C__ #define __G_SEEKABLE_C__

View File

@ -48,7 +48,7 @@ typedef struct _GSeekableIface GSeekableIface;
* @can_seek: Checks if seeking is supported by the stream. * @can_seek: Checks if seeking is supported by the stream.
* @seek: Seeks to a location within a stream. * @seek: Seeks to a location within a stream.
* @can_truncate: Chekcs if truncation is suppored by the stream. * @can_truncate: Chekcs if truncation is suppored by the stream.
* @truncate: Truncates a stream. * @truncate_fn: Truncates a stream.
* *
* Provides an interface for implementing seekable functionality on I/O Streams. * Provides an interface for implementing seekable functionality on I/O Streams.
**/ **/
@ -68,7 +68,7 @@ struct _GSeekableIface
GError **error); GError **error);
gboolean (* can_truncate) (GSeekable *seekable); gboolean (* can_truncate) (GSeekable *seekable);
gboolean (* truncate) (GSeekable *seekable, gboolean (* truncate_fn) (GSeekable *seekable,
goffset offset, goffset offset,
GCancellable *cancellable, GCancellable *cancellable,
GError **error); GError **error);

View File

@ -315,7 +315,7 @@ g_unix_volume_drive_iface_init (GDriveIface *iface)
iface->is_automounted = g_unix_drive_is_automounted; iface->is_automounted = g_unix_drive_is_automounted;
iface->can_mount = g_unix_drive_can_mount; iface->can_mount = g_unix_drive_can_mount;
iface->can_eject = g_unix_drive_can_eject; iface->can_eject = g_unix_drive_can_eject;
iface->mount = g_unix_drive_mount; iface->mount_fn = g_unix_drive_mount;
iface->mount_finish = g_unix_drive_mount_finish; iface->mount_finish = g_unix_drive_mount_finish;
iface->eject = g_unix_drive_eject; iface->eject = g_unix_drive_eject;
iface->eject_finish = g_unix_drive_eject_finish; iface->eject_finish = g_unix_drive_eject_finish;

View File

@ -116,8 +116,8 @@ g_unix_input_stream_class_init (GUnixInputStreamClass *klass)
gobject_class->finalize = g_unix_input_stream_finalize; gobject_class->finalize = g_unix_input_stream_finalize;
stream_class->read = g_unix_input_stream_read; stream_class->read_fn = g_unix_input_stream_read;
stream_class->close = g_unix_input_stream_close; stream_class->close_fn = g_unix_input_stream_close;
stream_class->read_async = g_unix_input_stream_read_async; stream_class->read_async = g_unix_input_stream_read_async;
stream_class->read_finish = g_unix_input_stream_read_finish; stream_class->read_finish = g_unix_input_stream_read_finish;
if (0) if (0)

View File

@ -108,8 +108,8 @@ g_unix_output_stream_class_init (GUnixOutputStreamClass *klass)
gobject_class->finalize = g_unix_output_stream_finalize; gobject_class->finalize = g_unix_output_stream_finalize;
stream_class->write = g_unix_output_stream_write; stream_class->write_fn = g_unix_output_stream_write;
stream_class->close = g_unix_output_stream_close; stream_class->close_fn = g_unix_output_stream_close;
stream_class->write_async = g_unix_output_stream_write_async; stream_class->write_async = g_unix_output_stream_write_async;
stream_class->write_finish = g_unix_output_stream_write_finish; stream_class->write_finish = g_unix_output_stream_write_finish;
stream_class->close_async = g_unix_output_stream_close_async; stream_class->close_async = g_unix_output_stream_close_async;