Minor cleanups (missing file added).
author <brian@gir-2.local> <>
Sun, 17 Feb 2008 15:56:31 +0000 (21:26 +0530)
committer <brian@gir-2.local> <>
Sun, 17 Feb 2008 15:56:31 +0000 (21:26 +0530)
lib/common.h
lib/memcached_key.c [new file with mode: 0644]
lib/memcached_parse.c

index 9e4cb5e17fb4346b98134f7ca8fa6354fdf8e5f0..b09d54336d11152db4b8efda479a7e683e3d35c1 100644 (file)
@@ -21,7 +21,6 @@
 #include <fcntl.h>
 #include <sys/un.h>
 #include <netinet/tcp.h>
-#include <libmemcached_config.h>
 
 #if TIME_WITH_SYS_TIME
 # include <sys/time.h>
diff --git a/lib/memcached_key.c b/lib/memcached_key.c
new file mode 100644 (file)
index 0000000..ef1fe15
--- /dev/null
@@ -0,0 +1,20 @@
+#include "common.h"
+
+memcached_return memcachd_key_test(char **keys, size_t *key_length, 
+                                   unsigned int number_of_keys)
+{
+  int x;
+
+  for (x= 0; x < number_of_keys; x++)
+  {
+    int y;
+    for (y= 0; y < key_length[x]; y++)
+    {
+      if ((isgraph(keys[x][y])) == 0)
+        return MEMCACHED_BAD_KEY_PROVIDED;
+    }
+  }
+
+  return MEMCACHED_SUCCESS;
+}
+
index 521542153725af9da5ca6df18fca3dffab57fbf6..366e77b55e6667b506baf4ff6bab6f72e9155e44 100644 (file)
@@ -6,7 +6,7 @@
 */
 
 #include <memcached.h>
-#include <common.h>
+#include "common.h"
 
 memcached_server_st *memcached_servers_parse(char *server_strings)
 {