Drizzled Public API Documentation

charset.h
00001 /* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
00002  *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
00003  *
00004  *  Copyright (C) 2008 Sun Microsystems, Inc.
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; version 2 of the License.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018  */
00019 
00020 #pragma once
00021 
00022 #include <cstddef>
00023 #include <drizzled/definitions.h>
00024 
00025 #include <drizzled/visibility.h>
00026 
00027 namespace drizzled
00028 {
00029 
00030 typedef struct charset_info_st CHARSET_INFO;
00031 
00032 extern DRIZZLED_API CHARSET_INFO *all_charsets[256];
00033 extern CHARSET_INFO compiled_charsets[];
00034 
00035 extern uint32_t get_charset_number(const char *cs_name, uint32_t cs_flags);
00036 extern uint32_t get_collation_number(const char *name);
00037 extern const char *get_charset_name(uint32_t cs_number);
00038 
00039 DRIZZLED_API const CHARSET_INFO *get_charset(uint32_t cs_number);
00040 DRIZZLED_API const CHARSET_INFO *get_charset_by_name(const char *cs_name);
00041 DRIZZLED_API const CHARSET_INFO *get_charset_by_csname(const char *cs_name, uint32_t cs_flags);
00042 
00043 extern bool resolve_charset(const char *cs_name,
00044           const CHARSET_INFO *default_cs,
00045           const CHARSET_INFO **cs);
00046 extern bool resolve_collation(const char *cl_name,
00047            const CHARSET_INFO *default_cl,
00048            const CHARSET_INFO **cl);
00049 
00050 extern void free_charsets(void);
00051 extern char *get_charsets_dir(char *buf);
00052 extern bool my_charset_same(const CHARSET_INFO *cs1, const CHARSET_INFO *cs2);
00053 extern bool init_compiled_charsets(myf flags);
00054 extern void add_compiled_collation(CHARSET_INFO *cs);
00055 extern size_t escape_string_for_drizzle(const CHARSET_INFO *charset_info,
00056           char *to, size_t to_length,
00057           const char *from, size_t length);
00058 extern size_t escape_quotes_for_drizzle(const CHARSET_INFO *charset_info,
00059           char *to, size_t to_length,
00060           const char *from, size_t length);
00061 
00062 } /* namespace drizzled */
00063