GBuffer: Suffix header with private.h
authorColin Walters <walters@verbum.org>
Fri, 3 Jun 2011 17:18:44 +0000 (13:18 -0400)
committerColin Walters <walters@verbum.org>
Mon, 6 Jun 2011 13:58:21 +0000 (09:58 -0400)
This makes it clearer it's not public API yet.

https://bugzilla.gnome.org/show_bug.cgi?id=651745

docs/reference/glib/Makefile.am
glib/Makefile.am
glib/gbuffer.c
glib/gbuffer.h [deleted file]
glib/gbufferprivate.h [new file with mode: 0644]
glib/gmappedfile.c
glib/gtimezone.c
glib/gvariant-core.c
glib/gvariant-core.h

index 4372db5622a52b6d11ef5feeaae1e18c752a99d7..28381065fdf3efe3689a00f1d318e34ebc997e56 100644 (file)
@@ -42,7 +42,7 @@ IGNORE_HFILES=                        \
        gnulib                  \
        pcre                    \
        update-pcre             \
-       gbuffer.h               \
+       gbufferprivate.h        \
        gvariant-internal.h     \
        gvariant-serialiser.h   \
        gvariant-core.h         \
index 7d333a8120ac1c9a8dc4a086381560e12475d2e2..becfcaa75596e77dc2e530053320c2e3b09ea062 100644 (file)
@@ -122,7 +122,7 @@ libglib_2_0_la_SOURCES =    \
        gbookmarkfile.c         \
        gbsearcharray.h         \
        gbuffer.c               \
-       gbuffer.h               \
+       gbufferprivate.h        \
        gcache.c                \
        gchecksum.c             \
        gcompletion.c           \
index f7e30441cf414b6675499c632a347e46c7aa5fa3..d4dc21b80502da13bcd49674dafd853fdadb673f 100644 (file)
@@ -21,7 +21,7 @@
 
 #include "config.h"
 
-#include "gbuffer.h"
+#include "gbufferprivate.h"
 
 #include <glib/gstrfuncs.h>
 #include <glib/gatomic.h>
