Merge Andre
[awesomized/libmemcached] / clients / utilities.h
1 /* LibMemcached
2 * Copyright (C) 2006-2009 Brian Aker
3 * All rights reserved.
4 *
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
7 *
8 * Summary:
9 *
10 */
11
12 #include <getopt.h>
13 #include <libmemcached/memcached.h>
14 #include "client_options.h"
15
16 #if TIME_WITH_SYS_TIME
17 # include <sys/time.h>
18 # include <time.h>
19 #else
20 # if HAVE_SYS_TIME_H
21 # include <sys/time.h>
22 # else
23 # include <time.h>
24 # endif
25 #endif
26
27 #ifdef __sun
28 /* For some odd reason the option struct on solaris defines the argument
29 * as char* and not const char*
30 */
31 #define OPTIONSTRING char*
32 #else
33 #define OPTIONSTRING const char*
34 #endif
35
36 typedef struct memcached_programs_help_st memcached_programs_help_st;
37
38 struct memcached_programs_help_st
39 {
40 char *not_used_yet;
41 };
42
43 char *strdup_cleanup(const char *str);
44 void cleanup(void);
45 long int timedif(struct timeval a, struct timeval b);
46 void version_command(const char *command_name);
47 void help_command(const char *command_name, const char *description,
48 const struct option *long_options,
49 memcached_programs_help_st *options);
50 void process_hash_option(memcached_st *memc, char *opt_hash);
51 bool initialize_sasl(memcached_st *memc, char *user, char *password);
52 void shutdown_sasl(void);