1/* Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
2
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; version 2 of the License.
6
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 GNU General Public License for more details.
11
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
15
16#ifndef STRFUNC_INCLUDED
17#define STRFUNC_INCLUDED
18
19typedef struct st_typelib TYPELIB;
20
21ulonglong find_set(TYPELIB *lib, const char *x, size_t length, CHARSET_INFO *cs,
22 char **err_pos, uint *err_len, bool *set_warning);
23ulonglong find_set_from_flags(TYPELIB *lib, uint default_name,
24 ulonglong cur_set, ulonglong default_set,
25 const char *str, uint length, CHARSET_INFO *cs,
26 char **err_pos, uint *err_len, bool *set_warning);
27uint find_type(const TYPELIB *lib, const char *find, size_t length,
28 bool part_match);
29uint find_type2(const TYPELIB *lib, const char *find, size_t length,
30 CHARSET_INFO *cs);
31void unhex_type2(TYPELIB *lib);
32uint check_word(TYPELIB *lib, const char *val, const char *end,
33 const char **end_of_word);
34int find_string_in_array(LEX_CSTRING * const haystack,
35 LEX_CSTRING * const needle,
36 CHARSET_INFO * const cs);
37const char *flagset_to_string(THD *thd, LEX_CSTRING *result, ulonglong set,
38 const char *lib[]);
39const char *set_to_string(THD *thd, LEX_CSTRING *result, ulonglong set,
40 const char *lib[]);
41
42/*
43 These functions were protected by INNODB_COMPATIBILITY_HOOKS
44 */
45uint strconvert(CHARSET_INFO *from_cs, const char *from, size_t from_length,
46 CHARSET_INFO *to_cs, char *to, size_t to_length, uint *errors);
47
48#endif /* STRFUNC_INCLUDED */
49