Remove requirements for rpm that were unused.
[awesomized/libmemcached] / libmemcached / instance.h
index 1c81da4447f2c7a34c1220eb44a39b1323c8b5ec..e564afaaa3871cf0d9b44c676380c1ef6c354bee 100644 (file)
 #pragma once
 
 #ifndef WIN32
-#include <netdb.h>
+# ifdef HAVE_NETDB_H
+#  include <netdb.h>
+# endif
 #endif
 
 #ifdef NI_MAXHOST
-#define MEMCACHED_NI_MAXHOST NI_MAXHOST
+# define MEMCACHED_NI_MAXHOST NI_MAXHOST
 #else
-#define MEMCACHED_NI_MAXHOST 1025
+# define MEMCACHED_NI_MAXHOST 1025
 #endif
 
 #ifdef NI_MAXSERV
-#define MEMCACHED_NI_MAXSERV NI_MAXSERV
+# define MEMCACHED_NI_MAXSERV NI_MAXSERV
 #else
-#define MEMCACHED_NI_MAXSERV 32
+# define MEMCACHED_NI_MAXSERV 32
 #endif
 
 #ifdef __cplusplus
@@ -59,6 +61,7 @@
 namespace org {
 namespace libmemcached {
 
+// @todo Complete class transformation
 struct Instance {
   in_port_t port() const
   {
@@ -70,20 +73,32 @@ struct Instance {
     port_= arg;
   }
 
-  inline void mark_server_as_clean()
+  void mark_server_as_clean()
   {
     server_failure_counter= 0;
     next_retry= 0;
   }
 
+  void disable()
+  {
+  }
+
+  void enable()
+  {
+  }
+
+  uint32_t response_count() const
+  {
+    return cursor_active_;
+  }
+
   struct {
     bool is_allocated:1;
     bool is_initialized:1;
     bool is_shutting_down:1;
     bool is_dead:1;
   } options;
-  uint32_t number_of_hosts;
-  uint32_t cursor_active;
+  uint32_t cursor_active_;
   in_port_t port_;
   memcached_socket_t fd;
   uint32_t io_bytes_sent; /* # bytes sent since last read */