* Summary:
*
*/
+#include "config.h"
-#include "libmemcached/common.h"
#include <stdio.h>
#include <ctype.h>
#include <string.h>
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);
};
}
}
+#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
static char *username;
static char *passwd;
-#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
static int get_username(void *context, int id, const char **result,
unsigned int *len)
{
#else
(void)memc;
(void)user;
- (void)passwd;
+ (void)password;
#endif
return true;
void shutdown_sasl(void)
{
-#if LIBMEMCACHED_WITH_SASL_SUPPORT
+#ifdef LIBMEMCACHED_WITH_SASL_SUPPORT
if (username != NULL || passwd != NULL)
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
+}