Initial version of GResource
[platform/upstream/glib.git] / gio / ginputstream.h
index b730a2b..8179529 100644 (file)
@@ -1,5 +1,5 @@
 /* GIO - GLib Input, Output and Streaming Library
- * 
+ *
  * Copyright (C) 2006-2007 Red Hat, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * Author: Alexander Larsson <alexl@redhat.com>
  */
 
+#if !defined (__GIO_GIO_H_INSIDE__) && !defined (GIO_COMPILATION)
+#error "Only <gio/gio.h> can be included directly."
+#endif
+
 #ifndef __G_INPUT_STREAM_H__
 #define __G_INPUT_STREAM_H__
 
-#include <glib-object.h>
-#include <gio/gioerror.h>
-#include <gio/gcancellable.h>
-#include <gio/gasyncresult.h>
+#include <gio/giotypes.h>
 
 G_BEGIN_DECLS
 
@@ -39,16 +40,15 @@ G_BEGIN_DECLS
 
 /**
  * GInputStream:
- * 
+ *
  * Base class for streaming input operations.
  **/
-typedef struct _GInputStream         GInputStream;
 typedef struct _GInputStreamClass    GInputStreamClass;
 typedef struct _GInputStreamPrivate  GInputStreamPrivate;
 
 struct _GInputStream
 {
-  GObject parent;
+  GObject parent_instance;
 
   /*< private >*/
   GInputStreamPrivate *priv;
@@ -59,48 +59,48 @@ struct _GInputStreamClass
   GObjectClass parent_class;
 
   /* Sync ops: */
-  
-  gssize   (* read_fn)     (GInputStream *stream,
-                           void         *buffer,
-                           gsize         count,
-                           GCancellable *cancellable,
-                           GError      **error);
-  gssize   (* skip)        (GInputStream *stream,
-                           gsize         count,
-                           GCancellable *cancellable,
-                           GError      **error);
-  gboolean (* close_fn)           (GInputStream *stream,
-                           GCancellable *cancellable,
-                           GError      **error);
+
+  gssize   (* read_fn)      (GInputStream        *stream,
+                             void                *buffer,
+                             gsize                count,
+                             GCancellable        *cancellable,
+                             GError             **error);
+  gssize   (* skip)         (GInputStream        *stream,
+                             gsize                count,
+                             GCancellable        *cancellable,
+                             GError             **error);
+  gboolean (* close_fn)            (GInputStream        *stream,
+                             GCancellable        *cancellable,
+                             GError             **error);
 
   /* Async ops: (optional in derived classes) */
-  void     (* read_async)  (GInputStream        *stream,
-                           void               *buffer,
-                           gsize               count,
-                           int                 io_priority,
-                           GCancellable       *cancellable,
-                           GAsyncReadyCallback callback,
-                           gpointer            user_data);
-  gssize   (* read_finish) (GInputStream       *stream,
-                           GAsyncResult       *result,
-                           GError            **error);
-  void     (* skip_async)  (GInputStream       *stream,
-                           gsize               count,
-                           int                 io_priority,
-                           GCancellable       *cancellable,
-                           GAsyncReadyCallback callback,
-                           gpointer            user_data);
-  gssize   (* skip_finish) (GInputStream        *stream,
-                           GAsyncResult       *result,
-                           GError            **error);
-  void     (* close_async) (GInputStream        *stream,
-                           int                  io_priority,
-                           GCancellable       *cancellable,
-                           GAsyncReadyCallback callback,
-                           gpointer            user_data);
-  gboolean (* close_finish)(GInputStream        *stream,
-                           GAsyncResult       *result,
-                           GError            **error);
+  void     (* read_async)   (GInputStream        *stream,
+                             void                *buffer,
+                             gsize                count,
+                             int                  io_priority,
+                             GCancellable        *cancellable,
+                             GAsyncReadyCallback  callback,
+                             gpointer             user_data);
+  gssize   (* read_finish)  (GInputStream        *stream,
+                             GAsyncResult        *result,
+                             GError             **error);
+  void     (* skip_async)   (GInputStream        *stream,
+                             gsize                count,
+                             int                  io_priority,
+                             GCancellable        *cancellable,
+                             GAsyncReadyCallback  callback,
+                             gpointer             user_data);
+  gssize   (* skip_finish)  (GInputStream        *stream,
+                             GAsyncResult        *result,
+                             GError             **error);
+  void     (* close_async)  (GInputStream        *stream,
+                             int                  io_priority,
+                             GCancellable        *cancellable,
+                             GAsyncReadyCallback  callback,
+                             gpointer             user_data);
+  gboolean (* close_finish) (GInputStream        *stream,
+                             GAsyncResult        *result,
+                             GError             **error);
 
   /*< private >*/
   /* Padding for future expansion */
@@ -111,7 +111,7 @@ struct _GInputStreamClass
   void (*_g_reserved5) (void);
 };
 
-GType g_input_stream_get_type (void) G_GNUC_CONST;
+GType    g_input_stream_get_type      (void) G_GNUC_CONST;
 
 gssize   g_input_stream_read          (GInputStream          *stream,
                                       void                  *buffer,