semver: 1.0 -> 1
[m6w6/libmemcached] / src / bin / memparse.cc
1 /*
2 +--------------------------------------------------------------------+
3 | libmemcached - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020 Michael Wallner <mike@php.net> |
13 +--------------------------------------------------------------------+
14 */
15
16 #include "mem_config.h"
17
18 #include <cstdio>
19 #include <cstring>
20 #include <iostream>
21
22 #include "libmemcached-1/memcached.h"
23
24 int main(int argc, char *argv[]) {
25 if (argc < 2) {
26 std::cerr << "No arguments provided." << std::endl;
27 return EXIT_FAILURE;
28 }
29
30 for (int x = 1; x < argc; x++) {
31 char buffer[BUFSIZ];
32 memcached_return_t rc;
33 rc = libmemcached_check_configuration(argv[x], strlen(argv[x]), buffer, sizeof(buffer));
34
35 if (rc != MEMCACHED_SUCCESS) {
36 std::cerr << "Failed to parse argument #" << x << " " << argv[x] << std::endl;
37 std::cerr << buffer << std::endl;
38 return EXIT_FAILURE;
39 }
40 }
41
42 return EXIT_SUCCESS;
43 }