Files are generated with each run, no reason to save them.
[m6w6/libmemcached] / lib / memcached.c
index 3cbac0b274fb54c6b803eef10ab3043527e39643..0bab79580661fc79781e7286d54389e224a8e3b3 100644 (file)
@@ -1,9 +1,9 @@
 /*
   Memcached library
 */
-#include <memcached.h>
+#include "common.h"
 
-memcached_st *memcached_init(memcached_st *ptr)
+memcached_st *memcached_create(memcached_st *ptr)
 {
   if (!ptr)
   {
@@ -23,23 +23,13 @@ memcached_st *memcached_init(memcached_st *ptr)
   return ptr;
 }
 
-void memcached_deinit(memcached_st *ptr)
+void memcached_free(memcached_st *ptr)
 {
-  unsigned int x;
-  memcached_host_st *host_ptr;
-
   if (ptr->hosts)
   {
-    for (x= 0; x < ptr->number_of_hosts; x++)
-    {
-      if (ptr->hosts[x].fd > 0)
-        close(ptr->hosts[x].fd);
-
-      if (ptr->hosts[x].hostname)
-        free(ptr->hosts[x].hostname);
-    }
-
-    free(ptr->hosts);
+    memcached_quit(ptr);
+    memcached_server_list_free(ptr->hosts);
+    ptr->hosts= NULL;
   }
 
   if (ptr->is_allocated == MEMCACHED_ALLOCATED)