[vala/wip/tintou/glib] glib-2.0: Allow GenericArray to have a foreign find function




commit 039b81c4d3ab350f3e4b98b72f73ed535c80b75c
Author: Corentin Noël <corentin elementary io>
Date:   Tue Nov 3 09:52:47 2020 +0100

    glib-2.0: Allow GenericArray to have a foreign find function
    
    There is a guarantee that the second parameter of the GEqualFunc will be the needle.

 vapi/glib-2.0.vapi | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/vapi/glib-2.0.vapi b/vapi/glib-2.0.vapi
index d024eb294..4c20dd268 100644
--- a/vapi/glib-2.0.vapi
+++ b/vapi/glib-2.0.vapi
@@ -5264,6 +5264,8 @@ namespace GLib {
 
        [CCode (has_target = false)]
        public delegate uint HashFunc<K> (K key);
+       [CCode (has_target = false, cname = "GEqualFunc")]
+       public delegate bool EqualFunc2<G, T> (G a, T b);
        [CCode (has_target = false)]
        public delegate bool EqualFunc<G> (G a, G b);
        public delegate void HFunc<K,V> (K key, V value);
@@ -5417,6 +5419,8 @@ namespace GLib {
                public bool find (G needle, out uint index = null);
                [Version (since = "2.54")]
                public bool find_with_equal_func (G needle, GLib.EqualFunc<G>? equal_func, out uint index = 
null);
+               [Version (since = "2.54")]
+               public bool find_with_equal_func2<T> (T needle, GLib.EqualFunc2<G, T>? equal_func, out uint 
index = null);
                public void foreach (GLib.Func<G> func);
                [CCode (cname = "g_ptr_array_index")]
                public unowned G get (uint index);


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