]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
glib-2.0: add HashTable.take and length
authorEvan Nemerson <evan@nemerson.com>
Wed, 11 Jun 2014 05:01:56 +0000 (22:01 -0700)
committerEvan Nemerson <evan@nemerson.com>
Thu, 12 Jun 2014 04:24:52 +0000 (21:24 -0700)
vapi/glib-2.0.vapi

index 29801e0f47ff167f4c14b3bda356e35adfbf89f7..0e8ec877aa1527354f2a5a8741445210d7392720 100644 (file)
@@ -4164,6 +4164,18 @@ namespace GLib {
                public uint size ();
                public bool steal (K key);
                public void steal_all ();
+               [CCode (cname = "_vala_g_hash_table_take")]
+               public V? take (K key, out bool exists = null) {
+                       GLib.HashTable<K,V>? ht = null;
+                       void** htp = &ht;
+                       *htp = this.lookup (key);
+                       exists = this.steal (key);
+                       return ht;
+               }
+               public uint length {
+                       [CCode (cname = "g_hash_table_get_size")]
+                       get;
+               }
        }
 
        public struct HashTableIter<K,V> {