*.exe
*.lo
*.pop
+*.rpm
*/*.l[oa]
*/*/*.l[oa]
*/*/.deps
config/missing
config/pandora_vc_revinfo
config/plugin.ac
+config/top.h
configure
docs/*.[13]
docs/*.html
libmemcached.pop
libmemcached/configure.h
libmemcached/dtrace_probes.h
+libmemcached/generated_probes.h
libmemcached/memcached_configure.h
+libmemcached/options/parser.cc
+libmemcached/options/parser.h
+libmemcached/options/parser.output
+libmemcached/options/parsers.cc
+libmemcached/options/parsers.h
+libmemcached/options/parsers.output
+libmemcached/options/scanner.cc
+libmemcached/options/scanner.h
libmemcached_examples.pop
libmemcachedutil.pop
libtool
tests/testplus
tests/testudp
unittests/unittests
-config/top.h
-libmemcached/generated_probes.h
+clients/memparse
check_PROGRAMS =
EXTRA_HEADERS =
BUILT_SOURCES=
+DISTCLEANFILES=
EXTRA_DIST= \
${srcdir}/m4/pandora_*.m4 \
.quickly \
clients/memdump \
clients/memerror \
clients/memflush \
+ clients/memparse \
clients/memrm \
clients/memstat
clients_memcat_SOURCES= clients/memcat.c
clients_memcat_LDADD= $(CLIENTS_LDADDS)
+clients_memparse_SOURCES= clients/memparse.cc
+clients_memparse_LDADD= $(CLIENTS_LDADDS)
+
clients_memcp_SOURCES= clients/memcp.c
clients_memcp_LDADD= $(CLIENTS_LDADDS)
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include <config.h>
+
+#include <iostream>
+
+#include <libmemcached/memcached.h>
+
+int main(int argc, char *argv[])
+{
+
+ if (argc != 2)
+ {
+ std::cerr << "Wrong number of arguments" << std::endl;
+ return EXIT_FAILURE;
+ }
+
+ memcached_st *memc;
+
+ memc= memcached_create(NULL);
+
+ memcached_return_t rc= memcached_parse_options(memc, argv[1], strlen(argv[1]));
+
+ if (rc != MEMCACHED_SUCCESS)
+ {
+ std::cerr << "Failed to parse options" << std::endl;
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
#!/usr/bin/env bash
-# libmemcached
+# LibmemcacheD
+# Copyright (C) 2011 Data Differential, http://datadifferential.com/
# Copyright (C) 2006-2010 Brian Aker, Monty Taylor, Trond Norbye
# All rights reserved.
#
AC_CONFIG_AUX_DIR(config)
PANDORA_CANONICAL_TARGET(no-vc-changelog)
+AC_CHECK_PROGS([YACC], ['bison'], [:])
+AC_CHECK_PROGS([LEX], ['flex'], [:])
#shared library versioning
MEMCACHED_UTIL_LIBRARY_VERSION=1:0:0
}
}
break;
+ case MEMCACHED_BEHAVIOR_LOAD_FROM_FILE:
+ ptr->flags.load_from_file= set_flag(data);
+ break;
case MEMCACHED_BEHAVIOR_MAX:
default:
/* Shouldn't get here */
return ptr->flags.cork;
case MEMCACHED_BEHAVIOR_TCP_KEEPALIVE:
return ptr->flags.tcp_keepalive;
+ case MEMCACHED_BEHAVIOR_LOAD_FROM_FILE:
+ return ptr->flags.load_from_file;
case MEMCACHED_BEHAVIOR_MAX:
default:
WATCHPOINT_ASSERT(0); /* Programming mistake if it gets this far */
MEMCACHED_BEHAVIOR_CORK,
MEMCACHED_BEHAVIOR_TCP_KEEPALIVE,
MEMCACHED_BEHAVIOR_TCP_KEEPIDLE,
+ MEMCACHED_BEHAVIOR_LOAD_FROM_FILE,
MEMCACHED_BEHAVIOR_MAX
} memcached_behavior_t;
# included from Top Level Makefile.am
# All paths should be given relative to the root
+libmemcached_libmemcached_la_SOURCES =
+
+include libmemcached/options/include.am
+
EXTRA_DIST+= \
libmemcached/configure.h.in \
libmemcached/libmemcached_probes.d \
libmemcached/memcached.h \
libmemcached/memcached.hpp \
libmemcached/memcached/protocol_binary.h \
+ libmemcached/options.h \
libmemcached/parse.h \
libmemcached/platform.h \
libmemcached/protocol/cache.h \
lib_LTLIBRARIES+= libmemcached/libmemcached.la
libmemcached_libmemcached_la_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION}
-libmemcached_libmemcached_la_SOURCES = \
+libmemcached_libmemcached_la_SOURCES+= \
libmemcached/allocators.c \
libmemcached/analyze.c \
libmemcached/auto.c \
libmemcached/flush_buffers.c \
libmemcached/get.c \
libmemcached/hash.c \
+ libmemcached/options.cc \
libmemcached/hosts.c \
libmemcached/io.c \
libmemcached/key.c \
libmemcached/verbosity.c \
libmemcached/version.c
+libmemcached/options.cc: libmemcached/options/parser.h
+
libmemcached_libmemcached_la_DEPENDENCIES= libmemcached/libmemcachedcallbacks.la libmemcached/libmemcachedinternal.la libhashkit/libhashkitinc.la
libmemcached_libmemcached_la_LIBADD= $(LIBM) libmemcached/libmemcachedcallbacks.la libmemcached/libmemcachedinternal.la libhashkit/libhashkitinc.la
.use_sort_hosts= false,
.use_udp= false,
.verify_key= false,
- .tcp_keepalive= false
+ .tcp_keepalive= false,
+ .load_from_file= false
+
}
};
#include <libmemcached/flush_buffers.h>
#include <libmemcached/get.h>
#include <libmemcached/hash.h>
+#include <libmemcached/options.h>
#include <libmemcached/parse.h>
#include <libmemcached/quit.h>
#include <libmemcached/result.h>
bool use_udp:1;
bool verify_key:1;
bool tcp_keepalive:1;
+ bool load_from_file:1;
} flags;
memcached_server_distribution_t distribution;
hashkit_st hashkit;
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "common.h"
+
+#include <libmemcached/options/parser.h>
+#include <libmemcached/options/scanner.h>
+
+int libmemcached_parse(type_st *, yyscan_t *);
+
+memcached_return_t memcached_parse_options(memcached_st *self, char const *option_string, size_t length)
+{
+ type_st pp;
+
+ memset(&pp, 0, sizeof(type_st));
+
+ pp.buf= option_string;
+ pp.memc= self;
+ pp.length= length;
+ libmemcached_lex_init(&pp.yyscanner);
+ libmemcached_set_extra(&pp, pp.yyscanner);
+ bool success= libmemcached_parse(&pp, pp.yyscanner) == 0;
+ libmemcached_lex_destroy(pp.yyscanner);
+
+ if (not success)
+ return MEMCACHED_INVALID_ARGUMENTS;
+
+ return MEMCACHED_SUCCESS;
+}
+
+memcached_return_t memcached_parse_file_options(memcached_st *ptr, const char *filename)
+{
+ (void)ptr;
+ (void)filename;
+
+ return MEMCACHED_SUCCESS;
+}
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+LIBMEMCACHED_API
+ memcached_return_t memcached_parse_options(memcached_st *ptr, const char *option_string, size_t length);
+
+LIBMEMCACHED_API
+ memcached_return_t memcached_parse_file_options(memcached_st *ptr, const char *filename);
+
+#ifdef __cplusplus
+}
+#endif
--- /dev/null
+# vim:ft=automake
+# included from Top Level Makefile.am
+# All paths should be given relative to the root
+
+DISTCLEANFILES+= \
+ libmemcached/options/parser.output \
+ libmemcached/options/parser.cc \
+ libmemcached/options/parser.h \
+ libmemcached/options/scanner.cc \
+ libmemcached/options/scanner.h
+
+EXTRA_DIST+= \
+ libmemcached/options/scanner.l \
+ libmemcached/options/parser.yy
+
+noinst_HEADERS+= \
+ libmemcached/options/parser.h \
+ libmemcached/options/scanner.h \
+ libmemcached/options/server.h \
+ libmemcached/options/string.h \
+ libmemcached/options/symbol.h \
+ libmemcached/options/type.h
+
+libmemcached_libmemcached_la_SOURCES+= \
+ libmemcached/options/parser.cc \
+ libmemcached/options/scanner.cc
+
+libmemcached/options/parser.h: libmemcached/options/parser.cc
+
+libmemcached/options/parser.cc: libmemcached/options/parser.yy libmemcached/options/scanner.l libmemcached/options/scanner.h
+ $(AM_V_YACC)$(am__skipyacc) $(YACC) $(YLFLAGS) $(AM_YFLAGS) -o $@ $<
+
+libmemcached/options/scanner.h: libmemcached/options/scanner.cc
+
+libmemcached/options/scanner.cc: libmemcached/options/scanner.l libmemcached/options/parser.yy
+ $(AM_V_GEN)$(LEX) $<
+
--- /dev/null
+#pragma once
+
+#include <stdlib.h>
+#include <iostream>
+
+struct string_t
+{
+ const char *c_str;
+ size_t length;
+};
+
+inline std::ostream& operator<<(std::ostream& output, const string_t& arg)
+{
+ output << arg.c_str;
+ return output;
+}
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+%{
+
+#include <stdint.h>
+#include <iostream>
+
+#include <libmemcached/options/type.h>
+#include <libmemcached/options/string.h>
+#include <libmemcached/options/symbol.h>
+
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+#include <libmemcached/options/scanner.h>
+
+inline int libmemcached_error(YYLTYPE *locp, type_st *parser, yyscan_t *scanner, const char *str)
+{
+ std::cerr << str << std::endl;
+ return 0;
+}
+
+
+%}
+
+%error-verbose
+%debug
+%defines
+%expect 0
+%output "libmemcached/options/parser.cc"
+%defines "libmemcached/options/parser.h"
+%lex-param { yyscan_t *scanner }
+%name-prefix="libmemcached_"
+%parse-param { type_st *parser }
+%parse-param { yyscan_t *scanner }
+%locations
+%pure-parser
+%require "2.2"
+%start statement
+%verbose
+
+%token EQ
+%token SERVER
+%token SERVERS
+%token TCPNODELAY
+%token UNKNOWN
+%token VERIFY_KEY
+%token COMMA
+
+%token <number> NUMBER
+%token <number> FLOAT
+%token <string> IDENTIFIER
+%token <string> SERVER_WITH_PORT
+
+%type <server> server
+
+%%
+
+statement:
+ expression
+ { }
+ | statement expression
+ { }
+ ;
+
+
+expression:
+ SERVER EQ server
+ {
+ (void) memcached_server_add(parser->memc, $3.c_str, $3.port);
+ }
+ | SERVERS EQ server_list
+ { }
+ | TCPNODELAY
+ {
+ memcached_behavior_set(parser->memc, MEMCACHED_BEHAVIOR_TCP_NODELAY, true);
+ }
+ | VERIFY_KEY
+ {
+ memcached_behavior_set(parser->memc, MEMCACHED_BEHAVIOR_VERIFY_KEY, true);
+ }
+ ;
+
+server_list:
+ server
+ {
+ (void) memcached_server_add(parser->memc, $1.c_str, $1.port);
+ }
+ | server_list COMMA server
+ {
+ (void) memcached_server_add(parser->memc, $3.c_str, $3.port);
+ }
+ ;
+
+server:
+ SERVER_WITH_PORT NUMBER
+ {
+ $$.c_str= $1.c_str;
+ $$.length= $1.length;
+ $$.port= $2;
+ }
+ | IDENTIFIER
+ {
+ $$.c_str= $1.c_str;
+ $$.length= $1.length;
+ $$.port= 80;
+ }
+ ;
--- /dev/null
+
+%top{
+
+#pragma GCC diagnostic ignored "-Wold-style-cast"
+#pragma GCC diagnostic ignored "-Wunused-parameter"
+#pragma GCC diagnostic ignored "-fpermissive"
+
+#include <libmemcached/options/parser.h>
+#include <libmemcached/options/string.h>
+#include <libmemcached/options/symbol.h>
+#include <libmemcached/options/type.h>
+
+}
+
+
+%{
+#include <cstdlib>
+#include <cstring>
+
+#define PARAM yyget_extra(yyscanner)
+
+static void get_lex_chars(char* buffer, int& result, int max_size, struct type_st *parser)
+{
+ if (parser->pos >= parser->length)
+ {
+ result = YY_NULL;
+ }
+ else
+ {
+ result = parser->length - parser->pos;
+ result > (int)max_size ? result = max_size : 0;
+ memcpy(buffer, parser->buf + parser->pos, result);
+ parser->pos += result;
+ }
+}
+
+
+#define YY_INPUT(buffer, result, max_size) get_lex_chars(buffer, result, max_size, PARAM)
+
+%}
+
+%option bison-locations
+%option bison-bridge
+%option case-insensitive
+%option debug
+%option nounput
+%option noyywrap
+%option outfile="libmemcached/options/scanner.cc" header-file="libmemcached/options/scanner.h"
+%option perf-report
+%option prefix="libmemcached_"
+%option reentrant
+
+%%
+
+[=] { return EQ; }
+[,] { return COMMA; }
+
+[0-9]+ { yylval->number = atoi(yytext); return (NUMBER); }
+
+([0-9]*.[0-9]+) { yylval->double_number = atof(yytext); return (FLOAT); }
+
+[ \t\r\n] ; /* skip whitespace */
+
+"--SERVER" { return SERVER; }
+"--SERVERS" { return SERVERS; }
+"--TCP_NODELAY" { return TCPNODELAY; }
+"--TCP-NODELAY" { return TCPNODELAY; }
+"--VERIFY_KEY" { return VERIFY_KEY; }
+"--VERIFY-KEY" { return VERIFY_KEY; }
+
+[A-Za-z][A-Za-z0-9_]*[:] {
+ yylval->string.c_str = yytext;
+ yylval->string.length = yyleng;
+ return SERVER_WITH_PORT;
+ }
+
+[A-Za-z][A-Za-z0-9_]* {
+ yylval->string.c_str = yytext;
+ yylval->string.length = yyleng;
+ return IDENTIFIER;
+ }
+[-] ;
+
+. {
+ std::cerr << "Near " << yytext << std::endl;
+ return UNKNOWN;
+ }
+
+%%
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+#include <cstdlib>
+#include <iostream>
+#include <arpa/inet.h>
+
+struct server_t
+{
+ const char *c_str;
+ size_t length;
+ in_port_t port;
+};
+
+inline std::ostream& operator<<(std::ostream& output, const server_t& arg)
+{
+ output.write(arg.c_str, arg.length);
+ output << ':' << arg.port;
+ return output;
+}
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+#include <cstdlib>
+#include <iostream>
+
+struct string_t
+{
+ const char *c_str;
+ size_t length;
+};
+
+inline std::ostream& operator<<(std::ostream& output, const string_t& arg)
+{
+ output.write(arg.c_str, arg.length);
+ return output;
+}
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+#include <libmemcached/options/string.h>
+#include <libmemcached/options/server.h>
+
+union YYSTYPE
+{
+ long long number;
+ string_t string;
+ server_t server;
+ double double_number;
+};
+
+typedef union YYSTYPE YYSTYPE;
--- /dev/null
+/* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
+ *
+ * Libmemcached library
+ *
+ * Copyright (C) 2011 Data Differential, http://datadifferential.com/
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *
+ * * The names of its contributors may not be used to endorse or
+ * promote products derived from this software without specific prior
+ * written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#pragma once
+
+#include <libmemcached/memcached.h>
+
+struct type_st
+{
+ void *yyscanner;
+ char *buf;
+ int pos;
+ int length;
+ memcached_st *memc;
+};
m4_if(PW_LESS_WARNINGS,[no],[
BASE_WARNINGS_FULL="${W_CONVERSION} -Wstrict-aliasing"
CC_WARNINGS_FULL="-Wswitch-default -Wswitch-enum -Wwrite-strings"
- CXX_WARNINGS_FULL="-Weffc++ -Wold-style-cast"
+ CXX_WARNINGS_FULL=""
NO_OLD_STYLE_CAST="-Wno-old-style-cast"
NO_EFF_CXX="-Wno-effc++"
],[