[vala] glib-2.0: add search functions for (S)List and Queue



commit a4b869a6c5dd7763748acdca837149e924d02385
Author: Evan Nemerson <evan coeus-group com>
Date:   Tue Jan 28 21:22:01 2014 -0800

    glib-2.0: add search functions for (S)List and Queue
    
    Fixes bug 540415.

 vapi/glib-2.0.vapi |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index 434078b..e2ab16b 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -3906,6 +3906,9 @@ namespace GLib {
 
                public unowned List<G> find (G data);
                public unowned List<G> find_custom (G data, CompareFunc<G> func);
+               [CCode (cname = "g_list_find_custom", simple_generics = true)]
+               public unowned List<G> search<T> (T data, SearchFunc<T,G> func);
+
                public int position (List<G> llink);
                public int index (G data);
 
@@ -3960,6 +3963,9 @@ namespace GLib {
 
                public unowned SList<G> find (G data);
                public unowned SList<G> find_custom (G data, CompareFunc<G> func);
+               [CCode (cname = "g_slist_find_custom", simple_generics = true)]
+               public unowned SList<G> search<T> (T data, SearchFunc<T,G> func);
+
                public int position (SList<G> llink);
                public int index (G data);
 
@@ -3975,6 +3981,9 @@ namespace GLib {
        [CCode (cname = "g_strcmp0")]
        public static GLib.CompareFunc<string> strcmp;
 
+       [CCode (has_target = false)]
+       public delegate int SearchFunc<G,T> (G a, T b);
+
        /* Double-ended Queues */
 
        [Compact]
@@ -3993,6 +4002,8 @@ namespace GLib {
                public Queue copy ();
                public unowned List<G> find (G data);
                public unowned List<G> find_custom (G data, CompareFunc<G> func);
+               [CCode (cname = "g_queue_find_custom", simple_generics = true)]
+               public unowned List<G> search<T> (T data, SearchFunc<T,G> func);
                public void sort (CompareDataFunc<G> compare_func);
                public void push_head (owned G data);
                public void push_tail (owned G data);


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