~eday/drizzle/eday-dev

« back to all changes in this revision

Viewing changes to drizzled/charset.h

  • Committer: Eric Day
  • Date: 2010-01-07 20:02:38 UTC
  • mfrom: (971.3.291 staging)
  • Revision ID: eday@oddments.org-20100107200238-uqw8v6kv9pl7nny5
Merged trunk.

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
 
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
typedef struct charset_info_st CHARSET_INFO;
 
27
 
 
28
extern CHARSET_INFO *all_charsets[256];
 
29
extern CHARSET_INFO compiled_charsets[];
 
30
 
 
31
#ifdef __cplusplus
 
32
extern "C" {
 
33
#endif
 
34
 
 
35
/* character sets */
 
36
void *cs_alloc(size_t size);
 
37
 
 
38
extern uint32_t get_charset_number(const char *cs_name, uint32_t cs_flags);
 
39
extern uint32_t get_collation_number(const char *name);
 
40
extern const char *get_charset_name(uint32_t cs_number);
 
41
 
 
42
extern const CHARSET_INFO *get_charset(uint32_t cs_number);
 
43
extern const CHARSET_INFO *get_charset_by_name(const char *cs_name);
 
44
extern const CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint32_t cs_flags);
 
45
 
 
46
extern bool resolve_charset(const char *cs_name,
 
47
                            const CHARSET_INFO *default_cs,
 
48
                            const CHARSET_INFO **cs);
 
49
extern bool resolve_collation(const char *cl_name,
 
50
                             const CHARSET_INFO *default_cl,
 
51
                             const CHARSET_INFO **cl);
 
52
 
 
53
extern void free_charsets(void);
 
54
extern char *get_charsets_dir(char *buf);
 
55
extern bool my_charset_same(const CHARSET_INFO *cs1, const CHARSET_INFO *cs2);
 
56
extern bool init_compiled_charsets(myf flags);
 
57
extern void add_compiled_collation(CHARSET_INFO *cs);
 
58
extern size_t escape_string_for_drizzle(const CHARSET_INFO *charset_info,
 
59
                                        char *to, size_t to_length,
 
60
                                        const char *from, size_t length);
 
61
extern size_t escape_quotes_for_drizzle(const CHARSET_INFO *charset_info,
 
62
                                        char *to, size_t to_length,
 
63
                                        const char *from, size_t length);
 
64
/* character sets */
 
65
void *cs_alloc(size_t size);
 
66
 
 
67
extern uint32_t get_charset_number(const char *cs_name, uint32_t cs_flags);
 
68
extern uint32_t get_collation_number(const char *name);
 
69
extern const char *get_charset_name(uint32_t cs_number);
 
70
 
 
71
extern const CHARSET_INFO *get_charset(uint32_t cs_number);
 
72
extern const CHARSET_INFO *get_charset_by_name(const char *cs_name);
 
73
extern const CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint32_t cs_flags);
 
74
 
 
75
extern bool resolve_charset(const char *cs_name,
 
76
                            const CHARSET_INFO *default_cs,
 
77
                            const CHARSET_INFO **cs);
 
78
extern bool resolve_collation(const char *cl_name,
 
79
                             const CHARSET_INFO *default_cl,
 
80
                             const CHARSET_INFO **cl);
 
81
 
 
82
extern void free_charsets(void);
 
83
extern char *get_charsets_dir(char *buf);
 
84
extern bool my_charset_same(const CHARSET_INFO *cs1, const CHARSET_INFO *cs2);
 
85
extern bool init_compiled_charsets(myf flags);
 
86
extern void add_compiled_collation(CHARSET_INFO *cs);
 
87
extern size_t escape_string_for_drizzle(const CHARSET_INFO *charset_info,
 
88
                                        char *to, size_t to_length,
 
89
                                        const char *from, size_t length);
 
90
extern size_t escape_quotes_for_drizzle(const CHARSET_INFO *charset_info,
 
91
                                        char *to, size_t to_length,
 
92
                                        const char *from, size_t length);
 
93
 
 
94
#ifdef __cplusplus
 
95
}
 
96
#endif
 
97
 
 
98
#endif /* DRIZZLED_CHARSET_H */