From: Date: Sun, 17 Feb 2008 15:56:31 +0000 (+0530) Subject: Minor cleanups (missing file added). X-Git-Tag: _20~14 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=816aa2e3dfe7d1a44edd66745bee33faa499e709;p=m6w6%2Flibmemcached Minor cleanups (missing file added). --- diff --git a/lib/common.h b/lib/common.h index 9e4cb5e1..b09d5433 100644 --- a/lib/common.h +++ b/lib/common.h @@ -21,7 +21,6 @@ #include #include #include -#include #if TIME_WITH_SYS_TIME # include diff --git a/lib/memcached_key.c b/lib/memcached_key.c new file mode 100644 index 00000000..ef1fe15f --- /dev/null +++ b/lib/memcached_key.c @@ -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; +} + diff --git a/lib/memcached_parse.c b/lib/memcached_parse.c index 52154215..366e77b5 100644 --- a/lib/memcached_parse.c +++ b/lib/memcached_parse.c @@ -6,7 +6,7 @@ */ #include -#include +#include "common.h" memcached_server_st *memcached_servers_parse(char *server_strings) {