[tracker/miner-priority-queues: 6/22] libtracker-miner: Add tracker_priority_queue_get_length



commit 459bcf7c49369d0e5fde2aa9b49c5797ca82a1a4
Author: Carlos Garnacho <carlos lanedo com>
Date:   Thu Jun 30 18:07:55 2011 +0200

    libtracker-miner: Add tracker_priority_queue_get_length

 src/libtracker-miner/tracker-priority-queue.c |    8 ++++++++
 src/libtracker-miner/tracker-priority-queue.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-miner/tracker-priority-queue.c b/src/libtracker-miner/tracker-priority-queue.c
index 0fc9404..01e637e 100644
--- a/src/libtracker-miner/tracker-priority-queue.c
+++ b/src/libtracker-miner/tracker-priority-queue.c
@@ -241,6 +241,14 @@ tracker_priority_queue_is_empty (TrackerPriorityQueue *queue)
 	return g_queue_is_empty (&queue->queue);
 }
 
+guint
+tracker_priority_queue_get_length (TrackerPriorityQueue *queue)
+{
+	g_return_val_if_fail (queue != NULL, 0);
+
+	return g_queue_get_length (&queue->queue);
+}
+
 void
 tracker_priority_queue_add (TrackerPriorityQueue *queue,
                             gpointer              data,
diff --git a/src/libtracker-miner/tracker-priority-queue.h b/src/libtracker-miner/tracker-priority-queue.h
index 2c24e1c..da42c62 100644
--- a/src/libtracker-miner/tracker-priority-queue.h
+++ b/src/libtracker-miner/tracker-priority-queue.h
@@ -38,6 +38,8 @@ void                  tracker_priority_queue_unref (TrackerPriorityQueue *queue)
 
 gboolean tracker_priority_queue_is_empty           (TrackerPriorityQueue *queue);
 
+guint    tracker_priority_queue_get_length         (TrackerPriorityQueue *queue);
+
 void     tracker_priority_queue_add     (TrackerPriorityQueue *queue,
                                          gpointer              data,
                                          gint                  priority);



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