[couchdb-glib: 6/21] The code is *almost* compiling again now...



commit ecc88fef0d15bc6540df256a3c9cf7734cb8a988
Author: Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com>
Date:   Sun Oct 4 14:08:07 2009 +0200

    The code is *almost* compiling again now...

 couchdb-glib/Makefile.am                |   18 ++++++++---
 couchdb-glib/couchdb-database-info.c    |   25 ++++++++++++++++
 couchdb-glib/couchdb-database-info.h    |   10 ++++++-
 couchdb-glib/couchdb-document-contact.h |   11 ++++++-
 couchdb-glib/couchdb-document-info.c    |   23 ++++++++++++++
 couchdb-glib/couchdb-document-info.h    |   49 ++++++++++++++++++++++++------
 couchdb-glib/couchdb-document.c         |    2 +-
 couchdb-glib/couchdb-document.h         |   16 +++++-----
 couchdb-glib/couchdb-struct-field.c     |   26 ++++++++++++++++
 couchdb-glib/couchdb-struct-field.h     |    9 ++++--
 couchdb-glib/couchdb.c                  |    7 ++--
 couchdb-glib/couchdb.h                  |    6 ++-
 couchdb-glib/dbwatch.h                  |    2 +-
 couchdb-glib/utils.h                    |    1 +
 14 files changed, 169 insertions(+), 36 deletions(-)
---
diff --git a/couchdb-glib/Makefile.am b/couchdb-glib/Makefile.am
index 0105777..e5ed6fa 100644
--- a/couchdb-glib/Makefile.am
+++ b/couchdb-glib/Makefile.am
@@ -22,22 +22,30 @@ couchdb-marshal.h: couchdb-marshal.list $(GLIB_GENMARSHAL)
 couchdb-marshal.c: couchdb-marshal.list $(GLIB_GENMARSHAL)
 	$(GLIB_GENMARSHAL) $< --body --prefix=_couchdb_marshal > $@
 
-libcouchdb_glib_1_0_la_SOURCES =	\
-	$(MARSHAL_GENERATED)		\
+libcouchdb_glib_1_0_la_SOURCES =	\	
 	couchdb.c			\
+	couchdb.h			\
+	couchdb-database-info.c		\
+	couchdb-database-info.h		\
 	couchdb-document.c		\
 	couchdb-document.h		\
 	couchdb-document-contact.c	\
-	couchdb-types.c			\
+	couchdb-document-contact.h	\
+	couchdb-document-info.c		\
+	couchdb-document-info.h		\
+	couchdb-glib.h			\
 	dbwatch.c			\
 	dbwatch.h			\
-	$(OAUTH_SOURCES)		\
 	utils.c				\
-	utils.h
+	utils.h				\
+	$(MARSHAL_GENERATED)		\
+	$(OAUTH_SOURCES)			
+	
 libcouchdb_glib_1_0_la_LIBADD =		\
 	$(COUCHDB_GLIB_LIBS)		\
 	$(OAUTH_LIBS)			\
 	-luuid
+
 libcouchdb_glib_1_0_la_LDFLAGS =	\
 	-version-info $(LIBCOUCHDBGLIB_CURRENT):$(LIBCOUCHDBGLIB_REVISION):$(LIBCOUCHDBGLIB_AGE)
 
