[couchdb-glib] * couchdb-glib/couchdb-document.c:



commit a06fd0e0662fad855fac9904a8b47a70a56fddb5
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Wed Jun 10 23:52:37 2009 +0200

    * couchdb-glib/couchdb-document.c:
    	(couchdb_document_new): new function to create an empty, unbound
    	document.
---
 couchdb-glib/couchdb-document.c |   13 +++++++++++++
 couchdb-glib/couchdb-glib.h     |    1 +
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/couchdb-glib/couchdb-document.c b/couchdb-glib/couchdb-document.c
index d235284..28ad894 100644
--- a/couchdb-glib/couchdb-document.c
+++ b/couchdb-glib/couchdb-document.c
@@ -62,6 +62,19 @@ couchdb_document_init (CouchDBDocument *document)
 }
 
 CouchDBDocument *
+couchdb_document_new (CouchDB *couchdb)
+{
+	CouchDBDocument *document;
+
+	document = g_object_new (COUCHDB_TYPE_DOCUMENT, NULL);
+	document->couchdb = couchdb;
+	document->dbname = NULL;
+	document->root_node = NULL;
+
+	return document;
+}
+
+CouchDBDocument *
 couchdb_document_get (CouchDB *couchdb,
 		      const char *dbname,
 		      const char *docid,
diff --git a/couchdb-glib/couchdb-glib.h b/couchdb-glib/couchdb-glib.h
index 7983ba1..7efd133 100644
--- a/couchdb-glib/couchdb-glib.h
+++ b/couchdb-glib/couchdb-glib.h
@@ -84,6 +84,7 @@ typedef struct {
 
 GSList *couchdb_list_documents (CouchDB *couchdb, const char *dbname, GError **error);
 
+CouchDBDocument *couchdb_document_new (CouchDB *couchdb);
 CouchDBDocument *couchdb_document_get (CouchDB *couchdb,
 				       const char *dbname,
 				       const char *docid,



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