X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=libmemcached%2Foptions%2Fparser.cc;h=2e478dcc81d0be6289ae379cc005526d66b2e8ef;hb=9fd31c03436acf24c593dc3a77c905eb137ef570;hp=fc08ed816c857af8d765a33088e0d5976fae8c26;hpb=f0b9c972a973d997db6660680938dd5acb2baa46;p=awesomized%2Flibmemcached diff --git a/libmemcached/options/parser.cc b/libmemcached/options/parser.cc index fc08ed81..2e478dcc 100644 --- a/libmemcached/options/parser.cc +++ b/libmemcached/options/parser.cc @@ -83,8 +83,9 @@ #include #include +#include + #include -#include #include #include @@ -103,7 +104,7 @@ inline void config_error(Context *context, yyscan_t *scanner, const char *error) /* Line 189 of yacc.c */ -#line 107 "libmemcached/options/parser.cc" +#line 108 "libmemcached/options/parser.cc" /* Enabling traces. */ #ifndef YYDEBUG @@ -214,7 +215,7 @@ inline void config_error(Context *context, yyscan_t *scanner, const char *error) /* Line 264 of yacc.c */ -#line 218 "libmemcached/options/parser.cc" +#line 219 "libmemcached/options/parser.cc" #ifdef short # undef short @@ -523,13 +524,13 @@ static const yytype_int8 yyrhs[] = /* 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, 159, 159, 160, 164, 166, 168, 170, 175, 180, + 184, 188, 199, 207, 215, 219, 223, 227, 231, 238, + 245, 256, 263, 270, 277, 283, 287, 291, 295, 299, + 303, 307, 311, 315, 319, 323, 327, 334, 338, 342, + 346, 350, 354, 358, 362, 366, 370, 374, 378, 385, + 386, 391, 392, 397, 401, 405, 409, 413, 417, 421, + 425, 429, 436, 440, 448, 452, 456 }; #endif @@ -1521,28 +1522,28 @@ yyreduce: case 4: /* Line 1464 of yacc.c */ -#line 162 "libmemcached/options/parser.yy" +#line 165 "libmemcached/options/parser.yy" { ;} break; case 5: /* Line 1464 of yacc.c */ -#line 164 "libmemcached/options/parser.yy" +#line 167 "libmemcached/options/parser.yy" { ;} break; case 6: /* Line 1464 of yacc.c */ -#line 166 "libmemcached/options/parser.yy" +#line 169 "libmemcached/options/parser.yy" { ;} break; case 7: /* Line 1464 of yacc.c */ -#line 168 "libmemcached/options/parser.yy" +#line 171 "libmemcached/options/parser.yy" { context->set_end(); YYACCEPT; @@ -1552,7 +1553,7 @@ yyreduce: case 8: /* Line 1464 of yacc.c */ -#line 173 "libmemcached/options/parser.yy" +#line 176 "libmemcached/options/parser.yy" { context->rc= MEMCACHED_PARSE_USER_ERROR; parser_abort(context, NULL); @@ -1562,7 +1563,7 @@ yyreduce: case 9: /* Line 1464 of yacc.c */ -#line 178 "libmemcached/options/parser.yy" +#line 181 "libmemcached/options/parser.yy" { memcached_reset(context->memc); ;} @@ -1571,7 +1572,7 @@ yyreduce: case 10: /* Line 1464 of yacc.c */ -#line 182 "libmemcached/options/parser.yy" +#line 185 "libmemcached/options/parser.yy" { yydebug= 1; ;} @@ -1580,9 +1581,9 @@ yyreduce: case 11: /* Line 1464 of yacc.c */ -#line 186 "libmemcached/options/parser.yy" +#line 189 "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); } @@ -1592,9 +1593,9 @@ yyreduce: case 12: /* Line 1464 of yacc.c */ -#line 197 "libmemcached/options/parser.yy" +#line 200 "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) + if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number)))) { parser_abort(context, NULL); } @@ -1605,9 +1606,9 @@ yyreduce: case 13: /* Line 1464 of yacc.c */ -#line 205 "libmemcached/options/parser.yy" +#line 208 "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) + if (memcached_failed(context->rc= memcached_server_add_with_weight(context->memc, (yyvsp[(2) - (4)].server).c_str, (yyvsp[(3) - (4)].number), (yyvsp[(4) - (4)].number)))) { parser_abort(context, NULL); } @@ -1618,16 +1619,16 @@ yyreduce: case 14: /* Line 1464 of yacc.c */ -#line 213 "libmemcached/options/parser.yy" +#line 216 "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 220 "libmemcached/options/parser.yy" { context->memc->configure.initial_pool_size= (yyvsp[(2) - (2)].number); ;} @@ -1636,7 +1637,7 @@ yyreduce: case 16: /* Line 1464 of yacc.c */ -#line 221 "libmemcached/options/parser.yy" +#line 224 "libmemcached/options/parser.yy" { context->memc->configure.max_pool_size= (yyvsp[(2) - (2)].number); ;} @@ -1645,9 +1646,9 @@ yyreduce: case 18: /* Line 1464 of yacc.c */ -#line 229 "libmemcached/options/parser.yy" +#line 232 "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);; } @@ -1657,7 +1658,7 @@ yyreduce: case 19: /* Line 1464 of yacc.c */ -#line 236 "libmemcached/options/parser.yy" +#line 239 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (2)].distribution))) != MEMCACHED_SUCCESS) { @@ -1669,7 +1670,7 @@ yyreduce: case 20: /* Line 1464 of yacc.c */ -#line 243 "libmemcached/options/parser.yy" +#line 246 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_DISTRIBUTION, (yyvsp[(2) - (4)].distribution))) != MEMCACHED_SUCCESS) { @@ -1685,7 +1686,7 @@ yyreduce: case 21: /* Line 1464 of yacc.c */ -#line 254 "libmemcached/options/parser.yy" +#line 257 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, MEMCACHED_BEHAVIOR_HASH, (yyvsp[(2) - (2)].hash))) != MEMCACHED_SUCCESS) { @@ -1697,7 +1698,7 @@ yyreduce: case 22: /* Line 1464 of yacc.c */ -#line 261 "libmemcached/options/parser.yy" +#line 264 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (2)].behavior), (yyvsp[(2) - (2)].number))) != MEMCACHED_SUCCESS) { @@ -1709,7 +1710,7 @@ yyreduce: case 23: /* Line 1464 of yacc.c */ -#line 268 "libmemcached/options/parser.yy" +#line 271 "libmemcached/options/parser.yy" { if ((context->rc= memcached_behavior_set(context->memc, (yyvsp[(1) - (1)].behavior), true)) != MEMCACHED_SUCCESS) { @@ -1721,7 +1722,7 @@ yyreduce: case 24: /* Line 1464 of yacc.c */ -#line 275 "libmemcached/options/parser.yy" +#line 278 "libmemcached/options/parser.yy" { ;} break; @@ -1729,7 +1730,7 @@ yyreduce: case 25: /* Line 1464 of yacc.c */ -#line 281 "libmemcached/options/parser.yy" +#line 284 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_REMOVE_FAILED_SERVERS; ;} @@ -1738,7 +1739,7 @@ yyreduce: case 26: /* Line 1464 of yacc.c */ -#line 285 "libmemcached/options/parser.yy" +#line 288 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_CONNECT_TIMEOUT; ;} @@ -1747,7 +1748,7 @@ yyreduce: case 27: /* Line 1464 of yacc.c */ -#line 289 "libmemcached/options/parser.yy" +#line 292 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_MSG_WATERMARK; ;} @@ -1756,7 +1757,7 @@ yyreduce: case 28: /* Line 1464 of yacc.c */ -#line 293 "libmemcached/options/parser.yy" +#line 296 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_BYTES_WATERMARK; ;} @@ -1765,7 +1766,7 @@ yyreduce: case 29: /* Line 1464 of yacc.c */ -#line 297 "libmemcached/options/parser.yy" +#line 300 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_IO_KEY_PREFETCH; ;} @@ -1774,7 +1775,7 @@ yyreduce: case 30: /* Line 1464 of yacc.c */ -#line 301 "libmemcached/options/parser.yy" +#line 304 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_NUMBER_OF_REPLICAS; ;} @@ -1783,7 +1784,7 @@ yyreduce: case 31: /* Line 1464 of yacc.c */ -#line 305 "libmemcached/options/parser.yy" +#line 308 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_POLL_TIMEOUT; ;} @@ -1792,7 +1793,7 @@ yyreduce: case 32: /* Line 1464 of yacc.c */ -#line 309 "libmemcached/options/parser.yy" +#line 312 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RCV_TIMEOUT; ;} @@ -1801,7 +1802,7 @@ yyreduce: case 33: /* Line 1464 of yacc.c */ -#line 313 "libmemcached/options/parser.yy" +#line 316 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RETRY_TIMEOUT; ;} @@ -1810,7 +1811,7 @@ yyreduce: case 34: /* Line 1464 of yacc.c */ -#line 317 "libmemcached/options/parser.yy" +#line 320 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SND_TIMEOUT; ;} @@ -1819,7 +1820,7 @@ yyreduce: case 35: /* Line 1464 of yacc.c */ -#line 321 "libmemcached/options/parser.yy" +#line 324 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_RECV_SIZE; ;} @@ -1828,7 +1829,7 @@ yyreduce: case 36: /* Line 1464 of yacc.c */ -#line 325 "libmemcached/options/parser.yy" +#line 328 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SOCKET_SEND_SIZE; ;} @@ -1837,7 +1838,7 @@ yyreduce: case 37: /* Line 1464 of yacc.c */ -#line 332 "libmemcached/options/parser.yy" +#line 335 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_BINARY_PROTOCOL; ;} @@ -1846,7 +1847,7 @@ yyreduce: case 38: /* Line 1464 of yacc.c */ -#line 336 "libmemcached/options/parser.yy" +#line 339 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_BUFFER_REQUESTS; ;} @@ -1855,7 +1856,7 @@ yyreduce: case 39: /* Line 1464 of yacc.c */ -#line 340 "libmemcached/options/parser.yy" +#line 343 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_HASH_WITH_PREFIX_KEY; ;} @@ -1864,7 +1865,7 @@ yyreduce: case 40: /* Line 1464 of yacc.c */ -#line 344 "libmemcached/options/parser.yy" +#line 347 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_NOREPLY; ;} @@ -1873,7 +1874,7 @@ yyreduce: case 41: /* Line 1464 of yacc.c */ -#line 348 "libmemcached/options/parser.yy" +#line 351 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_RANDOMIZE_REPLICA_READ; ;} @@ -1882,7 +1883,7 @@ yyreduce: case 42: /* Line 1464 of yacc.c */ -#line 352 "libmemcached/options/parser.yy" +#line 355 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SORT_HOSTS; ;} @@ -1891,7 +1892,7 @@ yyreduce: case 43: /* Line 1464 of yacc.c */ -#line 356 "libmemcached/options/parser.yy" +#line 359 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_SUPPORT_CAS; ;} @@ -1900,7 +1901,7 @@ yyreduce: case 44: /* Line 1464 of yacc.c */ -#line 360 "libmemcached/options/parser.yy" +#line 363 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_NODELAY; ;} @@ -1909,7 +1910,7 @@ yyreduce: case 45: /* Line 1464 of yacc.c */ -#line 364 "libmemcached/options/parser.yy" +#line 367 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPALIVE; ;} @@ -1918,7 +1919,7 @@ yyreduce: case 46: /* Line 1464 of yacc.c */ -#line 368 "libmemcached/options/parser.yy" +#line 371 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_TCP_KEEPIDLE; ;} @@ -1927,7 +1928,7 @@ yyreduce: case 47: /* Line 1464 of yacc.c */ -#line 372 "libmemcached/options/parser.yy" +#line 375 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_USE_UDP; ;} @@ -1936,7 +1937,7 @@ yyreduce: case 48: /* Line 1464 of yacc.c */ -#line 376 "libmemcached/options/parser.yy" +#line 379 "libmemcached/options/parser.yy" { (yyval.behavior)= MEMCACHED_BEHAVIOR_VERIFY_KEY; ;} @@ -1945,35 +1946,35 @@ yyreduce: case 49: /* Line 1464 of yacc.c */ -#line 382 "libmemcached/options/parser.yy" - { ;} +#line 385 "libmemcached/options/parser.yy" + { (yyval.number)= MEMCACHED_DEFAULT_PORT;;} break; case 50: /* Line 1464 of yacc.c */ -#line 384 "libmemcached/options/parser.yy" +#line 387 "libmemcached/options/parser.yy" { ;} break; case 51: /* Line 1464 of yacc.c */ -#line 388 "libmemcached/options/parser.yy" - { ;} +#line 391 "libmemcached/options/parser.yy" + { (yyval.number)= 1; ;} break; case 52: /* Line 1464 of yacc.c */ -#line 390 "libmemcached/options/parser.yy" +#line 393 "libmemcached/options/parser.yy" { ;} break; case 53: /* Line 1464 of yacc.c */ -#line 395 "libmemcached/options/parser.yy" +#line 398 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MD5; ;} @@ -1982,7 +1983,7 @@ yyreduce: case 54: /* Line 1464 of yacc.c */ -#line 399 "libmemcached/options/parser.yy" +#line 402 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_CRC; ;} @@ -1991,7 +1992,7 @@ yyreduce: case 55: /* Line 1464 of yacc.c */ -#line 403 "libmemcached/options/parser.yy" +#line 406 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_64; ;} @@ -2000,7 +2001,7 @@ yyreduce: case 56: /* Line 1464 of yacc.c */ -#line 407 "libmemcached/options/parser.yy" +#line 410 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_64; ;} @@ -2009,7 +2010,7 @@ yyreduce: case 57: /* Line 1464 of yacc.c */ -#line 411 "libmemcached/options/parser.yy" +#line 414 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1_32; ;} @@ -2018,7 +2019,7 @@ yyreduce: case 58: /* Line 1464 of yacc.c */ -#line 415 "libmemcached/options/parser.yy" +#line 418 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_FNV1A_32; ;} @@ -2027,7 +2028,7 @@ yyreduce: case 59: /* Line 1464 of yacc.c */ -#line 419 "libmemcached/options/parser.yy" +#line 422 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_HSIEH; ;} @@ -2036,7 +2037,7 @@ yyreduce: case 60: /* Line 1464 of yacc.c */ -#line 423 "libmemcached/options/parser.yy" +#line 426 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_MURMUR; ;} @@ -2045,7 +2046,7 @@ yyreduce: case 61: /* Line 1464 of yacc.c */ -#line 427 "libmemcached/options/parser.yy" +#line 430 "libmemcached/options/parser.yy" { (yyval.hash)= MEMCACHED_HASH_JENKINS; ;} @@ -2054,7 +2055,7 @@ yyreduce: case 62: /* Line 1464 of yacc.c */ -#line 434 "libmemcached/options/parser.yy" +#line 437 "libmemcached/options/parser.yy" { (yyval.string)= (yyvsp[(1) - (1)].string); ;} @@ -2063,17 +2064,17 @@ yyreduce: case 63: /* Line 1464 of yacc.c */ -#line 438 "libmemcached/options/parser.yy" +#line 441 "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 449 "libmemcached/options/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_CONSISTENT; ;} @@ -2082,7 +2083,7 @@ yyreduce: case 65: /* Line 1464 of yacc.c */ -#line 450 "libmemcached/options/parser.yy" +#line 453 "libmemcached/options/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_MODULA; ;} @@ -2091,7 +2092,7 @@ yyreduce: case 66: /* Line 1464 of yacc.c */ -#line 454 "libmemcached/options/parser.yy" +#line 457 "libmemcached/options/parser.yy" { (yyval.distribution)= MEMCACHED_DISTRIBUTION_RANDOM; ;} @@ -2100,7 +2101,7 @@ yyreduce: /* Line 1464 of yacc.c */ -#line 2104 "libmemcached/options/parser.cc" +#line 2105 "libmemcached/options/parser.cc" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -2312,7 +2313,7 @@ yyreturn: /* Line 1684 of yacc.c */ -#line 459 "libmemcached/options/parser.yy" +#line 462 "libmemcached/options/parser.yy" void Context::start()