Merge in conversion to C++.
[awesomized/libmemcached] / libmemcached / key.cc
1 #include "common.h"
2
3 memcached_return_t memcached_key_test(const char * const *keys,
4 const size_t *key_length,
5 size_t number_of_keys)
6 {
7 for (uint32_t x= 0; x < number_of_keys; x++)
8 {
9 memcached_return_t rc;
10 rc= memcached_validate_key_length(*(key_length + x), false);
11 if (rc != MEMCACHED_SUCCESS)
12 return rc;
13
14 for (size_t y= 0; y < *(key_length + x); y++)
15 {
16 if ((isgraph(keys[x][y])) == 0)
17 return MEMCACHED_BAD_KEY_PROVIDED;
18 }
19 }
20
21 return MEMCACHED_SUCCESS;
22 }
23