0bac61a75aac155900181e821bb2339670e7139a
[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 #pragma once
13
14 #include <getopt.h>
15 #include <libmemcached/memcached.h>
16 #include "libmemcached/watchpoint.h"
17 #include "client_options.h"
18
19 #if TIME_WITH_SYS_TIME
20 # include <sys/time.h>
21 # include <time.h>
22 #else
23 # if HAVE_SYS_TIME_H
24 # include <sys/time.h>
25 # else
26 # include <time.h>
27 # endif
28 #endif
29
30 #ifdef __sun
31 /* For some odd reason the option struct on solaris defines the argument
32 * as char* and not const char*
33 */
34 #define OPTIONSTRING char*
35 #else
36 #define OPTIONSTRING const char*
37 #endif
38
39 typedef struct memcached_programs_help_st memcached_programs_help_st;
40
41 struct memcached_programs_help_st
42 {
43 char *not_used_yet;
44 };
45
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49
50 char *strdup_cleanup(const char *str);
51 void cleanup(void);
52 long int timedif(struct timeval a, struct timeval b);
53 void version_command(const char *command_name);
54 void help_command(const char *command_name, const char *description,
55 const struct option *long_options,
56 memcached_programs_help_st *options);
57 void process_hash_option(memcached_st *memc, char *opt_hash);
58 bool initialize_sasl(memcached_st *memc, char *user, char *password);
59 void shutdown_sasl(void);
60 void initialize_sockets(void);
61 void close_stdio(void);
62
63 #ifdef __cplusplus
64 } // extern "C"
65 #endif