2007-11-28 Matthias Clasen <mclasen@redhat.com>
+ * *.c: Coding style fixups
+
+2007-11-28 Matthias Clasen <mclasen@redhat.com>
+
* inotify/inotify-helper.c: Don't export the lock from libgio.
2007-11-28 Matthias Clasen <mclasen@redhat.com>
* Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
**/
gboolean
-g_app_info_equal (GAppInfo *appinfo1,
- GAppInfo *appinfo2)
+g_app_info_equal (GAppInfo *appinfo1,
+ GAppInfo *appinfo2)
{
GAppInfoIface *iface;
* or in case of an error.
**/
gboolean
-g_app_info_set_as_default_for_extension (GAppInfo *appinfo,
- const char *extension,
- GError **error)
+g_app_info_set_as_default_for_extension (GAppInfo *appinfo,
+ const char *extension,
+ GError **error)
{
GAppInfoIface *iface;
* application is capable of opening files with the given 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
-g_app_info_add_supports_type (GAppInfo *appinfo,
- const char *content_type,
- GError **error)
+g_app_info_add_supports_type (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error)
{
GAppInfoIface *iface;
if (iface->add_supports_type)
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;
}
* Checks if a supported content type can be removed from an application.
*
* 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
g_app_info_can_remove_supports_type (GAppInfo *appinfo)
* Removes a supported type from an application, if possible.
*
* Returns: %TRUE if @content_type support was removed
- * from @appinfo. %FALSE if not.
+ * from @appinfo. %FALSE if not.
**/
gboolean
-g_app_info_remove_supports_type (GAppInfo *appinfo,
- const char *content_type,
- GError **error)
+g_app_info_remove_supports_type (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error)
{
GAppInfoIface *iface;
if (iface->remove_supports_type)
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;
}
* Returns: %TRUE on successful launch, %FALSE otherwise.
**/
gboolean
-g_app_info_launch (GAppInfo *appinfo,
- GList *files,
- GAppLaunchContext *launch_context,
- GError **error)
+g_app_info_launch (GAppInfo *appinfo,
+ GList *files,
+ GAppLaunchContext *launch_context,
+ GError **error)
{
GAppInfoIface *iface;
* Returns: %TRUE if the @appinfo was launched successfully, %FALSE otherwise.
**/
gboolean
-g_app_info_launch_uris (GAppInfo *appinfo,
- GList *uris,
- GAppLaunchContext *launch_context,
- GError **error)
+g_app_info_launch_uris (GAppInfo *appinfo,
+ GList *uris,
+ GAppLaunchContext *launch_context,
+ GError **error)
{
GAppInfoIface *iface;
* Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
**/
gboolean
-g_app_info_should_show (GAppInfo *appinfo,
- const char *desktop_env)
+g_app_info_should_show (GAppInfo *appinfo,
+ const char *desktop_env)
{
GAppInfoIface *iface;
* @files: a #GList of files.
*
* Gets the DESKTOP_STARTUP_ID for the launched application, if supported.
- * Startup notification IDs are defined in the FreeDesktop.Org Startup Notifications standard,
- * at <ulink url="http://standards.freedesktop.org/startup-notification-spec/startup-notification-latest.txt"/>.
+ * Startup notification IDs are defined in the FreeDesktop.Org Startup
+ * 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 *
g_app_launch_context_get_startup_notify_id (GAppLaunchContext *context,
/**
* g_app_launch_context_launch_failed:
* @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.
- *
**/
void
g_app_launch_context_launch_failed (GAppLaunchContext *context,
- const char *startup_notify_id)
+ const char *startup_notify_id)
{
GAppLaunchContextClass *class;
void
_g_queue_async_result (GAsyncResultData *result,
- gpointer async_object,
- GError *error,
- gpointer user_data,
- GSourceFunc source_func)
+ gpointer async_object,
+ GError *error,
+ gpointer user_data,
+ GSourceFunc source_func)
{
GSource *source;
} FDSource;
static gboolean
-fd_source_prepare (GSource *source,
- gint *timeout)
+fd_source_prepare (GSource *source,
+ gint *timeout)
{
FDSource *fd_source = (FDSource *)source;
*timeout = -1;
}
static gboolean
-fd_source_check (GSource *source)
+fd_source_check (GSource *source)
{
FDSource *fd_source = (FDSource *)source;
/* Might be called on another thread */
static void
fd_source_cancelled_cb (GCancellable *cancellable,
- gpointer data)
+ gpointer data)
{
/* Wake up the mainloop in case we're waiting on async calls with FDSource */
g_main_context_wakeup (NULL);
}
GSource *
-_g_fd_source_new (int fd,
- gushort events,
+_g_fd_source_new (int fd,
+ gushort events,
GCancellable *cancellable)
{
GSource *source;
**/
void
g_buffered_input_stream_set_buffer_size (GBufferedInputStream *stream,
- gsize size)
+ gsize size)
{
GBufferedInputStreamPrivate *priv;
gsize in_buffer;
}
static void
-g_buffered_input_stream_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+g_buffered_input_stream_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GBufferedInputStreamPrivate *priv;
GBufferedInputStream *bstream;
switch (prop_id)
{
-
case PROP_BUFSIZE:
g_value_set_uint (value, priv->len);
break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
-
}
static void
* @base_stream: a #GOutputStream.
* @size: a #gsize.
*
- * Creates a new #GBufferedInputStream from the given @base_stream, with
- * a buffer set to @size.
+ * Creates a new #GBufferedInputStream from the given @base_stream,
+ * with a buffer set to @size.
*
* Returns: a #GInputStream.
**/
* g_buffered_input_stream_fill_async().
*
* Returns: the number of bytes read into @stream's buffer, up to @count,
- * or -1 on error.
+ * or -1 on error.
**/
gssize
g_buffered_input_stream_fill (GBufferedInputStream *stream,
- gssize count,
- GCancellable *cancellable,
- GError **error)
+ gssize count,
+ GCancellable *cancellable,
+ GError **error)
{
GBufferedInputStreamClass *class;
GInputStream *input_stream;
}
static void
-async_fill_callback_wrapper (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+async_fill_callback_wrapper (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
GBufferedInputStream *stream = G_BUFFERED_INPUT_STREAM (source_object);
* g_buffered_input_stream_fill_async:
* @stream: #GBufferedInputStream.
* @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
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
* Reads data into @stream's buffer asynchronously, up to @count size.
* @io_priority can be used to prioritize reads. For the synchronous
* version of this function, see g_buffered_input_stream_fill().
- *
**/
-
void
-g_buffered_input_stream_fill_async (GBufferedInputStream *stream,
- gssize count,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_buffered_input_stream_fill_async (GBufferedInputStream *stream,
+ gssize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GBufferedInputStreamClass *class;
GSimpleAsyncResult *simple;
stream->priv->outstanding_callback = callback;
g_object_ref (stream);
class->fill_async (stream, count, io_priority, cancellable,
- async_fill_callback_wrapper, user_data);
+ async_fill_callback_wrapper, user_data);
}
/**
**/
gssize
g_buffered_input_stream_fill_finish (GBufferedInputStream *stream,
- GAsyncResult *result,
- GError **error)
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple;
GBufferedInputStreamClass *class;
{
simple = G_SIMPLE_ASYNC_RESULT (result);
if (g_simple_async_result_propagate_error (simple, error))
- return -1;
+ return -1;
/* Special case read of 0 bytes */
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);
* Returns: size of the available stream.
**/
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);
* @offset: a #gsize.
* @count: a #gsize.
*
- * Peeks in the buffer, copying data of size @count into @buffer, offset
- * @offset bytes.
+ * Peeks in the buffer, copying data of size @count into @buffer,
+ * offset @offset bytes.
*
* Returns: a #gsize of the number of bytes peeked, or %-1 on error.
**/
gsize
-g_buffered_input_stream_peek (GBufferedInputStream *stream,
- void *buffer,
- gsize offset,
- gsize count)
+g_buffered_input_stream_peek (GBufferedInputStream *stream,
+ void *buffer,
+ gsize offset,
+ gsize count)
{
gsize available;
gsize end;
* Returns: read-only buffer
**/
const void*
-g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream,
- gsize *count)
+g_buffered_input_stream_peek_buffer (GBufferedInputStream *stream,
+ gsize *count)
{
GBufferedInputStreamPrivate *priv;
priv = stream->priv;
- if (count) {
+ if (count)
*count = priv->end - priv->pos;
- }
return priv->buffer + priv->pos;
}
current_size = priv->end - priv->pos;
- g_memmove (priv->buffer,
- priv->buffer + priv->pos,
- current_size);
+ g_memmove (priv->buffer, priv->buffer + priv->pos, current_size);
priv->pos = 0;
priv->end = current_size;
}
static gssize
-g_buffered_input_stream_real_fill (GBufferedInputStream *stream,
- gssize count,
- GCancellable *cancellable,
- GError **error)
+g_buffered_input_stream_real_fill (GBufferedInputStream *stream,
+ gssize count,
+ GCancellable *cancellable,
+ GError **error)
{
GBufferedInputStreamPrivate *priv;
GInputStream *base_stream;
}
static gssize
-g_buffered_input_stream_skip (GInputStream *stream,
- gsize count,
- GCancellable *cancellable,
- GError **error)
+g_buffered_input_stream_skip (GInputStream *stream,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error)
{
GBufferedInputStream *bstream;
GBufferedInputStreamPrivate *priv;
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->end = 0;
base_stream = G_FILTER_INPUT_STREAM (stream)->base_stream;
nread = g_input_stream_skip (base_stream,
- count,
- cancellable,
- error);
+ count,
+ cancellable,
+ error);
if (nread < 0 && bytes_skipped == 0)
- return -1;
+ return -1;
if (nread > 0)
- bytes_skipped += nread;
+ bytes_skipped += nread;
return bytes_skipped;
}
if (nread < 0)
{
if (bytes_skipped == 0)
- return -1;
+ return -1;
else
- return bytes_skipped;
+ return bytes_skipped;
}
available = priv->end - priv->pos;
error);
if (nread < 0 && bytes_read == 0)
- return -1;
+ return -1;
if (nread > 0)
- bytes_read += nread;
+ bytes_read += nread;
return bytes_read;
}
if (nread < 0)
{
if (bytes_read == 0)
- return -1;
+ return -1;
else
- return bytes_read;
+ return bytes_read;
}
available = priv->end - priv->pos;
/* ************************** */
static void
-fill_async_callback (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
+fill_async_callback (GObject *source_object,
+ GAsyncResult *result,
+ gpointer user_data)
{
GError *error;
gssize res;
}
static void
-g_buffered_input_stream_real_fill_async (GBufferedInputStream *stream,
- gssize count,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_buffered_input_stream_real_fill_async (GBufferedInputStream *stream,
+ gssize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GBufferedInputStreamPrivate *priv;
GInputStream *base_stream;
#define __G_BUFFERED_INPUT_STREAM_C__
#include "gioaliasdef.c"
-
-/* vim: ts=2 sw=2 et */
#define __G_BUFFERED_OUTPUT_STREAM_C__
#include "gioaliasdef.c"
-
-/* vim: ts=2 sw=2 et */
#include <windows.h>
static char *
-get_registry_classes_key (const char *subdir,
+get_registry_classes_key (const char *subdir,
const wchar_t *key_name)
{
wchar_t *wc_key;
}
gboolean
-g_content_type_is_a (const char *type,
- const char *supertype)
+g_content_type_is_a (const char *type,
+ const char *supertype)
{
gboolean res;
char *value_utf8;
}
char *
-g_content_type_get_mime_type (const char *type)
+g_content_type_get_mime_type (const char *type)
{
char *mime;
}
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);
}
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);
}
static gboolean
-looks_like_text (const guchar *data, gsize data_size)
+looks_like_text (const guchar *data,
+ gsize data_size)
{
gsize i;
guchar c;
* %FALSE otherwise.
**/
gboolean
-g_content_type_equals (const char *type1,
- const char *type2)
+g_content_type_equals (const char *type1,
+ const char *type2)
{
gboolean res;
* %FALSE otherwise.
**/
gboolean
-g_content_type_is_a (const char *type,
- const char *supertype)
+g_content_type_is_a (const char *type,
+ const char *supertype)
{
gboolean res;
}
static void
-mime_info_start_element (GMarkupParseContext *context,
- const gchar *element_name,
- const gchar **attribute_names,
- const gchar **attribute_values,
- gpointer user_data,
- GError **error)
+mime_info_start_element (GMarkupParseContext *context,
+ const gchar *element_name,
+ const gchar **attribute_names,
+ const gchar **attribute_values,
+ gpointer user_data,
+ GError **error)
{
int i;
const char *lang;
}
static void
-mime_info_end_element (GMarkupParseContext *context,
- const gchar *element_name,
- gpointer user_data,
- GError **error)
+mime_info_end_element (GMarkupParseContext *context,
+ const gchar *element_name,
+ gpointer user_data,
+ GError **error)
{
MimeParser *parser = user_data;
}
static void
-mime_info_text (GMarkupParseContext *context,
- const gchar *text,
- gsize text_len,
- gpointer user_data,
- GError **error)
+mime_info_text (GMarkupParseContext *context,
+ const gchar *text,
+ gsize text_len,
+ gpointer user_data,
+ GError **error)
{
MimeParser *parser = user_data;
}
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;
char *filename, *data;
* Returns: the registered mime-type for the given @type.
**/
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);
* Returns: #GIcon corresponding to the content type.
**/
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);
* can be executable, %FALSE otherwise.
**/
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);
}
static gboolean
-foreach_mimetype (gpointer key,
- gpointer value,
- gpointer user_data)
+foreach_mimetype (gpointer key,
+ gpointer value,
+ gpointer user_data)
{
GList **l = user_data;
}
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;
struct dirent *ent;
}
static void
-enumerate_mimetypes_dir (const char *dir, GHashTable *mimetypes)
+enumerate_mimetypes_dir (const char *dir,
+ GHashTable *mimetypes)
{
DIR *d;
struct dirent *ent;
}
static void
-g_data_input_stream_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+g_data_input_stream_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GDataInputStreamPrivate *priv;
GDataInputStream *dstream;
static void
g_data_input_stream_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
{
GDataInputStreamPrivate *priv;
GDataInputStream *dstream;
switch (prop_id)
{
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
*
**/
void
-g_data_input_stream_set_byte_order (GDataInputStream *stream,
- GDataStreamByteOrder order)
+g_data_input_stream_set_byte_order (GDataInputStream *stream,
+ GDataStreamByteOrder order)
{
g_return_if_fail (G_IS_DATA_INPUT_STREAM (stream));
*
**/
void
-g_data_input_stream_set_newline_type (GDataInputStream *stream,
- GDataStreamNewlineType type)
+g_data_input_stream_set_newline_type (GDataInputStream *stream,
+ GDataStreamNewlineType type)
{
g_return_if_fail (G_IS_DATA_INPUT_STREAM (stream));
}
static gboolean
-read_data (GDataInputStream *stream,
- void *buffer,
- gsize size,
- GCancellable *cancellable,
- GError **error)
+read_data (GDataInputStream *stream,
+ void *buffer,
+ gsize size,
+ GCancellable *cancellable,
+ GError **error)
{
gsize available;
gssize res;
* if an error occured.
**/
guchar
-g_data_input_stream_read_byte (GDataInputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_data_input_stream_read_byte (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
guchar c;
* an error occured.
**/
gint16
-g_data_input_stream_read_int16 (GDataInputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_data_input_stream_read_int16 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
gint16 v;
* an error occured.
**/
guint16
-g_data_input_stream_read_uint16 (GDataInputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_data_input_stream_read_uint16 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
guint16 v;
* an error occured.
**/
gint32
-g_data_input_stream_read_int32 (GDataInputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_data_input_stream_read_int32 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
gint32 v;
* an error occured.
**/
guint32
-g_data_input_stream_read_uint32 (GDataInputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_data_input_stream_read_uint32 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
guint32 v;
* an error occured.
**/
gint64
-g_data_input_stream_read_int64 (GDataInputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_data_input_stream_read_int64 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
gint64 v;
* an error occured.
**/
guint64
-g_data_input_stream_read_uint64 (GDataInputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_data_input_stream_read_uint64 (GDataInputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
guint64 v;
static gssize
scan_for_newline (GDataInputStream *stream,
- gsize *checked_out,
- gboolean *last_saw_cr_out,
- int *newline_len_out)
+ gsize *checked_out,
+ gboolean *last_saw_cr_out,
+ int *newline_len_out)
{
GBufferedInputStream *bstream;
GDataInputStreamPrivate *priv;
* a #gsize to get the length of the read line. Returns %NULL on an error.
**/
char *
-g_data_input_stream_read_line (GDataInputStream *stream,
- gsize *length,
- GCancellable *cancellable,
- GError **error)
+g_data_input_stream_read_line (GDataInputStream *stream,
+ gsize *length,
+ GCancellable *cancellable,
+ GError **error)
{
GBufferedInputStream *bstream;
gsize checked;
static gssize
scan_for_chars (GDataInputStream *stream,
- gsize *checked_out,
- const char *stop_chars)
+ gsize *checked_out,
+ const char *stop_chars)
{
GBufferedInputStream *bstream;
GDataInputStreamPrivate *priv;
* of the string. This function will return %NULL on an error.
**/
char *
-g_data_input_stream_read_until (GDataInputStream *stream,
- const gchar *stop_chars,
- gsize *length,
- GCancellable *cancellable,
- GError **error)
+g_data_input_stream_read_until (GDataInputStream *stream,
+ const gchar *stop_chars,
+ gsize *length,
+ GCancellable *cancellable,
+ GError **error)
{
GBufferedInputStream *bstream;
gsize checked;
}
static void
-g_data_output_stream_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+g_data_output_stream_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GDataOutputStreamPrivate *priv;
GDataOutputStream *dstream;
switch (prop_id)
{
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
-
}
static void
switch (prop_id)
{
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
-
}
+
static void
g_data_output_stream_init (GDataOutputStream *stream)
{
* @order: a %GDataStreamByteOrder.
*
* Sets the byte order of the data output stream to @order.
- *
**/
void
-g_data_output_stream_set_byte_order (GDataOutputStream *stream,
- GDataStreamByteOrder order)
+g_data_output_stream_set_byte_order (GDataOutputStream *stream,
+ GDataStreamByteOrder order)
{
g_return_if_fail (G_IS_DATA_OUTPUT_STREAM (stream));
* Returns: %TRUE if @data was successfully added to the @stream.
**/
gboolean
-g_data_output_stream_put_byte (GDataOutputStream *stream,
- guchar data,
- GCancellable *cancellable,
- GError **error)
+g_data_output_stream_put_byte (GDataOutputStream *stream,
+ guchar data,
+ GCancellable *cancellable,
+ GError **error)
{
gsize bytes_written;
* Returns: %TRUE if @data was successfully added to the @stream.
**/
gboolean
-g_data_output_stream_put_int16 (GDataOutputStream *stream,
- gint16 data,
- GCancellable *cancellable,
- GError **error)
+g_data_output_stream_put_int16 (GDataOutputStream *stream,
+ gint16 data,
+ GCancellable *cancellable,
+ GError **error)
{
gsize bytes_written;
* Returns: %TRUE if @data was successfully added to the @stream.
**/
gboolean
-g_data_output_stream_put_uint16 (GDataOutputStream *stream,
- guint16 data,
- GCancellable *cancellable,
- GError **error)
+g_data_output_stream_put_uint16 (GDataOutputStream *stream,
+ guint16 data,
+ GCancellable *cancellable,
+ GError **error)
{
gsize bytes_written;
* Returns: %TRUE if @data was successfully added to the @stream.
**/
gboolean
-g_data_output_stream_put_int32 (GDataOutputStream *stream,
- gint32 data,
- GCancellable *cancellable,
- GError **error)
+g_data_output_stream_put_int32 (GDataOutputStream *stream,
+ gint32 data,
+ GCancellable *cancellable,
+ GError **error)
{
gsize bytes_written;
* Returns: %TRUE if @data was successfully added to the @stream.
**/
gboolean
-g_data_output_stream_put_uint32 (GDataOutputStream *stream,
- guint32 data,
- GCancellable *cancellable,
- GError **error)
+g_data_output_stream_put_uint32 (GDataOutputStream *stream,
+ guint32 data,
+ GCancellable *cancellable,
+ GError **error)
{
gsize bytes_written;
* Returns: %TRUE if @data was successfully added to the @stream.
**/
gboolean
-g_data_output_stream_put_int64 (GDataOutputStream *stream,
- gint64 data,
- GCancellable *cancellable,
- GError **error)
+g_data_output_stream_put_int64 (GDataOutputStream *stream,
+ gint64 data,
+ GCancellable *cancellable,
+ GError **error)
{
gsize bytes_written;
* Returns: %TRUE if @data was successfully added to the @stream.
**/
gboolean
-g_data_output_stream_put_uint64 (GDataOutputStream *stream,
- guint64 data,
- GCancellable *cancellable,
- GError **error)
+g_data_output_stream_put_uint64 (GDataOutputStream *stream,
+ guint64 data,
+ GCancellable *cancellable,
+ GError **error)
{
gsize bytes_written;
* Returns: %TRUE if @string was successfully added to the @stream.
**/
gboolean
-g_data_output_stream_put_string (GDataOutputStream *stream,
- const char *str,
- GCancellable *cancellable,
- GError **error)
+g_data_output_stream_put_string (GDataOutputStream *stream,
+ const char *str,
+ GCancellable *cancellable,
+ GError **error)
{
gsize bytes_written;
}
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;
char *expanded;
}
static gboolean
-expand_application_parameters (GDesktopAppInfo *info,
- GList **files,
- int *argc,
- char ***argv,
- GError **error)
+expand_application_parameters (GDesktopAppInfo *info,
+ GList **files,
+ int *argc,
+ char ***argv,
+ GError **error)
{
GList *file_list = *files;
const char *p = info->exec;
}
static gboolean
-prepend_terminal_to_vector (int *argc,
+prepend_terminal_to_vector (int *argc,
char ***argv)
{
#ifndef G_OS_WIN32
/* free with g_strfreev */
static char **
-replace_env_var (char **old_environ,
- const char *env_var,
- const char *new_value)
+replace_env_var (char **old_environ,
+ const char *env_var,
+ const char *new_value)
{
int length, new_length;
int index, new_index;
}
static gboolean
-g_desktop_app_info_launch (GAppInfo *appinfo,
- GList *files,
- GAppLaunchContext *launch_context,
- GError **error)
+g_desktop_app_info_launch (GAppInfo *appinfo,
+ GList *files,
+ GAppLaunchContext *launch_context,
+ GError **error)
{
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
gboolean completed = FALSE;
}
static gboolean
-g_desktop_app_info_launch_uris (GAppInfo *appinfo,
- GList *uris,
- GAppLaunchContext *launch_context,
- GError **error)
+g_desktop_app_info_launch_uris (GAppInfo *appinfo,
+ GList *uris,
+ GAppLaunchContext *launch_context,
+ GError **error)
{
GList *files;
GFile *file;
}
static gboolean
-g_desktop_app_info_should_show (GAppInfo *appinfo,
+g_desktop_app_info_should_show (GAppInfo *appinfo,
const char *desktop_env)
{
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
} DirType;
static char *
-ensure_dir (DirType type,
- GError **error)
+ensure_dir (DirType type,
+ GError **error)
{
char *path, *display_name;
int err;
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
- {
- 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;
if (g_mkdir_with_parents (path, 0700) == 0)
err = errno;
display_name = g_filename_display_name (path);
if (type == APP_DIR)
- {
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err),
- _("Can't create user application configuration folder %s: %s"),
- display_name, g_strerror (err));
- }
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err),
+ _("Can't create user application configuration folder %s: %s"),
+ display_name, g_strerror (err));
else
- {
- g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err),
- _("Can't create user MIME configuration folder %s: %s"),
- display_name, g_strerror (err));
- }
+ g_set_error (error, G_IO_ERROR, g_io_error_from_errno (err),
+ _("Can't create user MIME configuration folder %s: %s"),
+ display_name, g_strerror (err));
g_free (display_name);
g_free (path);
}
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;
GKeyFile *key_file;
}
static gboolean
-g_desktop_app_info_set_as_default_for_extension (GAppInfo *appinfo,
- const char *extension,
- GError **error)
+g_desktop_app_info_set_as_default_for_extension (GAppInfo *appinfo,
+ const char *extension,
+ GError **error)
{
char *filename, *basename, *mimetype;
char *dirname;
}
static gboolean
-g_desktop_app_info_add_supports_type (GAppInfo *appinfo,
- const char *content_type,
- GError **error)
+g_desktop_app_info_add_supports_type (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error)
{
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
GKeyFile *keyfile;
}
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);
char *user_dirname;
}
static gboolean
-g_desktop_app_info_remove_supports_type (GAppInfo *appinfo,
- const char *content_type,
- GError **error)
+g_desktop_app_info_remove_supports_type (GAppInfo *appinfo,
+ const char *content_type,
+ GError **error)
{
GDesktopAppInfo *info = G_DESKTOP_APP_INFO (appinfo);
GKeyFile *keyfile;
* Returns: new #GAppInfo for given command.
**/
GAppInfo *
-g_app_info_create_from_commandline (const char *commandline,
- const char *application_name,
- GAppInfoCreateFlags flags,
- GError **error)
+g_app_info_create_from_commandline (const char *commandline,
+ const char *application_name,
+ GAppInfoCreateFlags flags,
+ GError **error)
{
GKeyFile *key_file;
char *dirname;
}
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;
- l = l->next;
+ list = list->next;
}
return FALSE;
}
**/
GAppInfo *
g_app_info_get_default_for_type (const char *content_type,
- gboolean must_support_uris)
+ gboolean must_support_uris)
{
GList *desktop_entries, *l;
GAppInfo *info;
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;
const char *basename;
}
static void
-collect_apps (gpointer key,
- gpointer value,
- gpointer user_data)
+collect_apps (gpointer key,
+ gpointer value,
+ gpointer user_data)
{
GList **infos = user_data;
static MimeInfoCache *mime_info_cache = NULL;
G_LOCK_DEFINE_STATIC (mime_info_cache);
-static void mime_info_cache_dir_add_desktop_entries (MimeInfoCacheDir *dir,
- const char *mime_type,
- char **new_desktop_file_ids);
+static void mime_info_cache_dir_add_desktop_entries (MimeInfoCacheDir *dir,
+ const char *mime_type,
+ char **new_desktop_file_ids);
static MimeInfoCache * mime_info_cache_new (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_free (value);
static gboolean
mime_info_cache_dir_out_of_date (MimeInfoCacheDir *dir,
- const char *cache_file,
- time_t *timestamp)
+ const char *cache_file,
+ time_t *timestamp)
{
struct stat buf;
char *filename;
}
static void
-mime_info_cache_dir_add_desktop_entries (MimeInfoCacheDir *dir,
- const char *mime_type,
- char **new_desktop_file_ids)
+mime_info_cache_dir_add_desktop_entries (MimeInfoCacheDir *dir,
+ const char *mime_type,
+ char **new_desktop_file_ids)
{
GList *desktop_file_ids;
int i;
}
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 */
if (!g_list_find_custom (list, desktop_entry, (GCompareFunc) strcmp))
* Returns: %TRUE if the monitor was cancelled successfully. %FALSE otherwise.
**/
gboolean
-g_directory_monitor_cancel (GDirectoryMonitor* monitor)
+g_directory_monitor_cancel (GDirectoryMonitor *monitor)
{
GDirectoryMonitorClass *class;
/**
* g_directory_monitor_set_rate_limit:
* @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
g_directory_monitor_set_rate_limit (GDirectoryMonitor *monitor,
- int limit_msecs)
+ int limit_msecs)
{
g_return_if_fail (G_IS_DIRECTORY_MONITOR (monitor));
*
* 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
g_directory_monitor_is_cancelled (GDirectoryMonitor *monitor)
static RateLimiter *
new_limiter (GDirectoryMonitor *monitor,
- GFile *file)
+ GFile *file)
{
RateLimiter *limiter;
}
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)
{
}
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)
{
} ForEachData;
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;
guint32 expire_at;
}
static gboolean
-foreach_rate_limiter_fire (gpointer key,
- gpointer value,
- gpointer user_data)
+foreach_rate_limiter_fire (gpointer key,
+ gpointer value,
+ gpointer user_data)
{
RateLimiter *limiter = value;
ForEachData *data = user_data;
}
static gboolean
-foreach_rate_limiter_update (gpointer key,
- gpointer value,
- gpointer user_data)
+foreach_rate_limiter_update (gpointer key,
+ gpointer value,
+ gpointer user_data)
{
RateLimiter *limiter = value;
ForEachData *data = user_data;
}
static void
-update_rate_limiter_timeout (GDirectoryMonitor *monitor, guint new_time)
+update_rate_limiter_timeout (GDirectoryMonitor *monitor,
+ guint new_time)
{
ForEachData data;
GSource *source;
* @other_file: a #GFile.
* @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
* implementations only.
- *
**/
void
g_directory_monitor_emit_event (GDirectoryMonitor *monitor,
- GFile *child,
- GFile *other_file,
- GFileMonitorEvent event_type)
+ GFile *child,
+ GFile *other_file,
+ GFileMonitorEvent event_type)
{
guint32 time_now, since_last;
gboolean emit_now;
static void
g_drive_class_init (gpointer g_class,
- gpointer class_data)
+ gpointer class_data)
{
}
* @user_data: a #gpointer.
*
* Mounts a drive.
- *
**/
void
-g_drive_mount (GDrive *drive,
- GMountOperation *mount_operation,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_drive_mount (GDrive *drive,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GDriveIface *iface;
* Returns: %TRUE, %FALSE if operation failed.
**/
gboolean
-g_drive_mount_finish (GDrive *drive,
- GAsyncResult *result,
- GError **error)
+g_drive_mount_finish (GDrive *drive,
+ GAsyncResult *result,
+ GError **error)
{
GDriveIface *iface;
*
**/
void
-g_drive_eject (GDrive *drive,
- GCancellable *cancellable,
+g_drive_eject (GDrive *drive,
+ GCancellable *cancellable,
GAsyncReadyCallback callback,
- gpointer user_data)
+ gpointer user_data)
{
GDriveIface *iface;
* %FALSE otherwise.
**/
gboolean
-g_drive_eject_finish (GDrive *drive,
- GAsyncResult *result,
- GError **error)
+g_drive_eject_finish (GDrive *drive,
+ GAsyncResult *result,
+ GError **error)
{
GDriveIface *iface;
#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 {
char *scheme;
const gchar *escaped_string_end,
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);
static void
}
static int
-safe_strcmp (const char *a, const char *b)
+safe_strcmp (const char *a,
+ const char *b)
{
if (a == NULL)
a = "";
}
static const char *
-match_prefix (const char *path, const char *prefix)
+match_prefix (const char *path,
+ const char *prefix)
{
int prefix_len;
}
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)
{
unsigned char c;
* appended to their function names. The asynchronous I/O functions
* call a #GAsyncReadyCallback which is then used to finalize the operation,
* which is then passed to the function's matching _finish() operation.
- *
- *
- *
**/
static void g_file_base_init (gpointer g_class);
* Checks to see if a #GFile has a given URI scheme.
*
* Returns: %TRUE if #GFile's backend supports the
- * given URI scheme, FALSE if URI scheme is %NULL,
- * not supported, or #GFile is invalid.
+ * given URI scheme, %FALSE if URI scheme is %NULL,
+ * not supported, or #GFile is invalid.
**/
gboolean
-g_file_has_uri_scheme (GFile *file,
+g_file_has_uri_scheme (GFile *file,
const char *uri_scheme)
{
GFileIface *iface;
* Returns: a string containing the URI scheme for the given
* #GFile. The returned string should be freed with g_free()
* when no longer needed.
- **/
+ **/
char *
g_file_get_uri_scheme (GFile *file)
{
* child doesn't exist.
**/
GFile *
-g_file_get_child (GFile *file,
+g_file_get_child (GFile *file,
const char *name)
{
g_return_val_if_fail (G_IS_FILE (file), NULL);
* %NULL if @display_name is %NULL.
**/
GFile *
-g_file_get_child_for_display_name (GFile *file,
+g_file_get_child_for_display_name (GFile *file,
const char *display_name,
GError **error)
{
* is %NULL or if @file is invalid.
**/
GFile *
-g_file_resolve_relative_path (GFile *file,
+g_file_resolve_relative_path (GFile *file,
const char *relative_path)
{
GFileIface *iface;
* backend doesn't support #GFileEnumerator.
**/
GFileEnumerator *
-g_file_enumerate_children (GFile *file,
- const char *attributes,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_enumerate_children (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* To finish this asynchronous operation, see g_file_enumerate_children_finish().
**/
void
-g_file_enumerate_children_async (GFile *file,
- const char *attributes,
- GFileQueryInfoFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_enumerate_children_async (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
* @res: a #GAsyncResult.
* @error: a #GError.
*
+ * Finishes an async enumerate children operation.
+ *
* If @cancellable was not %NULL when g_file_enumerate_children_async()
* was called, then the operation could have been cancelled by triggering
* the cancellable object from another thread. If the operation was cancelled,
* Returns: a #GFileEnumerator or %NULL if an error occurred.
**/
GFileEnumerator *
-g_file_enumerate_children_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_enumerate_children_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GFileIface *iface;
* Returns: a #GFileInfo for the given @file, or %NULL on error.
**/
GFileInfo *
-g_file_query_info (GFile *file,
- const char *attributes,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_query_info (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* To finish this asynchronous operation, see g_file_query_info_finish().
**/
void
-g_file_query_info_async (GFile *file,
- const char *attributes,
- GFileQueryInfoFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_query_info_async (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
* Returns: #GFileInfo for given @file or %NULL on error.
**/
GFileInfo *
-g_file_query_info_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_query_info_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GFileIface *iface;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError.
*
+ * Obtains attributes of a #GFile.
+ *
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
* Returns: a #GFileInfo or %NULL if there was an error.
**/
GFileInfo *
-g_file_query_filesystem_info (GFile *file,
- const char *attributes,
- GCancellable *cancellable,
- GError **error)
+g_file_query_filesystem_info (GFile *file,
+ const char *attributes,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* Returns: a #GVolume where the @file is located or %NULL on error.
**/
GVolume *
-g_file_find_enclosing_volume (GFile *file,
- GCancellable *cancellable,
- GError **error)
+g_file_find_enclosing_volume (GFile *file,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* Returns: #GFileInputStream or %NULL on error.
**/
GFileInputStream *
-g_file_read (GFile *file,
- GCancellable *cancellable,
- GError **error)
+g_file_read (GFile *file,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
- * If the #GFileIface for @file does not support appending to files, then
- * @error will be set to %G_IO_ERROR_NOT_SUPPORTED and %NULL will be returned.
+ * Gets an output stream for appending to the file.
+ *
+ * If the #GFileIface for @file does not support appending to files,
+ * then @error will be set to %G_IO_ERROR_NOT_SUPPORTED and %NULL will
+ * be returned.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* Returns: a #GFileOutputStream.
**/
GFileOutputStream *
-g_file_append_to (GFile *file,
- GFileCreateFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_append_to (GFile *file,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
+ * Creates the file and returns an output stream for writing to it.
+ *
* If the #GFileIface for @file does not support creating files, then
* @error will be set to %G_IO_ERROR_NOT_SUPPORTED and %NULL will be returned.
*
* %NULL on error.
**/
GFileOutputStream *
-g_file_create (GFile *file,
- GFileCreateFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_create (GFile *file,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* g_file_replace:
* @file: input #GFile.
* @etag: an Entity Tag for the current #GFile.
- * @make_backup: a #gboolean.
+ * @make_backup: %TRUE if a backup should be created.
* @flags: a set of #GFileCreateFlags.
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
- * If the #GFileIface for @file does not support streaming operations, then
- * @error will be set to %G_IO_ERROR_NOT_SUPPORTED and %NULL will be returned.
+ * Returns an output stream for overwriting the file, possibly
+ * creating a backup copy of the file first.
+ *
+ * If the #GFileIface for @file does not support streaming operations,
+ * then @error will be set to %G_IO_ERROR_NOT_SUPPORTED and %NULL will
+ * be returned.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
*
* @etag will replace the entity tag for the current file.
*
- * Returns: a #GFileOutputStream or %NULL on error. If @make_backup is %TRUE,
- * this function will attempt to make a backup of the current file.
+ * Returns: a #GFileOutputStream or %NULL on error. If @make_backup is
+ * %TRUE, this function will attempt to make a backup of the current
+ * file.
**/
GFileOutputStream *
-g_file_replace (GFile *file,
- const char *etag,
- gboolean make_backup,
- GFileCreateFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_replace (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
*
- * Asynchronously reads @file. For the synchronous version of this function,
- * see g_file_read().
+ * Asynchronously reads @file.
+ *
+ * For the synchronous version of this function, see g_file_read().
**/
void
-g_file_read_async (GFile *file,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_read_async (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
* Finishes an asynchronous file read operation started with
* g_file_read_async().
*
- * If the #GFileIface for @file does not support streaming operations, then
- * @error will be set to %G_IO_ERROR_NOT_SUPPORTED and %NULL will be returned.
+ * If the #GFileIface for @file does not support streaming operations,
+ * then @error will be set to %G_IO_ERROR_NOT_SUPPORTED and %NULL will
+ * be returned.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* Returns: a #GFileInputStream or %NULL on error.
**/
GFileInputStream *
-g_file_read_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_read_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GFileIface *iface;
* g_file_append_to_async:
* @file: input #GFile.
* @flags: a set of #GFileCreateFlags.
- * @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.
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
*
* Readies a file for appending data asynchronously.
- * For the synchronous version of this function, see
- * g_file_append_to().
+ *
+ * For the synchronous version of this function, see g_file_append_to().
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_file_append_to_async (GFile *file,
- GFileCreateFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_append_to_async (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
* g_file_append_to_finish:
* @file: input #GFile.
* @res: #GAsyncResult
- * @error: a #GError, or #NULL
+ * @error: a #GError, or %NULL
*
* Finishes appending to a file started with g_file_append_to_async().
*
* Returns: a valid #GFileOutputStream or %NULL on error.
**/
GFileOutputStream *
-g_file_append_to_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_append_to_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GFileIface *iface;
* g_file_create_async:
* @file: input #GFile.
* @flags: a set of #GFileCreateFlags.
- * @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.
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
*
- * Creates a new file asynchronously. For the synchronous version of
- * this function, see g_file_create().
+ * Creates a new file asynchronously.
+ *
+ * For the synchronous version of this function, see g_file_create().
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_file_create_async (GFile *file,
- GFileCreateFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_create_async (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
* Returns: a #GFileOutputStream.
**/
GFileOutputStream *
-g_file_create_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_create_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GFileIface *iface;
* @etag: an Entity Tag for the current #GFile.
* @make_backup: a #gboolean.
* @flags: a set of #GFileCreateFlags.
- * @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.
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
*
- * Replaces a file's contents. For the synchronous version of this
- * function, see g_file_replace(). If @make_backup is %TRUE, this function
- * will attempt to make a backup of the current file.
- *
+ * Replaces a file's contents asynchronously. If @make_backup is
+ * %TRUE, this function will attempt to make a backup of the current file.
+ *
+ * For the synchronous version of this function, see g_file_replace().
+ *
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_file_replace_async (GFile *file,
- const char *etag,
- gboolean make_backup,
- GFileCreateFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_replace_async (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
* Returns: a #GFileOutputStream, or %NULL if an error has occured.
**/
GFileOutputStream *
-g_file_replace_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_replace_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GFileIface *iface;
}
static gboolean
-copy_symlink (GFile *destination,
- GFileCopyFlags flags,
- GCancellable *cancellable,
- const char *target,
- GError **error)
+copy_symlink (GFile *destination,
+ GFileCopyFlags flags,
+ GCancellable *cancellable,
+ const char *target,
+ GError **error)
{
GError *my_error;
gboolean tried_delete;
}
static GInputStream *
-open_source_for_copy (GFile *source,
- GFile *destination,
- GFileCopyFlags flags,
- GCancellable *cancellable,
- GError **error)
+open_source_for_copy (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GError *my_error;
GInputStream *in;
if (my_error->domain == G_IO_ERROR && my_error->code == G_IO_ERROR_IS_DIRECTORY)
{
- /* The source is a directory, don't fail with WOULD_RECURSE immediately, as
- that is less useful to the app. Better check for errors on the target instead. */
-
+ /* The source is a directory, don't fail with WOULD_RECURSE immediately,
+ * as that is less useful to the app. Better check for errors on the
+ * target instead.
+ */
g_error_free (my_error);
my_error = NULL;
}
else
{
- /* Error getting info from target, return that error (except for NOT_FOUND, which is no error here) */
+ /* Error getting info from target, return that error
+ * (except for NOT_FOUND, which is no error here)
+ */
if (my_error->domain != G_IO_ERROR && my_error->code != G_IO_ERROR_NOT_FOUND)
{
g_propagate_error (error, my_error);
}
static gboolean
-should_copy (GFileAttributeInfo *info, gboolean as_move)
+should_copy (GFileAttributeInfo *info,
+ gboolean as_move)
{
if (as_move)
return info->flags & G_FILE_ATTRIBUTE_FLAGS_COPY_WHEN_MOVED;
static char *
build_attribute_list_for_copy (GFileAttributeInfoList *attributes,
GFileAttributeInfoList *namespaces,
- gboolean as_move)
+ gboolean as_move)
{
GString *s;
gboolean first;
}
return g_string_free (s, FALSE);
-
}
gboolean
-g_file_copy_attributes (GFile *source,
- GFile *destination,
- GFileCopyFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_copy_attributes (GFile *source,
+ GFile *destination,
+ GFileCopyFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileAttributeInfoList *attributes, *namespaces;
char *attrs_to_read;
attrs_to_read = build_attribute_list_for_copy (attributes, namespaces, as_move);
/* Ignore errors here, if we can't read some info (e.g. if it doesn't exist)
- we just don't copy it. */
+ * we just don't copy it.
+ */
info = g_file_query_info (source, attrs_to_read,
source_nofollow_symlinks ? G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS:0,
cancellable,
/* Closes the streams */
static gboolean
-copy_stream_with_progress (GInputStream *in,
- GOutputStream *out,
- GCancellable *cancellable,
- GFileProgressCallback progress_callback,
- gpointer progress_callback_data,
- GError **error)
+copy_stream_with_progress (GInputStream *in,
+ GOutputStream *out,
+ GCancellable *cancellable,
+ GFileProgressCallback progress_callback,
+ gpointer progress_callback_data,
+ GError **error)
{
gssize n_read, n_written;
goffset current_size;
* dir file overwr G_IO_ERROR_WOULD_RECURSE
* Docbook version below -->
*
- * Copies a file or directory from @source to @destination, with the given @flags.
- * @flags should be set to %0 if not used. This operation may fail, and @error will
- * be set appropriately with the given error result (see the following table).
+ * Copies a file or directory from @source to @destination, with the given
+ * @flags. This operation may fail, and @error will be set appropriately with
+ * the given error result (see the following table).
* File copies are always asynchronous.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* g_file_move:
* @source: #GFile pointing to the source location.
* @destination: #GFile pointing to the destination location.
- * @flags: #GFileCopyFlags enum.
+ * @flags: set of #GFileCopyFlags.
* @cancellable: optional #GCancellable object, %NULL to ignore.
- * @progress_callback: GFileProgressCallback function for updates.
+ * @progress_callback: #GFileProgressCallback function for updates.
* @progress_callback_data: gpointer to user data for the callback function.
* @error: #GError for returning error conditions, or %NULL
*
- * List of possible returns from g_file_move() with given source,
- * destination, and flags:
* <!-- Source version
* source dest flags results in
* - * * G_IO_ERROR_NOT_FOUND
* dir * 0 G_IO_ERROR_EXISTS
* dir dir overwr G_IO_ERROR_WOULD_MERGE
* dir file overwr ok || G_IO_ERROR_WOULD_RECURSE
- * Pretty Docbook version -->
+ * Docbook version below -->
+ *
+ * Moves a file or directory from @source to @destination, with the given
+ * @flags. This operation may fail, and @error will be set appropriately with
+ * the given error result (see the following table).
+ * File moves are always asynchronous.
+ *
+ * If @cancellable is not %NULL, then the operation can be cancelled by
+ * triggering the cancellable object from another thread. If the operation
+ * was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
+ *
+ * If @progress_callback is not %NULL, then the operation can be monitored by
+ * setting this to a #GFileProgressCallback function. @progress_callback_data
+ * will be passed to this function.
+ *
* <table>
* <title>g_file_move() Error Conditions</title>
* <tgroup cols='4' align='left'><thead>
* @file: input #GFile.
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
+ *
+ * Creates a directory.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* Returns: %TRUE on successful creation, %FALSE otherwise.
**/
gboolean
-g_file_make_directory (GFile *file,
- GCancellable *cancellable,
- GError **error)
+g_file_make_directory (GFile *file,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError.
*
+ * Creates a symbolic link.
+ *
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
* Returns: %TRUE on the creation of a new symlink, %FALSE otherwise.
**/
gboolean
-g_file_make_symbolic_link (GFile *file,
- const char *symlink_value,
- GCancellable *cancellable,
- GError **error)
+g_file_make_symbolic_link (GFile *file,
+ const char *symlink_value,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* Returns: %TRUE if the file was deleted. %FALSE otherwise.
**/
gboolean
-g_file_delete (GFile *file,
- GCancellable *cancellable,
- GError **error)
+g_file_delete (GFile *file,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
*
* Sends @file to the virtual file system "Trash" location. If the
* virtual file system does not have support having a "Trash" location,
- * %FALSE will be returned, and @error will be set to %G_IO_ERROR_NOT_SUPPORTED.
+ * %FALSE will be returned, and @error will be set to
+ * %G_IO_ERROR_NOT_SUPPORTED.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* Returns: %TRUE on successful trash, %FALSE otherwise.
**/
gboolean
-g_file_trash (GFile *file,
- GCancellable *cancellable,
- GError **error)
+g_file_trash (GFile *file,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* Returns: a #GFile, or %NULL if there was an error.
**/
GFile *
-g_file_set_display_name (GFile *file,
- const char *display_name,
- GCancellable *cancellable,
- GError **error)
+g_file_set_display_name (GFile *file,
+ const char *display_name,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* g_file_set_display_name_async:
* @file: input #GFile.
* @display_name: a string.
- * @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.
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
*
* Asynchronously sets the display name for a given #GFile.
- * For the synchronous version of this function, see
- * g_file_set_display_name().
+ * For the synchronous version of this function, see g_file_set_display_name().
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_file_set_display_name_async (GFile *file,
- const char *display_name,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_set_display_name_async (GFile *file,
+ const char *display_name,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
* @res: a #GAsyncResult.
* @error: a #GError, or %NULL
*
- * Finishes setting a display name started with g_file_set_display_name_async().
+ * Finishes setting a display name started with
+ * g_file_set_display_name_async().
*
* Returns: a #GFile or %NULL on error.
**/
GFile *
-g_file_set_display_name_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_set_display_name_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GFileIface *iface;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
+ * Obtain the list of settable attributes for the file.
+ *
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
- * Returns: the type and full attribute name of all the attributes that
- * the file can set. This doesn't mean setting it will always succeed though,
- * you might get an access failure, or some specific file may not support a
- * specific attribute.
+ * Returns: the type and full attribute name of all the attributes
+ * that the file can set. This doesn't mean setting it will always
+ * succeed though, you might get an access failure, or some specific
+ * file may not support a specific attribute.
**/
GFileAttributeInfoList *
-g_file_query_settable_attributes (GFile *file,
- GCancellable *cancellable,
- GError **error)
+g_file_query_settable_attributes (GFile *file,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
GError *my_error;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
+ * Obtain the list of attribute namespaces where new attributes
+ * can be created.
+ *
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
* as extended attributes.
**/
GFileAttributeInfoList *
-g_file_query_writable_namespaces (GFile *file,
- GCancellable *cancellable,
- GError **error)
+g_file_query_writable_namespaces (GFile *file,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
GError *my_error;
* Returns: %TRUE if the attribute was set, %FALSE otherwise.
**/
gboolean
-g_file_set_attribute (GFile *file,
- const char *attribute,
- const GFileAttributeValue *value,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_set_attribute (GFile *file,
+ const char *attribute,
+ const GFileAttributeValue *value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
* %G_FILE_ATTRIBUTE_STATUS_ERROR_SETTING.
**/
gboolean
-g_file_set_attributes_from_info (GFile *file,
- GFileInfo *info,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_set_attributes_from_info (GFile *file,
+ GFileInfo *info,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileIface *iface;
iface = G_FILE_GET_IFACE (file);
- return (* iface->set_attributes_from_info) (file, info, flags, cancellable, error);
+ return (* iface->set_attributes_from_info) (file,
+ info,
+ flags,
+ cancellable,
+ error);
}
static gboolean
-g_file_real_set_attributes_from_info (GFile *file,
- GFileInfo *info,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_real_set_attributes_from_info (GFile *file,
+ GFileInfo *info,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
char **attributes;
int i;
* @file: input #GFile.
* @info: a #GFileInfo.
* @flags: a #GFileQueryInfoFlags.
- * @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.
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_file_set_attributes_async (GFile *file,
- GFileInfo *info,
- GFileQueryInfoFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_set_attributes_async (GFile *file,
+ GFileInfo *info,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
g_return_if_fail (G_IS_FILE_INFO (info));
iface = G_FILE_GET_IFACE (file);
- (* iface->set_attributes_async) (file, info, flags, io_priority, cancellable, callback, user_data);
-
+ (* iface->set_attributes_async) (file,
+ info,
+ flags,
+ io_priority,
+ cancellable,
+ callback,
+ user_data);
}
/**
* Returns: %TRUE if the attributes were set correctly, %FALSE otherwise.
**/
gboolean
-g_file_set_attributes_finish (GFile *file,
- GAsyncResult *result,
- GFileInfo **info,
- GError **error)
+g_file_set_attributes_finish (GFile *file,
+ GAsyncResult *result,
+ GFileInfo **info,
+ GError **error)
{
GFileIface *iface;
g_return_val_if_fail (G_IS_ASYNC_RESULT (result), FALSE);
/* No standard handling of errors here, as we must set info even
- on errors */
-
+ * on errors
+ */
iface = G_FILE_GET_IFACE (file);
return (* iface->set_attributes_finish) (file, result, info, error);
}
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
- * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value. If
- * @attribute is of a different type, this operation will fail.
+ * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_STRING to @value.
+ * If @attribute is of a different type, this operation will fail.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
**/
gboolean
-g_file_set_attribute_string (GFile *file,
- const char *attribute,
- const char *value,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_set_attribute_string (GFile *file,
+ const char *attribute,
+ const char *value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileAttributeValue v;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
- * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value. If
- * @attribute is of a different type, this operation will fail, returning %FALSE.
+ * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_BYTE_STRING to @value.
+ * If @attribute is of a different type, this operation will fail,
+ * returning %FALSE.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* in the @file, %FALSE otherwise.
**/
gboolean
-g_file_set_attribute_byte_string (GFile *file,
- const char *attribute,
- const char *value,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_set_attribute_byte_string (GFile *file,
+ const char *attribute,
+ const char *value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileAttributeValue v;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
- * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value. If
- * @attribute is of a different type, this operation will fail.
+ * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT32 to @value.
+ * If @attribute is of a different type, this operation will fail.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* in the @file, %FALSE otherwise.
**/
gboolean
-g_file_set_attribute_uint32 (GFile *file,
- const char *attribute,
- guint32 value,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_set_attribute_uint32 (GFile *file,
+ const char *attribute,
+ guint32 value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileAttributeValue v;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
- * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value. If
- * @attribute is of a different type, this operation will fail.
+ * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT32 to @value.
+ * If @attribute is of a different type, this operation will fail.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* in the @file, %FALSE otherwise.
**/
gboolean
-g_file_set_attribute_int32 (GFile *file,
- const char *attribute,
- gint32 value,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_set_attribute_int32 (GFile *file,
+ const char *attribute,
+ gint32 value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileAttributeValue v;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
- * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value. If
- * @attribute is of a different type, this operation will fail.
+ * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_UINT64 to @value.
+ * If @attribute is of a different type, this operation will fail.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* in the @file, %FALSE otherwise.
**/
gboolean
-g_file_set_attribute_uint64 (GFile *file,
- const char *attribute,
- guint64 value,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_set_attribute_uint64 (GFile *file,
+ const char *attribute,
+ guint64 value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileAttributeValue v;
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
- * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value. If
- * @attribute is of a different type, this operation will fail.
+ * Sets @attribute of type %G_FILE_ATTRIBUTE_TYPE_INT64 to @value.
+ * If @attribute is of a different type, this operation will fail.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* Returns: %TRUE if the @attribute was successfully set, %FALSE otherwise.
**/
gboolean
-g_file_set_attribute_int64 (GFile *file,
- const char *attribute,
- gint64 value,
- GFileQueryInfoFlags flags,
- GCancellable *cancellable,
- GError **error)
+g_file_set_attribute_int64 (GFile *file,
+ const char *attribute,
+ gint64 value,
+ GFileQueryInfoFlags flags,
+ GCancellable *cancellable,
+ GError **error)
{
GFileAttributeValue v;
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
*
+ * Mounts a mountable file using @mount_operation, if possible.
+ *
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
- *
- * Mounts a mountable file using @mount_operation, if possible.
**/
void
-g_file_mount_mountable (GFile *file,
- GMountOperation *mount_operation,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_mount_mountable (GFile *file,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
iface = G_FILE_GET_IFACE (file);
if (iface->mount_mountable == NULL)
- {
- g_simple_async_report_error_in_idle (G_OBJECT (file),
- callback,
- user_data,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- _("Operation not supported"));
- }
+ g_simple_async_report_error_in_idle (G_OBJECT (file),
+ callback,
+ user_data,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ _("Operation not supported"));
(* iface->mount_mountable) (file,
mount_operation,
cancellable,
callback,
user_data);
-
}
/**
* @result: a #GAsyncResult.
* @error: a #GError, or %NULL
*
+ * Finish an asynchronous mount operation that was started
+ * with g_file_mount_mountable().
+ *
* Returns: a #GFile or %NULL on error.
**/
GFile *
-g_file_mount_mountable_finish (GFile *file,
- GAsyncResult *result,
- GError **error)
+g_file_mount_mountable_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error)
{
GFileIface *iface;
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
*
+ * Unmounts a mounted file.
+ *
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_file_unmount_mountable (GFile *file,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_unmount_mountable (GFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
iface = G_FILE_GET_IFACE (file);
if (iface->unmount_mountable == NULL)
- {
- g_simple_async_report_error_in_idle (G_OBJECT (file),
- callback,
- user_data,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- _("Operation not supported"));
- }
+ g_simple_async_report_error_in_idle (G_OBJECT (file),
+ callback,
+ user_data,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ _("Operation not supported"));
(* iface->unmount_mountable) (file,
cancellable,
* @result: a #GAsyncResult.
* @error: a #GError, or %NULL
*
+ * Finish an asynchronous unmount operation that was started
+ * with g_file_unmount_mountable().
+ *
* Returns: %TRUE if the operation finished successfully. %FALSE
* otherwise.
**/
gboolean
-g_file_unmount_mountable_finish (GFile *file,
- GAsyncResult *result,
- GError **error)
+g_file_unmount_mountable_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error)
{
GFileIface *iface;
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_file_eject_mountable (GFile *file,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_eject_mountable (GFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
iface = G_FILE_GET_IFACE (file);
if (iface->eject_mountable == NULL)
- {
- g_simple_async_report_error_in_idle (G_OBJECT (file),
- callback,
- user_data,
- G_IO_ERROR,
- G_IO_ERROR_NOT_SUPPORTED,
- _("Operation not supported"));
- }
+ g_simple_async_report_error_in_idle (G_OBJECT (file),
+ callback,
+ user_data,
+ G_IO_ERROR,
+ G_IO_ERROR_NOT_SUPPORTED,
+ _("Operation not supported"));
(* iface->eject_mountable) (file,
cancellable,
* otherwise.
**/
gboolean
-g_file_eject_mountable_finish (GFile *file,
- GAsyncResult *result,
- GError **error)
+g_file_eject_mountable_finish (GFile *file,
+ GAsyncResult *result,
+ GError **error)
{
GFileIface *iface;
* @flags: a set of #GFileMonitorFlags.
* @cancellable: optional #GCancellable object, %NULL to ignore.
*
+ * Obtains a directory monitor for the given file.
+ *
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
* or %NULL on error.
**/
GDirectoryMonitor*
-g_file_monitor_directory (GFile *file,
- GFileMonitorFlags flags,
- GCancellable *cancellable)
+g_file_monitor_directory (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable)
{
GFileIface *iface;
* @flags: a set of #GFileMonitorFlags.
* @cancellable: optional #GCancellable object, %NULL to ignore.
*
+ * Obtains a file monitor for the given file.
+ *
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
* or %NULL on error.
**/
GFileMonitor*
-g_file_monitor_file (GFile *file,
- GFileMonitorFlags flags,
- GCancellable *cancellable)
+g_file_monitor_file (GFile *file,
+ GFileMonitorFlags flags,
+ GCancellable *cancellable)
{
GFileIface *iface;
GFileMonitor *monitor;
static void
query_info_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GError *error = NULL;
QueryInfoAsyncData *data;
}
static void
-g_file_real_query_info_async (GFile *file,
- const char *attributes,
- GFileQueryInfoFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_real_query_info_async (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
QueryInfoAsyncData *data;
}
static GFileInfo *
-g_file_real_query_info_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_real_query_info_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
QueryInfoAsyncData *data;
static void
enumerate_children_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GError *error = NULL;
EnumerateChildrenAsyncData *data;
}
static void
-g_file_real_enumerate_children_async (GFile *file,
- const char *attributes,
- GFileQueryInfoFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_real_enumerate_children_async (GFile *file,
+ const char *attributes,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
EnumerateChildrenAsyncData *data;
}
static GFileEnumerator *
-g_file_real_enumerate_children_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_real_enumerate_children_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
EnumerateChildrenAsyncData *data;
static void
open_read_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GFileIface *iface;
GFileInputStream *stream;
}
static void
-g_file_real_read_async (GFile *file,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_real_read_async (GFile *file,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
}
static GFileInputStream *
-g_file_real_read_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_real_read_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
gpointer op;
static void
append_to_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GFileIface *iface;
GFileCreateFlags *data;
}
static void
-g_file_real_append_to_async (GFile *file,
- GFileCreateFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_real_append_to_async (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileCreateFlags *data;
GSimpleAsyncResult *res;
}
static GFileOutputStream *
-g_file_real_append_to_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_real_append_to_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
gpointer op;
static void
create_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GFileIface *iface;
GFileCreateFlags *data;
}
static void
-g_file_real_create_async (GFile *file,
- GFileCreateFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_real_create_async (GFile *file,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileCreateFlags *data;
GSimpleAsyncResult *res;
}
static GFileOutputStream *
-g_file_real_create_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_real_create_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
gpointer op;
static void
replace_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GFileIface *iface;
GFileOutputStream *stream;
}
static void
-g_file_real_replace_async (GFile *file,
- const char *etag,
- gboolean make_backup,
- GFileCreateFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_real_replace_async (GFile *file,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
ReplaceAsyncData *data;
}
static GFileOutputStream *
-g_file_real_replace_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_real_replace_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
ReplaceAsyncData *data;
static void
set_display_name_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GError *error = NULL;
SetDisplayNameAsyncData *data;
}
static void
-g_file_real_set_display_name_async (GFile *file,
- const char *display_name,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_real_set_display_name_async (GFile *file,
+ const char *display_name,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
SetDisplayNameAsyncData *data;
}
static GFile *
-g_file_real_set_display_name_finish (GFile *file,
- GAsyncResult *res,
- GError **error)
+g_file_real_set_display_name_finish (GFile *file,
+ GAsyncResult *res,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
SetDisplayNameAsyncData *data;
static void
set_info_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
SetInfoAsyncData *data;
}
static void
-g_file_real_set_attributes_async (GFile *file,
- GFileInfo *info,
- GFileQueryInfoFlags flags,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_real_set_attributes_async (GFile *file,
+ GFileInfo *info,
+ GFileQueryInfoFlags flags,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
SetInfoAsyncData *data;
}
static gboolean
-g_file_real_set_attributes_finish (GFile *file,
- GAsyncResult *res,
- GFileInfo **info,
- GError **error)
+g_file_real_set_attributes_finish (GFile *file,
+ GAsyncResult *res,
+ GFileInfo **info,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
SetInfoAsyncData *data;
if (info)
*info = g_object_ref (data->info);
- if (error != NULL && data->error) {
+ if (error != NULL && data->error)
*error = g_error_copy (data->error);
- }
return data->res;
}
{
g_return_val_if_fail (path != NULL, NULL);
- return g_vfs_get_file_for_path (g_vfs_get_default (),
- path);
+ return g_vfs_get_file_for_path (g_vfs_get_default (), path);
}
/**
{
g_return_val_if_fail (uri != NULL, NULL);
- return g_vfs_get_file_for_uri (g_vfs_get_default (),
- uri);
+ return g_vfs_get_file_for_uri (g_vfs_get_default (), uri);
}
/**
{
g_return_val_if_fail (parse_name != NULL, NULL);
- return g_vfs_parse_name (g_vfs_get_default (),
- parse_name);
+ return g_vfs_parse_name (g_vfs_get_default (), parse_name);
}
static gboolean
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_mount_for_location (GFile *location,
- GMountOperation *mount_operation,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_mount_for_location (GFile *location,
+ GMountOperation *mount_operation,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIface *iface;
* appropriately if present.
**/
gboolean
-g_mount_for_location_finish (GFile *location,
- GAsyncResult *result,
- GError **error)
+g_mount_for_location_finish (GFile *location,
+ GAsyncResult *result,
+ GError **error)
{
GFileIface *iface;
* put into @length, the contents in @contents.
**/
gboolean
-g_file_load_contents (GFile *file,
- GCancellable *cancellable,
- char **contents,
- gsize *length,
- char **etag_out,
- GError **error)
+g_file_load_contents (GFile *file,
+ GCancellable *cancellable,
+ char **contents,
+ gsize *length,
+ char **etag_out,
+ GError **error)
{
GFileInputStream *in;
GByteArray *content;
g_return_val_if_fail (G_IS_FILE (file), FALSE);
g_return_val_if_fail (contents != NULL, FALSE);
- in = g_file_read (file,
- cancellable,
- error);
+ in = g_file_read (file, cancellable, error);
if (in == NULL)
return FALSE;
}
static void
-load_contents_close_callback (GObject *obj,
- GAsyncResult *close_res,
- gpointer user_data)
+load_contents_close_callback (GObject *obj,
+ GAsyncResult *close_res,
+ gpointer user_data)
{
GInputStream *stream = G_INPUT_STREAM (obj);
LoadContentsData *data = user_data;
}
static void
-load_contents_fstat_callback (GObject *obj,
+load_contents_fstat_callback (GObject *obj,
GAsyncResult *stat_res,
- gpointer user_data)
+ gpointer user_data)
{
GInputStream *stream = G_INPUT_STREAM (obj);
LoadContentsData *data = user_data;
}
static void
-load_contents_read_callback (GObject *obj,
+load_contents_read_callback (GObject *obj,
GAsyncResult *read_res,
- gpointer user_data)
+ gpointer user_data)
{
GInputStream *stream = G_INPUT_STREAM (obj);
LoadContentsData *data = user_data;
}
static void
-load_contents_open_callback (GObject *obj,
+load_contents_open_callback (GObject *obj,
GAsyncResult *open_res,
- gpointer user_data)
+ gpointer user_data)
{
GFile *file = G_FILE (obj);
GFileInputStream *stream;
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_file_load_partial_contents_async (GFile *file,
- GCancellable *cancellable,
- GFileReadMoreCallback read_more_callback,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_load_partial_contents_async (GFile *file,
+ GCancellable *cancellable,
+ GFileReadMoreCallback read_more_callback,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
LoadContentsData *data;
* @etag_out: a location to place the current entity tag for the file.
* @error: a #GError, or %NULL
*
+ * Finishes an asynchronous partial load operation that was started
+ * with g_file_load_partial_contents_async().
+ *
* Returns: %TRUE if the load was successful. If %FALSE and @error is
* present, it will be set appropriately.
**/
gboolean
-g_file_load_partial_contents_finish (GFile *file,
- GAsyncResult *res,
- char **contents,
- gsize *length,
- char **etag_out,
- GError **error)
+g_file_load_partial_contents_finish (GFile *file,
+ GAsyncResult *res,
+ char **contents,
+ gsize *length,
+ char **etag_out,
+ GError **error)
{
GSimpleAsyncResult *simple;
LoadContentsData *data;
}
/* Zero terminate */
- g_byte_array_set_size (data->content,
- data->pos + 1);
+ g_byte_array_set_size (data->content, data->pos + 1);
data->content->data[data->pos] = 0;
*contents = (char *)g_byte_array_free (data->content, FALSE);
* @callback: a #GAsyncReadyCallback.
* @user_data: a #gpointer.
*
- * Starts an asynchronous load of the @file's contents. When the load operation
- * has completed, @callback will be called with @userdata. To finish
- * the operation, call g_file_load_contents_finish() with the
- * #GAsyncResult returned by the @callback.
+ * Starts an asynchronous load of the @file's contents.
+ * When the load operation has completed, @callback will be called
+ * with @userdata. To finish the operation, call
+ * g_file_load_contents_finish() with the #GAsyncResult returned by
+ * the @callback.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
**/
void
-g_file_load_contents_async (GFile *file,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_load_contents_async (GFile *file,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
g_file_load_partial_contents_async (file,
cancellable,
NULL,
callback, user_data);
-
}
/**
* @etag_out: a location to place the current entity tag for the file.
* @error: a #GError, or %NULL
*
- * Finishes an asynchronous load of the @file's contents. The contents
- * are placed in @contents, and @length is set to the size of the @contents
- * string. If @etag_out is present, it will be set to the new entity
- * tag for the @file.
+ * Finishes an asynchronous load of the @file's contents.
+ * The contents are placed in @contents, and @length is set to the
+ * size of the @contents string. If @etag_out is present, it will be
+ * set to the new entity tag for the @file.
*
* Returns: %TRUE if the load was successful. If %FALSE and @error is
* present, it will be set appropriately.
**/
gboolean
-g_file_load_contents_finish (GFile *file,
- GAsyncResult *res,
- char **contents,
- gsize *length,
- char **etag_out,
- GError **error)
+g_file_load_contents_finish (GFile *file,
+ GAsyncResult *res,
+ char **contents,
+ gsize *length,
+ char **etag_out,
+ GError **error)
{
return g_file_load_partial_contents_finish (file,
res,
length,
etag_out,
error);
-
}
/**
* @cancellable: optional #GCancellable object, %NULL to ignore.
* @error: a #GError, or %NULL
*
- * Replaces the contents of @file with @contents of @length bytes. The old
- * @etag will be replaced with the @new_etag. If @make_backup is %TRUE,
- * this function will attempt to make a backup of @file.
+ * Replaces the contents of @file with @contents of @length bytes.
+ * The old @etag will be replaced with the @new_etag. If @make_backup
+ * is %TRUE, this function will attempt to make a backup of @file.
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
* appropriately if present.
**/
gboolean
-g_file_replace_contents (GFile *file,
- const char *contents,
- gsize length,
- const char *etag,
- gboolean make_backup,
- GFileCreateFlags flags,
- char **new_etag,
- GCancellable *cancellable,
- GError **error)
+g_file_replace_contents (GFile *file,
+ const char *contents,
+ gsize length,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ char **new_etag,
+ GCancellable *cancellable,
+ GError **error)
{
GFileOutputStream *out;
gsize pos, remainder;
}
static void
-replace_contents_close_callback (GObject *obj,
+replace_contents_close_callback (GObject *obj,
GAsyncResult *close_res,
- gpointer user_data)
+ gpointer user_data)
{
GOutputStream *stream = G_OUTPUT_STREAM (obj);
ReplaceContentsData *data = user_data;
}
static void
-replace_contents_write_callback (GObject *obj,
+replace_contents_write_callback (GObject *obj,
GAsyncResult *read_res,
- gpointer user_data)
+ gpointer user_data)
{
GOutputStream *stream = G_OUTPUT_STREAM (obj);
ReplaceContentsData *data = user_data;
}
static void
-replace_contents_open_callback (GObject *obj,
+replace_contents_open_callback (GObject *obj,
GAsyncResult *open_res,
- gpointer user_data)
+ gpointer user_data)
{
GFile *file = G_FILE (obj);
GFileOutputStream *stream;
* make a backup of @file.
**/
void
-g_file_replace_contents_async (GFile *file,
- const char *contents,
- gsize length,
- const char *etag,
- gboolean make_backup,
- GFileCreateFlags flags,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_replace_contents_async (GFile *file,
+ const char *contents,
+ gsize length,
+ const char *etag,
+ gboolean make_backup,
+ GFileCreateFlags flags,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
ReplaceContentsData *data;
* Returns: %TRUE on success, %FALSE on failure.
**/
gboolean
-g_file_replace_contents_finish (GFile *file,
- GAsyncResult *res,
- char **new_etag,
- GError **error)
+g_file_replace_contents_finish (GFile *file,
+ GAsyncResult *res,
+ char **new_etag,
+ GError **error)
{
GSimpleAsyncResult *simple;
ReplaceContentsData *data;
* Sets an attribute's value from another attribute.
**/
void
-g_file_attribute_value_set (GFileAttributeValue *attr,
+g_file_attribute_value_set (GFileAttributeValue *attr,
const GFileAttributeValue *new_value)
{
g_return_if_fail (attr != NULL);
* Return value: #TRUE on success or #FALSE on error.
**/
gboolean
-g_file_enumerator_close (GFileEnumerator *enumerator,
- GCancellable *cancellable,
- GError **error)
+g_file_enumerator_close (GFileEnumerator *enumerator,
+ GCancellable *cancellable,
+ GError **error)
{
GFileEnumeratorClass *class;
}
static void
-next_async_callback_wrapper (GObject *source_object,
+next_async_callback_wrapper (GObject *source_object,
GAsyncResult *res,
- gpointer user_data)
+ gpointer user_data)
{
GFileEnumerator *enumerator = G_FILE_ENUMERATOR (source_object);
* priority is %G_PRIORITY_DEFAULT.
**/
void
-g_file_enumerator_next_files_async (GFileEnumerator *enumerator,
- int num_files,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_enumerator_next_files_async (GFileEnumerator *enumerator,
+ int num_files,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileEnumeratorClass *class;
GSimpleAsyncResult *simple;
* Returns:
**/
GList *
-g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
- GAsyncResult *result,
- GError **error)
+g_file_enumerator_next_files_finish (GFileEnumerator *enumerator,
+ GAsyncResult *result,
+ GError **error)
{
GFileEnumeratorClass *class;
GSimpleAsyncResult *simple;
}
static void
-close_async_callback_wrapper (GObject *source_object,
+close_async_callback_wrapper (GObject *source_object,
GAsyncResult *res,
- gpointer user_data)
+ gpointer user_data)
{
GFileEnumerator *enumerator = G_FILE_ENUMERATOR (source_object);
/**
* g_file_enumerator_close_async:
* @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.
* @callback: callback to call when the request is satisfied
* @user_data: the user_data to pass to callback function
*
**/
void
-g_file_enumerator_close_async (GFileEnumerator *enumerator,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_enumerator_close_async (GFileEnumerator *enumerator,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileEnumeratorClass *class;
* Returns: %TRUE if the close operation has finished successfully.
**/
gboolean
-g_file_enumerator_close_finish (GFileEnumerator *enumerator,
- GAsyncResult *result,
- GError **error)
+g_file_enumerator_close_finish (GFileEnumerator *enumerator,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple;
GFileEnumeratorClass *class;
*
**/
void
-g_file_enumerator_set_pending (GFileEnumerator *enumerator,
- gboolean pending)
+g_file_enumerator_set_pending (GFileEnumerator *enumerator,
+ gboolean pending)
{
g_return_if_fail (G_IS_FILE_ENUMERATOR (enumerator));
static void
next_files_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
NextAsyncOp *op;
GFileEnumeratorClass *class;
static void
-g_file_enumerator_real_next_files_async (GFileEnumerator *enumerator,
- int num_files,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_enumerator_real_next_files_async (GFileEnumerator *enumerator,
+ int num_files,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
NextAsyncOp *op;
static void
close_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GFileEnumeratorClass *class;
GError *error = NULL;
static void
-g_file_enumerator_real_close_async (GFileEnumerator *enumerator,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_enumerator_real_close_async (GFileEnumerator *enumerator,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
}
static gboolean
-g_file_enumerator_real_close_finish (GFileEnumerator *enumerator,
- GAsyncResult *result,
- GError **error)
+g_file_enumerator_real_close_finish (GFileEnumerator *enumerator,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) ==
static GInputStream *
-g_file_icon_load (GLoadableIcon *icon,
- int size,
- char **type,
- GCancellable *cancellable,
- GError **error)
+g_file_icon_load (GLoadableIcon *icon,
+ int size,
+ char **type,
+ GCancellable *cancellable,
+ GError **error)
{
GFileInputStream *stream;
GFileIcon *file_icon = G_FILE_ICON (icon);
}
static void
-load_async_callback (GObject *source_object,
+load_async_callback (GObject *source_object,
GAsyncResult *res,
- gpointer user_data)
+ gpointer user_data)
{
GFileInputStream *stream;
GError *error = NULL;
}
static void
-g_file_icon_load_async (GLoadableIcon *icon,
- int size,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_icon_load_async (GLoadableIcon *icon,
+ int size,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileIcon *file_icon = G_FILE_ICON (icon);
LoadData *data;
}
static GInputStream *
-g_file_icon_load_finish (GLoadableIcon *icon,
- GAsyncResult *res,
- char **type,
- GError **error)
+g_file_icon_load_finish (GLoadableIcon *icon,
+ GAsyncResult *res,
+ char **type,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
gpointer op;
* Copies all of the #GFileAttribute<!-- -->s from @src_info to @dest_info.
**/
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;
int i;
* Returns: a duplicate #GFileInfo of @other.
**/
GFileInfo *
-g_file_info_dup (GFileInfo *other)
+g_file_info_dup (GFileInfo *other)
{
GFileInfo *new;
* Sets @mask on @info to match specific attribute types.
**/
void
-g_file_info_set_attribute_mask (GFileInfo *info,
+g_file_info_set_attribute_mask (GFileInfo *info,
GFileAttributeMatcher *mask)
{
GFileAttribute *attr;
static int
g_file_info_find_place (GFileInfo *info,
- guint32 attribute)
+ guint32 attribute)
{
int min, max, med;
GFileAttribute *attrs;
static GFileAttributeValue *
g_file_info_find_value (GFileInfo *info,
- guint32 attr_id)
+ guint32 attr_id)
{
GFileAttribute *attrs;
int i;
}
static GFileAttributeValue *
-g_file_info_find_value_by_name (GFileInfo *info,
+g_file_info_find_value_by_name (GFileInfo *info,
const char *attribute)
{
guint32 attr_id;
*
* Gets an unsigned 32-bit integer contained within the attribute. If the
* 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.
**/
*
* Gets a signed 32-bit integer contained within the attribute. If the
* 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.
**/
*
* Gets a unsigned 64-bit integer contained within the attribute. If the
* 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.
**/
*
* Gets a signed 64-bit integer contained within the attribute. If the
* 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.
**/
*
* Sets the @attribute to contain the given @attr_value,
* if possible.
- *
**/
void
-g_file_info_set_attribute (GFileInfo *info,
- const char *attribute,
+g_file_info_set_attribute (GFileInfo *info,
+ const char *attribute,
const GFileAttributeValue *attr_value)
{
GFileAttributeValue *value;
*
* Sets the @attribute to contain the given @attr_value,
* if possible.
- *
**/
void
g_file_info_set_attribute_object (GFileInfo *info,
const char *attribute,
- GObject *attr_value)
+ GObject *attr_value)
{
GFileAttributeValue *value;
*
* Sets the @attribute to contain the given @attr_value,
* if possible.
- *
**/
void
g_file_info_set_attribute_string (GFileInfo *info,
*
* Sets the @attribute to contain the given @attr_value,
* if possible.
- *
**/
void
g_file_info_set_attribute_byte_string (GFileInfo *info,
*
* Sets the @attribute to contain the given @attr_value,
* if possible.
- *
**/
void
g_file_info_set_attribute_boolean (GFileInfo *info,
const char *attribute,
- gboolean attr_value)
+ gboolean attr_value)
{
GFileAttributeValue *value;
*
* Sets the @attribute to contain the given @attr_value,
* if possible.
- *
**/
-
void
g_file_info_set_attribute_uint32 (GFileInfo *info,
const char *attribute,
*
* Sets the @attribute to contain the given @attr_value,
* if possible.
- *
**/
void
-g_file_info_set_attribute_int32 (GFileInfo *info,
- const char *attribute,
- gint32 attr_value)
+g_file_info_set_attribute_int32 (GFileInfo *info,
+ const char *attribute,
+ gint32 attr_value)
{
GFileAttributeValue *value;
*
* Sets the @attribute to contain the given @attr_value,
* if possible.
- *
**/
void
g_file_info_set_attribute_uint64 (GFileInfo *info,
*
* Gets the modification time of the current @info and sets it
* in @result.
- *
**/
-
void
g_file_info_get_modification_time (GFileInfo *info,
GTimeVal *result)
* See %G_FILE_ATTRIBUTE_STD_TYPE.
**/
void
-g_file_info_set_file_type (GFileInfo *info,
- GFileType type)
+g_file_info_set_file_type (GFileInfo *info,
+ GFileType type)
{
static guint32 attr = 0;
GFileAttributeValue *value;
*
* Sets the "is_symlink" attribute in a #GFileInfo according to @is_symlink.
* See %G_FILE_ATTRIBUTE_STD_IS_SYMLINK.
- *
**/
void
g_file_info_set_is_symlink (GFileInfo *info,
*
* Sets the name attribute for the current #GFileInfo.
* See %G_FILE_ATTRIBUTE_STD_NAME.
- *
**/
void
-g_file_info_set_name (GFileInfo *info,
- const char *name)
+g_file_info_set_name (GFileInfo *info,
+ const char *name)
{
static guint32 attr = 0;
GFileAttributeValue *value;
*
* Sets the display name for the current #GFileInfo.
* See %G_FILE_ATTRIBUTE_STD_DISPLAY_NAME.
- *
**/
void
-g_file_info_set_display_name (GFileInfo *info,
- const char *display_name)
+g_file_info_set_display_name (GFileInfo *info,
+ const char *display_name)
{
static guint32 attr = 0;
GFileAttributeValue *value;
*
* Sets the edit name for the current file.
* See %G_FILE_ATTRIBUTE_STD_EDIT_NAME.
- *
**/
-
void
-g_file_info_set_edit_name (GFileInfo *info,
- const char *edit_name)
+g_file_info_set_edit_name (GFileInfo *info,
+ const char *edit_name)
{
static guint32 attr = 0;
GFileAttributeValue *value;
*
* Sets the icon for a given #GFileInfo.
* See %G_FILE_ATTRIBUTE_STD_ICON.
- *
**/
void
-g_file_info_set_icon (GFileInfo *info,
- GIcon *icon)
+g_file_info_set_icon (GFileInfo *info,
+ GIcon *icon)
{
static guint32 attr = 0;
GFileAttributeValue *value;
*
* Sets the content type attribute for a given #GFileInfo.
* See %G_FILE_ATTRIBUTE_STD_CONTENT_TYPE.
- *
**/
void
-g_file_info_set_content_type (GFileInfo *info,
- const char *content_type)
+g_file_info_set_content_type (GFileInfo *info,
+ const char *content_type)
{
static guint32 attr = 0;
GFileAttributeValue *value;
*
* Sets the %G_FILE_ATTRIBUTE_STD_SIZE attribute in the file info
* to the given size.
- *
**/
void
-g_file_info_set_size (GFileInfo *info,
- goffset size)
+g_file_info_set_size (GFileInfo *info,
+ goffset size)
{
static guint32 attr = 0;
GFileAttributeValue *value;
*
* Sets the %G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file
* info to the given time value.
- *
**/
void
-g_file_info_set_modification_time (GFileInfo *info,
- GTimeVal *mtime)
+g_file_info_set_modification_time (GFileInfo *info,
+ GTimeVal *mtime)
{
static guint32 attr_mtime = 0, attr_mtime_usec;
GFileAttributeValue *value;
*
* Sets the %G_FILE_ATTRIBUTE_STD_SYMLINK_TARGET attribute in the file info
* to the given symlink target.
- *
**/
void
-g_file_info_set_symlink_target (GFileInfo *info,
- const char *symlink_target)
+g_file_info_set_symlink_target (GFileInfo *info,
+ const char *symlink_target)
{
static guint32 attr = 0;
GFileAttributeValue *value;
*
* Sets the sort order attribute in the file info structure. See
* %G_FILE_ATTRIBUTE_STD_SORT_ORDER.
- *
**/
void
-g_file_info_set_sort_order (GFileInfo *info,
- gint32 sort_order)
+g_file_info_set_sort_order (GFileInfo *info,
+ gint32 sort_order)
{
static guint32 attr = 0;
GFileAttributeValue *value;
static void
matcher_add (GFileAttributeMatcher *matcher,
- guint id, guint mask)
+ guint id,
+ guint mask)
{
SubMatcher *sub_matchers;
int i;
static gboolean
matcher_matches_id (GFileAttributeMatcher *matcher,
- guint32 id)
+ guint32 id)
{
SubMatcher *sub_matchers;
int i;
static gboolean
g_file_attribute_matcher_matches_id (GFileAttributeMatcher *matcher,
- guint32 id)
+ guint32 id)
{
g_return_val_if_fail (matcher != NULL, FALSE);
* @error: a #GError location to store the error occuring, or %NULL to
* ignore.
*
- * Queries a file input stream the given @attributes.his function blocks while querying
- * the stream. For the asynchronous (non-blocking) version of this function, see
- * g_file_input_stream_query_info_async(). While the stream is blocked,
- * the stream will set the pending flag internally, and any other operations on the
- * stream will fail with %G_IO_ERROR_PENDING.
+ * Queries a file input stream the given @attributes.his function blocks
+ * while querying the stream. For the asynchronous (non-blocking) version
+ * of this function, see g_file_input_stream_query_info_async(). While the
+ * stream is blocked, the stream will set the pending flag internally, and
+ * any other operations on the stream will fail with %G_IO_ERROR_PENDING.
*
* Returns: a #GFileInfo, or %NULL on error.
**/
GFileInfo *
-g_file_input_stream_query_info (GFileInputStream *stream,
- char *attributes,
- GCancellable *cancellable,
- GError **error)
+g_file_input_stream_query_info (GFileInputStream *stream,
+ char *attributes,
+ GCancellable *cancellable,
+ GError **error)
{
GFileInputStreamClass *class;
GInputStream *input_stream;
}
static void
-async_ready_callback_wrapper (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+async_ready_callback_wrapper (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
{
GFileInputStream *stream = G_FILE_INPUT_STREAM (source_object);
* @callback: callback to call when the request is satisfied
* @user_data: the data to pass to callback function
*
- * Queries the stream information asynchronously. For the synchronous version
- * of this function, see g_file_input_stream_query_info().
+ * Queries the stream information asynchronously. For the synchronous
+ * version of this function, see g_file_input_stream_query_info().
*
* If @cancellable is not %NULL, then the operation can be cancelled by
* triggering the cancellable object from another thread. If the operation
*
**/
void
-g_file_input_stream_query_info_async (GFileInputStream *stream,
- char *attributes,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_input_stream_query_info_async (GFileInputStream *stream,
+ char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFileInputStreamClass *klass;
GInputStream *input_stream;
* g_file_input_stream_query_info_finish:
* @stream: a #GFileInputStream.
* @result: a #GAsyncResult.
- * @error: a #GError location to store the error occuring, or %NULL to
- * ignore.
+ * @error: a #GError location to store the error occuring,
+ * or %NULL to ignore.
*
* Finishes an asynchronous info query operation.
*
* Returns: #GFileInfo.
**/
GFileInfo *
-g_file_input_stream_query_info_finish (GFileInputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_file_input_stream_query_info_finish (GFileInputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple;
GFileInputStreamClass *class;
* Returns: a #goffset with the position in the stream.
**/
goffset
-g_file_input_stream_tell (GFileInputStream *stream)
+g_file_input_stream_tell (GFileInputStream *stream)
{
GFileInputStreamClass *class;
goffset offset;
* Returns: %TRUE if stream can be seeked. %FALSE otherwise.
**/
gboolean
-g_file_input_stream_can_seek (GFileInputStream *stream)
+g_file_input_stream_can_seek (GFileInputStream *stream)
{
GFileInputStreamClass *class;
gboolean can_seek;
* @offset: a #goffset to seek.
* @type: a #GSeekType.
* @cancellable: optional #GCancellable object, %NULL to ignore.
- * @error: a #GError location to store the error occuring, or %NULL to
- * ignore.
+ * @error: a #GError location to store the error occuring, or
+ * %NULL to ignore.
*
* Seeks in the file input stream.
*
}
static gboolean
-g_file_input_stream_seekable_seek (GSeekable *seekable,
- goffset offset,
- GSeekType type,
+g_file_input_stream_seekable_seek (GSeekable *seekable,
+ goffset offset,
+ GSeekType type,
GCancellable *cancellable,
- GError **error)
+ GError **error)
{
return g_file_input_stream_seek (G_FILE_INPUT_STREAM (seekable),
offset, type, cancellable, error);
}
static gboolean
-g_file_input_stream_seekable_can_truncate (GSeekable *seekable)
+g_file_input_stream_seekable_can_truncate (GSeekable *seekable)
{
return FALSE;
}
static gboolean
-g_file_input_stream_seekable_truncate (GSeekable *seekable,
- goffset offset,
+g_file_input_stream_seekable_truncate (GSeekable *seekable,
+ goffset offset,
GCancellable *cancellable,
- GError **error)
+ GError **error)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
_("Truncate not allowed on input stream"));
static void
query_info_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GFileInputStreamClass *class;
GError *error = NULL;
}
static void
-g_file_input_stream_real_query_info_async (GFileInputStream *stream,
- char *attributes,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_file_input_stream_real_query_info_async (GFileInputStream *stream,
+ char *attributes,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
QueryInfoAsyncData *data;
}
static GFileInfo *
-g_file_input_stream_real_query_info_finish (GFileInputStream *stream,
- GAsyncResult *res,
- GError **error)
+g_file_input_stream_real_query_info_finish (GFileInputStream *stream,
+ GAsyncResult *res,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
QueryInfoAsyncData *data;
}
static gssize
-g_filter_input_stream_read (GInputStream *stream,
- void *buffer,
- gsize count,
- GCancellable *cancellable,
- GError **error)
+g_filter_input_stream_read (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error)
{
GFilterInputStream *filter_stream;
GInputStream *base_stream;
}
static gssize
-g_filter_input_stream_skip (GInputStream *stream,
- gsize count,
- GCancellable *cancellable,
- GError **error)
+g_filter_input_stream_skip (GInputStream *stream,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error)
{
GFilterInputStream *filter_stream;
GInputStream *base_stream;
}
static void
-g_filter_input_stream_read_async (GInputStream *stream,
- void *buffer,
- gsize count,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_filter_input_stream_read_async (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFilterInputStream *filter_stream;
GInputStream *base_stream;
}
static void
-g_filter_input_stream_close_async (GInputStream *stream,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_filter_input_stream_close_async (GInputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GFilterInputStream *filter_stream;
GInputStream *base_stream;
cancellable,
callback,
user_data);
-
-
}
static gboolean
#define __G_FILTER_INPUT_STREAM_C__
#include "gioaliasdef.c"
-
-/* vim: ts=2 sw=2 et */
}
static void
-g_filter_output_stream_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+g_filter_output_stream_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
GFilterOutputStream *filter_stream;
GObject *obj;
static void
g_filter_output_stream_dispose (GObject *object)
{
- GFilterOutputStream *stream;
+ GFilterOutputStream *stream;
stream = G_FILTER_OUTPUT_STREAM (object);
}
static gssize
-g_filter_output_stream_write (GOutputStream *stream,
- const void *buffer,
- gsize count,
- GCancellable *cancellable,
- GError **error)
+g_filter_output_stream_write (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error)
{
GFilterOutputStream *filter_stream;
gssize nwritten;
}
static gboolean
-g_filter_output_stream_flush (GOutputStream *stream,
- GCancellable *cancellable,
- GError **error)
+g_filter_output_stream_flush (GOutputStream *stream,
+ GCancellable *cancellable,
+ GError **error)
{
GFilterOutputStream *filter_stream;
gboolean res;
}
static void
-g_filter_output_stream_write_async (GOutputStream *stream,
- const void *buffer,
- gsize count,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer data)
+g_filter_output_stream_write_async (GOutputStream *stream,
+ const void *buffer,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer data)
{
GFilterOutputStream *filter_stream;
}
static gssize
-g_filter_output_stream_write_finish (GOutputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_filter_output_stream_write_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GFilterOutputStream *filter_stream;
gssize nwritten;
}
static void
-g_filter_output_stream_flush_async (GOutputStream *stream,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer data)
+g_filter_output_stream_flush_async (GOutputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer data)
{
GFilterOutputStream *filter_stream;
}
static gboolean
-g_filter_output_stream_flush_finish (GOutputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_filter_output_stream_flush_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GFilterOutputStream *filter_stream;
gboolean res;
}
static void
-g_filter_output_stream_close_async (GOutputStream *stream,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer data)
+g_filter_output_stream_close_async (GOutputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer data)
{
GFilterOutputStream *filter_stream;
}
static gboolean
-g_filter_output_stream_close_finish (GOutputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_filter_output_stream_close_finish (GOutputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GFilterOutputStream *filter_stream;
gboolean res;
* Return value: %TRUE on success, %FALSE if there was an error
**/
gboolean
-g_input_stream_read_all (GInputStream *stream,
- void *buffer,
- gsize count,
- gsize *bytes_read,
- GCancellable *cancellable,
- GError **error)
+g_input_stream_read_all (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ gsize *bytes_read,
+ GCancellable *cancellable,
+ GError **error)
{
gsize _bytes_read;
gssize res;
* Return value: Number of bytes skipped, or -1 on error
**/
gssize
-g_input_stream_skip (GInputStream *stream,
- gsize count,
- GCancellable *cancellable,
- GError **error)
+g_input_stream_skip (GInputStream *stream,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error)
{
GInputStreamClass *class;
gssize res;
}
static gssize
-g_input_stream_real_skip (GInputStream *stream,
- gsize count,
- GCancellable *cancellable,
- GError **error)
+g_input_stream_real_skip (GInputStream *stream,
+ gsize count,
+ GCancellable *cancellable,
+ GError **error)
{
GInputStreamClass *class;
gssize ret, read_bytes;
}
static void
-async_ready_callback_wrapper (GObject *source_object,
+async_ready_callback_wrapper (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
}
static void
-async_ready_close_callback_wrapper (GObject *source_object,
+async_ready_close_callback_wrapper (GObject *source_object,
GAsyncResult *res,
gpointer user_data)
{
* Returns: number of bytes read in, or -1 on error.
**/
gssize
-g_input_stream_read_finish (GInputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_input_stream_read_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple;
GInputStreamClass *class;
* Returns: the size of the bytes skipped, or %-1 on error.
**/
gssize
-g_input_stream_skip_finish (GInputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_input_stream_skip_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple;
GInputStreamClass *class;
* override one you must override all.
**/
void
-g_input_stream_close_async (GInputStream *stream,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_input_stream_close_async (GInputStream *stream,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GInputStreamClass *class;
GSimpleAsyncResult *simple;
* Returns: %TRUE if the stream was closed successfully.
**/
gboolean
-g_input_stream_close_finish (GInputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_input_stream_close_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple;
GInputStreamClass *class;
* Sets @stream has actions pending.
**/
void
-g_input_stream_set_pending (GInputStream *stream,
- gboolean pending)
+g_input_stream_set_pending (GInputStream *stream,
+ gboolean pending)
{
g_return_if_fail (G_IS_INPUT_STREAM (stream));
static void
read_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
ReadData *op;
GInputStreamClass *class;
}
static void
-g_input_stream_real_read_async (GInputStream *stream,
- void *buffer,
- gsize count,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_input_stream_real_read_async (GInputStream *stream,
+ void *buffer,
+ gsize count,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
ReadData *op;
}
static gssize
-g_input_stream_real_read_finish (GInputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_input_stream_real_read_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
ReadData *op;
static void
skip_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
SkipData *op;
GInputStreamClass *class;
} SkipFallbackAsyncData;
static void
-skip_callback_wrapper (GObject *source_object,
+skip_callback_wrapper (GObject *source_object,
GAsyncResult *res,
- gpointer user_data)
+ gpointer user_data)
{
GInputStreamClass *class;
SkipFallbackAsyncData *data = user_data;
}
static gssize
-g_input_stream_real_skip_finish (GInputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_input_stream_real_skip_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
SkipData *op;
static void
close_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GInputStreamClass *class;
GError *error = NULL;
}
static gboolean
-g_input_stream_real_close_finish (GInputStream *stream,
- GAsyncResult *result,
- GError **error)
+g_input_stream_real_close_finish (GInputStream *stream,
+ GAsyncResult *result,
+ GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (result);
g_assert (g_simple_async_result_get_source_tag (simple) == g_input_stream_real_close_async);
static GThreadPool *job_thread_pool = NULL;
-static void io_job_thread (gpointer data,
- gpointer user_data);
+static void io_job_thread (gpointer data,
+ gpointer user_data);
static void
g_io_job_free (GIOJob *job)
}
static gint
-g_io_job_compare (gconstpointer a,
- gconstpointer b,
- gpointer user_data)
+g_io_job_compare (gconstpointer a,
+ gconstpointer b,
+ gpointer user_data)
{
const GIOJob *aa = a;
const GIOJob *bb = b;
}
static void
-io_job_thread (gpointer data,
- gpointer user_data)
+io_job_thread (gpointer data,
+ gpointer user_data)
{
GIOJob *job = data;
*
**/
void
-g_schedule_io_job (GIOJobFunc job_func,
- gpointer user_data,
- GDestroyNotify notify,
- gint io_priority,
- GCancellable *cancellable)
+g_schedule_io_job (GIOJobFunc job_func,
+ gpointer user_data,
+ GDestroyNotify notify,
+ gint io_priority,
+ GCancellable *cancellable)
{
static GOnce once_init = G_ONCE_INIT;
GIOJob *job;
*
**/
void
-g_io_job_send_to_mainloop (GIOJob *job,
- GIODataFunc func,
- gpointer user_data,
- GDestroyNotify notify,
- gboolean block)
+g_io_job_send_to_mainloop (GIOJob *job,
+ GIODataFunc func,
+ gpointer user_data,
+ GDestroyNotify notify,
+ gboolean block)
{
GSource *source;
MainLoopProxy *proxy;
* Returns: a #GInputStream to read the icon from.
**/
GInputStream *
-g_loadable_icon_load (GLoadableIcon *icon,
- int size,
- char **type,
- GCancellable *cancellable,
- GError **error)
+g_loadable_icon_load (GLoadableIcon *icon,
+ int size,
+ char **type,
+ GCancellable *cancellable,
+ GError **error)
{
GLoadableIconIface *iface;
*
**/
void
-g_loadable_icon_load_async (GLoadableIcon *icon,
- int size,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_loadable_icon_load_async (GLoadableIcon *icon,
+ int size,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GLoadableIconIface *iface;
* Returns: a #GInputStream to read the icon from.
**/
GInputStream *
-g_loadable_icon_load_finish (GLoadableIcon *icon,
- GAsyncResult *res,
- char **type,
- GError **error)
+g_loadable_icon_load_finish (GLoadableIcon *icon,
+ GAsyncResult *res,
+ char **type,
+ GError **error)
{
GLoadableIconIface *iface;
static void
load_async_thread (GSimpleAsyncResult *res,
- GObject *object,
- GCancellable *cancellable)
+ GObject *object,
+ GCancellable *cancellable)
{
GLoadableIconIface *iface;
GInputStream *stream;
static void
-g_loadable_icon_real_load_async (GLoadableIcon *icon,
- int size,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+g_loadable_icon_real_load_async (GLoadableIcon *icon,
+ int size,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *res;
LoadData *data;