diff --git a/glib/gbuffer.h b/glib/gbuffer.h
deleted file mode 100644 (file)
index 6bb29b7..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright © 2009, 2010 Codethink Limited
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the licence, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Ryan Lortie <desrt@desrt.ca>
- */
-
-#ifndef __G_BUFFER_H__
-#define __G_BUFFER_H__
-
-#include <glib/gtypes.h>
-
-/* < private >
- * GBuffer:
- * @data: a pointer to the data held in the buffer
- * @size: the size of @data
- *
- * A simple refcounted data type representing a byte sequence from an
- * unspecified origin.
- *
- * The purpose of a #GBuffer is to keep the memory region that it holds
- * alive for as long as anyone holds a reference to the buffer.  When
- * the last reference count is dropped, the memory is released.
- *
- * A #GBuffer can come from many different origins that may have
- * different procedures for freeing the memory region.  Examples are
- * memory from g_malloc(), from memory slices, from a #GMappedFile or
- * memory from other allocators.
- */
-typedef struct _GBuffer GBuffer;
-
-/* < private >
- * GBufferFreeFunc:
- * @buffer: the #GBuffer to be freed
- *
- * This function is provided by creators of a #GBuffer.  It is the
- * function to be called when the reference count of @buffer drops to
- * zero.  It should free any memory associated with the buffer and free
- * @buffer itself.
- */
-typedef void (* GBufferFreeFunc)                (GBuffer        *buffer);
-
-struct _GBuffer
-{
-  gconstpointer data;
-  gsize size;
-
-  /*< protected >*/
-  GBufferFreeFunc free_func;
-
-  /*< private >*/
-  gint ref_count;
-};
-
-G_GNUC_INTERNAL
-GBuffer *       g_buffer_new_from_data          (gconstpointer   data,
-                                                 gsize           size);
-G_GNUC_INTERNAL
-GBuffer *       g_buffer_new_take_data          (gpointer        data,
-                                                 gsize           size);
-G_GNUC_INTERNAL
-GBuffer *       g_buffer_new_from_static_data   (gconstpointer   data,
-                                                 gsize           size);
-G_GNUC_INTERNAL
-GBuffer *       g_buffer_new_from_pointer       (gconstpointer   data,
-                                                 gsize           size,
-                                                 GDestroyNotify  notify,
-                                                 gpointer        user_data);
-G_GNUC_INTERNAL
-GBuffer *     g_buffer_ref                      (GBuffer        *buffer);
-G_GNUC_INTERNAL
-void          g_buffer_unref                    (GBuffer        *buffer);
-
-#endif /* __G_BUFFER_H__ */
diff --git a/glib/gbufferprivate.h b/glib/gbufferprivate.h
new file mode 100644 (file)
index 0000000..6bb29b7
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * Copyright © 2009, 2010 Codethink Limited
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the licence, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ * Author: Ryan Lortie <desrt@desrt.ca>
+ */
+
+#ifndef __G_BUFFER_H__
+#define __G_BUFFER_H__
+
+#include <glib/gtypes.h>
+
+/* < private >
+ * GBuffer:
+ * @data: a pointer to the data held in the buffer
+ * @size: the size of @data
+ *
+ * A simple refcounted data type representing a byte sequence from an
+ * unspecified origin.
+ *
+ * The purpose of a #GBuffer is to keep the memory region that it holds
+ * alive for as long as anyone holds a reference to the buffer.  When
+ * the last reference count is dropped, the memory is released.
+ *
+ * A #GBuffer can come from many different origins that may have
+ * different procedures for freeing the memory region.  Examples are
+ * memory from g_malloc(), from memory slices, from a #GMappedFile or
+ * memory from other allocators.
+ */
+typedef struct _GBuffer GBuffer;
+
+/* < private >
+ * GBufferFreeFunc:
+ * @buffer: the #GBuffer to be freed
+ *
+ * This function is provided by creators of a #GBuffer.  It is the
+ * function to be called when the reference count of @buffer drops to
+ * zero.  It should free any memory associated with the buffer and free
+ * @buffer itself.
+ */
+typedef void (* GBufferFreeFunc)                (GBuffer        *buffer);
+
+struct _GBuffer
+{
+  gconstpointer data;
+  gsize size;
+
+  /*< protected >*/
+  GBufferFreeFunc free_func;
+
+  /*< private >*/
+  gint ref_count;
+};
+
+G_GNUC_INTERNAL
+GBuffer *       g_buffer_new_from_data          (gconstpointer   data,
+                                                 gsize           size);
+G_GNUC_INTERNAL
+GBuffer *       g_buffer_new_take_data          (gpointer        data,
+                                                 gsize           size);
+G_GNUC_INTERNAL
+GBuffer *       g_buffer_new_from_static_data   (gconstpointer   data,
+                                                 gsize           size);
+G_GNUC_INTERNAL
+GBuffer *       g_buffer_new_from_pointer       (gconstpointer   data,
+                                                 gsize           size,
+                                                 GDestroyNotify  notify,
+                                                 gpointer        user_data);
+G_GNUC_INTERNAL
+GBuffer *     g_buffer_ref                      (GBuffer        *buffer);
+G_GNUC_INTERNAL
+void          g_buffer_unref                    (GBuffer        *buffer);
+
+#endif /* __G_BUFFER_H__ */
index b78651729e03c66ecd8f8add4d8b93ee66199542..48081dcb97fd26a4df8e06b6e425044e4da5e110 100644 (file)
@@ -52,7 +52,7 @@
 #include "gstdio.h"
 #include "gstrfuncs.h"
 #include "gatomic.h"
-#include "gbuffer.h"
+#include "gbufferprivate.h"
 
 #include "glibintl.h"
 
index 0d9d6f7420072318d01612a34fd7312ac069d003..9b2fb07fa6d6fba949e992038bf38f00a3e2037a 100644 (file)
@@ -33,7 +33,7 @@
 #include "gstrfuncs.h"
 #include "ghash.h"
 #include "gthread.h"
-#include "gbuffer.h"
+#include "gbufferprivate.h"
 
 /**
  * SECTION:timezone
index d2bd576d219b23b435fba767a50095bd52ee7f6b..211156126f3190f2be42840a1e9b25efe4d0b621 100644 (file)
@@ -24,7 +24,7 @@
 #include <glib/gtestutils.h>
 #include <glib/gbitlock.h>
 #include <glib/gatomic.h>
-#include <glib/gbuffer.h>
+#include <glib/gbufferprivate.h>
 #include <glib/gslice.h>
 #include <glib/gmem.h>
 #include <string.h>
index 33c0ef313a434c59cadec8fd0ead6997ef9647c0..a31212ee22be9b58d572a5eaba7de1600e8f3e7d 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <glib/gvarianttypeinfo.h>
 #include <glib/gvariant.h>
-#include <glib/gbuffer.h>
+#include <glib/gbufferprivate.h>
 
 /* gvariant-core.c */
 G_GNUC_INTERNAL