Drizzled Public API Documentation

typelib.h

00001 /* Copyright (C) 2000 MySQL AB
00002 
00003    This program is free software; you can redistribute it and/or modify
00004    it under the terms of the GNU General Public License as published by
00005    the Free Software Foundation; version 2 of the License.
00006 
00007    This program is distributed in the hope that it will be useful,
00008    but WITHOUT ANY WARRANTY; without even the implied warranty of
00009    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010    GNU General Public License for more details.
00011 
00012    You should have received a copy of the GNU General Public License
00013    along with this program; if not, write to the Free Software
00014    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
00015 
00016 
00017 #pragma once
00018 
00019 #include <drizzled/global_charset_info.h>
00020 #include <drizzled/memory/root.h>
00021 
00022 namespace drizzled
00023 {
00024 
00025 typedef struct st_typelib 
00026 {
00027 public:
00028   st_typelib *copy_typelib(memory::Root *root) const;
00029   int find_type_or_exit(const char *x, const char *option) const;
00030   int find_type(const char *x, unsigned int full_name) const;
00031   int find_type(char *x, unsigned int full_name) const;
00032   uint64_t find_typeset(const char *x, int *error_position) const;
00033   const char *get_type(unsigned int nr) const;
00034   void make_type(char *to, unsigned int nr) const;
00035 
00036   uint64_t find_set(const char *x, uint32_t length, const CHARSET_INFO *cs,
00037                     char **err_pos, uint32_t *err_len, bool *set_warning) const;
00038   uint32_t find_type(const char *find, uint32_t length, bool part_match) const;
00039   uint32_t find_type2(const char *find, uint32_t length, const CHARSET_INFO *cs) const;
00040 
00041   unsigned int count;
00042   const char *name;
00043   const char **type_names;
00044   unsigned int *type_lengths;
00045 } TYPELIB;
00046 
00047 } /* namespace drizzled */
00048