[couchdb-glib] Added desktopcouch-glib library
- From: Rodrigo Moya <rodrigo src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [couchdb-glib] Added desktopcouch-glib library
- Date: Fri, 8 Jan 2010 15:47:58 +0000 (UTC)
commit 95272023b161f89bd527d1574bbd2bbc9d15daa1
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Fri Jan 8 14:12:19 2010 +0100
Added desktopcouch-glib library
desktopcouch-glib.pc.in | 11 +++
desktopcouch-glib/Makefile.am | 115 +++++++++++++++++++++++++++++++++
desktopcouch-glib/desktopcouch-glib.h | 35 ++++++++++
desktopcouch-glib/desktopcouch.c | 48 ++++++++++++++
desktopcouch-glib/desktopcouch.h | 49 ++++++++++++++
5 files changed, 258 insertions(+), 0 deletions(-)
---
diff --git a/desktopcouch-glib.pc.in b/desktopcouch-glib.pc.in
new file mode 100644
index 0000000..e895a6a
--- /dev/null
+++ b/desktopcouch-glib.pc.in
@@ -0,0 +1,11 @@
+prefix= prefix@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${exec_prefix}/include
+
+Name: CouchDB-GLib
+Description: GLib-based API for CouchDB databases
+Version: @VERSION@
+Libs: -L${libdir} -lcouchdb-glib-1.0
+Cflags: -I${includedir}/couchdb-glib-1.0
+Requires: gobject-2.0 json-glib-1.0 >= 0.7.4
diff --git a/desktopcouch-glib/Makefile.am b/desktopcouch-glib/Makefile.am
new file mode 100644
index 0000000..068caaf
--- /dev/null
+++ b/desktopcouch-glib/Makefile.am
@@ -0,0 +1,115 @@
+
+oauth_headers = oauth.h xmalloc.h
+oauth_sources = oauth.c xmalloc.c
+
+if HAVE_OAUTH
+OAUTH_FILES = $(oauth_headers) $(oauth_sources)
+OAUTH_LIBS =
+else
+OAUTH_FILES =
+OAUTH_LIBS =
+endif
+
+INCLUDES = \
+ $(COUCHDB_GLIB_CFLAGS)
+
+lib_LTLIBRARIES = libcouchdb-glib-1.0.la
+
+# Marshallers
+marshal_headers = couchdb-marshal.h
+marshal_sources = couchdb-marshal.c
+MARSHAL_FILES = $(marshal_headers) $(marshal_sources)
+
+couchdb-marshal.h: couchdb-marshal.list $(GLIB_GENMARSHAL)
+ $(GLIB_GENMARSHAL) $< --header --prefix=_couchdb_marshal > $@
+
+couchdb-marshal.c: couchdb-marshal.list $(GLIB_GENMARSHAL)
+ $(GLIB_GENMARSHAL) $< --body --prefix=_couchdb_marshal > $@
+
+libcouchdb_glib_1_0_la_headers = \
+ couchdb.h \
+ couchdb-database-info.h \
+ couchdb-document.h \
+ couchdb-document-contact.h \
+ couchdb-document-info.h \
+ couchdb-glib.h \
+ couchdb-struct-field.h \
+ couchdb-types.h \
+ dbwatch.h \
+ utils.h
+
+libcouchdb_glib_1_0_la_sources = \
+ couchdb.c \
+ couchdb-database-info.c \
+ couchdb-document.c \
+ couchdb-document-contact.c \
+ couchdb-document-info.c \
+ couchdb-struct-field.c \
+ dbwatch.c \
+ utils.c \
+ $(marshal_sources) \
+ $(oauth_sources)
+
+libcouchdb_glib_1_0_la_SOURCES = \
+ $(libcouchdb_glib_1_0_la_headers) \
+ $(libcouchdb_glib_1_0_la_sources) \
+ $(marshal_headers) \
+ $(oauth_headers)
+
+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)
+
+hdir = $(includedir)/couchdb-glib-1.0
+h_DATA = \
+ couchdb.h \
+ couchdb-glib.h \
+ couchdb-database-info.h \
+ couchdb-document-contact.h \
+ couchdb-document.h \
+ couchdb-document-info.h \
+ couchdb-struct-field.h \
+ couchdb-types.h
+
+EXTRA_DIST = $(h_DATA) couchdb-marshal.list $(MARSHAL_FILES) $(OAUTH_FILES)
+BUILT_SOURCES = $(MARSHAL_FILES)
+CLEANFILES = $(BUILT_SOURCES)
+
+if HAVE_INTROSPECTION
+
+BUILT_SOURCES += Couchdb-1.0.gir Couchdb-1.0.typelib
+
+girdir = $(datadir)/gir-1.0
+gir_DATA = Couchdb-1.0.gir
+
+typelibsdir = $(libdir)/girepository-1.0/
+typelibs_DATA = Couchdb-1.0.typelib
+
+Couchdb-1.0.gir: libcouchdb-glib-1.0.la
+ $(INTROSPECTION_SCANNER) -v \
+ --namespace Couchdb --nsversion=1.0 \
+ --add-include-path=$(srcdir) \
+ --add-include-path=. \
+ --include=GObject-2.0 \
+ --include=Json-1.0 \
+ --library=couchdb-glib-1.0 \
+ --pkg gobject-2.0 \
+ --pkg json-glib-1.0 \
+ --output $@ \
+ -I$(top_srcdir) \
+ $(h_DATA) \
+ $(libcouchdb_glib_1_0_la_headers) \
+ $(libcouchdb_glib_1_0_la_sources)
+
+Couchdb-1.0.typelib: Couchdb-1.0.gir
+ LD_LIBRARY_PATH=.libs$${LD_LIBRARY_PATH:+:$$LD_LIBRARY_PATH} \
+ $(INTROSPECTION_COMPILER) \
+ --includedir=$(srcdir) \
+ --includedir=. \
+ $(INTROSPECTION_COMPILER_OPTS) $< -o $(@F)
+
+endif
diff --git a/desktopcouch-glib/desktopcouch-glib.h b/desktopcouch-glib/desktopcouch-glib.h
new file mode 100644
index 0000000..cebc9b4
--- /dev/null
+++ b/desktopcouch-glib/desktopcouch-glib.h
@@ -0,0 +1,35 @@
+/* -*- 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_GLIB_H__
+#define __COUCHDB_GLIB_H__
+
+#include <couchdb-types.h>
+#include <couchdb.h>
+#include <couchdb-database-info.h>
+#include <couchdb-document.h>
+#include <couchdb-document-contact.h>
+#include <couchdb-document-info.h>
+#include <couchdb-struct-field.h>
+
+#endif /* __COUCHDB_GLIB_H__ */
diff --git a/desktopcouch-glib/desktopcouch.c b/desktopcouch-glib/desktopcouch.c
new file mode 100644
index 0000000..97a73e1
--- /dev/null
+++ b/desktopcouch-glib/desktopcouch.c
@@ -0,0 +1,48 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2010 Canonical Services Ltd (www.canonical.com)
+ *
+ * Authors: Rodrigo Moya <rodrigo moya canonical 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 "desktopcouchdb.h"
+
+G_DEFINE_TYPE(Desktopcouchdb, desktopcouchdb, COUCHDB_TYPE)
+
+static void
+desktopcouchdb_finalize (GObject *object)
+{
+ G_OBJECT_CLASS (desktopcouchdb_parent_class)->finalize (object);
+}
+
+static void
+desktopcouchdb_class_init (DesktopcouchdbClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = desktopcouchdb_finalize;
+}
+
+static void
+desktopcouchdb_init (Desktopcouchdb *dc)
+{
+}
+
+/**
+ * desktopcouchdb_new:
+ *
+ * Create a #Couchdb instance prepared to connect to desktopcouch
diff --git a/desktopcouch-glib/desktopcouch.h b/desktopcouch-glib/desktopcouch.h
new file mode 100644
index 0000000..e93af72
--- /dev/null
+++ b/desktopcouch-glib/desktopcouch.h
@@ -0,0 +1,49 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2010 Canonical Services Ltd (www.canonical.com)
+ *
+ * Authors: Rodrigo Moya <rodrigo moya canonical 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 __DESKTOPCOUCHDB_H__
+#define __DESKTOPCOUCHDB_H__
+
+#include <couchdb-glib.h>
+
+G_BEGIN_DECLS
+
+#define DESKTOPCOUCHDB_TYPE (desktopcouchdb_get_type ())
+#define DESKTOPCOUCHDB(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), DESKTOPCOUCHDB_TYPE, Desktopcouchdb))
+#define DESKTOPCOUCHDB_IS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), DESKTOPCOUCHDB_TYPE))
+#define DESKTOPCOUCHDB_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), DESKTOPCOUCHDB_TYPE, DesktopcouchdbClass))
+#define DESKTOPCOUCHDB_IS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), DESKTOPCOUCHDB_TYPE))
+#define DESKTOPCOUCHDB_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), DESKTOPCOUCHDB_TYPE, DesktopouchdbClass))
+
+typedef struct {
+ Couchdb parent;
+} Desktopcouchdb;
+
+typedef struct {
+ CouchdbClass parent_class;
+} DesktopcouchdbClass;
+
+GType desktopcouchdb_get_type (void);
+Desktopcouchdb *desktopcouchdb_new (void);
+
+G_END_DECLS
+
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]