diff --git a/couchdb-glib/couchdb-database-info.c b/couchdb-glib/couchdb-database-info.c
index f9c4be0..0b87952 100644
--- a/couchdb-glib/couchdb-database-info.c
+++ b/couchdb-glib/couchdb-database-info.c
@@ -1,3 +1,28 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2009 Canonical Services Ltd (www.canonical.com)
+ *               2009 Mikkel Kamstrup Erlandsen
+ *
+ * Authors: Rodrigo Moya <rodrigo moya canonical com>
+ *          Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program 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
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "couchdb-database-info.h"
+
 struct _CouchDBDatabaseInfo {
 	gint ref_count;
 
diff --git a/couchdb-glib/couchdb-database-info.h b/couchdb-glib/couchdb-database-info.h
index 6f6797c..2d955f6 100644
--- a/couchdb-glib/couchdb-database-info.h
+++ b/couchdb-glib/couchdb-database-info.h
@@ -21,10 +21,15 @@
  * Boston, MA 02110-1301, USA.
  */
  
+#ifndef __COUCHDB_DATABASE_INFO_H__
+#define __COUCHDB_DATABASE_INFO_H__
+ 
+#include <glib.h>
 #include <glib-object.h>
 
-#define COUCHDB_TYPE_DATABASE_INFO (couchdb_database_info_get_type ())
+G_BEGIN_DECLS
 
+#define COUCHDB_TYPE_DATABASE_INFO (couchdb_database_info_get_type ())
 
 /*
  * CouchDBDatabaseInfo
@@ -49,3 +54,6 @@ CouchDBDatabaseInfo*	couchdb_database_info_new (const char *dbname,
 						gboolean compact_running,
 						gint disk_size);
 
+G_END_DECLS
+
+#endif /* __COUCHDB_DATABASE_INFO_H__ */
diff --git a/couchdb-glib/couchdb-document-contact.h b/couchdb-glib/couchdb-document-contact.h
index a2e6c50..602f69b 100644
--- a/couchdb-glib/couchdb-document-contact.h
+++ b/couchdb-glib/couchdb-document-contact.h
@@ -22,7 +22,11 @@
 #ifndef __COUCHDB_DOCUMENT_CONTACT_H__
 #define __COUCHDB_DOCUMENT_CONTACT_H__
 
-#include <couchdb-glib.h>
+#include <glib.h>
+#include "couchdb-document.h"
+#include "couchdb-struct-field.h"
+
+G_BEGIN_DECLS
 
 #define COUCHDB_RECORD_TYPE_CONTACT "http://www.freedesktop.org/wiki/Specifications/desktopcouch/contact";
 
@@ -191,4 +195,7 @@ void                couchdb_document_contact_url_set_address (CouchDBStructField
 
 const char         *couchdb_document_contact_url_get_description (CouchDBStructField *sf);
 void                couchdb_document_contact_url_set_description (CouchDBStructField *sf, const char *description);
-#endif
+
+G_END_DECLS
+
+#endif /* __COUCHDB_DOCUMENT_CONTACT_H__ */
diff --git a/couchdb-glib/couchdb-document-info.c b/couchdb-glib/couchdb-document-info.c
index 121c72c..7568dd2 100644
--- a/couchdb-glib/couchdb-document-info.c
+++ b/couchdb-glib/couchdb-document-info.c
@@ -1,3 +1,26 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2009 Canonical Services Ltd (www.canonical.com)
+ *               2009 Mikkel Kamstrup Erlandsen
+ *
+ * Authors: Rodrigo Moya <rodrigo moya canonical com>
+ *          Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program 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
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
 struct _CouchDBDocumentInfo {
 	gint ref_count;
 
diff --git a/couchdb-glib/couchdb-document-info.h b/couchdb-glib/couchdb-document-info.h
index 42e48a3..fc9b2b4 100644
--- a/couchdb-glib/couchdb-document-info.h
+++ b/couchdb-glib/couchdb-document-info.h
@@ -1,19 +1,48 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2009 Canonical Services Ltd (www.canonical.com)
+ *               2009 Mikkel Kamstrup Erlandsen
+ *
+ * Authors: Rodrigo Moya <rodrigo moya canonical com>
+ *          Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program 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
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __COUCHDB_DOCUMENT_INFO_H__
+#define __COUCHDB_DOCUMENT_INFO_H__
+
+#include <glib.h>
+#include <glib-object.h>
+#include "couchdb-database-info.h"
+
+G_BEGIN_DECLS
+
 #define COUCHDB_TYPE_DOCUMENT_INFO (couchdb_document_info_get_type ())
 
 
-typedef struct _CouchDBDatabaseInfo CouchDBDatabaseInfo;
+typedef struct _CouchDBDocumentInfo CouchDBDocumentInfo;
 
-GType                couchdb_database_info_get_type (void);
+GType                couchdb_document_info_get_type (void);
 CouchDBDocumentInfo *couchdb_document_info_new (const char *docid, const char *revision);
-CouchDBDatabaseInfo *couchdb_database_info_ref (CouchDBDatabaseInfo *dbinfo);
-void                 couchdb_database_info_unref (CouchDBDatabaseInfo *dbinfo);
+CouchDBDatabaseInfo *couchdb_document_info_ref (CouchDBDatabaseInfo *dbinfo);
+void                 couchdb_document_info_unref (CouchDBDatabaseInfo *dbinfo);
 
-const char          *couchdb_database_info_get_dbname (CouchDBDatabaseInfo *dbinfo);
 const char          *couchdb_document_info_get_docid (CouchDBDocumentInfo *doc_info);
 const char          *couchdb_document_info_get_revision (CouchDBDocumentInfo *doc_info);
-gint                 couchdb_database_info_get_documents_count (CouchDBDatabaseInfo *dbinfo);
-gint                 couchdb_database_info_get_deleted_documents_count (CouchDBDatabaseInfo *dbinfo);
-gint                 couchdb_database_info_get_update_sequence (CouchDBDatabaseInfo *dbinfo);
-gboolean             couchdb_database_info_is_compact_running (CouchDBDatabaseInfo *dbinfo);
-gint                 couchdb_database_info_get_disk_size (CouchDBDatabaseInfo *dbinfo);
 
+G_END_DECLS
+
+#endif /* __COUCHDB_DOCUMENT_INFO_H__ */
diff --git a/couchdb-glib/couchdb-document.c b/couchdb-glib/couchdb-document.c
index cbaee93..a5a5cbe 100644
--- a/couchdb-glib/couchdb-document.c
+++ b/couchdb-glib/couchdb-document.c
@@ -23,7 +23,7 @@
 #include <libsoup/soup-session-async.h>
 #include <libsoup/soup-gnome.h>
 #include <json-glib/json-glib.h>
-#include "couchdb-glib.h"
+#include "couchdb-document.h"
 #include "utils.h"
 
 G_DEFINE_TYPE(CouchDBDocument, couchdb_document, G_TYPE_OBJECT);
diff --git a/couchdb-glib/couchdb-document.h b/couchdb-glib/couchdb-document.h
index 7a15064..8a807f2 100644
--- a/couchdb-glib/couchdb-document.h
+++ b/couchdb-glib/couchdb-document.h
@@ -21,13 +21,13 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef __COUCHDB_GLIB_DOCUMENT_H__
-#define __COUCHDB_GLIB_DOCUMENT_H__
+#ifndef __COUCHDB_DOCUMENT_H__
+#define __COUCHDB_DOCUMENT_H__
 
 #include <glib.h>
 #include <glib-object.h>
 #include "couchdb.h"
-#include "couchdb-types.h"
+#include "couchdb-struct-field.h"
 
 G_BEGIN_DECLS
 
@@ -39,12 +39,12 @@ G_BEGIN_DECLS
 #define COUCHDB_IS_DOCUMENT_CLASS(klass)     (G_TYPE_CHECK_CLASS_TYPE ((klass), COUCHDB_TYPE_DOCUMENT))
 #define COUCHDB_DOCUMENT_GET_CLASS(obj)      (G_TYPE_INSTANCE_GET_CLASS ((obj), COUCHDB_TYPE_DOCUMENT, CouchDBDocumentClass))
 
-typedef struct _CouchDBDocument CouchDBDocument
-typedef struct _CouchDBDocumentClass CouchDBDocumentClass
+typedef struct _CouchDBDocument CouchDBDocument;
+typedef struct _CouchDBDocumentClass CouchDBDocumentClass;
 
-typedef struct {
+struct {
 	GObjectClass parent_class;
-} CouchDBDocumentClass;
+} _CouchDBDocumentClass;
 
 
 GType            couchdb_document_get_type 		(void);
@@ -130,4 +130,4 @@ void             couchdb_document_set_application_annotations
       
 char*		couchdb_document_to_string		(CouchDBDocument *document);
 
-#endif /* __COUCHDB_GLIB_DOCUMENT_H__ */
+#endif /* __COUCHDB_DOCUMENT_H__ */
diff --git a/couchdb-glib/couchdb-struct-field.c b/couchdb-glib/couchdb-struct-field.c
index 2418129..15394d4 100644
--- a/couchdb-glib/couchdb-struct-field.c
+++ b/couchdb-glib/couchdb-struct-field.c
@@ -1,3 +1,29 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2009 Canonical Services Ltd (www.canonical.com)
+ *               2009 Mikkel Kamstrup Erlandsen
+ *
+ * Authors: Rodrigo Moya <rodrigo moya canonical com>
+ *          Mikkel Kamstrup Erlandsen <mikkel kamstrup gmail com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program 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
+ * 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., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include <json-glib/json-glib.h>
+#include "couchdb-struct-field.h"
+
 struct _CouchDBStructField {
 	gint ref_count;
 	JsonObject *json_object;
diff --git a/couchdb-glib/couchdb-struct-field.h b/couchdb-glib/couchdb-struct-field.h
index 70caea7..776e0d3 100644
--- a/couchdb-glib/couchdb-struct-field.h
+++ b/couchdb-glib/couchdb-struct-field.h
@@ -21,13 +21,13 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef __COUCHDB_GLIB_DOCUMENT_H__
-#define __COUCHDB_GLIB_DOCUMENT_H__
+#ifndef __COUCHDB_STRUCT_FIELD_H__
+#define __COUCHDB_STRUCT_FIELD_H__
 
 #include <glib.h>
 #include <glib-object.h>
 #include "couchdb.h"
-#include "couchdb-types.h"
+#include "couchdb-struct-field.h"
 
 G_BEGIN_DECLS
 
@@ -62,3 +62,6 @@ char               *couchdb_struct_field_to_string (CouchDBStructField *sf);
 
 CouchDBStructField *couchdb_struct_field_new_from_json_object (JsonObject *json_object);
 
+G_END_DECLS
+
+#endif /* __COUCHDB_STRUCT_FIELD__ */
diff --git a/couchdb-glib/couchdb.c b/couchdb-glib/couchdb.c
index cc59c4d..018591b 100644
--- a/couchdb-glib/couchdb.c
+++ b/couchdb-glib/couchdb.c
@@ -22,13 +22,12 @@
 #include <libsoup/soup-logger.h>
 #include <libsoup/soup-gnome.h>
 #include <json-glib/json-glib.h>
-#include "couchdb-glib.h"
+#include "couchdb.h"
+#include "couchdb-document-info.h"
 #include "couchdb-marshal.h"
 #include "dbwatch.h"
 #include "utils.h"
 
-G_DEFINE_TYPE(CouchDB, couchdb, G_TYPE_OBJECT)
-
 struct _CouchDB {
 	GObject parent;
 
@@ -49,6 +48,8 @@ struct _CouchDB {
 	#endif
 };
 
+G_DEFINE_TYPE(CouchDB, couchdb, G_TYPE_OBJECT)
+
 enum {
 	DATABASE_CREATED,
 	DATABASE_DELETED,
diff --git a/couchdb-glib/couchdb.h b/couchdb-glib/couchdb.h
index ebc3f0b..8f95898 100644
--- a/couchdb-glib/couchdb.h
+++ b/couchdb-glib/couchdb.h
@@ -24,8 +24,10 @@
 #ifndef __COUCHDB_H__
 #define __COUCHDB_H__
 
-#include <couchdb-types.h>
-#include <couchdb-document.h>
+#include <glib.h>
+#include <glib-object.h>
+#include "couchdb-document.h"
+#include "couchdb-database-info.h"
 
 G_BEGIN_DECLS
 
diff --git a/couchdb-glib/dbwatch.h b/couchdb-glib/dbwatch.h
index 9e9771e..7c1e056 100644
--- a/couchdb-glib/dbwatch.h
+++ b/couchdb-glib/dbwatch.h
@@ -34,4 +34,4 @@ typedef struct {
 DBWatch *dbwatch_new (CouchDB *couchdb, const gchar *dbname, gint update_seq);
 void     dbwatch_free (DBWatch *watch);
 
-#endif
+#endif /* __DBWATCH_H__ */
diff --git a/couchdb-glib/utils.h b/couchdb-glib/utils.h
index 82d7d27..2b8f8f1 100644
--- a/couchdb-glib/utils.h
+++ b/couchdb-glib/utils.h
@@ -23,6 +23,7 @@
 #define __UTILS_H__
 
 #include <glib.h>
+#include <json-glib/json-glib.h>
 #include "config.h"
 #include "couchdb.h"
 



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