[tracker] libtracker-db: Add tracker_db_statement_bind_null



commit b06f4d7d15072fbcb5e83130f7a134d0244862a7
Author: Jürg Billeter <j bitron ch>
Date:   Mon Oct 26 11:06:23 2009 +0100

    libtracker-db: Add tracker_db_statement_bind_null

 src/libtracker-db/tracker-db-interface-sqlite.c |   14 ++++++++++++++
 src/libtracker-db/tracker-db-interface.c        |    9 +++++++++
 src/libtracker-db/tracker-db-interface.h        |   10 +++++++---
 3 files changed, 30 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-interface-sqlite.c b/src/libtracker-db/tracker-db-interface-sqlite.c
index e3645c3..b240dee 100644
--- a/src/libtracker-db/tracker-db-interface-sqlite.c
+++ b/src/libtracker-db/tracker-db-interface-sqlite.c
@@ -1015,6 +1015,19 @@ tracker_db_statement_sqlite_bind_int64 (TrackerDBStatement	 *stmt,
 }
 
 static void
+tracker_db_statement_sqlite_bind_null (TrackerDBStatement	 *stmt,
+				       int			  index)
+{
+	TrackerDBStatementSqlitePrivate *priv;
+
+	priv = TRACKER_DB_STATEMENT_SQLITE_GET_PRIVATE (stmt);
+
+	g_assert (!priv->stmt_is_sunk);
+
+	sqlite3_bind_null (priv->stmt, index + 1);
+}
+
+static void
 tracker_db_statement_sqlite_bind_text (TrackerDBStatement	 *stmt,
 				       int			  index,
 				       const gchar		 *value)
@@ -1177,6 +1190,7 @@ tracker_db_statement_sqlite_iface_init (TrackerDBStatementIface *iface)
 	iface->bind_double = tracker_db_statement_sqlite_bind_double;
 	iface->bind_int = tracker_db_statement_sqlite_bind_int;
 	iface->bind_int64 = tracker_db_statement_sqlite_bind_int64;
+	iface->bind_null = tracker_db_statement_sqlite_bind_null;
 	iface->bind_text = tracker_db_statement_sqlite_bind_text;
 	iface->execute = tracker_db_statement_sqlite_execute;
 	iface->start_cursor = tracker_db_statement_sqlite_start_cursor;
diff --git a/src/libtracker-db/tracker-db-interface.c b/src/libtracker-db/tracker-db-interface.c
index 7f259c6..452de4d 100644
--- a/src/libtracker-db/tracker-db-interface.c
+++ b/src/libtracker-db/tracker-db-interface.c
@@ -439,6 +439,15 @@ tracker_db_statement_bind_int64 (TrackerDBStatement	*stmt,
 }
 
 void
+tracker_db_statement_bind_null (TrackerDBStatement	*stmt,
+				int			 idx)
+{
+	g_return_if_fail (TRACKER_IS_DB_STATEMENT (stmt));
+
+	TRACKER_DB_STATEMENT_GET_IFACE (stmt)->bind_null (stmt, idx);
+}
+
+void
 tracker_db_statement_bind_text (TrackerDBStatement	*stmt,
 				int			 idx,
 				const gchar		*value)
diff --git a/src/libtracker-db/tracker-db-interface.h b/src/libtracker-db/tracker-db-interface.h
index ec16ba6..0d0e73f 100644
--- a/src/libtracker-db/tracker-db-interface.h
+++ b/src/libtracker-db/tracker-db-interface.h
@@ -90,14 +90,16 @@ struct TrackerDBStatementIface {
 	void		     (* bind_int)	(TrackerDBStatement  *stmt,
 						 int		      index,
 						 int		      value);
+	void		     (* bind_int64)	(TrackerDBStatement  *stmt,
+						 int		      index,
+						 gint64		      value);
+	void		     (* bind_null)	(TrackerDBStatement  *stmt,
+						 int		      index);
 	void		     (* bind_text)	(TrackerDBStatement  *stmt,
 						 int		      index,
 						 const gchar	     *value);
 	TrackerDBResultSet * (* execute)	(TrackerDBStatement  *stmt,
 						 GError		    **error);
-	void		     (* bind_int64)	(TrackerDBStatement  *stmt,
-						 int		      index,
-						 gint64		      value);
 	TrackerDBCursor    * (* start_cursor)	(TrackerDBStatement  *stmt,
 						 GError		    **error);
 };
@@ -161,6 +163,8 @@ void                tracker_db_statement_bind_int          (TrackerDBStatement
 void                tracker_db_statement_bind_int64        (TrackerDBStatement  *stmt,
 							    int                  index,
 							    gint64               value);
+void                tracker_db_statement_bind_null         (TrackerDBStatement  *stmt,
+							    int                  index);
 void                tracker_db_statement_bind_text         (TrackerDBStatement  *stmt,
 							    int                  index,
 							    const gchar         *value);



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