1#ifndef KEYCACHES_INCLUDED
2#define KEYCACHES_INCLUDED
3
4/* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; version 2 of the License.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
18
19#include "sql_list.h"
20#include <keycache.h>
21#include <rpl_filter.h>
22
23extern "C"
24{
25 typedef int (*process_key_cache_t) (const char *, KEY_CACHE *, void *);
26}
27
28class NAMED_ILINK;
29
30class NAMED_ILIST: public I_List<NAMED_ILINK>
31{
32 public:
33 void delete_elements(void (*free_element)(const char*, uchar*));
34 bool delete_element(const char *name, size_t length, void (*free_element)(const char*, uchar*));
35};
36
37/* For key cache */
38extern LEX_CSTRING default_key_cache_base;
39extern KEY_CACHE zero_key_cache;
40extern NAMED_ILIST key_caches;
41
42KEY_CACHE *create_key_cache(const char *name, size_t length);
43KEY_CACHE *get_key_cache(const LEX_CSTRING *cache_name);
44KEY_CACHE *get_or_create_key_cache(const char *name, size_t length);
45void free_key_cache(const char *name, KEY_CACHE *key_cache);
46bool process_key_caches(process_key_cache_t func, void *param);
47
48/* For Rpl_filter */
49extern LEX_CSTRING default_rpl_filter_base;
50extern NAMED_ILIST rpl_filters;
51
52Rpl_filter *create_rpl_filter(const char *name, size_t length);
53Rpl_filter *get_rpl_filter(LEX_CSTRING *filter_name);
54Rpl_filter *get_or_create_rpl_filter(const char *name, size_t length);
55void free_rpl_filter(const char *name, Rpl_filter *filter);
56void free_all_rpl_filters(void);
57
58#endif /* KEYCACHES_INCLUDED */
59