1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2008 Sun Microsystems
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.
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.
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
1
/* Copyright (C) 2000 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
20
16
#ifndef DRIZZLE_SERVER_SQL_STRING_H
21
17
#define DRIZZLE_SERVER_SQL_STRING_H
23
19
/* This file is originally from the mysql distribution. Coded by monty */
21
#ifdef USE_PRAGMA_INTERFACE
22
#pragma interface /* gcc class implementation */
26
25
#ifndef NOT_FIXED_DEC
27
26
#define NOT_FIXED_DEC 31
30
#include <drizzled/common.h>
31
#include <mysys/iocache.h>
34
30
int sortcmp(const String *a,const String *b, const CHARSET_INFO * const cs);
35
31
String *copy_if_not_alloced(String *a,String *b,uint32_t arg_length);
36
32
uint32_t copy_and_convert(char *to, uint32_t to_length, const CHARSET_INFO * const to_cs,
37
33
const char *from, uint32_t from_length,
38
const CHARSET_INFO * const from_cs, uint32_t *errors);
34
const CHARSET_INFO * const from_cs, uint *errors);
39
35
uint32_t well_formed_copy_nchars(const CHARSET_INFO * const to_cs,
40
char *to, uint32_t to_length,
36
char *to, uint to_length,
41
37
const CHARSET_INFO * const from_cs,
42
const char *from, uint32_t from_length,
38
const char *from, uint from_length,
44
40
const char **well_formed_error_pos,
45
41
const char **cannot_convert_error_pos,
46
42
const char **from_end_pos);
257
253
const CHARSET_INFO * const cs);
258
254
bool set_or_copy_aligned(const char *s, uint32_t arg_length, const CHARSET_INFO * const cs);
259
255
bool copy(const char*s,uint32_t arg_length, const CHARSET_INFO * const csfrom,
260
const CHARSET_INFO * const csto, uint32_t *errors);
256
const CHARSET_INFO * const csto, uint *errors);
261
257
bool append(const String &s);
262
258
bool append(const char *s);
263
259
bool append(const char *s,uint32_t arg_length);