[vala-extra-vapis] Improvments for memcached.vapi binding.



commit 7828e70c96a58f6ac318b8a25aab33101fa4df96
Author: Guillaume Poirier-Morency <guillaumepoiriermorency gmail com>
Date:   Mon Jul 13 18:02:58 2015 -0400

    Improvments for memcached.vapi binding.
    
    Binds memcached_create as the default constructor and rename the old
    constructor for Context.from_configuration.
    
    Binds clone and pass the instance as second argument.
    
    Marks servers_parse deprecated as Context.from_configuration should be
    used instead.
    
    Provides an iterator to call fetch_result in a foreach loop.

 libmemcached.vapi |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/libmemcached.vapi b/libmemcached.vapi
index 0dcf406..42483d6 100644
--- a/libmemcached.vapi
+++ b/libmemcached.vapi
@@ -93,15 +93,13 @@ namespace Memcached {
     // memcached.h
     public void servers_reset ();
     [CCode (cname = "memcached_create")]
-    private static Memcached.Context _create (Memcached.Context? ptr = null);
+    public Context (Memcached.Context? ptr = null);
     [CCode (cname = "memcached")]
-    public Context ([CCode (array_length_type = "size_t")] uint8[]? str = null);
+    public Context.from_configuration ([CCode (array_length_type = "size_t")] uint8[]? str = null);
     public Memcached.ReturnCode reset ();
     public void reset_last_disconnected_server ();
-    [CCode (cname = "_vala_memcached_clone")]
-    public Memcached.Context clone () {
-      return Memcached.Context._create (this);
-    }
+    [CCode (instance_pos = 2)]
+    public Memcached.Context clone (Memcached.Context? destination = null);
     public void set_user_data<T> (T data);
     public T get_user_data<T> ();
     public Memcached.ReturnCode push (Memcached.Context source);
@@ -269,6 +267,14 @@ namespace Memcached {
 
     // version.h
     public Memcached.ReturnCode version ();
+
+    public unowned Memcached.Context iterator () {
+      return this;
+    }
+    public Memcached.Result? next_value () {
+      Memcached.ReturnCode error;
+      return this.fetch_result (null, out error);
+    }
   }
 
   // type/analysis.h
@@ -474,6 +480,7 @@ namespace Memcached {
   }
 
   // parse.h
+  [Deprecated (since = "0.39", replacement = "Context.from_configuration")]
   public Memcached.ServerList servers_parse (string server_strings);
 
   // server.h


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