~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/charset.h

Merge Stewart's dead code removal

Show diffs side-by-side

added added

removed removed

Lines of Context:
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, Inc.
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
 
 
26
 
#include "drizzled/visibility.h"
27
 
 
28
 
namespace drizzled
29
 
{
30
 
 
31
 
typedef struct charset_info_st CHARSET_INFO;
32
 
 
33
 
extern DRIZZLED_API CHARSET_INFO *all_charsets[256];
34
 
extern CHARSET_INFO compiled_charsets[];
35
 
 
36
 
/* character sets */
37
 
void *cs_alloc(size_t size);
38
 
 
39
 
extern uint32_t get_charset_number(const char *cs_name, uint32_t cs_flags);
40
 
extern uint32_t get_collation_number(const char *name);
41
 
extern const char *get_charset_name(uint32_t cs_number);
42
 
 
43
 
DRIZZLED_API const CHARSET_INFO *get_charset(uint32_t cs_number);
44
 
DRIZZLED_API const CHARSET_INFO *get_charset_by_name(const char *cs_name);
45
 
DRIZZLED_API const CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint32_t cs_flags);
46
 
 
47
 
extern bool resolve_charset(const char *cs_name,
48
 
                            const CHARSET_INFO *default_cs,
49
 
                            const CHARSET_INFO **cs);
50
 
extern bool resolve_collation(const char *cl_name,
51
 
                             const CHARSET_INFO *default_cl,
52
 
                             const CHARSET_INFO **cl);
53
 
 
54
 
extern void free_charsets(void);
55
 
extern char *get_charsets_dir(char *buf);
56
 
extern bool my_charset_same(const CHARSET_INFO *cs1, const CHARSET_INFO *cs2);
57
 
extern bool init_compiled_charsets(myf flags);
58
 
extern void add_compiled_collation(CHARSET_INFO *cs);
59
 
extern size_t escape_string_for_drizzle(const CHARSET_INFO *charset_info,
60
 
                                        char *to, size_t to_length,
61
 
                                        const char *from, size_t length);
62
 
extern size_t escape_quotes_for_drizzle(const CHARSET_INFO *charset_info,
63
 
                                        char *to, size_t to_length,
64
 
                                        const char *from, size_t length);
65
 
 
66
 
} /* namespace drizzled */
67
 
 
68
 
#endif /* DRIZZLED_CHARSET_H */