projects
/
awesomized
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Merge in pid/ping status.
[awesomized/libmemcached]
/
libmemcached
/
options
/
parser.yy
diff --git
a/libmemcached/options/parser.yy
b/libmemcached/options/parser.yy
index 6a7bd9b9f7378d3c011a00e61265db5fbfa8f98c..81415226e82e002e49b947de5645abd11df9b3f9 100644
(file)
--- a/
libmemcached/options/parser.yy
+++ b/
libmemcached/options/parser.yy
@@
-29,21
+29,21
@@
%parse-param { Context *context }
%parse-param { yyscan_t *scanner }
%pure-parser
%parse-param { Context *context }
%parse-param { yyscan_t *scanner }
%pure-parser
-%require "2.
2
"
+%require "2.
4
"
%start begin
%verbose
%{
%start begin
%verbose
%{
-#include <config.h>
-
-#include <stdint.h>
-
#include <libmemcached/common.h>
#include <libmemcached/common.h>
+#include <libmemcached/options.hpp>
+
#include <libmemcached/options/context.h>
#include <libmemcached/options/symbol.h>
#include <libmemcached/options/scanner.h>
#include <libmemcached/options/context.h>
#include <libmemcached/options/symbol.h>
#include <libmemcached/options/scanner.h>
+#include <iostream>
+
#pragma GCC diagnostic ignored "-Wold-style-cast"
int conf_lex(YYSTYPE* lvalp, void* scanner);
#pragma GCC diagnostic ignored "-Wold-style-cast"
int conf_lex(YYSTYPE* lvalp, void* scanner);
@@
-67,6
+67,7
@@
inline void config_error(Context *context, yyscan_t *scanner, const char *error)
%token CONFIGURE_FILE
%token EMPTY_LINE
%token SERVER
%token CONFIGURE_FILE
%token EMPTY_LINE
%token SERVER
+%token SOCKET
%token SERVERS
%token SERVERS_OPTION
%token UNKNOWN_OPTION
%token SERVERS
%token SERVERS_OPTION
%token UNKNOWN_OPTION
@@
-185,7
+186,7
@@
statement:
}
| INCLUDE ' ' string
{
}
| INCLUDE ' ' string
{
- if ((context->rc= memcached_parse_configure_file(context->memc, $3.c_str, $3.size)) != MEMCACHED_SUCCESS)
+ if ((context->rc= memcached_parse_configure_file(
*
context->memc, $3.c_str, $3.size)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);
}
{
parser_abort(context, NULL);
}
@@
-210,6
+211,13
@@
expression:
}
context->unset_server();
}
}
context->unset_server();
}
+ | SOCKET string optional_weight
+ {
+ if (memcached_failed(context->rc= memcached_server_add_unix_socket_with_weight(context->memc, $2.c_str, $3)))
+ {
+ parser_abort(context, NULL);
+ }
+ }
| CONFIGURE_FILE string
{
memcached_set_configuration_file(context->memc, $2.c_str, $2.size);
| CONFIGURE_FILE string
{
memcached_set_configuration_file(context->memc, $2.c_str, $2.size);
@@
-228,7
+236,7
@@
expression:
behaviors:
NAMESPACE string
{
behaviors:
NAMESPACE string
{
- if ((context->rc= memcached_set_
prefix_key
(context->memc, $2.c_str, $2.size)) != MEMCACHED_SUCCESS)
+ if ((context->rc= memcached_set_
namespace
(context->memc, $2.c_str, $2.size)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);;
}
{
parser_abort(context, NULL);;
}
@@
-437,8
+445,11
@@
string:
}
| QUOTED_STRING
{
}
| QUOTED_STRING
{
+ $$= $1;
+ #if 0
$$.c_str= $1.c_str +1; // +1 to move use passed the initial quote
$$.size= $1.size -2; // -2 removes the begin and end quote
$$.c_str= $1.c_str +1; // +1 to move use passed the initial quote
$$.size= $1.size -2; // -2 removes the begin and end quote
+ #endif
}
;
}
;