projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
m4: merge TangentOrg/ddm4
[awesomized/libmemcached]
/
clients
/
memparse.cc
diff --git
a/clients/memparse.cc
b/clients/memparse.cc
index 5b6a6a89dda6b62df21352604e91fd36219426f5..fc2cb0c722cedc1ff671dc5474b660764a56eae4 100644
(file)
--- a/
clients/memparse.cc
+++ b/
clients/memparse.cc
@@
-2,7
+2,7
@@
*
* Libmemcached library
*
*
* Libmemcached library
*
- * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * Copyright (C) 2011
-2012
Data Differential, http://datadifferential.com/
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@
-35,11
+35,13
@@
*
*/
*
*/
-#include <config.h>
+#include <
mem_
config.h>
+#include <cstdio>
+#include <cstring>
#include <iostream>
#include <iostream>
-#include <libmemcached/memcached.h>
+#include <libmemcached
-1.0
/memcached.h>
int main(int argc, char *argv[])
{
int main(int argc, char *argv[])
{
@@
-52,18
+54,16
@@
int main(int argc, char *argv[])
for (int x= 1; x < argc; x++)
{
for (int x= 1; x < argc; x++)
{
+ char buffer[BUFSIZ];
memcached_return_t rc;
memcached_return_t rc;
- memcached_st *memc_ptr= memcached_create(NULL);
-
- rc= memcached_parse_configuration(memc_ptr, argv[x], strlen(argv[x]));
+ rc= libmemcached_check_configuration(argv[x], strlen(argv[x]), buffer, sizeof(buffer));
if (rc != MEMCACHED_SUCCESS)
{
if (rc != MEMCACHED_SUCCESS)
{
- std::cerr << "Failed to parse
options:
" << argv[x] << std::endl;
-
memcached_error_print(memc_ptr)
;
+ std::cerr << "Failed to parse
argument #" << x << "
" << argv[x] << std::endl;
+
std::cerr << buffer << std::endl
;
return EXIT_FAILURE;
}
return EXIT_FAILURE;
}
- memcached_free(memc_ptr);
}
return EXIT_SUCCESS;
}
return EXIT_SUCCESS;