[ostree] core: Add ostree-types.h



commit f44b8aca4446bac0c7a0879eb421823c93459936
Author: Colin Walters <walters verbum org>
Date:   Tue Mar 6 08:45:43 2012 -0500

    core: Add ostree-types.h
    
    This allows us to have circular references between the headers.

 Makefile-libostree.am               |    1 +
 src/libostree/ostree-mutable-tree.c |    4 ++-
 src/libostree/ostree-mutable-tree.h |    7 ++---
 src/libostree/ostree-repo-file.c    |    3 +-
 src/libostree/ostree-repo-file.h    |    3 +-
 src/libostree/ostree-repo.h         |    6 ++--
 src/libostree/ostree-types.h        |   39 +++++++++++++++++++++++++++++++++++
 7 files changed, 52 insertions(+), 11 deletions(-)
---
diff --git a/Makefile-libostree.am b/Makefile-libostree.am
index 20af32c..f2b688f 100644
--- a/Makefile-libostree.am
+++ b/Makefile-libostree.am
@@ -30,6 +30,7 @@ libostree_la_SOURCES = src/libostree/ostree.h \
 	src/libostree/ostree-repo-file.h \
 	src/libostree/ostree-repo-file-enumerator.c \
 	src/libostree/ostree-repo-file-enumerator.h \
+	src/libostree/ostree-types.h \
 	$(NULL)
 if USE_LIBARCHIVE
 libostree_la_SOURCES += src/libostree/ostree-libarchive-input-stream.h \
diff --git a/src/libostree/ostree-mutable-tree.c b/src/libostree/ostree-mutable-tree.c
index 5f63f11..37acc80 100644
--- a/src/libostree/ostree-mutable-tree.c
+++ b/src/libostree/ostree-mutable-tree.c
@@ -23,8 +23,10 @@
 #include "config.h"
 
 #include "ostree-mutable-tree.h"
+#include "otutil.h"
+#include "ostree-core.h"
 
-struct _OstreeMutableTree
+struct OstreeMutableTree
 {
   GObject parent_instance;
 
diff --git a/src/libostree/ostree-mutable-tree.h b/src/libostree/ostree-mutable-tree.h
index e47964d..643c6fb 100644
--- a/src/libostree/ostree-mutable-tree.h
+++ b/src/libostree/ostree-mutable-tree.h
@@ -23,7 +23,7 @@
 #ifndef _OSTREE_MUTABLE_TREE
 #define _OSTREE_MUTABLE_TREE
 
-#include "otutil.h"
+#include "ostree-types.h"
 
 G_BEGIN_DECLS
 
@@ -34,15 +34,14 @@ G_BEGIN_DECLS
 #define OSTREE_IS_MUTABLE_TREE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), OSTREE_TYPE_MUTABLE_TREE))
 #define OSTREE_MUTABLE_TREE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), OSTREE_TYPE_MUTABLE_TREE, OstreeMutableTreeClass))
 
-typedef struct _OstreeMutableTree        OstreeMutableTree;
-typedef struct _OstreeMutableTreeClass   OstreeMutableTreeClass;
+typedef struct OstreeMutableTreeClass   OstreeMutableTreeClass;
 
 typedef struct {
   gboolean        in_files;
   GHashTableIter  iter;
 } OstreeMutableTreeIter;
 
-struct _OstreeMutableTreeClass
+struct OstreeMutableTreeClass
 {
   GObjectClass parent_class;
 };
diff --git a/src/libostree/ostree-repo-file.c b/src/libostree/ostree-repo-file.c
index 625067d..24ec230 100644
--- a/src/libostree/ostree-repo-file.c
+++ b/src/libostree/ostree-repo-file.c
@@ -23,10 +23,11 @@
 #include "config.h"
 
 #include "ostree-repo-file-enumerator.h"
+#include "ostree-repo.h"
 
 static void ostree_repo_file_file_iface_init (GFileIface *iface);
 
-struct _OstreeRepoFile
+struct OstreeRepoFile
 {
   GObject parent_instance;
 
diff --git a/src/libostree/ostree-repo-file.h b/src/libostree/ostree-repo-file.h
index 44dda4c..aa6b4d4 100644
--- a/src/libostree/ostree-repo-file.h
+++ b/src/libostree/ostree-repo-file.h
@@ -23,7 +23,7 @@
 #ifndef _OSTREE_REPO_FILE
 #define _OSTREE_REPO_FILE
 
-#include "ostree-repo.h"
+#include "ostree-types.h"
 
 G_BEGIN_DECLS
 
@@ -34,7 +34,6 @@ G_BEGIN_DECLS
 #define OSTREE_IS_REPO_FILE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), OSTREE_TYPE_REPO_FILE))
 #define OSTREE_REPO_FILE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), OSTREE_TYPE_REPO_FILE, OstreeRepoFileClass))
 
-typedef struct _OstreeRepoFile        OstreeRepoFile;
 typedef struct _OstreeRepoFileClass   OstreeRepoFileClass;
 
 struct _OstreeRepoFileClass
diff --git a/src/libostree/ostree-repo.h b/src/libostree/ostree-repo.h
index ca1fecf..002b02e 100644
--- a/src/libostree/ostree-repo.h
+++ b/src/libostree/ostree-repo.h
@@ -24,7 +24,7 @@
 #define _OSTREE_REPO
 
 #include "ostree-core.h"
-#include "ostree-mutable-tree.h"
+#include "ostree-types.h"
 
 G_BEGIN_DECLS
 
@@ -40,9 +40,9 @@ G_BEGIN_DECLS
 #define OSTREE_REPO_GET_CLASS(obj) \
   (G_TYPE_INSTANCE_GET_CLASS ((obj), OSTREE_TYPE_REPO, OstreeRepoClass))
 
-typedef struct {
+struct OstreeRepo {
   GObject parent;
-} OstreeRepo;
+};
 
 typedef struct {
   GObjectClass parent_class;
diff --git a/src/libostree/ostree-types.h b/src/libostree/ostree-types.h
new file mode 100644
index 0000000..af1ae0d
--- /dev/null
+++ b/src/libostree/ostree-types.h
@@ -0,0 +1,39 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
+ *
+ * Copyright (C) 2011 Colin Walters <walters verbum org>
+ *
+ * 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 License, 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: Colin Walters <walters verbum org>
+ */
+
+#ifndef _OSTREE_TYPES
+#define _OSTREE_TYPES
+
+#include <gio/gio.h>
+
+G_BEGIN_DECLS
+
+struct OstreeRepo;
+typedef struct OstreeRepo OstreeRepo;
+struct OstreeMutableTree;
+typedef struct OstreeMutableTree OstreeMutableTree;
+struct OstreeRepoFile;
+typedef struct OstreeRepoFile OstreeRepoFile;
+
+G_END_DECLS
+
+#endif



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]