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