Coding style fixups

svn path=/trunk/; revision=5993
This commit is contained in:
Matthias Clasen 2007-11-29 07:17:59 +00:00
parent 7c0e098f4e
commit 09471fec46
23 changed files with 1268 additions and 1222 deletions

View File

@ -1,3 +1,7 @@
2007-11-28 Matthias Clasen <mclasen@redhat.com>
* *.c: Coding style fixups
2007-11-28 Matthias Clasen <mclasen@redhat.com> 2007-11-28 Matthias Clasen <mclasen@redhat.com>
* inotify/inotify-helper.c: Don't export the lock from libgio. * inotify/inotify-helper.c: Don't export the lock from libgio.

View File

@ -114,8 +114,8 @@ g_app_info_dup (GAppInfo *appinfo)
* Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise. * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
**/ **/
gboolean gboolean
g_app_info_equal (GAppInfo *appinfo1, g_app_info_equal (GAppInfo *appinfo1,
GAppInfo *appinfo2) GAppInfo *appinfo2)
{ {
GAppInfoIface *iface; GAppInfoIface *iface;
@ -255,9 +255,9 @@ g_app_info_set_as_default_for_type (GAppInfo *appinfo,
* or in case of an error. * or in case of an error.
**/ **/
gboolean gboolean
g_app_info_set_as_default_for_extension (GAppInfo *appinfo, g_app_info_set_as_default_for_extension (GAppInfo *appinfo,
const char *extension, const char *extension,
GError **error) GError **error)
{ {
GAppInfoIface *iface; GAppInfoIface *iface;
@ -284,12 +284,12 @@ g_app_info_set_as_default_for_extension (GAppInfo *appinfo,
* application is capable of opening files with the given content type. * application is capable of opening files with the given content type.
* *
* Returns: %TRUE if @appinfo supports @content_type. * Returns: %TRUE if @appinfo supports @content_type.
* %FALSE if not, or in case of an error. * %FALSE if not, or in case of an error.
**/ **/
gboolean gboolean
g_app_info_add_supports_type (GAppInfo *appinfo, g_app_info_add_supports_type (GAppInfo *appinfo,
const char *content_type, const char *content_type,
GError **error) GError **error)
{ {
GAppInfoIface *iface; GAppInfoIface *iface;
@ -301,7 +301,10 @@ g_app_info_add_supports_type (GAppInfo *appinfo,
if (iface->add_supports_type) if (iface->add_supports_type)
return (* iface->add_supports_type) (appinfo, content_type, error); return (* iface->add_supports_type) (appinfo, content_type, error);
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "g_app_info_add_supports_type not supported yet"); g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"g_app_info_add_supports_type not supported yet");
return FALSE; return FALSE;
} }
@ -313,7 +316,7 @@ g_app_info_add_supports_type (GAppInfo *appinfo,
* Checks if a supported content type can be removed from an application. * Checks if a supported content type can be removed from an application.
* *
* Returns: %TRUE if it is possible to remove supported * Returns: %TRUE if it is possible to remove supported
* content types from a given @appinfo, %FALSE if not. * content types from a given @appinfo, %FALSE if not.
**/ **/
gboolean gboolean
g_app_info_can_remove_supports_type (GAppInfo *appinfo) g_app_info_can_remove_supports_type (GAppInfo *appinfo)
@ -340,12 +343,12 @@ g_app_info_can_remove_supports_type (GAppInfo *appinfo)
* Removes a supported type from an application, if possible. * Removes a supported type from an application, if possible.
* *
* Returns: %TRUE if @content_type support was removed * Returns: %TRUE if @content_type support was removed
* from @appinfo. %FALSE if not. * from @appinfo. %FALSE if not.
**/ **/
gboolean gboolean
g_app_info_remove_supports_type (GAppInfo *appinfo, g_app_info_remove_supports_type (GAppInfo *appinfo,
const char *content_type, const char *content_type,
GError **error) GError **error)
{ {
GAppInfoIface *iface; GAppInfoIface *iface;
@ -357,7 +360,10 @@ g_app_info_remove_supports_type (GAppInfo *appinfo,
if (iface->remove_supports_type) if (iface->remove_supports_type)
return (* iface->remove_supports_type) (appinfo, content_type, error); return (* iface->remove_supports_type) (appinfo, content_type, error);
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED, "g_app_info_remove_supports_type not supported yet"); g_set_error (error, G_IO_ERROR,
G_IO_ERROR_NOT_SUPPORTED,
"g_app_info_remove_supports_type not supported yet");
return FALSE; return FALSE;
} }
@ -397,10 +403,10 @@ g_app_info_get_icon (GAppInfo *appinfo)
* Returns: %TRUE on successful launch, %FALSE otherwise. * Returns: %TRUE on successful launch, %FALSE otherwise.
**/ **/
gboolean gboolean
g_app_info_launch (GAppInfo *appinfo, g_app_info_launch (GAppInfo *appinfo,
GList *files, GList *files,
GAppLaunchContext *launch_context, GAppLaunchContext *launch_context,
GError **error) GError **error)
{ {
GAppInfoIface *iface; GAppInfoIface *iface;
@ -447,10 +453,10 @@ g_app_info_supports_uris (GAppInfo *appinfo)
* Returns: %TRUE if the @appinfo was launched successfully, %FALSE otherwise. * Returns: %TRUE if the @appinfo was launched successfully, %FALSE otherwise.
**/ **/
gboolean gboolean
g_app_info_launch_uris (GAppInfo *appinfo, g_app_info_launch_uris (GAppInfo *appinfo,
GList *uris, GList *uris,
GAppLaunchContext *launch_context, GAppLaunchContext *launch_context,
GError **error) GError **error)
{ {
GAppInfoIface *iface; GAppInfoIface *iface;
@ -473,8 +479,8 @@ g_app_info_launch_uris (GAppInfo *appinfo,
* Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise. * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
**/ **/
gboolean gboolean
g_app_info_should_show (GAppInfo *appinfo, g_app_info_should_show (GAppInfo *appinfo,
const char *desktop_env) const char *desktop_env)
{ {
GAppInfoIface *iface; GAppInfoIface *iface;
@ -548,10 +554,12 @@ g_app_launch_context_get_display (GAppLaunchContext *context,
* @files: a #GList of files. * @files: a #GList of files.
* *
* Gets the DESKTOP_STARTUP_ID for the launched application, if supported. * Gets the DESKTOP_STARTUP_ID for the launched application, if supported.
* Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard, * Startup notification IDs are defined in the FreeDesktop.Org Startup
* at <ulink url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt"/>. * Notifications standard, at
* <ulink url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt"/>.
* *
* Returns: a startup notifaction ID for the application, or %NULL if not supported. * Returns: a startup notifaction ID for the application, or %NULL if
* not supported.
**/ **/
char * char *
g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context, g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
@ -575,14 +583,14 @@ g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
/** /**
* g_app_launch_context_launch_failed: * g_app_launch_context_launch_failed:
* @context: a #GAppLaunchContext. * @context: a #GAppLaunchContext.
* @startup_notify_id: a string containing the DESKTOP_STARTUP_ID of the launched application. * @startup_notify_id: a string containing the DESKTOP_STARTUP_ID
* of the launched application.
* *
* TODO: what does this do? Can't find it implemented anywhere. * TODO: what does this do? Can't find it implemented anywhere.
*
**/ **/
void void
g_app_launch_context_launch_failed (GAppLaunchContext *context, g_app_launch_context_launch_failed (GAppLaunchContext *context,
const char *startup_notify_id) const char *startup_notify_id)
{ {
GAppLaunchContextClass *class; GAppLaunchContextClass *class;

View File

@ -50,10 +50,10 @@ async_result_free (gpointer data)
void void
_g_queue_async_result (GAsyncResultData *result, _g_queue_async_result (GAsyncResultData *result,
gpointer async_object, gpointer async_object,
GError *error, GError *error,
gpointer user_data, gpointer user_data,
GSourceFunc source_func) GSourceFunc source_func)
{ {
GSource *source; GSource *source;
@ -83,8 +83,8 @@ typedef struct
} FDSource; } FDSource;
static gboolean static gboolean
fd_source_prepare (GSource *source, fd_source_prepare (GSource *source,
gint *timeout) gint *timeout)
{ {
FDSource *fd_source = (FDSource *)source; FDSource *fd_source = (FDSource *)source;
*timeout = -1; *timeout = -1;
@ -93,7 +93,7 @@ fd_source_prepare (GSource *source,
} }
static gboolean static gboolean
fd_source_check (GSource *source) fd_source_check (GSource *source)
{ {
FDSource *fd_source = (FDSource *)source; FDSource *fd_source = (FDSource *)source;
@ -139,15 +139,15 @@ static GSourceFuncs fd_source_funcs = {
/* Might be called on another thread */ /* Might be called on another thread */
static void static void
fd_source_cancelled_cb (GCancellable *cancellable, fd_source_cancelled_cb (GCancellable *cancellable,
gpointer data) gpointer data)
{ {
/* Wake up the mainloop in case we're waiting on async calls with FDSource */ /* Wake up the mainloop in case we're waiting on async calls with FDSource */
g_main_context_wakeup (NULL); g_main_context_wakeup (NULL);
} }
GSource * GSource *
_g_fd_source_new (int fd, _g_fd_source_new (int fd,
gushort events, gushort events,
GCancellable *cancellable) GCancellable *cancellable)
{ {
GSource *source; GSource *source;

View File

@ -197,7 +197,7 @@ g_buffered_input_stream_get_buffer_size (GBufferedInputStream *stream)
**/ **/
void void
g_buffered_input_stream_set_buffer_size (GBufferedInputStream *stream, g_buffered_input_stream_set_buffer_size (GBufferedInputStream *stream,
gsize size) gsize size)
{ {
GBufferedInputStreamPrivate *priv; GBufferedInputStreamPrivate *priv;
gsize in_buffer; gsize in_buffer;
@ -232,10 +232,10 @@ g_buffered_input_stream_set_buffer_size (GBufferedInputStream *stream,
} }
static void static void
g_buffered_input_stream_set_property (GObject *object, g_buffered_input_stream_set_property (GObject *object,
guint prop_id, guint prop_id,
const GValue *value, const GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
GBufferedInputStreamPrivate *priv; GBufferedInputStreamPrivate *priv;
GBufferedInputStream *bstream; GBufferedInputStream *bstream;
@ -270,15 +270,14 @@ g_buffered_input_stream_get_property (GObject *object,
switch (prop_id) switch (prop_id)
{ {
case PROP_BUFSIZE: case PROP_BUFSIZE:
g_value_set_uint (value, priv->len); g_value_set_uint (value, priv->len);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
} }
} }
static void static void
@ -333,8 +332,8 @@ g_buffered_input_stream_new (GInputStream *base_stream)
* @base_stream: a #GOutputStream. * @base_stream: a #GOutputStream.
* @size: a #gsize. * @size: a #gsize.
* *
* Creates a new #GBufferedInputStream from the given @base_stream, with * Creates a new #GBufferedInputStream from the given @base_stream,
* a buffer set to @size. * with a buffer set to @size.
* *
* Returns: a #GInputStream. * Returns: a #GInputStream.
**/ **/
@ -384,13 +383,13 @@ g_buffered_input_stream_new_sized (GInputStream *base_stream,
* g_buffered_input_stream_fill_async(). * g_buffered_input_stream_fill_async().
* *
* Returns: the number of bytes read into @stream's buffer, up to @count, * Returns: the number of bytes read into @stream's buffer, up to @count,
* or -1 on error. * or -1 on error.
**/ **/
gssize gssize
g_buffered_input_stream_fill (GBufferedInputStream *stream, g_buffered_input_stream_fill (GBufferedInputStream *stream,
gssize count, gssize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GBufferedInputStreamClass *class; GBufferedInputStreamClass *class;
GInputStream *input_stream; GInputStream *input_stream;
@ -431,9 +430,9 @@ g_buffered_input_stream_fill (GBufferedInputStream *stream,
} }
static void static void
async_fill_callback_wrapper (GObject *source_object, async_fill_callback_wrapper (GObject *source_object,
GAsyncResult *res, GAsyncResult *res,
gpointer user_data) gpointer user_data)
{ {
GBufferedInputStream *stream = G_BUFFERED_INPUT_STREAM (source_object); GBufferedInputStream *stream = G_BUFFERED_INPUT_STREAM (source_object);
@ -446,7 +445,7 @@ async_fill_callback_wrapper (GObject *source_object,
* g_buffered_input_stream_fill_async: * g_buffered_input_stream_fill_async:
* @stream: #GBufferedInputStream. * @stream: #GBufferedInputStream.
* @count: a #gssize. * @count: a #gssize.
* @io_priority: the io priority of the request. the io priority of the request. * @io_priority: the io priority of the request.
* @cancellable: optional #GCancellable object * @cancellable: optional #GCancellable object
* @callback: a #GAsyncReadyCallback. * @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer. * @user_data: a #gpointer.
@ -454,16 +453,14 @@ async_fill_callback_wrapper (GObject *source_object,
* Reads data into @stream's buffer asynchronously, up to @count size. * Reads data into @stream's buffer asynchronously, up to @count size.
* @io_priority can be used to prioritize reads. For the synchronous * @io_priority can be used to prioritize reads. For the synchronous
* version of this function, see g_buffered_input_stream_fill(). * version of this function, see g_buffered_input_stream_fill().
*
**/ **/
void void
g_buffered_input_stream_fill_async (GBufferedInputStream *stream, g_buffered_input_stream_fill_async (GBufferedInputStream *stream,
gssize count, gssize count,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GBufferedInputStreamClass *class; GBufferedInputStreamClass *class;
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
@ -517,7 +514,7 @@ g_buffered_input_stream_fill_async (GBufferedInputStream *stream,
stream->priv->outstanding_callback = callback; stream->priv->outstanding_callback = callback;
g_object_ref (stream); g_object_ref (stream);
class->fill_async (stream, count, io_priority, cancellable, class->fill_async (stream, count, io_priority, cancellable,
async_fill_callback_wrapper, user_data); async_fill_callback_wrapper, user_data);
} }
/** /**
@ -532,8 +529,8 @@ g_buffered_input_stream_fill_async (GBufferedInputStream *stream,
**/ **/
gssize gssize
g_buffered_input_stream_fill_finish (GBufferedInputStream *stream, g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
GBufferedInputStreamClass *class; GBufferedInputStreamClass *class;
@ -545,11 +542,11 @@ g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
{ {
simple = G_SIMPLE_ASYNC_RESULT (result); simple = G_SIMPLE_ASYNC_RESULT (result);
if (g_simple_async_result_propagate_error (simple, error)) if (g_simple_async_result_propagate_error (simple, error))
return -1; return -1;
/* Special case read of 0 bytes */ /* Special case read of 0 bytes */
if (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_fill_async) if (g_simple_async_result_get_source_tag (simple) == g_buffered_input_stream_fill_async)
return 0; return 0;
} }
class = G_BUFFERED_INPUT_STREAM_GET_CLASS (stream); class = G_BUFFERED_INPUT_STREAM_GET_CLASS (stream);
@ -565,7 +562,7 @@ g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
* Returns: size of the available stream. * Returns: size of the available stream.
**/ **/
gsize gsize
g_buffered_input_stream_get_available (GBufferedInputStream *stream) g_buffered_input_stream_get_available (GBufferedInputStream *stream)
{ {
g_return_val_if_fail (G_IS_BUFFERED_INPUT_STREAM (stream), -1); g_return_val_if_fail (G_IS_BUFFERED_INPUT_STREAM (stream), -1);
@ -579,16 +576,16 @@ g_buffered_input_stream_get_available (GBufferedInputStream *stream)
* @offset: a #gsize. * @offset: a #gsize.
* @count: a #gsize. * @count: a #gsize.
* *
* Peeks in the buffer, copying data of size @count into @buffer, offset * Peeks in the buffer, copying data of size @count into @buffer,
* @offset bytes. * offset @offset bytes.
* *
* Returns: a #gsize of the number of bytes peeked, or %-1 on error. * Returns: a #gsize of the number of bytes peeked, or %-1 on error.
**/ **/
gsize gsize
g_buffered_input_stream_peek (GBufferedInputStream *stream, g_buffered_input_stream_peek (GBufferedInputStream *stream,
void *buffer, void *buffer,
gsize offset, gsize offset,
gsize count) gsize count)
{ {
gsize available; gsize available;
gsize end; gsize end;
@ -620,8 +617,8 @@ g_buffered_input_stream_peek (GBufferedInputStream *stream,
* Returns: read-only buffer * Returns: read-only buffer
**/ **/
const void* const void*
g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream, g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream,
gsize *count) gsize *count)
{ {
GBufferedInputStreamPrivate *priv; GBufferedInputStreamPrivate *priv;
@ -629,9 +626,8 @@ g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream,
priv = stream->priv; priv = stream->priv;
if (count) { if (count)
*count = priv->end - priv->pos; *count = priv->end - priv->pos;
}
return priv->buffer + priv->pos; return priv->buffer + priv->pos;
} }
@ -646,19 +642,17 @@ compact_buffer (GBufferedInputStream *stream)
current_size = priv->end - priv->pos; current_size = priv->end - priv->pos;
g_memmove (priv->buffer, g_memmove (priv->buffer, priv->buffer + priv->pos, current_size);
priv->buffer + priv->pos,
current_size);
priv->pos = 0; priv->pos = 0;
priv->end = current_size; priv->end = current_size;
} }
static gssize static gssize
g_buffered_input_stream_real_fill (GBufferedInputStream *stream, g_buffered_input_stream_real_fill (GBufferedInputStream *stream,
gssize count, gssize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GBufferedInputStreamPrivate *priv; GBufferedInputStreamPrivate *priv;
GInputStream *base_stream; GInputStream *base_stream;
@ -693,10 +687,10 @@ g_buffered_input_stream_real_fill (GBufferedInputStream *stream,
} }
static gssize static gssize
g_buffered_input_stream_skip (GInputStream *stream, g_buffered_input_stream_skip (GInputStream *stream,
gsize count, gsize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GBufferedInputStream *bstream; GBufferedInputStream *bstream;
GBufferedInputStreamPrivate *priv; GBufferedInputStreamPrivate *priv;
@ -715,7 +709,9 @@ g_buffered_input_stream_skip (GInputStream *stream,
return count; return count;
} }
/* Full request not available, skip all currently availbile and request refill for more */ /* Full request not available, skip all currently available and
* request refill for more
*/
priv->pos = 0; priv->pos = 0;
priv->end = 0; priv->end = 0;
@ -732,15 +728,15 @@ g_buffered_input_stream_skip (GInputStream *stream,
base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream; base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream;
nread = g_input_stream_skip (base_stream, nread = g_input_stream_skip (base_stream,
count, count,
cancellable, cancellable,
error); error);
if (nread < 0 && bytes_skipped == 0) if (nread < 0 && bytes_skipped == 0)
return -1; return -1;
if (nread > 0) if (nread > 0)
bytes_skipped += nread; bytes_skipped += nread;
return bytes_skipped; return bytes_skipped;
} }
@ -752,9 +748,9 @@ g_buffered_input_stream_skip (GInputStream *stream,
if (nread < 0) if (nread < 0)
{ {
if (bytes_skipped == 0) if (bytes_skipped == 0)
return -1; return -1;
else else
return bytes_skipped; return bytes_skipped;
} }
available = priv->end - priv->pos; available = priv->end - priv->pos;
@ -815,10 +811,10 @@ g_buffered_input_stream_read (GInputStream *stream,
error); error);
if (nread < 0 && bytes_read == 0) if (nread < 0 && bytes_read == 0)
return -1; return -1;
if (nread > 0) if (nread > 0)
bytes_read += nread; bytes_read += nread;
return bytes_read; return bytes_read;
} }
@ -829,9 +825,9 @@ g_buffered_input_stream_read (GInputStream *stream,
if (nread < 0) if (nread < 0)
{ {
if (bytes_read == 0) if (bytes_read == 0)
return -1; return -1;
else else
return bytes_read; return bytes_read;
} }
available = priv->end - priv->pos; available = priv->end - priv->pos;
@ -924,9 +920,9 @@ g_buffered_input_stream_read_byte (GBufferedInputStream *stream,
/* ************************** */ /* ************************** */
static void static void
fill_async_callback (GObject *source_object, fill_async_callback (GObject *source_object,
GAsyncResult *result, GAsyncResult *result,
gpointer user_data) gpointer user_data)
{ {
GError *error; GError *error;
gssize res; gssize res;
@ -951,12 +947,12 @@ fill_async_callback (GObject *source_object,
} }
static void static void
g_buffered_input_stream_real_fill_async (GBufferedInputStream *stream, g_buffered_input_stream_real_fill_async (GBufferedInputStream *stream,
gssize count, gssize count,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GBufferedInputStreamPrivate *priv; GBufferedInputStreamPrivate *priv;
GInputStream *base_stream; GInputStream *base_stream;
@ -1364,5 +1360,3 @@ g_buffered_input_stream_skip_finish (GInputStream *stream,
#define __G_BUFFERED_INPUT_STREAM_C__ #define __G_BUFFERED_INPUT_STREAM_C__
#include "gioaliasdef.c" #include "gioaliasdef.c"
/* vim: ts=2 sw=2 et */

View File

@ -762,5 +762,3 @@ g_buffered_output_stream_close_finish (GOutputStream *stream,
#define __G_BUFFERED_OUTPUT_STREAM_C__ #define __G_BUFFERED_OUTPUT_STREAM_C__
#include "gioaliasdef.c" #include "gioaliasdef.c"
/* vim: ts=2 sw=2 et */

View File

@ -45,7 +45,7 @@
#include <windows.h> #include <windows.h>
static char * static char *
get_registry_classes_key (const char *subdir, get_registry_classes_key (const char *subdir,
const wchar_t *key_name) const wchar_t *key_name)
{ {
wchar_t *wc_key; wchar_t *wc_key;
@ -105,8 +105,8 @@ g_content_type_equals (const char *type1,
} }
gboolean gboolean
g_content_type_is_a (const char *type, g_content_type_is_a (const char *type,
const char *supertype) const char *supertype)
{ {
gboolean res; gboolean res;
char *value_utf8; char *value_utf8;
@ -158,7 +158,7 @@ g_content_type_get_description (const char *type)
} }
char * char *
g_content_type_get_mime_type (const char *type) g_content_type_get_mime_type (const char *type)
{ {
char *mime; char *mime;
@ -177,7 +177,7 @@ g_content_type_get_mime_type (const char *type)
} }
GIcon * GIcon *
g_content_type_get_icon (const char *type) g_content_type_get_icon (const char *type)
{ {
g_return_val_if_fail (type != NULL, NULL); g_return_val_if_fail (type != NULL, NULL);
@ -192,7 +192,7 @@ g_content_type_get_icon (const char *type)
} }
gboolean gboolean
g_content_type_can_be_executable (const char *type) g_content_type_can_be_executable (const char *type)
{ {
g_return_val_if_fail (type != NULL, FALSE); g_return_val_if_fail (type != NULL, FALSE);
@ -204,7 +204,8 @@ g_content_type_can_be_executable (const char *type)
} }
static gboolean static gboolean
looks_like_text (const guchar *data, gsize data_size) looks_like_text (const guchar *data,
gsize data_size)
{ {
gsize i; gsize i;
guchar c; guchar c;
@ -352,8 +353,8 @@ _g_unix_content_type_get_parents (const char *type)
* %FALSE otherwise. * %FALSE otherwise.
**/ **/
gboolean gboolean
g_content_type_equals (const char *type1, g_content_type_equals (const char *type1,
const char *type2) const char *type2)
{ {
gboolean res; gboolean res;
@ -378,8 +379,8 @@ g_content_type_equals (const char *type1,
* %FALSE otherwise. * %FALSE otherwise.
**/ **/
gboolean gboolean
g_content_type_is_a (const char *type, g_content_type_is_a (const char *type,
const char *supertype) const char *supertype)
{ {
gboolean res; gboolean res;
@ -441,12 +442,12 @@ language_level (const char *lang)
} }
static void static void
mime_info_start_element (GMarkupParseContext *context, mime_info_start_element (GMarkupParseContext *context,
const gchar *element_name, const gchar *element_name,
const gchar **attribute_names, const gchar **attribute_names,
const gchar **attribute_values, const gchar **attribute_values,
gpointer user_data, gpointer user_data,
GError **error) GError **error)
{ {
int i; int i;
const char *lang; const char *lang;
@ -471,10 +472,10 @@ mime_info_start_element (GMarkupParseContext *context,
} }
static void static void
mime_info_end_element (GMarkupParseContext *context, mime_info_end_element (GMarkupParseContext *context,
const gchar *element_name, const gchar *element_name,
gpointer user_data, gpointer user_data,
GError **error) GError **error)
{ {
MimeParser *parser = user_data; MimeParser *parser = user_data;
@ -482,11 +483,11 @@ mime_info_end_element (GMarkupParseContext *context,
} }
static void static void
mime_info_text (GMarkupParseContext *context, mime_info_text (GMarkupParseContext *context,
const gchar *text, const gchar *text,
gsize text_len, gsize text_len,
gpointer user_data, gpointer user_data,
GError **error) GError **error)
{ {
MimeParser *parser = user_data; MimeParser *parser = user_data;
@ -500,7 +501,8 @@ mime_info_text (GMarkupParseContext *context,
} }
static char * static char *
load_comment_for_mime_helper (const char *dir, const char *basename) load_comment_for_mime_helper (const char *dir,
const char *basename)
{ {
GMarkupParseContext *context; GMarkupParseContext *context;
char *filename, *data; char *filename, *data;
@ -612,7 +614,7 @@ g_content_type_get_description (const char *type)
* Returns: the registered mime-type for the given @type. * Returns: the registered mime-type for the given @type.
**/ **/
char * char *
g_content_type_get_mime_type (const char *type) g_content_type_get_mime_type (const char *type)
{ {
g_return_val_if_fail (type != NULL, NULL); g_return_val_if_fail (type != NULL, NULL);
@ -628,7 +630,7 @@ g_content_type_get_mime_type (const char *type)
* Returns: #GIcon corresponding to the content type. * Returns: #GIcon corresponding to the content type.
**/ **/
GIcon * GIcon *
g_content_type_get_icon (const char *type) g_content_type_get_icon (const char *type)
{ {
g_return_val_if_fail (type != NULL, NULL); g_return_val_if_fail (type != NULL, NULL);
@ -647,7 +649,7 @@ g_content_type_get_icon (const char *type)
* can be executable, %FALSE otherwise. * can be executable, %FALSE otherwise.
**/ **/
gboolean gboolean
g_content_type_can_be_executable (const char *type) g_content_type_can_be_executable (const char *type)
{ {
g_return_val_if_fail (type != NULL, FALSE); g_return_val_if_fail (type != NULL, FALSE);
@ -777,9 +779,9 @@ g_content_type_guess (const char *filename,
} }
static gboolean static gboolean
foreach_mimetype (gpointer key, foreach_mimetype (gpointer key,
gpointer value, gpointer value,
gpointer user_data) gpointer user_data)
{ {
GList **l = user_data; GList **l = user_data;
@ -788,7 +790,9 @@ foreach_mimetype (gpointer key,
} }
static void static void
enumerate_mimetypes_subdir (const char *dir, const char *prefix, GHashTable *mimetypes) enumerate_mimetypes_subdir (const char *dir,
const char *prefix,
GHashTable *mimetypes)
{ {
DIR *d; DIR *d;
struct dirent *ent; struct dirent *ent;
@ -810,7 +814,8 @@ enumerate_mimetypes_subdir (const char *dir, const char *prefix, GHashTable *mim
} }
static void static void
enumerate_mimetypes_dir (const char *dir, GHashTable *mimetypes) enumerate_mimetypes_dir (const char *dir,
GHashTable *mimetypes)
{ {
DIR *d; DIR *d;
struct dirent *ent; struct dirent *ent;

View File

@ -73,10 +73,10 @@ g_data_input_stream_class_init (GDataInputStreamClass *klass)
} }
static void static void
g_data_input_stream_set_property (GObject *object, g_data_input_stream_set_property (GObject *object,
guint prop_id, guint prop_id,
const GValue *value, const GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
GDataInputStreamPrivate *priv; GDataInputStreamPrivate *priv;
GDataInputStream *dstream; GDataInputStream *dstream;
@ -96,9 +96,9 @@ g_data_input_stream_set_property (GObject *object,
static void static void
g_data_input_stream_get_property (GObject *object, g_data_input_stream_get_property (GObject *object,
guint prop_id, guint prop_id,
GValue *value, GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
GDataInputStreamPrivate *priv; GDataInputStreamPrivate *priv;
GDataInputStream *dstream; GDataInputStream *dstream;
@ -108,7 +108,6 @@ g_data_input_stream_get_property (GObject *object,
switch (prop_id) switch (prop_id)
{ {
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
@ -158,8 +157,8 @@ g_data_input_stream_new (GInputStream *base_stream)
* *
**/ **/
void void
g_data_input_stream_set_byte_order (GDataInputStream *stream, g_data_input_stream_set_byte_order (GDataInputStream *stream,
GDataStreamByteOrder order) GDataStreamByteOrder order)
{ {
g_return_if_fail (G_IS_DATA_INPUT_STREAM (stream)); g_return_if_fail (G_IS_DATA_INPUT_STREAM (stream));
@ -194,8 +193,8 @@ g_data_input_stream_get_byte_order (GDataInputStream *stream)
* *
**/ **/
void void
g_data_input_stream_set_newline_type (GDataInputStream *stream, g_data_input_stream_set_newline_type (GDataInputStream *stream,
GDataStreamNewlineType type) GDataStreamNewlineType type)
{ {
g_return_if_fail (G_IS_DATA_INPUT_STREAM (stream)); g_return_if_fail (G_IS_DATA_INPUT_STREAM (stream));
@ -219,11 +218,11 @@ g_data_input_stream_get_newline_type (GDataInputStream *stream)
} }
static gboolean static gboolean
read_data (GDataInputStream *stream, read_data (GDataInputStream *stream,
void *buffer, void *buffer,
gsize size, gsize size,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize available; gsize available;
gssize res; gssize res;
@ -264,9 +263,9 @@ read_data (GDataInputStream *stream,
* if an error occured. * if an error occured.
**/ **/
guchar guchar
g_data_input_stream_read_byte (GDataInputStream *stream, g_data_input_stream_read_byte (GDataInputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
guchar c; guchar c;
@ -294,9 +293,9 @@ g_data_input_stream_read_byte (GDataInputStream *stream,
* an error occured. * an error occured.
**/ **/
gint16 gint16
g_data_input_stream_read_int16 (GDataInputStream *stream, g_data_input_stream_read_int16 (GDataInputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gint16 v; gint16 v;
@ -338,9 +337,9 @@ g_data_input_stream_read_int16 (GDataInputStream *stream,
* an error occured. * an error occured.
**/ **/
guint16 guint16
g_data_input_stream_read_uint16 (GDataInputStream *stream, g_data_input_stream_read_uint16 (GDataInputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
guint16 v; guint16 v;
@ -386,9 +385,9 @@ g_data_input_stream_read_uint16 (GDataInputStream *stream,
* an error occured. * an error occured.
**/ **/
gint32 gint32
g_data_input_stream_read_int32 (GDataInputStream *stream, g_data_input_stream_read_int32 (GDataInputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gint32 v; gint32 v;
@ -434,9 +433,9 @@ g_data_input_stream_read_int32 (GDataInputStream *stream,
* an error occured. * an error occured.
**/ **/
guint32 guint32
g_data_input_stream_read_uint32 (GDataInputStream *stream, g_data_input_stream_read_uint32 (GDataInputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
guint32 v; guint32 v;
@ -482,9 +481,9 @@ g_data_input_stream_read_uint32 (GDataInputStream *stream,
* an error occured. * an error occured.
**/ **/
gint64 gint64
g_data_input_stream_read_int64 (GDataInputStream *stream, g_data_input_stream_read_int64 (GDataInputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gint64 v; gint64 v;
@ -530,9 +529,9 @@ g_data_input_stream_read_int64 (GDataInputStream *stream,
* an error occured. * an error occured.
**/ **/
guint64 guint64
g_data_input_stream_read_uint64 (GDataInputStream *stream, g_data_input_stream_read_uint64 (GDataInputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
guint64 v; guint64 v;
@ -560,9 +559,9 @@ g_data_input_stream_read_uint64 (GDataInputStream *stream,
static gssize static gssize
scan_for_newline (GDataInputStream *stream, scan_for_newline (GDataInputStream *stream,
gsize *checked_out, gsize *checked_out,
gboolean *last_saw_cr_out, gboolean *last_saw_cr_out,
int *newline_len_out) int *newline_len_out)
{ {
GBufferedInputStream *bstream; GBufferedInputStream *bstream;
GDataInputStreamPrivate *priv; GDataInputStreamPrivate *priv;
@ -674,10 +673,10 @@ scan_for_newline (GDataInputStream *stream,
* a #gsize to get the length of the read line. Returns %NULL on an error. * a #gsize to get the length of the read line. Returns %NULL on an error.
**/ **/
char * char *
g_data_input_stream_read_line (GDataInputStream *stream, g_data_input_stream_read_line (GDataInputStream *stream,
gsize *length, gsize *length,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GBufferedInputStream *bstream; GBufferedInputStream *bstream;
gsize checked; gsize checked;
@ -740,8 +739,8 @@ g_data_input_stream_read_line (GDataInputStream *stream,
static gssize static gssize
scan_for_chars (GDataInputStream *stream, scan_for_chars (GDataInputStream *stream,
gsize *checked_out, gsize *checked_out,
const char *stop_chars) const char *stop_chars)
{ {
GBufferedInputStream *bstream; GBufferedInputStream *bstream;
GDataInputStreamPrivate *priv; GDataInputStreamPrivate *priv;
@ -795,11 +794,11 @@ scan_for_chars (GDataInputStream *stream,
* of the string. This function will return %NULL on an error. * of the string. This function will return %NULL on an error.
**/ **/
char * char *
g_data_input_stream_read_until (GDataInputStream *stream, g_data_input_stream_read_until (GDataInputStream *stream,
const gchar *stop_chars, const gchar *stop_chars,
gsize *length, gsize *length,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GBufferedInputStream *bstream; GBufferedInputStream *bstream;
gsize checked; gsize checked;

View File

@ -74,10 +74,10 @@ g_data_output_stream_class_init (GDataOutputStreamClass *klass)
} }
static void static void
g_data_output_stream_set_property (GObject *object, g_data_output_stream_set_property (GObject *object,
guint prop_id, guint prop_id,
const GValue *value, const GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
GDataOutputStreamPrivate *priv; GDataOutputStreamPrivate *priv;
GDataOutputStream *dstream; GDataOutputStream *dstream;
@ -87,12 +87,10 @@ g_data_output_stream_set_property (GObject *object,
switch (prop_id) switch (prop_id)
{ {
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
} }
} }
static void static void
@ -109,13 +107,12 @@ g_data_output_stream_get_property (GObject *object,
switch (prop_id) switch (prop_id)
{ {
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break; break;
} }
} }
static void static void
g_data_output_stream_init (GDataOutputStream *stream) g_data_output_stream_init (GDataOutputStream *stream)
{ {
@ -154,11 +151,10 @@ g_data_output_stream_new (GOutputStream *base_stream)
* @order: a %GDataStreamByteOrder. * @order: a %GDataStreamByteOrder.
* *
* Sets the byte order of the data output stream to @order. * Sets the byte order of the data output stream to @order.
*
**/ **/
void void
g_data_output_stream_set_byte_order (GDataOutputStream *stream, g_data_output_stream_set_byte_order (GDataOutputStream *stream,
GDataStreamByteOrder order) GDataStreamByteOrder order)
{ {
g_return_if_fail (G_IS_DATA_OUTPUT_STREAM (stream)); g_return_if_fail (G_IS_DATA_OUTPUT_STREAM (stream));
@ -193,10 +189,10 @@ g_data_output_stream_get_byte_order (GDataOutputStream *stream)
* Returns: %TRUE if @data was successfully added to the @stream. * Returns: %TRUE if @data was successfully added to the @stream.
**/ **/
gboolean gboolean
g_data_output_stream_put_byte (GDataOutputStream *stream, g_data_output_stream_put_byte (GDataOutputStream *stream,
guchar data, guchar data,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize bytes_written; gsize bytes_written;
@ -220,10 +216,10 @@ g_data_output_stream_put_byte (GDataOutputStream *stream,
* Returns: %TRUE if @data was successfully added to the @stream. * Returns: %TRUE if @data was successfully added to the @stream.
**/ **/
gboolean gboolean
g_data_output_stream_put_int16 (GDataOutputStream *stream, g_data_output_stream_put_int16 (GDataOutputStream *stream,
gint16 data, gint16 data,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize bytes_written; gsize bytes_written;
@ -260,10 +256,10 @@ g_data_output_stream_put_int16 (GDataOutputStream *stream,
* Returns: %TRUE if @data was successfully added to the @stream. * Returns: %TRUE if @data was successfully added to the @stream.
**/ **/
gboolean gboolean
g_data_output_stream_put_uint16 (GDataOutputStream *stream, g_data_output_stream_put_uint16 (GDataOutputStream *stream,
guint16 data, guint16 data,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize bytes_written; gsize bytes_written;
@ -300,10 +296,10 @@ g_data_output_stream_put_uint16 (GDataOutputStream *stream,
* Returns: %TRUE if @data was successfully added to the @stream. * Returns: %TRUE if @data was successfully added to the @stream.
**/ **/
gboolean gboolean
g_data_output_stream_put_int32 (GDataOutputStream *stream, g_data_output_stream_put_int32 (GDataOutputStream *stream,
gint32 data, gint32 data,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize bytes_written; gsize bytes_written;
@ -340,10 +336,10 @@ g_data_output_stream_put_int32 (GDataOutputStream *stream,
* Returns: %TRUE if @data was successfully added to the @stream. * Returns: %TRUE if @data was successfully added to the @stream.
**/ **/
gboolean gboolean
g_data_output_stream_put_uint32 (GDataOutputStream *stream, g_data_output_stream_put_uint32 (GDataOutputStream *stream,
guint32 data, guint32 data,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize bytes_written; gsize bytes_written;
@ -380,10 +376,10 @@ g_data_output_stream_put_uint32 (GDataOutputStream *stream,
* Returns: %TRUE if @data was successfully added to the @stream. * Returns: %TRUE if @data was successfully added to the @stream.
**/ **/
gboolean gboolean
g_data_output_stream_put_int64 (GDataOutputStream *stream, g_data_output_stream_put_int64 (GDataOutputStream *stream,
gint64 data, gint64 data,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize bytes_written; gsize bytes_written;
@ -420,10 +416,10 @@ g_data_output_stream_put_int64 (GDataOutputStream *stream,
* Returns: %TRUE if @data was successfully added to the @stream. * Returns: %TRUE if @data was successfully added to the @stream.
**/ **/
gboolean gboolean
g_data_output_stream_put_uint64 (GDataOutputStream *stream, g_data_output_stream_put_uint64 (GDataOutputStream *stream,
guint64 data, guint64 data,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize bytes_written; gsize bytes_written;
@ -460,10 +456,10 @@ g_data_output_stream_put_uint64 (GDataOutputStream *stream,
* Returns: %TRUE if @string was successfully added to the @stream. * Returns: %TRUE if @string was successfully added to the @stream.
**/ **/
gboolean gboolean
g_data_output_stream_put_string (GDataOutputStream *stream, g_data_output_stream_put_string (GDataOutputStream *stream,
const char *str, const char *str,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize bytes_written; gsize bytes_written;

View File

@ -449,7 +449,10 @@ expand_macro_single (char macro, GFile *file)
} }
static void static void
expand_macro (char macro, GString *exec, GDesktopAppInfo *info, GList **file_list) expand_macro (char macro,
GString *exec,
GDesktopAppInfo *info,
GList **file_list)
{ {
GList *files = *file_list; GList *files = *file_list;
char *expanded; char *expanded;
@ -526,11 +529,11 @@ expand_macro (char macro, GString *exec, GDesktopAppInfo *info, GList **file_lis
} }
static gboolean static gboolean
expand_application_parameters (GDesktopAppInfo *info, expand_application_parameters (GDesktopAppInfo *info,
GList **files, GList **files,
int *argc, int *argc,
char ***argv, char ***argv,
GError **error) GError **error)
{ {
GList *file_list = *files; GList *file_list = *files;
const char *p = info->exec; const char *p = info->exec;
@ -571,7 +574,7 @@ expand_application_parameters (GDesktopAppInfo *info,
} }
static gboolean static gboolean
prepend_terminal_to_vector (int *argc, prepend_terminal_to_vector (int *argc,
char ***argv) char ***argv)
{ {
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
@ -680,9 +683,9 @@ is_env (const char *a,
/* free with g_strfreev */ /* free with g_strfreev */
static char ** static char **
replace_env_var (char **old_environ, replace_env_var (char **old_environ,
const char *env_var, const char *env_var,
const char *new_value) const char *new_value)
{ {
int length, new_length; int length, new_length;
int index, new_index; int index, new_index;
@ -792,10 +795,10 @@ dup_list_segment (GList *start,
} }
static gboolean static gboolean
g_desktop_app_info_launch (GAppInfo *appinfo, g_desktop_app_info_launch (GAppInfo *appinfo,
GList *files, GList *files,
GAppLaunchContext *launch_context, GAppLaunchContext *launch_context,
GError **error) GError **error)
{ {
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo); GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
gboolean completed = FALSE; gboolean completed = FALSE;
@ -916,10 +919,10 @@ g_desktop_app_info_supports_xdg_startup_notify (GAppInfo *appinfo)
} }
static gboolean static gboolean
g_desktop_app_info_launch_uris (GAppInfo *appinfo, g_desktop_app_info_launch_uris (GAppInfo *appinfo,
GList *uris, GList *uris,
GAppLaunchContext *launch_context, GAppLaunchContext *launch_context,
GError **error) GError **error)
{ {
GList *files; GList *files;
GFile *file; GFile *file;
@ -947,7 +950,7 @@ g_desktop_app_info_launch_uris (GAppInfo *appinfo,
} }
static gboolean static gboolean
g_desktop_app_info_should_show (GAppInfo *appinfo, g_desktop_app_info_should_show (GAppInfo *appinfo,
const char *desktop_env) const char *desktop_env)
{ {
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo); GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
@ -993,20 +996,16 @@ typedef enum {
} DirType; } DirType;
static char * static char *
ensure_dir (DirType type, ensure_dir (DirType type,
GError **error) GError **error)
{ {
char *path, *display_name; char *path, *display_name;
int err; int err;
if (type == APP_DIR) if (type == APP_DIR)
{ path = g_build_filename (g_get_user_data_dir (), "applications", NULL);
path = g_build_filename (g_get_user_data_dir (), "applications", NULL);
}
else else
{ path = g_build_filename (g_get_user_data_dir (), "mime", "packages", NULL);
path = g_build_filename (g_get_user_data_dir (), "mime", "packages", NULL);
}
errno = 0; errno = 0;
if (g_mkdir_with_parents (path, 0700) == 0) if (g_mkdir_with_parents (path, 0700) == 0)
@ -1015,17 +1014,13 @@ ensure_dir (DirType type,
err = errno; err = errno;
display_name = g_filename_display_name (path); display_name = g_filename_display_name (path);
if (type == APP_DIR) if (type == APP_DIR)
{ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err),
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err), _("Can't create user application configuration folder %s: %s"),
_("Can't create user application configuration folder %s: %s"), display_name, g_strerror (err));
display_name, g_strerror (err));
}
else else
{ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err),
g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err), _("Can't create user MIME configuration folder %s: %s"),
_("Can't create user MIME configuration folder %s: %s"), display_name, g_strerror (err));
display_name, g_strerror (err));
}
g_free (display_name); g_free (display_name);
g_free (path); g_free (path);
@ -1034,7 +1029,10 @@ ensure_dir (DirType type,
} }
static gboolean static gboolean
update_default_list (const char *desktop_id, const char *content_type, gboolean add, GError **error) update_default_list (const char *desktop_id,
const char *content_type,
gboolean add,
GError **error)
{ {
char *dirname, *filename; char *dirname, *filename;
GKeyFile *key_file; GKeyFile *key_file;
@ -1167,9 +1165,9 @@ run_update_command (char *command,
} }
static gboolean static gboolean
g_desktop_app_info_set_as_default_for_extension (GAppInfo *appinfo, g_desktop_app_info_set_as_default_for_extension (GAppInfo *appinfo,
const char *extension, const char *extension,
GError **error) GError **error)
{ {
char *filename, *basename, *mimetype; char *filename, *basename, *mimetype;
char *dirname; char *dirname;
@ -1215,9 +1213,9 @@ g_desktop_app_info_set_as_default_for_extension (GAppInfo *appinfo,
} }
static gboolean static gboolean
g_desktop_app_info_add_supports_type (GAppInfo *appinfo, g_desktop_app_info_add_supports_type (GAppInfo *appinfo,
const char *content_type, const char *content_type,
GError **error) GError **error)
{ {
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo); GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
GKeyFile *keyfile; GKeyFile *keyfile;
@ -1267,7 +1265,7 @@ g_desktop_app_info_add_supports_type (GAppInfo *appinfo,
} }
static gboolean static gboolean
g_desktop_app_info_can_remove_supports_type (GAppInfo *appinfo) g_desktop_app_info_can_remove_supports_type (GAppInfo *appinfo)
{ {
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo); GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
char *user_dirname; char *user_dirname;
@ -1277,9 +1275,9 @@ g_desktop_app_info_can_remove_supports_type (GAppInfo *appinfo)
} }
static gboolean static gboolean
g_desktop_app_info_remove_supports_type (GAppInfo *appinfo, g_desktop_app_info_remove_supports_type (GAppInfo *appinfo,
const char *content_type, const char *content_type,
GError **error) GError **error)
{ {
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo); GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
GKeyFile *keyfile; GKeyFile *keyfile;
@ -1349,10 +1347,10 @@ g_desktop_app_info_remove_supports_type (GAppInfo *appinfo,
* Returns: new #GAppInfo for given command. * Returns: new #GAppInfo for given command.
**/ **/
GAppInfo * GAppInfo *
g_app_info_create_from_commandline (const char *commandline, g_app_info_create_from_commandline (const char *commandline,
const char *application_name, const char *application_name,
GAppInfoCreateFlags flags, GAppInfoCreateFlags flags,
GError **error) GError **error)
{ {
GKeyFile *key_file; GKeyFile *key_file;
char *dirname; char *dirname;
@ -1475,13 +1473,14 @@ g_desktop_app_info_iface_init (GAppInfoIface *iface)
} }
static gboolean static gboolean
app_info_in_list (GAppInfo *info, GList *l) app_info_in_list (GAppInfo *info,
GList *list)
{ {
while (l != NULL) while (list != NULL)
{ {
if (g_app_info_equal (info, l->data)) if (g_app_info_equal (info, list->data))
return TRUE; return TRUE;
l = l->next; list = list->next;
} }
return FALSE; return FALSE;
} }
@ -1538,7 +1537,7 @@ g_app_info_get_all_for_type (const char *content_type)
**/ **/
GAppInfo * GAppInfo *
g_app_info_get_default_for_type (const char *content_type, g_app_info_get_default_for_type (const char *content_type,
gboolean must_support_uris) gboolean must_support_uris)
{ {
GList *desktop_entries, *l; GList *desktop_entries, *l;
GAppInfo *info; GAppInfo *info;
@ -1587,7 +1586,9 @@ g_app_info_get_default_for_uri_scheme (const char *uri_scheme)
static void static void
get_apps_from_dir (GHashTable *apps, const char *dirname, const char *prefix) get_apps_from_dir (GHashTable *apps,
const char *dirname,
const char *prefix)
{ {
GDir *dir; GDir *dir;
const char *basename; const char *basename;
@ -1653,9 +1654,9 @@ get_apps_from_dir (GHashTable *apps, const char *dirname, const char *prefix)
} }
static void static void
collect_apps (gpointer key, collect_apps (gpointer key,
gpointer value, gpointer value,
gpointer user_data) gpointer user_data)
{ {
GList **infos = user_data; GList **infos = user_data;
@ -1717,14 +1718,16 @@ typedef struct {
static MimeInfoCache *mime_info_cache = NULL; static MimeInfoCache *mime_info_cache = NULL;
G_LOCK_DEFINE_STATIC (mime_info_cache); G_LOCK_DEFINE_STATIC (mime_info_cache);
static void mime_info_cache_dir_add_desktop_entries (MimeInfoCacheDir *dir, static void mime_info_cache_dir_add_desktop_entries (MimeInfoCacheDir *dir,
const char *mime_type, const char *mime_type,
char **new_desktop_file_ids); char **new_desktop_file_ids);
static MimeInfoCache * mime_info_cache_new (void); static MimeInfoCache * mime_info_cache_new (void);
static void static void
destroy_info_cache_value (gpointer key, GList *value, gpointer data) destroy_info_cache_value (gpointer key,
GList *value,
gpointer data)
{ {
g_list_foreach (value, (GFunc)g_free, NULL); g_list_foreach (value, (GFunc)g_free, NULL);
g_list_free (value); g_list_free (value);
@ -1739,8 +1742,8 @@ destroy_info_cache_map (GHashTable *info_cache_map)
static gboolean static gboolean
mime_info_cache_dir_out_of_date (MimeInfoCacheDir *dir, mime_info_cache_dir_out_of_date (MimeInfoCacheDir *dir,
const char *cache_file, const char *cache_file,
time_t *timestamp) time_t *timestamp)
{ {
struct stat buf; struct stat buf;
char *filename; char *filename;
@ -1978,9 +1981,9 @@ mime_info_cache_dir_free (MimeInfoCacheDir *dir)
} }
static void static void
mime_info_cache_dir_add_desktop_entries (MimeInfoCacheDir *dir, mime_info_cache_dir_add_desktop_entries (MimeInfoCacheDir *dir,
const char *mime_type, const char *mime_type,
char **new_desktop_file_ids) char **new_desktop_file_ids)
{ {
GList *desktop_file_ids; GList *desktop_file_ids;
int i; int i;
@ -2120,7 +2123,8 @@ mime_info_cache_reload (const char *dir)
} }
static GList * static GList *
append_desktop_entry (GList *list, const char *desktop_entry) append_desktop_entry (GList *list,
const char *desktop_entry)
{ {
/* Add if not already in list, and valid */ /* Add if not already in list, and valid */
if (!g_list_find_custom (list, desktop_entry, (GCompareFunc) strcmp)) if (!g_list_find_custom (list, desktop_entry, (GCompareFunc) strcmp))

View File

@ -164,7 +164,7 @@ g_directory_monitor_init (GDirectoryMonitor *monitor)
* Returns: %TRUE if the monitor was cancelled successfully. %FALSE otherwise. * Returns: %TRUE if the monitor was cancelled successfully. %FALSE otherwise.
**/ **/
gboolean gboolean
g_directory_monitor_cancel (GDirectoryMonitor* monitor) g_directory_monitor_cancel (GDirectoryMonitor *monitor)
{ {
GDirectoryMonitorClass *class; GDirectoryMonitorClass *class;
@ -182,14 +182,15 @@ g_directory_monitor_cancel (GDirectoryMonitor* monitor)
/** /**
* g_directory_monitor_set_rate_limit: * g_directory_monitor_set_rate_limit:
* @monitor: a #GDirectoryMonitor. * @monitor: a #GDirectoryMonitor.
* @limit_msecs: an integer to set the limit of the directory monitor in milliseconds. * @limit_msecs: an integer to set the limit of the directory monitor
* in milliseconds.
* *
* Sets the limit of the directory monitor to watch for changes every @limit_msecs milliseconds. * Sets the limit of the directory monitor to watch for changes every
* * @limit_msecs milliseconds.
**/ **/
void void
g_directory_monitor_set_rate_limit (GDirectoryMonitor *monitor, g_directory_monitor_set_rate_limit (GDirectoryMonitor *monitor,
int limit_msecs) int limit_msecs)
{ {
g_return_if_fail (G_IS_DIRECTORY_MONITOR (monitor)); g_return_if_fail (G_IS_DIRECTORY_MONITOR (monitor));
@ -202,7 +203,8 @@ g_directory_monitor_set_rate_limit (GDirectoryMonitor *monitor,
* *
* Checks whether @monitor is cancelled. * Checks whether @monitor is cancelled.
* *
* Returns: %TRUE if the monitor on the directory was cancelled. %FALSE otherwise. * Returns: %TRUE if the monitor on the directory was cancelled.
* %FALSE otherwise.
**/ **/
gboolean gboolean
g_directory_monitor_is_cancelled (GDirectoryMonitor *monitor) g_directory_monitor_is_cancelled (GDirectoryMonitor *monitor)
@ -228,7 +230,7 @@ time_difference (guint32 from, guint32 to)
static RateLimiter * static RateLimiter *
new_limiter (GDirectoryMonitor *monitor, new_limiter (GDirectoryMonitor *monitor,
GFile *file) GFile *file)
{ {
RateLimiter *limiter; RateLimiter *limiter;
@ -240,7 +242,8 @@ new_limiter (GDirectoryMonitor *monitor,
} }
static void static void
rate_limiter_send_virtual_changes_done_now (GDirectoryMonitor *monitor, RateLimiter *limiter) rate_limiter_send_virtual_changes_done_now (GDirectoryMonitor *monitor,
RateLimiter *limiter)
{ {
if (limiter->send_virtual_changes_done_at != 0) if (limiter->send_virtual_changes_done_at != 0)
{ {
@ -250,7 +253,9 @@ rate_limiter_send_virtual_changes_done_now (GDirectoryMonitor *monitor, RateLimi
} }
static void static void
rate_limiter_send_delayed_change_now (GDirectoryMonitor *monitor, RateLimiter *limiter, guint32 time_now) rate_limiter_send_delayed_change_now (GDirectoryMonitor *monitor,
RateLimiter *limiter,
guint32 time_now)
{ {
if (limiter->send_delayed_change_at != 0) if (limiter->send_delayed_change_at != 0)
{ {
@ -267,7 +272,10 @@ typedef struct {
} ForEachData; } ForEachData;
static gboolean static gboolean
calc_min_time (GDirectoryMonitor *monitor, RateLimiter *limiter, guint32 time_now, guint32 *min_time) calc_min_time (GDirectoryMonitor *monitor,
RateLimiter *limiter,
guint32 time_now,
guint32 *min_time)
{ {
gboolean delete_me; gboolean delete_me;
guint32 expire_at; guint32 expire_at;
@ -305,9 +313,9 @@ calc_min_time (GDirectoryMonitor *monitor, RateLimiter *limiter, guint32 time_no
} }
static gboolean static gboolean
foreach_rate_limiter_fire (gpointer key, foreach_rate_limiter_fire (gpointer key,
gpointer value, gpointer value,
gpointer user_data) gpointer user_data)
{ {
RateLimiter *limiter = value; RateLimiter *limiter = value;
ForEachData *data = user_data; ForEachData *data = user_data;
@ -361,9 +369,9 @@ rate_limiter_timeout (gpointer timeout_data)
} }
static gboolean static gboolean
foreach_rate_limiter_update (gpointer key, foreach_rate_limiter_update (gpointer key,
gpointer value, gpointer value,
gpointer user_data) gpointer user_data)
{ {
RateLimiter *limiter = value; RateLimiter *limiter = value;
ForEachData *data = user_data; ForEachData *data = user_data;
@ -372,7 +380,8 @@ foreach_rate_limiter_update (gpointer key,
} }
static void static void
update_rate_limiter_timeout (GDirectoryMonitor *monitor, guint new_time) update_rate_limiter_timeout (GDirectoryMonitor *monitor,
guint new_time)
{ {
ForEachData data; ForEachData data;
GSource *source; GSource *source;
@ -416,16 +425,15 @@ update_rate_limiter_timeout (GDirectoryMonitor *monitor, guint new_time)
* @other_file: a #GFile. * @other_file: a #GFile.
* @event_type: a set of #GFileMonitorEvent flags. * @event_type: a set of #GFileMonitorEvent flags.
* *
* Emits the GDirectoryMonitor::changed signal if a change * Emits the #GDirectoryMonitor::changed signal if a change
* has taken place. Should be called from directory monitor * has taken place. Should be called from directory monitor
* implementations only. * implementations only.
*
**/ **/
void void
g_directory_monitor_emit_event (GDirectoryMonitor *monitor, g_directory_monitor_emit_event (GDirectoryMonitor *monitor,
GFile *child, GFile *child,
GFile *other_file, GFile *other_file,
GFileMonitorEvent event_type) GFileMonitorEvent event_type)
{ {
guint32 time_now, since_last; guint32 time_now, since_last;
gboolean emit_now; gboolean emit_now;

View File

@ -73,7 +73,7 @@ g_drive_get_type (void)
static void static void
g_drive_class_init (gpointer g_class, g_drive_class_init (gpointer g_class,
gpointer class_data) gpointer class_data)
{ {
} }
@ -260,14 +260,13 @@ g_drive_can_eject (GDrive *drive)
* @user_data: a #gpointer. * @user_data: a #gpointer.
* *
* Mounts a drive. * Mounts a drive.
*
**/ **/
void void
g_drive_mount (GDrive *drive, g_drive_mount (GDrive *drive,
GMountOperation *mount_operation, GMountOperation *mount_operation,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GDriveIface *iface; GDriveIface *iface;
@ -299,9 +298,9 @@ g_drive_mount (GDrive *drive,
* Returns: %TRUE, %FALSE if operation failed. * Returns: %TRUE, %FALSE if operation failed.
**/ **/
gboolean gboolean
g_drive_mount_finish (GDrive *drive, g_drive_mount_finish (GDrive *drive,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GDriveIface *iface; GDriveIface *iface;
@ -330,10 +329,10 @@ g_drive_mount_finish (GDrive *drive,
* *
**/ **/
void void
g_drive_eject (GDrive *drive, g_drive_eject (GDrive *drive,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GDriveIface *iface; GDriveIface *iface;
@ -365,9 +364,9 @@ g_drive_eject (GDrive *drive,
* %FALSE otherwise. * %FALSE otherwise.
**/ **/
gboolean gboolean
g_drive_eject_finish (GDrive *drive, g_drive_eject_finish (GDrive *drive,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GDriveIface *iface; GDriveIface *iface;

View File

@ -34,7 +34,7 @@
#include "gioalias.h" #include "gioalias.h"
static void g_dummy_file_file_iface_init (GFileIface *iface); static void g_dummy_file_file_iface_init (GFileIface *iface);
typedef struct { typedef struct {
char *scheme; char *scheme;
@ -70,7 +70,8 @@ static char * unescape_string (const gchar *escaped_string,
const gchar *escaped_string_end, const gchar *escaped_string_end,
const gchar *illegal_characters); const gchar *illegal_characters);
static void g_string_append_encoded (GString *string, const char *encoded, static void g_string_append_encoded (GString *string,
const char *encoded,
const char *reserved_chars_allowed); const char *reserved_chars_allowed);
static void static void
@ -218,7 +219,8 @@ g_dummy_file_equal (GFile *file1,
} }
static int static int
safe_strcmp (const char *a, const char *b) safe_strcmp (const char *a,
const char *b)
{ {
if (a == NULL) if (a == NULL)
a = ""; a = "";
@ -245,7 +247,8 @@ uri_same_except_path (GDecodedUri *a,
} }
static const char * static const char *
match_prefix (const char *path, const char *prefix) match_prefix (const char *path,
const char *prefix)
{ {
int prefix_len; int prefix_len;
@ -683,7 +686,8 @@ is_valid (char c, const char *reserved_chars_allowed)
} }
static void static void
g_string_append_encoded (GString *string, const char *encoded, g_string_append_encoded (GString *string,
const char *encoded,
const char *reserved_chars_allowed) const char *reserved_chars_allowed)
{ {
unsigned char c; unsigned char c;

File diff suppressed because it is too large Load Diff

View File

@ -232,7 +232,7 @@ g_file_attribute_value_clear (GFileAttributeValue *attr)
* Sets an attribute's value from another attribute. * Sets an attribute's value from another attribute.
**/ **/
void void
g_file_attribute_value_set (GFileAttributeValue *attr, g_file_attribute_value_set (GFileAttributeValue *attr,
const GFileAttributeValue *new_value) const GFileAttributeValue *new_value)
{ {
g_return_if_fail (attr != NULL); g_return_if_fail (attr != NULL);

View File

@ -179,9 +179,9 @@ g_file_enumerator_next_file (GFileEnumerator *enumerator,
* Return value: #TRUE on success or #FALSE on error. * Return value: #TRUE on success or #FALSE on error.
**/ **/
gboolean gboolean
g_file_enumerator_close (GFileEnumerator *enumerator, g_file_enumerator_close (GFileEnumerator *enumerator,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GFileEnumeratorClass *class; GFileEnumeratorClass *class;
@ -215,9 +215,9 @@ g_file_enumerator_close (GFileEnumerator *enumerator,
} }
static void static void
next_async_callback_wrapper (GObject *source_object, next_async_callback_wrapper (GObject *source_object,
GAsyncResult *res, GAsyncResult *res,
gpointer user_data) gpointer user_data)
{ {
GFileEnumerator *enumerator = G_FILE_ENUMERATOR (source_object); GFileEnumerator *enumerator = G_FILE_ENUMERATOR (source_object);
@ -254,12 +254,12 @@ next_async_callback_wrapper (GObject *source_object,
* priority is %G_PRIORITY_DEFAULT. * priority is %G_PRIORITY_DEFAULT.
**/ **/
void void
g_file_enumerator_next_files_async (GFileEnumerator *enumerator, g_file_enumerator_next_files_async (GFileEnumerator *enumerator,
int num_files, int num_files,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GFileEnumeratorClass *class; GFileEnumeratorClass *class;
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
@ -320,9 +320,9 @@ g_file_enumerator_next_files_async (GFileEnumerator *enumerator,
* Returns: * Returns:
**/ **/
GList * GList *
g_file_enumerator_next_files_finish (GFileEnumerator *enumerator, g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GFileEnumeratorClass *class; GFileEnumeratorClass *class;
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
@ -346,9 +346,9 @@ g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
} }
static void static void
close_async_callback_wrapper (GObject *source_object, close_async_callback_wrapper (GObject *source_object,
GAsyncResult *res, GAsyncResult *res,
gpointer user_data) gpointer user_data)
{ {
GFileEnumerator *enumerator = G_FILE_ENUMERATOR (source_object); GFileEnumerator *enumerator = G_FILE_ENUMERATOR (source_object);
@ -362,18 +362,18 @@ close_async_callback_wrapper (GObject *source_object,
/** /**
* g_file_enumerator_close_async: * g_file_enumerator_close_async:
* @enumerator: a #GFileEnumerator. * @enumerator: a #GFileEnumerator.
* @io_priority: the io priority of the request. the io priority of the request * @io_priority: the io priority of the request.
* @cancellable: optional #GCancellable object, %NULL to ignore. * @cancellable: optional #GCancellable object, %NULL to ignore.
* @callback: callback to call when the request is satisfied * @callback: callback to call when the request is satisfied
* @user_data: the user_data to pass to callback function * @user_data: the user_data to pass to callback function
* *
**/ **/
void void
g_file_enumerator_close_async (GFileEnumerator *enumerator, g_file_enumerator_close_async (GFileEnumerator *enumerator,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GFileEnumeratorClass *class; GFileEnumeratorClass *class;
@ -420,9 +420,9 @@ g_file_enumerator_close_async (GFileEnumerator *enumerator,
* Returns: %TRUE if the close operation has finished successfully. * Returns: %TRUE if the close operation has finished successfully.
**/ **/
gboolean gboolean
g_file_enumerator_close_finish (GFileEnumerator *enumerator, g_file_enumerator_close_finish (GFileEnumerator *enumerator,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
GFileEnumeratorClass *class; GFileEnumeratorClass *class;
@ -476,8 +476,8 @@ g_file_enumerator_has_pending (GFileEnumerator *enumerator)
* *
**/ **/
void void
g_file_enumerator_set_pending (GFileEnumerator *enumerator, g_file_enumerator_set_pending (GFileEnumerator *enumerator,
gboolean pending) gboolean pending)
{ {
g_return_if_fail (G_IS_FILE_ENUMERATOR (enumerator)); g_return_if_fail (G_IS_FILE_ENUMERATOR (enumerator));
@ -491,8 +491,8 @@ typedef struct {
static void static void
next_files_thread (GSimpleAsyncResult *res, next_files_thread (GSimpleAsyncResult *res,
GObject *object, GObject *object,
GCancellable *cancellable) GCancellable *cancellable)
{ {
NextAsyncOp *op; NextAsyncOp *op;
GFileEnumeratorClass *class; GFileEnumeratorClass *class;
@ -535,12 +535,12 @@ next_files_thread (GSimpleAsyncResult *res,
static void static void
g_file_enumerator_real_next_files_async (GFileEnumerator *enumerator, g_file_enumerator_real_next_files_async (GFileEnumerator *enumerator,
int num_files, int num_files,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GSimpleAsyncResult *res; GSimpleAsyncResult *res;
NextAsyncOp *op; NextAsyncOp *op;
@ -575,8 +575,8 @@ g_file_enumerator_real_next_files_finish (GFileEnumerator *enumer
static void static void
close_async_thread (GSimpleAsyncResult *res, close_async_thread (GSimpleAsyncResult *res,
GObject *object, GObject *object,
GCancellable *cancellable) GCancellable *cancellable)
{ {
GFileEnumeratorClass *class; GFileEnumeratorClass *class;
GError *error = NULL; GError *error = NULL;
@ -598,11 +598,11 @@ close_async_thread (GSimpleAsyncResult *res,
static void static void
g_file_enumerator_real_close_async (GFileEnumerator *enumerator, g_file_enumerator_real_close_async (GFileEnumerator *enumerator,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GSimpleAsyncResult *res; GSimpleAsyncResult *res;
@ -621,9 +621,9 @@ g_file_enumerator_real_close_async (GFileEnumerator *enumerator,
} }
static gboolean static gboolean
g_file_enumerator_real_close_finish (GFileEnumerator *enumerator, g_file_enumerator_real_close_finish (GFileEnumerator *enumerator,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_assert (g_simple_async_result_get_source_tag (simple) ==

View File

@ -155,11 +155,11 @@ g_file_icon_icon_iface_init (GIconIface *iface)
static GInputStream * static GInputStream *
g_file_icon_load (GLoadableIcon *icon, g_file_icon_load (GLoadableIcon *icon,
int size, int size,
char **type, char **type,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GFileInputStream *stream; GFileInputStream *stream;
GFileIcon *file_icon = G_FILE_ICON (icon); GFileIcon *file_icon = G_FILE_ICON (icon);
@ -185,9 +185,9 @@ load_data_free (LoadData *data)
} }
static void static void
load_async_callback (GObject *source_object, load_async_callback (GObject *source_object,
GAsyncResult *res, GAsyncResult *res,
gpointer user_data) gpointer user_data)
{ {
GFileInputStream *stream; GFileInputStream *stream;
GError *error = NULL; GError *error = NULL;
@ -223,11 +223,11 @@ load_async_callback (GObject *source_object,
} }
static void static void
g_file_icon_load_async (GLoadableIcon *icon, g_file_icon_load_async (GLoadableIcon *icon,
int size, int size,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GFileIcon *file_icon = G_FILE_ICON (icon); GFileIcon *file_icon = G_FILE_ICON (icon);
LoadData *data; LoadData *data;
@ -244,10 +244,10 @@ g_file_icon_load_async (GLoadableIcon *icon,
} }
static GInputStream * static GInputStream *
g_file_icon_load_finish (GLoadableIcon *icon, g_file_icon_load_finish (GLoadableIcon *icon,
GAsyncResult *res, GAsyncResult *res,
char **type, char **type,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
gpointer op; gpointer op;

View File

@ -257,7 +257,8 @@ g_file_info_new (void)
* Copies all of the #GFileAttribute<!-- -->s from @src_info to @dest_info. * Copies all of the #GFileAttribute<!-- -->s from @src_info to @dest_info.
**/ **/
void void
g_file_info_copy_into (GFileInfo *src_info, GFileInfo *dest_info) g_file_info_copy_into (GFileInfo *src_info,
GFileInfo *dest_info)
{ {
GFileAttribute *source, *dest; GFileAttribute *source, *dest;
int i; int i;
@ -297,7 +298,7 @@ g_file_info_copy_into (GFileInfo *src_info, GFileInfo *dest_info)
* Returns: a duplicate #GFileInfo of @other. * Returns: a duplicate #GFileInfo of @other.
**/ **/
GFileInfo * GFileInfo *
g_file_info_dup (GFileInfo *other) g_file_info_dup (GFileInfo *other)
{ {
GFileInfo *new; GFileInfo *new;
@ -316,7 +317,7 @@ g_file_info_dup (GFileInfo *other)
* Sets @mask on @info to match specific attribute types. * Sets @mask on @info to match specific attribute types.
**/ **/
void void
g_file_info_set_attribute_mask (GFileInfo *info, g_file_info_set_attribute_mask (GFileInfo *info,
GFileAttributeMatcher *mask) GFileAttributeMatcher *mask)
{ {
GFileAttribute *attr; GFileAttribute *attr;
@ -384,7 +385,7 @@ g_file_info_clear_status (GFileInfo *info)
static int static int
g_file_info_find_place (GFileInfo *info, g_file_info_find_place (GFileInfo *info,
guint32 attribute) guint32 attribute)
{ {
int min, max, med; int min, max, med;
GFileAttribute *attrs; GFileAttribute *attrs;
@ -415,7 +416,7 @@ g_file_info_find_place (GFileInfo *info,
static GFileAttributeValue * static GFileAttributeValue *
g_file_info_find_value (GFileInfo *info, g_file_info_find_value (GFileInfo *info,
guint32 attr_id) guint32 attr_id)
{ {
GFileAttribute *attrs; GFileAttribute *attrs;
int i; int i;
@ -430,7 +431,7 @@ g_file_info_find_value (GFileInfo *info,
} }
static GFileAttributeValue * static GFileAttributeValue *
g_file_info_find_value_by_name (GFileInfo *info, g_file_info_find_value_by_name (GFileInfo *info,
const char *attribute) const char *attribute)
{ {
guint32 attr_id; guint32 attr_id;
@ -680,7 +681,7 @@ g_file_info_get_attribute_boolean (GFileInfo *info,
* *
* Gets an unsigned 32-bit integer contained within the attribute. If the * Gets an unsigned 32-bit integer contained within the attribute. If the
* attribute does not contain an unsigned 32-bit integer, or is invalid, * attribute does not contain an unsigned 32-bit integer, or is invalid,
* %0 will be returned. * 0 will be returned.
* *
* Returns: an unsigned 32-bit integer from the attribute. * Returns: an unsigned 32-bit integer from the attribute.
**/ **/
@ -704,7 +705,7 @@ g_file_info_get_attribute_uint32 (GFileInfo *info,
* *
* Gets a signed 32-bit integer contained within the attribute. If the * Gets a signed 32-bit integer contained within the attribute. If the
* attribute does not contain a signed 32-bit integer, or is invalid, * attribute does not contain a signed 32-bit integer, or is invalid,
* %0 will be returned. * 0 will be returned.
* *
* Returns: a signed 32-bit integer from the attribute. * Returns: a signed 32-bit integer from the attribute.
**/ **/
@ -728,7 +729,7 @@ g_file_info_get_attribute_int32 (GFileInfo *info,
* *
* Gets a unsigned 64-bit integer contained within the attribute. If the * Gets a unsigned 64-bit integer contained within the attribute. If the
* attribute does not contain an unsigned 64-bit integer, or is invalid, * attribute does not contain an unsigned 64-bit integer, or is invalid,
* %0 will be returned. * 0 will be returned.
* *
* Returns: a unsigned 64-bit integer from the attribute. * Returns: a unsigned 64-bit integer from the attribute.
**/ **/
@ -752,7 +753,7 @@ g_file_info_get_attribute_uint64 (GFileInfo *info,
* *
* Gets a signed 64-bit integer contained within the attribute. If the * Gets a signed 64-bit integer contained within the attribute. If the
* attribute does not contain an signed 64-bit integer, or is invalid, * attribute does not contain an signed 64-bit integer, or is invalid,
* %0 will be returned. * 0 will be returned.
* *
* Returns: a signed 64-bit integer from the attribute. * Returns: a signed 64-bit integer from the attribute.
**/ **/
@ -817,11 +818,10 @@ g_file_info_create_value_by_name (GFileInfo *info,
* *
* Sets the @attribute to contain the given @attr_value, * Sets the @attribute to contain the given @attr_value,
* if possible. * if possible.
*
**/ **/
void void
g_file_info_set_attribute (GFileInfo *info, g_file_info_set_attribute (GFileInfo *info,
const char *attribute, const char *attribute,
const GFileAttributeValue *attr_value) const GFileAttributeValue *attr_value)
{ {
GFileAttributeValue *value; GFileAttributeValue *value;
@ -843,12 +843,11 @@ g_file_info_set_attribute (GFileInfo *info,
* *
* Sets the @attribute to contain the given @attr_value, * Sets the @attribute to contain the given @attr_value,
* if possible. * if possible.
*
**/ **/
void void
g_file_info_set_attribute_object (GFileInfo *info, g_file_info_set_attribute_object (GFileInfo *info,
const char *attribute, const char *attribute,
GObject *attr_value) GObject *attr_value)
{ {
GFileAttributeValue *value; GFileAttributeValue *value;
@ -869,7 +868,6 @@ g_file_info_set_attribute_object (GFileInfo *info,
* *
* Sets the @attribute to contain the given @attr_value, * Sets the @attribute to contain the given @attr_value,
* if possible. * if possible.
*
**/ **/
void void
g_file_info_set_attribute_string (GFileInfo *info, g_file_info_set_attribute_string (GFileInfo *info,
@ -895,7 +893,6 @@ g_file_info_set_attribute_string (GFileInfo *info,
* *
* Sets the @attribute to contain the given @attr_value, * Sets the @attribute to contain the given @attr_value,
* if possible. * if possible.
*
**/ **/
void void
g_file_info_set_attribute_byte_string (GFileInfo *info, g_file_info_set_attribute_byte_string (GFileInfo *info,
@ -921,12 +918,11 @@ g_file_info_set_attribute_byte_string (GFileInfo *info,
* *
* Sets the @attribute to contain the given @attr_value, * Sets the @attribute to contain the given @attr_value,
* if possible. * if possible.
*
**/ **/
void void
g_file_info_set_attribute_boolean (GFileInfo *info, g_file_info_set_attribute_boolean (GFileInfo *info,
const char *attribute, const char *attribute,
gboolean attr_value) gboolean attr_value)
{ {
GFileAttributeValue *value; GFileAttributeValue *value;
@ -946,9 +942,7 @@ g_file_info_set_attribute_boolean (GFileInfo *info,
* *
* Sets the @attribute to contain the given @attr_value, * Sets the @attribute to contain the given @attr_value,
* if possible. * if possible.
*
**/ **/
void void
g_file_info_set_attribute_uint32 (GFileInfo *info, g_file_info_set_attribute_uint32 (GFileInfo *info,
const char *attribute, const char *attribute,
@ -973,12 +967,11 @@ g_file_info_set_attribute_uint32 (GFileInfo *info,
* *
* Sets the @attribute to contain the given @attr_value, * Sets the @attribute to contain the given @attr_value,
* if possible. * if possible.
*
**/ **/
void void
g_file_info_set_attribute_int32 (GFileInfo *info, g_file_info_set_attribute_int32 (GFileInfo *info,
const char *attribute, const char *attribute,
gint32 attr_value) gint32 attr_value)
{ {
GFileAttributeValue *value; GFileAttributeValue *value;
@ -998,7 +991,6 @@ g_file_info_set_attribute_int32 (GFileInfo *info,
* *
* Sets the @attribute to contain the given @attr_value, * Sets the @attribute to contain the given @attr_value,
* if possible. * if possible.
*
**/ **/
void void
g_file_info_set_attribute_uint64 (GFileInfo *info, g_file_info_set_attribute_uint64 (GFileInfo *info,
@ -1283,9 +1275,7 @@ g_file_info_get_size (GFileInfo *info)
* *
* Gets the modification time of the current @info and sets it * Gets the modification time of the current @info and sets it
* in @result. * in @result.
*
**/ **/
void void
g_file_info_get_modification_time (GFileInfo *info, g_file_info_get_modification_time (GFileInfo *info,
GTimeVal *result) GTimeVal *result)
@ -1389,8 +1379,8 @@ g_file_info_get_sort_order (GFileInfo *info)
* See %G_FILE_ATTRIBUTE_STD_TYPE. * See %G_FILE_ATTRIBUTE_STD_TYPE.
**/ **/
void void
g_file_info_set_file_type (GFileInfo *info, g_file_info_set_file_type (GFileInfo *info,
GFileType type) GFileType type)
{ {
static guint32 attr = 0; static guint32 attr = 0;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1437,7 +1427,6 @@ g_file_info_set_is_hidden (GFileInfo *info,
* *
* Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink. * Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
* See %G_FILE_ATTRIBUTE_STD_IS_SYMLINK. * See %G_FILE_ATTRIBUTE_STD_IS_SYMLINK.
*
**/ **/
void void
g_file_info_set_is_symlink (GFileInfo *info, g_file_info_set_is_symlink (GFileInfo *info,
@ -1463,11 +1452,10 @@ g_file_info_set_is_symlink (GFileInfo *info,
* *
* Sets the name attribute for the current #GFileInfo. * Sets the name attribute for the current #GFileInfo.
* See %G_FILE_ATTRIBUTE_STD_NAME. * See %G_FILE_ATTRIBUTE_STD_NAME.
*
**/ **/
void void
g_file_info_set_name (GFileInfo *info, g_file_info_set_name (GFileInfo *info,
const char *name) const char *name)
{ {
static guint32 attr = 0; static guint32 attr = 0;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1490,11 +1478,10 @@ g_file_info_set_name (GFileInfo *info,
* *
* Sets the display name for the current #GFileInfo. * Sets the display name for the current #GFileInfo.
* See %G_FILE_ATTRIBUTE_STD_DISPLAY_NAME. * See %G_FILE_ATTRIBUTE_STD_DISPLAY_NAME.
*
**/ **/
void void
g_file_info_set_display_name (GFileInfo *info, g_file_info_set_display_name (GFileInfo *info,
const char *display_name) const char *display_name)
{ {
static guint32 attr = 0; static guint32 attr = 0;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1517,12 +1504,10 @@ g_file_info_set_display_name (GFileInfo *info,
* *
* Sets the edit name for the current file. * Sets the edit name for the current file.
* See %G_FILE_ATTRIBUTE_STD_EDIT_NAME. * See %G_FILE_ATTRIBUTE_STD_EDIT_NAME.
*
**/ **/
void void
g_file_info_set_edit_name (GFileInfo *info, g_file_info_set_edit_name (GFileInfo *info,
const char *edit_name) const char *edit_name)
{ {
static guint32 attr = 0; static guint32 attr = 0;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1545,11 +1530,10 @@ g_file_info_set_edit_name (GFileInfo *info,
* *
* Sets the icon for a given #GFileInfo. * Sets the icon for a given #GFileInfo.
* See %G_FILE_ATTRIBUTE_STD_ICON. * See %G_FILE_ATTRIBUTE_STD_ICON.
*
**/ **/
void void
g_file_info_set_icon (GFileInfo *info, g_file_info_set_icon (GFileInfo *info,
GIcon *icon) GIcon *icon)
{ {
static guint32 attr = 0; static guint32 attr = 0;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1572,11 +1556,10 @@ g_file_info_set_icon (GFileInfo *info,
* *
* Sets the content type attribute for a given #GFileInfo. * Sets the content type attribute for a given #GFileInfo.
* See %G_FILE_ATTRIBUTE_STD_CONTENT_TYPE. * See %G_FILE_ATTRIBUTE_STD_CONTENT_TYPE.
*
**/ **/
void void
g_file_info_set_content_type (GFileInfo *info, g_file_info_set_content_type (GFileInfo *info,
const char *content_type) const char *content_type)
{ {
static guint32 attr = 0; static guint32 attr = 0;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1599,11 +1582,10 @@ g_file_info_set_content_type (GFileInfo *info,
* *
* Sets the %G_FILE_ATTRIBUTE_STD_SIZE attribute in the file info * Sets the %G_FILE_ATTRIBUTE_STD_SIZE attribute in the file info
* to the given size. * to the given size.
*
**/ **/
void void
g_file_info_set_size (GFileInfo *info, g_file_info_set_size (GFileInfo *info,
goffset size) goffset size)
{ {
static guint32 attr = 0; static guint32 attr = 0;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1625,11 +1607,10 @@ g_file_info_set_size (GFileInfo *info,
* *
* Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file * Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
* info to the given time value. * info to the given time value.
*
**/ **/
void void
g_file_info_set_modification_time (GFileInfo *info, g_file_info_set_modification_time (GFileInfo *info,
GTimeVal *mtime) GTimeVal *mtime)
{ {
static guint32 attr_mtime = 0, attr_mtime_usec; static guint32 attr_mtime = 0, attr_mtime_usec;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1658,11 +1639,10 @@ g_file_info_set_modification_time (GFileInfo *info,
* *
* Sets the %G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET attribute in the file info * Sets the %G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET attribute in the file info
* to the given symlink target. * to the given symlink target.
*
**/ **/
void void
g_file_info_set_symlink_target (GFileInfo *info, g_file_info_set_symlink_target (GFileInfo *info,
const char *symlink_target) const char *symlink_target)
{ {
static guint32 attr = 0; static guint32 attr = 0;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1685,11 +1665,10 @@ g_file_info_set_symlink_target (GFileInfo *info,
* *
* Sets the sort order attribute in the file info structure. See * Sets the sort order attribute in the file info structure. See
* %G_FILE_ATTRIBUTE_STD_SORT_ORDER. * %G_FILE_ATTRIBUTE_STD_SORT_ORDER.
*
**/ **/
void void
g_file_info_set_sort_order (GFileInfo *info, g_file_info_set_sort_order (GFileInfo *info,
gint32 sort_order) gint32 sort_order)
{ {
static guint32 attr = 0; static guint32 attr = 0;
GFileAttributeValue *value; GFileAttributeValue *value;
@ -1725,7 +1704,8 @@ struct _GFileAttributeMatcher {
static void static void
matcher_add (GFileAttributeMatcher *matcher, matcher_add (GFileAttributeMatcher *matcher,
guint id, guint mask) guint id,
guint mask)
{ {
SubMatcher *sub_matchers; SubMatcher *sub_matchers;
int i; int i;
@ -1923,7 +1903,7 @@ g_file_attribute_matcher_matches_only (GFileAttributeMatcher *matcher,
static gboolean static gboolean
matcher_matches_id (GFileAttributeMatcher *matcher, matcher_matches_id (GFileAttributeMatcher *matcher,
guint32 id) guint32 id)
{ {
SubMatcher *sub_matchers; SubMatcher *sub_matchers;
int i; int i;
@ -1952,7 +1932,7 @@ matcher_matches_id (GFileAttributeMatcher *matcher,
static gboolean static gboolean
g_file_attribute_matcher_matches_id (GFileAttributeMatcher *matcher, g_file_attribute_matcher_matches_id (GFileAttributeMatcher *matcher,
guint32 id) guint32 id)
{ {
g_return_val_if_fail (matcher != NULL, FALSE); g_return_val_if_fail (matcher != NULL, FALSE);

View File

@ -106,19 +106,19 @@ g_file_input_stream_init (GFileInputStream *stream)
* @error: a #GError location to store the error occuring, or %NULL to * @error: a #GError location to store the error occuring, or %NULL to
* ignore. * ignore.
* *
* Queries a file input stream the given @attributes.his function blocks while querying * Queries a file input stream the given @attributes.his function blocks
* the stream. For the asynchronous (non-blocking) version of this function, see * while querying the stream. For the asynchronous (non-blocking) version
* g_file_input_stream_query_info_async(). While the stream is blocked, * of this function, see g_file_input_stream_query_info_async(). While the
* the stream will set the pending flag internally, and any other operations on the * stream is blocked, the stream will set the pending flag internally, and
* stream will fail with %G_IO_ERROR_PENDING. * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
* *
* Returns: a #GFileInfo, or %NULL on error. * Returns: a #GFileInfo, or %NULL on error.
**/ **/
GFileInfo * GFileInfo *
g_file_input_stream_query_info (GFileInputStream *stream, g_file_input_stream_query_info (GFileInputStream *stream,
char *attributes, char *attributes,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GFileInputStreamClass *class; GFileInputStreamClass *class;
GInputStream *input_stream; GInputStream *input_stream;
@ -165,9 +165,9 @@ g_file_input_stream_query_info (GFileInputStream *stream,
} }
static void static void
async_ready_callback_wrapper (GObject *source_object, async_ready_callback_wrapper (GObject *source_object,
GAsyncResult *res, GAsyncResult *res,
gpointer user_data) gpointer user_data)
{ {
GFileInputStream *stream = G_FILE_INPUT_STREAM (source_object); GFileInputStream *stream = G_FILE_INPUT_STREAM (source_object);
@ -186,8 +186,8 @@ async_ready_callback_wrapper (GObject *source_object,
* @callback: callback to call when the request is satisfied * @callback: callback to call when the request is satisfied
* @user_data: the data to pass to callback function * @user_data: the data to pass to callback function
* *
* Queries the stream information asynchronously. For the synchronous version * Queries the stream information asynchronously. For the synchronous
* of this function, see g_file_input_stream_query_info(). * version of this function, see g_file_input_stream_query_info().
* *
* If @cancellable is not %NULL, then the operation can be cancelled by * If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation * triggering the cancellable object from another thread. If the operation
@ -195,12 +195,12 @@ async_ready_callback_wrapper (GObject *source_object,
* *
**/ **/
void void
g_file_input_stream_query_info_async (GFileInputStream *stream, g_file_input_stream_query_info_async (GFileInputStream *stream,
char *attributes, char *attributes,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GFileInputStreamClass *klass; GFileInputStreamClass *klass;
GInputStream *input_stream; GInputStream *input_stream;
@ -242,17 +242,17 @@ g_file_input_stream_query_info_async (GFileInputStream *stream,
* g_file_input_stream_query_info_finish: * g_file_input_stream_query_info_finish:
* @stream: a #GFileInputStream. * @stream: a #GFileInputStream.
* @result: a #GAsyncResult. * @result: a #GAsyncResult.
* @error: a #GError location to store the error occuring, or %NULL to * @error: a #GError location to store the error occuring,
* ignore. * or %NULL to ignore.
* *
* Finishes an asynchronous info query operation. * Finishes an asynchronous info query operation.
* *
* Returns: #GFileInfo. * Returns: #GFileInfo.
**/ **/
GFileInfo * GFileInfo *
g_file_input_stream_query_info_finish (GFileInputStream *stream, g_file_input_stream_query_info_finish (GFileInputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
GFileInputStreamClass *class; GFileInputStreamClass *class;
@ -280,7 +280,7 @@ g_file_input_stream_query_info_finish (GFileInputStream *stream,
* Returns: a #goffset with the position in the stream. * Returns: a #goffset with the position in the stream.
**/ **/
goffset goffset
g_file_input_stream_tell (GFileInputStream *stream) g_file_input_stream_tell (GFileInputStream *stream)
{ {
GFileInputStreamClass *class; GFileInputStreamClass *class;
goffset offset; goffset offset;
@ -311,7 +311,7 @@ g_file_input_stream_seekable_tell (GSeekable *seekable)
* Returns: %TRUE if stream can be seeked. %FALSE otherwise. * Returns: %TRUE if stream can be seeked. %FALSE otherwise.
**/ **/
gboolean gboolean
g_file_input_stream_can_seek (GFileInputStream *stream) g_file_input_stream_can_seek (GFileInputStream *stream)
{ {
GFileInputStreamClass *class; GFileInputStreamClass *class;
gboolean can_seek; gboolean can_seek;
@ -343,8 +343,8 @@ g_file_input_stream_seekable_can_seek (GSeekable *seekable)
* @offset: a #goffset to seek. * @offset: a #goffset to seek.
* @type: a #GSeekType. * @type: a #GSeekType.
* @cancellable: optional #GCancellable object, %NULL to ignore. * @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError location to store the error occuring, or %NULL to * @error: a #GError location to store the error occuring, or
* ignore. * %NULL to ignore.
* *
* Seeks in the file input stream. * Seeks in the file input stream.
* *
@ -408,27 +408,27 @@ g_file_input_stream_seek (GFileInputStream *stream,
} }
static gboolean static gboolean
g_file_input_stream_seekable_seek (GSeekable *seekable, g_file_input_stream_seekable_seek (GSeekable *seekable,
goffset offset, goffset offset,
GSeekType type, GSeekType type,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
return g_file_input_stream_seek (G_FILE_INPUT_STREAM (seekable), return g_file_input_stream_seek (G_FILE_INPUT_STREAM (seekable),
offset, type, cancellable, error); offset, type, cancellable, error);
} }
static gboolean static gboolean
g_file_input_stream_seekable_can_truncate (GSeekable *seekable) g_file_input_stream_seekable_can_truncate (GSeekable *seekable)
{ {
return FALSE; return FALSE;
} }
static gboolean static gboolean
g_file_input_stream_seekable_truncate (GSeekable *seekable, g_file_input_stream_seekable_truncate (GSeekable *seekable,
goffset offset, goffset offset,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
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 allowed on input stream")); _("Truncate not allowed on input stream"));
@ -455,8 +455,8 @@ query_info_data_free (QueryInfoAsyncData *data)
static void static void
query_info_async_thread (GSimpleAsyncResult *res, query_info_async_thread (GSimpleAsyncResult *res,
GObject *object, GObject *object,
GCancellable *cancellable) GCancellable *cancellable)
{ {
GFileInputStreamClass *class; GFileInputStreamClass *class;
GError *error = NULL; GError *error = NULL;
@ -484,12 +484,12 @@ query_info_async_thread (GSimpleAsyncResult *res,
} }
static void static void
g_file_input_stream_real_query_info_async (GFileInputStream *stream, g_file_input_stream_real_query_info_async (GFileInputStream *stream,
char *attributes, char *attributes,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GSimpleAsyncResult *res; GSimpleAsyncResult *res;
QueryInfoAsyncData *data; QueryInfoAsyncData *data;
@ -505,9 +505,9 @@ g_file_input_stream_real_query_info_async (GFileInputStream *stream,
} }
static GFileInfo * static GFileInfo *
g_file_input_stream_real_query_info_finish (GFileInputStream *stream, g_file_input_stream_real_query_info_finish (GFileInputStream *stream,
GAsyncResult *res, GAsyncResult *res,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res); GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
QueryInfoAsyncData *data; QueryInfoAsyncData *data;

View File

@ -211,11 +211,11 @@ g_filter_input_stream_get_base_stream (GFilterInputStream *stream)
} }
static gssize static gssize
g_filter_input_stream_read (GInputStream *stream, g_filter_input_stream_read (GInputStream *stream,
void *buffer, void *buffer,
gsize count, gsize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GFilterInputStream *filter_stream; GFilterInputStream *filter_stream;
GInputStream *base_stream; GInputStream *base_stream;
@ -234,10 +234,10 @@ g_filter_input_stream_read (GInputStream *stream,
} }
static gssize static gssize
g_filter_input_stream_skip (GInputStream *stream, g_filter_input_stream_skip (GInputStream *stream,
gsize count, gsize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GFilterInputStream *filter_stream; GFilterInputStream *filter_stream;
GInputStream *base_stream; GInputStream *base_stream;
@ -273,13 +273,13 @@ g_filter_input_stream_close (GInputStream *stream,
} }
static void static void
g_filter_input_stream_read_async (GInputStream *stream, g_filter_input_stream_read_async (GInputStream *stream,
void *buffer, void *buffer,
gsize count, gsize count,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GFilterInputStream *filter_stream; GFilterInputStream *filter_stream;
GInputStream *base_stream; GInputStream *base_stream;
@ -358,11 +358,11 @@ g_filter_input_stream_skip_finish (GInputStream *stream,
} }
static void static void
g_filter_input_stream_close_async (GInputStream *stream, g_filter_input_stream_close_async (GInputStream *stream,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GFilterInputStream *filter_stream; GFilterInputStream *filter_stream;
GInputStream *base_stream; GInputStream *base_stream;
@ -375,8 +375,6 @@ g_filter_input_stream_close_async (GInputStream *stream,
cancellable, cancellable,
callback, callback,
user_data); user_data);
} }
static gboolean static gboolean
@ -400,5 +398,3 @@ g_filter_input_stream_close_finish (GInputStream *stream,
#define __G_FILTER_INPUT_STREAM_C__ #define __G_FILTER_INPUT_STREAM_C__
#include "gioaliasdef.c" #include "gioaliasdef.c"
/* vim: ts=2 sw=2 et */

View File

@ -128,10 +128,10 @@ g_filter_output_stream_class_init (GFilterOutputStreamClass *klass)
} }
static void static void
g_filter_output_stream_set_property (GObject *object, g_filter_output_stream_set_property (GObject *object,
guint prop_id, guint prop_id,
const GValue *value, const GValue *value,
GParamSpec *pspec) GParamSpec *pspec)
{ {
GFilterOutputStream *filter_stream; GFilterOutputStream *filter_stream;
GObject *obj; GObject *obj;
@ -178,7 +178,7 @@ g_filter_output_stream_get_property (GObject *object,
static void static void
g_filter_output_stream_dispose (GObject *object) g_filter_output_stream_dispose (GObject *object)
{ {
GFilterOutputStream *stream; GFilterOutputStream *stream;
stream = G_FILTER_OUTPUT_STREAM (object); stream = G_FILTER_OUTPUT_STREAM (object);
@ -214,11 +214,11 @@ g_filter_output_stream_get_base_stream (GFilterOutputStream *stream)
} }
static gssize static gssize
g_filter_output_stream_write (GOutputStream *stream, g_filter_output_stream_write (GOutputStream *stream,
const void *buffer, const void *buffer,
gsize count, gsize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GFilterOutputStream *filter_stream; GFilterOutputStream *filter_stream;
gssize nwritten; gssize nwritten;
@ -235,9 +235,9 @@ g_filter_output_stream_write (GOutputStream *stream,
} }
static gboolean static gboolean
g_filter_output_stream_flush (GOutputStream *stream, g_filter_output_stream_flush (GOutputStream *stream,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GFilterOutputStream *filter_stream; GFilterOutputStream *filter_stream;
gboolean res; gboolean res;
@ -269,13 +269,13 @@ g_filter_output_stream_close (GOutputStream *stream,
} }
static void static void
g_filter_output_stream_write_async (GOutputStream *stream, g_filter_output_stream_write_async (GOutputStream *stream,
const void *buffer, const void *buffer,
gsize count, gsize count,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer data) gpointer data)
{ {
GFilterOutputStream *filter_stream; GFilterOutputStream *filter_stream;
@ -292,9 +292,9 @@ g_filter_output_stream_write_async (GOutputStream *stream,
} }
static gssize static gssize
g_filter_output_stream_write_finish (GOutputStream *stream, g_filter_output_stream_write_finish (GOutputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GFilterOutputStream *filter_stream; GFilterOutputStream *filter_stream;
gssize nwritten; gssize nwritten;
@ -309,11 +309,11 @@ g_filter_output_stream_write_finish (GOutputStream *stream,
} }
static void static void
g_filter_output_stream_flush_async (GOutputStream *stream, g_filter_output_stream_flush_async (GOutputStream *stream,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer data) gpointer data)
{ {
GFilterOutputStream *filter_stream; GFilterOutputStream *filter_stream;
@ -327,9 +327,9 @@ g_filter_output_stream_flush_async (GOutputStream *stream,
} }
static gboolean static gboolean
g_filter_output_stream_flush_finish (GOutputStream *stream, g_filter_output_stream_flush_finish (GOutputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GFilterOutputStream *filter_stream; GFilterOutputStream *filter_stream;
gboolean res; gboolean res;
@ -344,11 +344,11 @@ g_filter_output_stream_flush_finish (GOutputStream *stream,
} }
static void static void
g_filter_output_stream_close_async (GOutputStream *stream, g_filter_output_stream_close_async (GOutputStream *stream,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer data) gpointer data)
{ {
GFilterOutputStream *filter_stream; GFilterOutputStream *filter_stream;
@ -362,9 +362,9 @@ g_filter_output_stream_close_async (GOutputStream *stream,
} }
static gboolean static gboolean
g_filter_output_stream_close_finish (GOutputStream *stream, g_filter_output_stream_close_finish (GOutputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GFilterOutputStream *filter_stream; GFilterOutputStream *filter_stream;
gboolean res; gboolean res;

View File

@ -248,12 +248,12 @@ g_input_stream_read (GInputStream *stream,
* Return value: %TRUE on success, %FALSE if there was an error * Return value: %TRUE on success, %FALSE if there was an error
**/ **/
gboolean gboolean
g_input_stream_read_all (GInputStream *stream, g_input_stream_read_all (GInputStream *stream,
void *buffer, void *buffer,
gsize count, gsize count,
gsize *bytes_read, gsize *bytes_read,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
gsize _bytes_read; gsize _bytes_read;
gssize res; gssize res;
@ -309,10 +309,10 @@ g_input_stream_read_all (GInputStream *stream,
* Return value: Number of bytes skipped, or -1 on error * Return value: Number of bytes skipped, or -1 on error
**/ **/
gssize gssize
g_input_stream_skip (GInputStream *stream, g_input_stream_skip (GInputStream *stream,
gsize count, gsize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GInputStreamClass *class; GInputStreamClass *class;
gssize res; gssize res;
@ -359,10 +359,10 @@ g_input_stream_skip (GInputStream *stream,
} }
static gssize static gssize
g_input_stream_real_skip (GInputStream *stream, g_input_stream_real_skip (GInputStream *stream,
gsize count, gsize count,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GInputStreamClass *class; GInputStreamClass *class;
gssize ret, read_bytes; gssize ret, read_bytes;
@ -489,7 +489,7 @@ g_input_stream_close (GInputStream *stream,
} }
static void static void
async_ready_callback_wrapper (GObject *source_object, async_ready_callback_wrapper (GObject *source_object,
GAsyncResult *res, GAsyncResult *res,
gpointer user_data) gpointer user_data)
{ {
@ -502,7 +502,7 @@ async_ready_callback_wrapper (GObject *source_object,
} }
static void static void
async_ready_close_callback_wrapper (GObject *source_object, async_ready_close_callback_wrapper (GObject *source_object,
GAsyncResult *res, GAsyncResult *res,
gpointer user_data) gpointer user_data)
{ {
@ -625,9 +625,9 @@ g_input_stream_read_async (GInputStream *stream,
* Returns: number of bytes read in, or -1 on error. * Returns: number of bytes read in, or -1 on error.
**/ **/
gssize gssize
g_input_stream_read_finish (GInputStream *stream, g_input_stream_read_finish (GInputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
GInputStreamClass *class; GInputStreamClass *class;
@ -757,9 +757,9 @@ g_input_stream_skip_async (GInputStream *stream,
* Returns: the size of the bytes skipped, or %-1 on error. * Returns: the size of the bytes skipped, or %-1 on error.
**/ **/
gssize gssize
g_input_stream_skip_finish (GInputStream *stream, g_input_stream_skip_finish (GInputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
GInputStreamClass *class; GInputStreamClass *class;
@ -800,11 +800,11 @@ g_input_stream_skip_finish (GInputStream *stream,
* override one you must override all. * override one you must override all.
**/ **/
void void
g_input_stream_close_async (GInputStream *stream, g_input_stream_close_async (GInputStream *stream,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GInputStreamClass *class; GInputStreamClass *class;
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
@ -853,9 +853,9 @@ g_input_stream_close_async (GInputStream *stream,
* Returns: %TRUE if the stream was closed successfully. * Returns: %TRUE if the stream was closed successfully.
**/ **/
gboolean gboolean
g_input_stream_close_finish (GInputStream *stream, g_input_stream_close_finish (GInputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple; GSimpleAsyncResult *simple;
GInputStreamClass *class; GInputStreamClass *class;
@ -918,8 +918,8 @@ g_input_stream_has_pending (GInputStream *stream)
* Sets @stream has actions pending. * Sets @stream has actions pending.
**/ **/
void void
g_input_stream_set_pending (GInputStream *stream, g_input_stream_set_pending (GInputStream *stream,
gboolean pending) gboolean pending)
{ {
g_return_if_fail (G_IS_INPUT_STREAM (stream)); g_return_if_fail (G_IS_INPUT_STREAM (stream));
@ -938,8 +938,8 @@ typedef struct {
static void static void
read_async_thread (GSimpleAsyncResult *res, read_async_thread (GSimpleAsyncResult *res,
GObject *object, GObject *object,
GCancellable *cancellable) GCancellable *cancellable)
{ {
ReadData *op; ReadData *op;
GInputStreamClass *class; GInputStreamClass *class;
@ -960,13 +960,13 @@ read_async_thread (GSimpleAsyncResult *res,
} }
static void static void
g_input_stream_real_read_async (GInputStream *stream, g_input_stream_real_read_async (GInputStream *stream,
void *buffer, void *buffer,
gsize count, gsize count,
int io_priority, int io_priority,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GSimpleAsyncResult *res; GSimpleAsyncResult *res;
ReadData *op; ReadData *op;
@ -982,9 +982,9 @@ g_input_stream_real_read_async (GInputStream *stream,
} }
static gssize static gssize
g_input_stream_real_read_finish (GInputStream *stream, g_input_stream_real_read_finish (GInputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
ReadData *op; ReadData *op;
@ -1005,8 +1005,8 @@ typedef struct {
static void static void
skip_async_thread (GSimpleAsyncResult *res, skip_async_thread (GSimpleAsyncResult *res,
GObject *object, GObject *object,
GCancellable *cancellable) GCancellable *cancellable)
{ {
SkipData *op; SkipData *op;
GInputStreamClass *class; GInputStreamClass *class;
@ -1035,9 +1035,9 @@ typedef struct {
} SkipFallbackAsyncData; } SkipFallbackAsyncData;
static void static void
skip_callback_wrapper (GObject *source_object, skip_callback_wrapper (GObject *source_object,
GAsyncResult *res, GAsyncResult *res,
gpointer user_data) gpointer user_data)
{ {
GInputStreamClass *class; GInputStreamClass *class;
SkipFallbackAsyncData *data = user_data; SkipFallbackAsyncData *data = user_data;
@ -1139,9 +1139,9 @@ g_input_stream_real_skip_async (GInputStream *stream,
} }
static gssize static gssize
g_input_stream_real_skip_finish (GInputStream *stream, g_input_stream_real_skip_finish (GInputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
SkipData *op; SkipData *op;
@ -1153,8 +1153,8 @@ g_input_stream_real_skip_finish (GInputStream *stream,
static void static void
close_async_thread (GSimpleAsyncResult *res, close_async_thread (GSimpleAsyncResult *res,
GObject *object, GObject *object,
GCancellable *cancellable) GCancellable *cancellable)
{ {
GInputStreamClass *class; GInputStreamClass *class;
GError *error = NULL; GError *error = NULL;
@ -1198,9 +1198,9 @@ g_input_stream_real_close_async (GInputStream *stream,
} }
static gboolean static gboolean
g_input_stream_real_close_finish (GInputStream *stream, g_input_stream_real_close_finish (GInputStream *stream,
GAsyncResult *result, GAsyncResult *result,
GError **error) GError **error)
{ {
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result); GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_close_async); g_assert (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_close_async);

View File

@ -53,8 +53,8 @@ static GSList *active_jobs = NULL;
static GThreadPool *job_thread_pool = NULL; static GThreadPool *job_thread_pool = NULL;
static void io_job_thread (gpointer data, static void io_job_thread (gpointer data,
gpointer user_data); gpointer user_data);
static void static void
g_io_job_free (GIOJob *job) g_io_job_free (GIOJob *job)
@ -65,9 +65,9 @@ g_io_job_free (GIOJob *job)
} }
static gint static gint
g_io_job_compare (gconstpointer a, g_io_job_compare (gconstpointer a,
gconstpointer b, gconstpointer b,
gpointer user_data) gpointer user_data)
{ {
const GIOJob *aa = a; const GIOJob *aa = a;
const GIOJob *bb = b; const GIOJob *bb = b;
@ -142,8 +142,8 @@ remove_active_job (GIOJob *job)
} }
static void static void
io_job_thread (gpointer data, io_job_thread (gpointer data,
gpointer user_data) gpointer user_data)
{ {
GIOJob *job = data; GIOJob *job = data;
@ -195,11 +195,11 @@ run_job_at_idle (gpointer data)
* *
**/ **/
void void
g_schedule_io_job (GIOJobFunc job_func, g_schedule_io_job (GIOJobFunc job_func,
gpointer user_data, gpointer user_data,
GDestroyNotify notify, GDestroyNotify notify,
gint io_priority, gint io_priority,
GCancellable *cancellable) GCancellable *cancellable)
{ {
static GOnce once_init = G_ONCE_INIT; static GOnce once_init = G_ONCE_INIT;
GIOJob *job; GIOJob *job;
@ -329,11 +329,11 @@ mainloop_proxy_notify (gpointer data)
* *
**/ **/
void void
g_io_job_send_to_mainloop (GIOJob *job, g_io_job_send_to_mainloop (GIOJob *job,
GIODataFunc func, GIODataFunc func,
gpointer user_data, gpointer user_data,
GDestroyNotify notify, GDestroyNotify notify,
gboolean block) gboolean block)
{ {
GSource *source; GSource *source;
MainLoopProxy *proxy; MainLoopProxy *proxy;

View File

@ -109,11 +109,11 @@ g_loadable_icon_base_init (gpointer g_class)
* Returns: a #GInputStream to read the icon from. * Returns: a #GInputStream to read the icon from.
**/ **/
GInputStream * GInputStream *
g_loadable_icon_load (GLoadableIcon *icon, g_loadable_icon_load (GLoadableIcon *icon,
int size, int size,
char **type, char **type,
GCancellable *cancellable, GCancellable *cancellable,
GError **error) GError **error)
{ {
GLoadableIconIface *iface; GLoadableIconIface *iface;
@ -139,11 +139,11 @@ g_loadable_icon_load (GLoadableIcon *icon,
* *
**/ **/
void void
g_loadable_icon_load_async (GLoadableIcon *icon, g_loadable_icon_load_async (GLoadableIcon *icon,
int size, int size,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GLoadableIconIface *iface; GLoadableIconIface *iface;
@ -168,10 +168,10 @@ g_loadable_icon_load_async (GLoadableIcon *icon,
* Returns: a #GInputStream to read the icon from. * Returns: a #GInputStream to read the icon from.
**/ **/
GInputStream * GInputStream *
g_loadable_icon_load_finish (GLoadableIcon *icon, g_loadable_icon_load_finish (GLoadableIcon *icon,
GAsyncResult *res, GAsyncResult *res,
char **type, char **type,
GError **error) GError **error)
{ {
GLoadableIconIface *iface; GLoadableIconIface *iface;
@ -212,8 +212,8 @@ load_data_free (LoadData *data)
static void static void
load_async_thread (GSimpleAsyncResult *res, load_async_thread (GSimpleAsyncResult *res,
GObject *object, GObject *object,
GCancellable *cancellable) GCancellable *cancellable)
{ {
GLoadableIconIface *iface; GLoadableIconIface *iface;
GInputStream *stream; GInputStream *stream;
@ -241,11 +241,11 @@ load_async_thread (GSimpleAsyncResult *res,
static void static void
g_loadable_icon_real_load_async (GLoadableIcon *icon, g_loadable_icon_real_load_async (GLoadableIcon *icon,
int size, int size,
GCancellable *cancellable, GCancellable *cancellable,
GAsyncReadyCallback callback, GAsyncReadyCallback callback,
gpointer user_data) gpointer user_data)
{ {
GSimpleAsyncResult *res; GSimpleAsyncResult *res;
LoadData *data; LoadData *data;