~drizzle-trunk/drizzle/development

1241.9.57 by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined.
1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 *
4
 *  Copyright (C) 2008 Sun Microsystems
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
20
#ifndef DRIZZLED_CHARSET_H
21
#define DRIZZLED_CHARSET_H
22
23
#include <cstddef>
24
#include "drizzled/definitions.h"
25
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
26
namespace drizzled
27
{
28
1241.9.57 by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined.
29
typedef struct charset_info_st CHARSET_INFO;
30
31
extern CHARSET_INFO *all_charsets[256];
32
extern CHARSET_INFO compiled_charsets[];
33
1280.1.10 by Monty Taylor
Put everything in drizzled into drizzled namespace.
34
/* character sets */
35
void *cs_alloc(size_t size);
36
37
extern uint32_t get_charset_number(const char *cs_name, uint32_t cs_flags);
38
extern uint32_t get_collation_number(const char *name);
39
extern const char *get_charset_name(uint32_t cs_number);
40
41
extern const CHARSET_INFO *get_charset(uint32_t cs_number);
42
extern const CHARSET_INFO *get_charset_by_name(const char *cs_name);
43
extern const CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint32_t cs_flags);
44
45
extern bool resolve_charset(const char *cs_name,
46
			    const CHARSET_INFO *default_cs,
47
			    const CHARSET_INFO **cs);
48
extern bool resolve_collation(const char *cl_name,
49
			     const CHARSET_INFO *default_cl,
50
			     const CHARSET_INFO **cl);
51
52
extern void free_charsets(void);
53
extern char *get_charsets_dir(char *buf);
54
extern bool my_charset_same(const CHARSET_INFO *cs1, const CHARSET_INFO *cs2);
55
extern bool init_compiled_charsets(myf flags);
56
extern void add_compiled_collation(CHARSET_INFO *cs);
57
extern size_t escape_string_for_drizzle(const CHARSET_INFO *charset_info,
58
					char *to, size_t to_length,
59
					const char *from, size_t length);
60
extern size_t escape_quotes_for_drizzle(const CHARSET_INFO *charset_info,
61
					char *to, size_t to_length,
62
					const char *from, size_t length);
63
/* character sets */
64
void *cs_alloc(size_t size);
65
66
extern uint32_t get_charset_number(const char *cs_name, uint32_t cs_flags);
67
extern uint32_t get_collation_number(const char *name);
68
extern const char *get_charset_name(uint32_t cs_number);
69
70
extern const CHARSET_INFO *get_charset(uint32_t cs_number);
71
extern const CHARSET_INFO *get_charset_by_name(const char *cs_name);
72
extern const CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint32_t cs_flags);
73
74
extern bool resolve_charset(const char *cs_name,
75
			    const CHARSET_INFO *default_cs,
76
			    const CHARSET_INFO **cs);
77
extern bool resolve_collation(const char *cl_name,
78
			     const CHARSET_INFO *default_cl,
79
			     const CHARSET_INFO **cl);
80
81
extern void free_charsets(void);
82
extern char *get_charsets_dir(char *buf);
83
extern bool my_charset_same(const CHARSET_INFO *cs1, const CHARSET_INFO *cs2);
84
extern bool init_compiled_charsets(myf flags);
85
extern void add_compiled_collation(CHARSET_INFO *cs);
86
extern size_t escape_string_for_drizzle(const CHARSET_INFO *charset_info,
87
					char *to, size_t to_length,
88
					const char *from, size_t length);
89
extern size_t escape_quotes_for_drizzle(const CHARSET_INFO *charset_info,
90
					char *to, size_t to_length,
91
					const char *from, size_t length);
92
93
} /* namespace drizzled */
1241.9.57 by Monty Taylor
Oy. Bigger change than I normally like - but this stuff is all intertwined.
94
95
#endif /* DRIZZLED_CHARSET_H */