libmemcached/options/parser.h \
libmemcached/options/scanner.h \
libmemcached/options/server.h \
- libmemcached/options/string.h \
libmemcached/options/symbol.h
libmemcached_libmemcached_la_SOURCES+= \
+++ /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;
-}
#include <libmemcached/common.h>
#include <libmemcached/options/context.h>
-#include <libmemcached/options/string.h>
#include <libmemcached/options/symbol.h>
#include <libmemcached/options/scanner.h>
/* Line 189 of yacc.c */
-#line 107 "libmemcached/options/parser.cc"
+#line 106 "libmemcached/options/parser.cc"
/* Enabling traces. */
#ifndef YYDEBUG
/* Line 264 of yacc.c */
-#line 218 "libmemcached/options/parser.cc"
+#line 217 "libmemcached/options/parser.cc"
#ifdef short
# undef short
/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 156, 156, 157, 161, 163, 165, 167, 172, 177,
- 181, 185, 196, 204, 212, 216, 220, 224, 228, 235,
- 242, 253, 260, 267, 274, 280, 284, 288, 292, 296,
- 300, 304, 308, 312, 316, 320, 324, 331, 335, 339,
- 343, 347, 351, 355, 359, 363, 367, 371, 375, 382,
- 383, 388, 389, 394, 398, 402, 406, 410, 414, 418,
- 422, 426, 433, 437, 445, 449, 453
+ 0, 155, 155, 156, 160, 162, 164, 166, 171, 176,
+ 180, 184, 195, 203, 211, 215, 219, 223, 227, 234,
+ 241, 252, 259, 266, 273, 279, 283, 287, 291, 295,
+ 299, 303, 307, 311, 315, 319, 323, 330, 334, 338,
+ 342, 346, 350, 354, 358, 362, 366, 370, 374, 381,
+ 382, 387, 388, 393, 397, 401, 405, 409, 413, 417,
+ 421, 425, 432, 436, 444, 448, 452
};
#endif
case 4:
/* Line 1464 of yacc.c */
-#line 162 "libmemcached/options/parser.yy"
+#line 161 "libmemcached/options/parser.yy"
{ ;}
break;
case 5:
/* Line 1464 of yacc.c */
-#line 164 "libmemcached/options/parser.yy"
+#line 163 "libmemcached/options/parser.yy"
{ ;}
break;
case 6:
/* Line 1464 of yacc.c */
-#line 166 "libmemcached/options/parser.yy"
+#line 165 "libmemcached/options/parser.yy"
{ ;}
break;
case 7:
/* Line 1464 of yacc.c */
-#line 168 "libmemcached/options/parser.yy"
+#line 167 "libmemcached/options/parser.yy"
{
context->set_end();
YYACCEPT;
case 8:
/* Line 1464 of yacc.c */
-#line 173 "libmemcached/options/parser.yy"
+#line 172 "libmemcached/options/parser.yy"
{
context->rc= MEMCACHED_PARSE_USER_ERROR;
parser_abort(context, NULL);
case 9:
/* Line 1464 of yacc.c */
-#line 178 "libmemcached/options/parser.yy"
+#line 177 "libmemcached/options/parser.yy"
{
memcached_reset(context->memc);
;}
case 10:
/* Line 1464 of yacc.c */
-#line 182 "libmemcached/options/parser.yy"
+#line 181 "libmemcached/options/parser.yy"
{
yydebug= 1;
;}
case 11:
/* Line 1464 of yacc.c */
-#line 186 "libmemcached/options/parser.yy"
+#line 185 "libmemcached/options/parser.yy"
{
- if ((context->rc= memcached_parse_configure_file(context->memc, (yyvsp[(3) - (3)].string).c_str, (yyvsp[(3) - (3)].string).length)) != MEMCACHED_SUCCESS)
+ if ((context->rc= memcached_parse_configure_file(context->memc, (yyvsp[(3) - (3)].string).c_str, (yyvsp[(3) - (3)].string).size)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);
}
case 12:
/* Line 1464 of yacc.c */
-#line 197 "libmemcached/options/parser.yy"
+#line 196 "libmemcached/options/parser.yy"
{
if ((context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(2) - (4)].server).port, (yyvsp[(2) - (4)].server).weight)) != MEMCACHED_SUCCESS)
{
case 13:
/* Line 1464 of yacc.c */
-#line 205 "libmemcached/options/parser.yy"
+#line 204 "libmemcached/options/parser.yy"
{
if ((context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(2) - (4)].server).port, (yyvsp[(2) - (4)].server).weight)) != MEMCACHED_SUCCESS)
{
case 14:
/* Line 1464 of yacc.c */
-#line 213 "libmemcached/options/parser.yy"
+#line 212 "libmemcached/options/parser.yy"
{
- memcached_set_configuration_file(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).length);
+ memcached_set_configuration_file(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size);
;}
break;
case 15:
/* Line 1464 of yacc.c */
-#line 217 "libmemcached/options/parser.yy"
+#line 216 "libmemcached/options/parser.yy"
{
context->memc->configure.initial_pool_size= (yyvsp[(2) - (2)].number);
;}
case 16:
/* Line 1464 of yacc.c */
-#line 221 "libmemcached/options/parser.yy"
+#line 220 "libmemcached/options/parser.yy"
{
context->memc->configure.max_pool_size= (yyvsp[(2) - (2)].number);
;}
case 18:
/* Line 1464 of yacc.c */
-#line 229 "libmemcached/options/parser.yy"
+#line 228 "libmemcached/options/parser.yy"
{
- if ((context->rc= memcached_set_prefix_key(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).length)) != MEMCACHED_SUCCESS)
+ if ((context->rc= memcached_set_prefix_key(context->memc, (yyvsp[(2) - (2)].string).c_str, (yyvsp[(2) - (2)].string).size)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);;
}
case 19:
/* Line 1464 of yacc.c */
-#line 236 "libmemcached/options/parser.yy"
+#line 235 "libmemcached/options/parser.yy"
{
if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS)
{
case 20:
/* Line 1464 of yacc.c */
-#line 243 "libmemcached/options/parser.yy"
+#line 242 "libmemcached/options/parser.yy"
{
if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS)
{
case 21:
/* Line 1464 of yacc.c */
-#line 254 "libmemcached/options/parser.yy"
+#line 253 "libmemcached/options/parser.yy"
{
if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, (yyvsp[(2) - (2)].hash))) != MEMCACHED_SUCCESS)
{
case 22:
/* Line 1464 of yacc.c */
-#line 261 "libmemcached/options/parser.yy"
+#line 260 "libmemcached/options/parser.yy"
{
if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS)
{
case 23:
/* Line 1464 of yacc.c */
-#line 268 "libmemcached/options/parser.yy"
+#line 267 "libmemcached/options/parser.yy"
{
if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS)
{
case 24:
/* Line 1464 of yacc.c */
-#line 275 "libmemcached/options/parser.yy"
+#line 274 "libmemcached/options/parser.yy"
{
;}
break;
case 25:
/* Line 1464 of yacc.c */
-#line 281 "libmemcached/options/parser.yy"
+#line 280 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS;
;}
case 26:
/* Line 1464 of yacc.c */
-#line 285 "libmemcached/options/parser.yy"
+#line 284 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT;
;}
case 27:
/* Line 1464 of yacc.c */
-#line 289 "libmemcached/options/parser.yy"
+#line 288 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK;
;}
case 28:
/* Line 1464 of yacc.c */
-#line 293 "libmemcached/options/parser.yy"
+#line 292 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK;
;}
case 29:
/* Line 1464 of yacc.c */
-#line 297 "libmemcached/options/parser.yy"
+#line 296 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH;
;}
case 30:
/* Line 1464 of yacc.c */
-#line 301 "libmemcached/options/parser.yy"
+#line 300 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS;
;}
case 31:
/* Line 1464 of yacc.c */
-#line 305 "libmemcached/options/parser.yy"
+#line 304 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT;
;}
case 32:
/* Line 1464 of yacc.c */
-#line 309 "libmemcached/options/parser.yy"
+#line 308 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT;
;}
case 33:
/* Line 1464 of yacc.c */
-#line 313 "libmemcached/options/parser.yy"
+#line 312 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT;
;}
case 34:
/* Line 1464 of yacc.c */
-#line 317 "libmemcached/options/parser.yy"
+#line 316 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT;
;}
case 35:
/* Line 1464 of yacc.c */
-#line 321 "libmemcached/options/parser.yy"
+#line 320 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE;
;}
case 36:
/* Line 1464 of yacc.c */
-#line 325 "libmemcached/options/parser.yy"
+#line 324 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE;
;}
case 37:
/* Line 1464 of yacc.c */
-#line 332 "libmemcached/options/parser.yy"
+#line 331 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL;
;}
case 38:
/* Line 1464 of yacc.c */
-#line 336 "libmemcached/options/parser.yy"
+#line 335 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS;
;}
case 39:
/* Line 1464 of yacc.c */
-#line 340 "libmemcached/options/parser.yy"
+#line 339 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY;
;}
case 40:
/* Line 1464 of yacc.c */
-#line 344 "libmemcached/options/parser.yy"
+#line 343 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY;
;}
case 41:
/* Line 1464 of yacc.c */
-#line 348 "libmemcached/options/parser.yy"
+#line 347 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ;
;}
case 42:
/* Line 1464 of yacc.c */
-#line 352 "libmemcached/options/parser.yy"
+#line 351 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_SORT_HOSTS;
;}
case 43:
/* Line 1464 of yacc.c */
-#line 356 "libmemcached/options/parser.yy"
+#line 355 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_SUPPORT_CAS;
;}
case 44:
/* Line 1464 of yacc.c */
-#line 360 "libmemcached/options/parser.yy"
+#line 359 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_NODELAY;
;}
case 45:
/* Line 1464 of yacc.c */
-#line 364 "libmemcached/options/parser.yy"
+#line 363 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE;
;}
case 46:
/* Line 1464 of yacc.c */
-#line 368 "libmemcached/options/parser.yy"
+#line 367 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE;
;}
case 47:
/* Line 1464 of yacc.c */
-#line 372 "libmemcached/options/parser.yy"
+#line 371 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_USE_UDP;
;}
case 48:
/* Line 1464 of yacc.c */
-#line 376 "libmemcached/options/parser.yy"
+#line 375 "libmemcached/options/parser.yy"
{
(yyval.behavior)= MEMCACHED_BEHAVIOR_VERIFY_KEY;
;}
case 49:
/* Line 1464 of yacc.c */
-#line 382 "libmemcached/options/parser.yy"
+#line 381 "libmemcached/options/parser.yy"
{ ;}
break;
case 50:
/* Line 1464 of yacc.c */
-#line 384 "libmemcached/options/parser.yy"
+#line 383 "libmemcached/options/parser.yy"
{ ;}
break;
case 51:
/* Line 1464 of yacc.c */
-#line 388 "libmemcached/options/parser.yy"
+#line 387 "libmemcached/options/parser.yy"
{ ;}
break;
case 52:
/* Line 1464 of yacc.c */
-#line 390 "libmemcached/options/parser.yy"
+#line 389 "libmemcached/options/parser.yy"
{ ;}
break;
case 53:
/* Line 1464 of yacc.c */
-#line 395 "libmemcached/options/parser.yy"
+#line 394 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_MD5;
;}
case 54:
/* Line 1464 of yacc.c */
-#line 399 "libmemcached/options/parser.yy"
+#line 398 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_CRC;
;}
case 55:
/* Line 1464 of yacc.c */
-#line 403 "libmemcached/options/parser.yy"
+#line 402 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_FNV1_64;
;}
case 56:
/* Line 1464 of yacc.c */
-#line 407 "libmemcached/options/parser.yy"
+#line 406 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_FNV1A_64;
;}
case 57:
/* Line 1464 of yacc.c */
-#line 411 "libmemcached/options/parser.yy"
+#line 410 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_FNV1_32;
;}
case 58:
/* Line 1464 of yacc.c */
-#line 415 "libmemcached/options/parser.yy"
+#line 414 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_FNV1A_32;
;}
case 59:
/* Line 1464 of yacc.c */
-#line 419 "libmemcached/options/parser.yy"
+#line 418 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_HSIEH;
;}
case 60:
/* Line 1464 of yacc.c */
-#line 423 "libmemcached/options/parser.yy"
+#line 422 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_MURMUR;
;}
case 61:
/* Line 1464 of yacc.c */
-#line 427 "libmemcached/options/parser.yy"
+#line 426 "libmemcached/options/parser.yy"
{
(yyval.hash)= MEMCACHED_HASH_JENKINS;
;}
case 62:
/* Line 1464 of yacc.c */
-#line 434 "libmemcached/options/parser.yy"
+#line 433 "libmemcached/options/parser.yy"
{
(yyval.string)= (yyvsp[(1) - (1)].string);
;}
case 63:
/* Line 1464 of yacc.c */
-#line 438 "libmemcached/options/parser.yy"
+#line 437 "libmemcached/options/parser.yy"
{
(yyval.string).c_str= (yyvsp[(1) - (1)].string).c_str +1; // +1 to move use passed the initial quote
- (yyval.string).length= (yyvsp[(1) - (1)].string).length -2; // -2 removes the begin and end quote
+ (yyval.string).size= (yyvsp[(1) - (1)].string).size -2; // -2 removes the begin and end quote
;}
break;
case 64:
/* Line 1464 of yacc.c */
-#line 446 "libmemcached/options/parser.yy"
+#line 445 "libmemcached/options/parser.yy"
{
(yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT;
;}
case 65:
/* Line 1464 of yacc.c */
-#line 450 "libmemcached/options/parser.yy"
+#line 449 "libmemcached/options/parser.yy"
{
(yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA;
;}
case 66:
/* Line 1464 of yacc.c */
-#line 454 "libmemcached/options/parser.yy"
+#line 453 "libmemcached/options/parser.yy"
{
(yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM;
;}
/* Line 1464 of yacc.c */
-#line 2104 "libmemcached/options/parser.cc"
+#line 2103 "libmemcached/options/parser.cc"
default: break;
}
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
/* Line 1684 of yacc.c */
-#line 459 "libmemcached/options/parser.yy"
+#line 458 "libmemcached/options/parser.yy"
void Context::start()
#include <libmemcached/common.h>
#include <libmemcached/options/context.h>
-#include <libmemcached/options/string.h>
#include <libmemcached/options/symbol.h>
#include <libmemcached/options/scanner.h>
}
| INCLUDE ' ' string
{
- if ((context->rc= memcached_parse_configure_file(context->memc, $3.c_str, $3.length)) != MEMCACHED_SUCCESS)
+ if ((context->rc= memcached_parse_configure_file(context->memc, $3.c_str, $3.size)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);
}
}
| CONFIGURE_FILE string
{
- memcached_set_configuration_file(context->memc, $2.c_str, $2.length);
+ memcached_set_configuration_file(context->memc, $2.c_str, $2.size);
}
| POOL_MIN NUMBER
{
behaviors:
NAMESPACE string
{
- if ((context->rc= memcached_set_prefix_key(context->memc, $2.c_str, $2.length)) != MEMCACHED_SUCCESS)
+ if ((context->rc= memcached_set_prefix_key(context->memc, $2.c_str, $2.size)) != MEMCACHED_SUCCESS)
{
parser_abort(context, NULL);;
}
| QUOTED_STRING
{
$$.c_str= $1.c_str +1; // +1 to move use passed the initial quote
- $$.length= $1.length -2; // -2 removes the begin and end quote
+ $$.size= $1.size -2; // -2 removes the begin and end quote
}
;
#include <libmemcached/common.h>
#include <libmemcached/options/context.h>
#include <libmemcached/options/parser.h>
-#include <libmemcached/options/string.h>
#include <libmemcached/options/symbol.h>
#pragma GCC diagnostic ignored "-Wold-style-cast"
-#line 20 "libmemcached/options/scanner.cc"
+#line 19 "libmemcached/options/scanner.cc"
#define YY_INT_ALIGNED short int
static yyconst flex_int16_t yy_rule_linenum[64] =
{ 0,
- 78, 80, 82, 84, 86, 89, 93, 95, 96, 97,
- 98, 99, 100, 101, 102, 103, 104, 105, 106, 107,
- 108, 109, 110, 111, 112, 113, 114, 115, 116, 117,
- 118, 119, 120, 121, 122, 124, 125, 127, 129, 130,
- 131, 132, 133, 134, 136, 137, 140, 145, 146, 147,
- 149, 150, 151, 152, 153, 154, 155, 156, 157, 159,
- 168, 186, 192
+ 77, 79, 81, 83, 85, 88, 92, 94, 95, 96,
+ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
+ 117, 118, 119, 120, 121, 123, 124, 126, 128, 129,
+ 130, 131, 132, 133, 135, 136, 139, 144, 145, 146,
+ 148, 149, 150, 151, 152, 153, 154, 155, 156, 158,
+ 167, 185, 191
} ;
/* The intent behind this definition is that it'll catch
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#line 39 "libmemcached/options/scanner.l"
+#line 38 "libmemcached/options/scanner.l"
#include <cstdlib>
#include <cstring>
#define YY_INPUT(buffer, result, max_size) get_lex_chars(buffer, result, max_size, PARAM)
-#line 1141 "libmemcached/options/scanner.cc"
+#line 1140 "libmemcached/options/scanner.cc"
#define INITIAL 0
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* %% [7.0] user's declarations go here */
-#line 75 "libmemcached/options/scanner.l"
+#line 74 "libmemcached/options/scanner.l"
-#line 1448 "libmemcached/options/scanner.cc"
+#line 1447 "libmemcached/options/scanner.cc"
yylval = yylval_param;
case 1:
YY_RULE_SETUP
-#line 78 "libmemcached/options/scanner.l"
+#line 77 "libmemcached/options/scanner.l"
{ return yytext[0];}
YY_BREAK
case 2:
YY_RULE_SETUP
-#line 80 "libmemcached/options/scanner.l"
+#line 79 "libmemcached/options/scanner.l"
{ yylval->number = atoi(yytext); return (NUMBER); }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 82 "libmemcached/options/scanner.l"
+#line 81 "libmemcached/options/scanner.l"
{ yylval->server.port = atoi(yytext +1); return PORT; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 84 "libmemcached/options/scanner.l"
+#line 83 "libmemcached/options/scanner.l"
{ yylval->server.weight = atoi(yytext +2); return WEIGHT_START; }
YY_BREAK
case 5:
/* rule 5 can match eol */
YY_RULE_SETUP
-#line 86 "libmemcached/options/scanner.l"
+#line 85 "libmemcached/options/scanner.l"
; /* skip whitespace */
YY_BREAK
case 6:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 89 "libmemcached/options/scanner.l"
+#line 88 "libmemcached/options/scanner.l"
{
return COMMENT;
}
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 93 "libmemcached/options/scanner.l"
+#line 92 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; yyextra->set_server(); return SERVER; }
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 95 "libmemcached/options/scanner.l"
+#line 94 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return BINARY_PROTOCOL; }
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 96 "libmemcached/options/scanner.l"
+#line 95 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return BUFFER_REQUESTS; }
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 97 "libmemcached/options/scanner.l"
+#line 96 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return CONFIGURE_FILE; }
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 98 "libmemcached/options/scanner.l"
+#line 97 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return CONNECT_TIMEOUT; }
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 99 "libmemcached/options/scanner.l"
+#line 98 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return DISTRIBUTION; }
YY_BREAK
case 13:
YY_RULE_SETUP
-#line 100 "libmemcached/options/scanner.l"
+#line 99 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return HASH_WITH_NAMESPACE; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 101 "libmemcached/options/scanner.l"
+#line 100 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return HASH; }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 102 "libmemcached/options/scanner.l"
+#line 101 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return IO_BYTES_WATERMARK; }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 103 "libmemcached/options/scanner.l"
+#line 102 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return IO_KEY_PREFETCH; }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 104 "libmemcached/options/scanner.l"
+#line 103 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return IO_MSG_WATERMARK; }
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 105 "libmemcached/options/scanner.l"
+#line 104 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return NOREPLY; }
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 106 "libmemcached/options/scanner.l"
+#line 105 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return NUMBER_OF_REPLICAS; }
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 107 "libmemcached/options/scanner.l"
+#line 106 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return POLL_TIMEOUT; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 108 "libmemcached/options/scanner.l"
+#line 107 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return RANDOMIZE_REPLICA_READ; }
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 109 "libmemcached/options/scanner.l"
+#line 108 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return RCV_TIMEOUT; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 110 "libmemcached/options/scanner.l"
+#line 109 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return REMOVE_FAILED_SERVERS; }
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 111 "libmemcached/options/scanner.l"
+#line 110 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return RETRY_TIMEOUT; }
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 112 "libmemcached/options/scanner.l"
+#line 111 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return SND_TIMEOUT; }
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 113 "libmemcached/options/scanner.l"
+#line 112 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return SOCKET_RECV_SIZE; }
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 114 "libmemcached/options/scanner.l"
+#line 113 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return SOCKET_SEND_SIZE; }
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 115 "libmemcached/options/scanner.l"
+#line 114 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return SORT_HOSTS; }
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 116 "libmemcached/options/scanner.l"
+#line 115 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return SUPPORT_CAS; }
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 117 "libmemcached/options/scanner.l"
+#line 116 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return _TCP_KEEPALIVE; }
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 118 "libmemcached/options/scanner.l"
+#line 117 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return _TCP_KEEPIDLE; }
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 119 "libmemcached/options/scanner.l"
+#line 118 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return _TCP_NODELAY; }
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 120 "libmemcached/options/scanner.l"
+#line 119 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return USE_UDP; }
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 121 "libmemcached/options/scanner.l"
+#line 120 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return USER_DATA; }
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 122 "libmemcached/options/scanner.l"
+#line 121 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return VERIFY_KEY; }
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 124 "libmemcached/options/scanner.l"
+#line 123 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return POOL_MIN; }
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 125 "libmemcached/options/scanner.l"
+#line 124 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return POOL_MAX; }
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 127 "libmemcached/options/scanner.l"
+#line 126 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return NAMESPACE; }
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 129 "libmemcached/options/scanner.l"
+#line 128 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return INCLUDE; }
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 130 "libmemcached/options/scanner.l"
+#line 129 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return RESET; }
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 131 "libmemcached/options/scanner.l"
+#line 130 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return PARSER_DEBUG; }
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 132 "libmemcached/options/scanner.l"
+#line 131 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return SERVERS; }
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 133 "libmemcached/options/scanner.l"
+#line 132 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return END; }
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 134 "libmemcached/options/scanner.l"
+#line 133 "libmemcached/options/scanner.l"
{ yyextra->begin= yytext; return ERROR; }
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 136 "libmemcached/options/scanner.l"
+#line 135 "libmemcached/options/scanner.l"
{ return TRUE; }
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 137 "libmemcached/options/scanner.l"
+#line 136 "libmemcached/options/scanner.l"
{ return FALSE; }
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 140 "libmemcached/options/scanner.l"
+#line 139 "libmemcached/options/scanner.l"
{
yyextra->begin= yytext;
return UNKNOWN_OPTION;
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 145 "libmemcached/options/scanner.l"
+#line 144 "libmemcached/options/scanner.l"
{ return CONSISTENT; }
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 146 "libmemcached/options/scanner.l"
+#line 145 "libmemcached/options/scanner.l"
{ return MODULA; }
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 147 "libmemcached/options/scanner.l"
+#line 146 "libmemcached/options/scanner.l"
{ return RANDOM; }
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 149 "libmemcached/options/scanner.l"
+#line 148 "libmemcached/options/scanner.l"
{ return MD5; }
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 150 "libmemcached/options/scanner.l"
+#line 149 "libmemcached/options/scanner.l"
{ return CRC; }
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 151 "libmemcached/options/scanner.l"
+#line 150 "libmemcached/options/scanner.l"
{ return FNV1_64; }
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 152 "libmemcached/options/scanner.l"
+#line 151 "libmemcached/options/scanner.l"
{ return FNV1A_64; }
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 153 "libmemcached/options/scanner.l"
+#line 152 "libmemcached/options/scanner.l"
{ return FNV1_32; }
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 154 "libmemcached/options/scanner.l"
+#line 153 "libmemcached/options/scanner.l"
{ return FNV1A_32; }
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 155 "libmemcached/options/scanner.l"
+#line 154 "libmemcached/options/scanner.l"
{ return HSIEH; }
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 156 "libmemcached/options/scanner.l"
+#line 155 "libmemcached/options/scanner.l"
{ return MURMUR; }
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 157 "libmemcached/options/scanner.l"
+#line 156 "libmemcached/options/scanner.l"
{ return JENKINS; }
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 159 "libmemcached/options/scanner.l"
+#line 158 "libmemcached/options/scanner.l"
{
yylval->server.port= MEMCACHED_DEFAULT_PORT;
yylval->server.weight= 1;
yylval->server.c_str= yyextra->set_hostname(yytext, yyleng);
if (yylval->server.c_str)
- yylval->server.length= yyleng;
+ yylval->server.size= yyleng;
return IPADDRESS;
}
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 168 "libmemcached/options/scanner.l"
+#line 167 "libmemcached/options/scanner.l"
{
if (yyextra->is_server())
{
yylval->server.weight= 1;
yylval->server.c_str= yyextra->set_hostname(yytext, yyleng);
if (yylval->server.c_str)
- yylval->server.length= yyleng;
+ yylval->server.size= yyleng;
return HOSTNAME;
}
yylval->string.c_str = yytext;
- yylval->string.length = yyleng;
+ yylval->string.size = yyleng;
return STRING;
}
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 186 "libmemcached/options/scanner.l"
+#line 185 "libmemcached/options/scanner.l"
{
yylval->string.c_str = yytext;
- yylval->string.length = yyleng;
+ yylval->string.size = yyleng;
return QUOTED_STRING;
}
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 192 "libmemcached/options/scanner.l"
+#line 191 "libmemcached/options/scanner.l"
{
yyextra->begin= yytext;
return UNKNOWN;
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 197 "libmemcached/options/scanner.l"
+#line 196 "libmemcached/options/scanner.l"
ECHO;
YY_BREAK
-#line 1924 "libmemcached/options/scanner.cc"
+#line 1923 "libmemcached/options/scanner.cc"
case YY_STATE_EOF(INITIAL):
yyterminate();
/* %ok-for-header */
-#line 197 "libmemcached/options/scanner.l"
+#line 196 "libmemcached/options/scanner.l"
#include <libmemcached/common.h>
#include <libmemcached/options/context.h>
#include <libmemcached/options/parser.h>
-#include <libmemcached/options/string.h>
#include <libmemcached/options/symbol.h>
#pragma GCC diagnostic ignored "-Wold-style-cast"
-#line 24 "libmemcached/options/scanner.h"
+#line 23 "libmemcached/options/scanner.h"
#define YY_INT_ALIGNED short int
#undef YY_DECL
#endif
-#line 197 "libmemcached/options/scanner.l"
+#line 196 "libmemcached/options/scanner.l"
-#line 479 "libmemcached/options/scanner.h"
+#line 478 "libmemcached/options/scanner.h"
#undef config_IN_HEADER
#endif /* config_HEADER_H */
#include <libmemcached/common.h>
#include <libmemcached/options/context.h>
#include <libmemcached/options/parser.h>
-#include <libmemcached/options/string.h>
#include <libmemcached/options/symbol.h>
#pragma GCC diagnostic ignored "-Wold-style-cast"
yylval->server.weight= 1;
yylval->server.c_str= yyextra->set_hostname(yytext, yyleng);
if (yylval->server.c_str)
- yylval->server.length= yyleng;
+ yylval->server.size= yyleng;
return IPADDRESS;
}
yylval->server.weight= 1;
yylval->server.c_str= yyextra->set_hostname(yytext, yyleng);
if (yylval->server.c_str)
- yylval->server.length= yyleng;
+ yylval->server.size= yyleng;
return HOSTNAME;
}
yylval->string.c_str = yytext;
- yylval->string.length = yyleng;
+ yylval->string.size = yyleng;
return STRING;
}
(\".*\") {
yylval->string.c_str = yytext;
- yylval->string.length = yyleng;
+ yylval->string.size = yyleng;
return QUOTED_STRING;
}
#pragma once
#include <cstdlib>
-#include <iostream>
#include <arpa/inet.h>
struct server_t
{
in_port_t port;
uint32_t weight;
- size_t length;
const char *c_str;
+ size_t size;
};
+#if 0
+#include <iostream>
inline std::ostream& operator<<(std::ostream& output, const server_t& arg)
{
- output.write(arg.c_str, arg.length);
+ output.write(arg.c_str, arg.size);
output << ':' << arg.port;
output << '+' << arg.weight;
return output;
}
+#endif
+++ /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;
-}
#pragma once
+#include <libmemcached/basic_string.h>
#include <libmemcached/constants.h>
-#include <libmemcached/options/string.h>
#include <libmemcached/options/server.h>
union YYSTYPE
{
long long number;
- string_t string;
- string_t option;
+ memcached_string_t string;
+ memcached_string_t option;
double double_number;
memcached_server_distribution_t distribution;
memcached_hash_t hash;