[rhythmbox] rhythmdb: add rhythmdb_query_new_empty



commit 716550468e488d1a7bd98c065be42463f0a16c34
Author: Jonathan Matthew <jonathan d14n org>
Date:   Tue Apr 19 09:09:07 2011 +1000

    rhythmdb: add rhythmdb_query_new_empty
    
    Without this it's kind of tricky to create a query in python.

 rhythmdb/rhythmdb-query.c |   16 ++++++++++++++++
 rhythmdb/rhythmdb.h       |    1 +
 2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/rhythmdb/rhythmdb-query.c b/rhythmdb/rhythmdb-query.c
index 294bd41..63a66a1 100644
--- a/rhythmdb/rhythmdb-query.c
+++ b/rhythmdb/rhythmdb-query.c
@@ -58,6 +58,22 @@
 #define RB_PARSE_YEAR_LESS RB_PARSE_LESS
 
 /**
+ * rhythmdb_query_new_empty:
+ * @db: a #RhythmDB instance
+ *
+ * Creates an empty query.  Only really useful for callers
+ * using introspection.
+ *
+ * Return value: (transfer full): a new query, must be freed
+ * with rhythmdb_query_free()
+ */
+RhythmDBQuery *
+rhythmdb_query_new_empty (RhythmDB *db)
+{
+	return rhythmdb_query_parse (db, RHYTHMDB_QUERY_END);
+}
+
+/**
  * rhythmdb_query_copy:
  * @array: the query to copy.
  *
diff --git a/rhythmdb/rhythmdb.h b/rhythmdb/rhythmdb.h
index 4c68f3b..02ffdc4 100644
--- a/rhythmdb/rhythmdb.h
+++ b/rhythmdb/rhythmdb.h
@@ -412,6 +412,7 @@ void		rhythmdb_do_full_query_async_parsed	(RhythmDB *db,
 							 RhythmDBQueryResults *results,
 							 RhythmDBQuery *query);
 
+RhythmDBQuery * rhythmdb_query_new_empty		(RhythmDB *db);
 RhythmDBQuery *	rhythmdb_query_parse			(RhythmDB *db, ...);
 void		rhythmdb_query_append			(RhythmDB *db, RhythmDBQuery *query, ...);
 void		rhythmdb_query_append_params		(RhythmDB *db, RhythmDBQuery *query, RhythmDBQueryType type, RhythmDBPropType prop, const GValue *value);



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