* Author: Alexander Larsson <alexl@redhat.com>
*/
-#include <config.h>
+#include "config.h"
#include "gseekable.h"
#include "glibintl.h"
+#include "gioalias.h"
+
/**
* SECTION:gseekable
* @short_description: Stream seeking interface
+ * @include: gio/gio.h
* @see_also: #GInputStream, #GOutputStream
*
* #GSeekable is implemented by streams (implementations of
GType
g_seekable_get_type (void)
{
- static GType seekable_type = 0;
+ static volatile gsize g_define_type_id__volatile = 0;
- if (! seekable_type)
+ if (g_once_init_enter (&g_define_type_id__volatile))
{
- static const GTypeInfo seekable_info =
+ const GTypeInfo seekable_info =
{
sizeof (GSeekableIface), /* class_size */
g_seekable_base_init, /* base_init */
0, /* n_preallocs */
NULL
};
-
- seekable_type =
+ GType g_define_type_id =
g_type_register_static (G_TYPE_INTERFACE, I_("GSeekable"),
&seekable_info, 0);
- g_type_interface_add_prerequisite (seekable_type, G_TYPE_OBJECT);
+ g_type_interface_add_prerequisite (g_define_type_id, G_TYPE_OBJECT);
+
+ g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
}
- return seekable_type;
+ return g_define_type_id__volatile;
}
static void
* was cancelled, the error %G_IO_ERROR_CANCELLED will be returned.
*
* Returns: %TRUE if successful. If an error
- * has occured, this function will return %FALSE and set @error
- * appropriately if present.
+ * has occurred, this function will return %FALSE and set @error
+ * appropriately if present.
**/
gboolean
g_seekable_seek (GSeekable *seekable,
* partial result will be returned, without an error.
*
* Returns: %TRUE if successful. If an error
- * has occured, this function will return %FALSE and set @error
- * appropriately if present.
+ * has occurred, this function will return %FALSE and set @error
+ * appropriately if present.
**/
gboolean
g_seekable_truncate (GSeekable *seekable,
iface = G_SEEKABLE_GET_IFACE (seekable);
- return (* iface->truncate) (seekable, offset, cancellable, error);
+ return (* iface->truncate_fn) (seekable, offset, cancellable, error);
}
+#define __G_SEEKABLE_C__
+#include "gioaliasdef.c"