2 +--------------------------------------------------------------------+
3 | libmemcached - C/C++ Client Library for memcached |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted under the terms of the BSD license. |
7 | You should have received a copy of the license in a bundled file |
8 | named LICENSE; in case you did not receive a copy you can review |
9 | the terms online at: https://opensource.org/licenses/BSD-3-Clause |
10 +--------------------------------------------------------------------+
11 | Copyright (c) 2006-2014 Brian Aker https://datadifferential.com/ |
12 | Copyright (c) 2020 Michael Wallner <mike@php.net> |
13 +--------------------------------------------------------------------+
18 #include "libmemcached/csl/common.h"
19 #include "libmemcached/csl/parser.h"
23 Context(const char *option_string
, size_t option_string_length
, memcached_st
*memc_
,
24 memcached_return_t
&rc_arg
)
30 , length(option_string_length
)
38 rc
= MEMCACHED_SUCCESS
;
40 memc
->state
.is_parsing
= true;
41 memcached_string_create(memc
, &_string_buffer
, 1024);
44 bool end() { return _end
; }
49 rc
= MEMCACHED_SUCCESS
;
53 bool set_hash(memcached_hash_t hash
);
55 void set_server() { _is_server
= true; }
57 void unset_server() { _is_server
= false; }
59 bool is_server() const { return _is_server
; }
61 void hostname(const char *, size_t, server_t
&);
63 bool string_buffer(const char *, size_t, memcached_string_t
&);
65 const char *hostname() const { return _hostname
; }
67 void abort(const char *, config_tokentype
, const char *);
68 void error(const char *, config_tokentype
, const char *);
71 memcached_string_free(&_string_buffer
);
73 memc
->state
.is_parsing
= false;
76 config_tokentype previous_token
;
83 memcached_return_t
&rc
;
87 void destroy_scanner();
92 char _hostname
[NI_MAXHOST
];
94 memcached_string_st _string_buffer
;