~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/charset.cc

  • Committer: Brian Aker
  • Date: 2009-11-12 16:13:04 UTC
  • mfrom: (1211.1.7 staging)
  • Revision ID: brian@gaz-20091112161304-opamiauv36fg0n6u
Rollup of Brian, Padraig, and Stewart patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
 
 
16
 
#include "config.h"
17
 
 
18
 
#include "drizzled/charset.h"
19
 
#include "drizzled/error.h"
20
 
#include "drizzled/charset_info.h"
21
 
#include "drizzled/internal/m_string.h"
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
15
 
 
16
#include "mysys/mysys_priv.h"
 
17
#include "mysys/mysys_err.h"
 
18
#include <mystrings/m_ctype.h>
 
19
#include <mystrings/m_string.h>
22
20
#include <drizzled/configmake.h>
23
21
#include <vector>
24
22
 
25
 
#include "drizzled/visibility.h"
26
 
 
27
23
using namespace std;
28
24
 
29
 
namespace drizzled
30
 
{
31
25
 
32
26
/*
33
27
  We collect memory in this vector that we free on delete.
58
52
       cs < all_charsets+array_elements(all_charsets)-1 ;
59
53
       cs++)
60
54
  {
61
 
    if ( cs[0] && cs[0]->name && !my_strcasecmp(&my_charset_utf8_general_ci, cs[0]->name, name))
62
 
    {
 
55
    if ( cs[0] && cs[0]->name &&
 
56
         !my_strcasecmp(&my_charset_utf8_general_ci, cs[0]->name, name))
63
57
      return cs[0]->number;
64
 
    }
65
58
  }
66
59
  return 0;
67
60
}
131
124
 
132
125
static bool charset_initialized= false;
133
126
 
134
 
DRIZZLED_API CHARSET_INFO *all_charsets[256];
135
 
const DRIZZLED_API CHARSET_INFO *default_charset_info = &my_charset_utf8_general_ci;
 
127
CHARSET_INFO *all_charsets[256];
 
128
const CHARSET_INFO *default_charset_info = &my_charset_utf8_general_ci;
136
129
 
137
130
void add_compiled_collation(CHARSET_INFO * cs)
138
131
{
150
143
}
151
144
 
152
145
 
153
 
 
154
146
static bool init_available_charsets(myf myflags)
155
147
{
156
148
  bool error= false;
216
208
       cs < all_charsets+array_elements(all_charsets)-1 ;
217
209
       cs++)
218
210
  {
219
 
    if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) && !my_strcasecmp(&my_charset_utf8_general_ci, cs[0]->csname, charset_name))
 
211
    if ( cs[0] && cs[0]->csname && (cs[0]->state & cs_flags) &&
 
212
         !my_strcasecmp(&my_charset_utf8_general_ci, cs[0]->csname, charset_name))
220
213
      return cs[0]->number;
221
214
  }
222
215
  return 0;
383
376
  *to= 0;
384
377
  return overflow ? UINT32_MAX : (uint32_t) (to - to_start);
385
378
}
386
 
 
387
 
} /* namespace drizzled */