X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Futilities.c;h=f223ae6fd0d4ca6ede0fb67fb6f6e8cbc6248e84;hb=07e0de42263978e78c08a2663425f7e6f16f6c7e;hp=e21df20dca1782c554e54a240eb36c1573e27bd7;hpb=36e8b818f50d7b5f6daed3e7e22ebc181adf1954;p=awesomized%2Flibmemcached diff --git a/clients/utilities.c b/clients/utilities.c index e21df20d..f223ae6f 100644 --- a/clients/utilities.c +++ b/clients/utilities.c @@ -8,8 +8,8 @@ * Summary: * */ +#include "config.h" -#include "libmemcached/common.h" #include #include #include @@ -60,6 +60,8 @@ static const char *lookup_help(memcached_options option) case OPT_UDP: return("Use UDP protocol when communicating with server."); case OPT_USERNAME: return "Username to use for SASL authentication"; case OPT_PASSWD: return "Password to use for SASL authentication"; + case OPT_FILE: return "Path to file in which to save result"; + case OPT_STAT_ARGS: return "Argument for statistics"; default: WATCHPOINT_ASSERT(0); }; @@ -69,9 +71,10 @@ static const char *lookup_help(memcached_options option) void help_command(const char *command_name, const char *description, const struct option *long_options, - memcached_programs_help_st *options __attribute__((unused))) + memcached_programs_help_st *options) { unsigned int x; + (void)options; printf("%s v%u.%u\n\n", command_name, 1U, 0U); printf("\t%s\n\n", description); @@ -214,3 +217,16 @@ void shutdown_sasl(void) sasl_done(); #endif } + +void initialize_sockets(void) +{ + /* Define the function for all platforms to avoid #ifdefs in each program */ +#ifdef WIN32 + WSADATA wsaData; + if (WSAStartup(MAKEWORD(2,0), &wsaData) != 0) + { + fprintf(stderr, "Socket Initialization Error. Program aborted\n"); + exit(EXIT_FAILURE); + } +#endif +}