X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=clients%2Futilities.h;h=a9f199d5e48115e13fb7cd817e02f81310615c0d;hb=d169e8c62f8ca4fe7d058d8e2254426105032b7e;hp=b35f03ef10a86e4553e6a58f4196830acb6e13fc;hpb=8fce86636639afaeac4ca0e869e8bcd833324a62;p=awesomized%2Flibmemcached diff --git a/clients/utilities.h b/clients/utilities.h index b35f03ef..a9f199d5 100644 --- a/clients/utilities.h +++ b/clients/utilities.h @@ -1,31 +1,62 @@ +/* LibMemcached + * Copyright (C) 2006-2009 Brian Aker + * All rights reserved. + * + * Use and distribution licensed under the BSD license. See + * the COPYING file in the parent directory for full text. + * + * Summary: + * + */ + +#pragma once + #include -#include -#include -#include "client_options.h" +#include +#include "clients/client_options.h" -#if TIME_WITH_SYS_TIME +#if defined(HAVE_SYS_TIME_H) # include +#endif + +#if defined(HAVE_TIME_H) # include +#endif + + +#ifdef __sun + /* For some odd reason the option struct on solaris defines the argument + * as char* and not const char* + */ +#define OPTIONSTRING char* #else -# if HAVE_SYS_TIME_H -# include -# else -# include -# endif +#define OPTIONSTRING const char* #endif typedef struct memcached_programs_help_st memcached_programs_help_st; -struct memcached_programs_help_st +struct memcached_programs_help_st { char *not_used_yet; }; +#ifdef __cplusplus +extern "C" { +#endif + char *strdup_cleanup(const char *str); void cleanup(void); long int timedif(struct timeval a, struct timeval b); -void version_command(char *command_name); -void help_command(char *command_name, char *description, +void version_command(const char *command_name) __attribute__ ((noreturn)); +void help_command(const char *command_name, const char *description, const struct option *long_options, - memcached_programs_help_st *options); + memcached_programs_help_st *options) __attribute__ ((noreturn)); void process_hash_option(memcached_st *memc, char *opt_hash); +bool initialize_sasl(memcached_st *memc, char *user, char *password); +void shutdown_sasl(void); +void initialize_sockets(void); +void close_stdio(void); + +#ifdef __cplusplus +} // extern "C" +#endif