| 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 | |
| 23 | extern "C" |
| 24 | { |
| 25 | typedef int (*process_key_cache_t) (const char *, KEY_CACHE *, void *); |
| 26 | } |
| 27 | |
| 28 | class NAMED_ILINK; |
| 29 | |
| 30 | class 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 */ |
| 38 | extern LEX_CSTRING default_key_cache_base; |
| 39 | extern KEY_CACHE zero_key_cache; |
| 40 | extern NAMED_ILIST key_caches; |
| 41 | |
| 42 | KEY_CACHE *create_key_cache(const char *name, size_t length); |
| 43 | KEY_CACHE *get_key_cache(const LEX_CSTRING *cache_name); |
| 44 | KEY_CACHE *get_or_create_key_cache(const char *name, size_t length); |
| 45 | void free_key_cache(const char *name, KEY_CACHE *key_cache); |
| 46 | bool process_key_caches(process_key_cache_t func, void *param); |
| 47 | |
| 48 | /* For Rpl_filter */ |
| 49 | extern LEX_CSTRING default_rpl_filter_base; |
| 50 | extern NAMED_ILIST rpl_filters; |
| 51 | |
| 52 | Rpl_filter *create_rpl_filter(const char *name, size_t length); |
| 53 | Rpl_filter *get_rpl_filter(LEX_CSTRING *filter_name); |
| 54 | Rpl_filter *get_or_create_rpl_filter(const char *name, size_t length); |
| 55 | void free_rpl_filter(const char *name, Rpl_filter *filter); |
| 56 | void free_all_rpl_filters(void); |
| 57 | |
| 58 | #endif /* KEYCACHES_INCLUDED */ |
| 59 | |