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 */
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
16
20
#ifndef DRIZZLE_SERVER_SQL_STRING_H
17
21
#define DRIZZLE_SERVER_SQL_STRING_H
19
23
/* This file is originally from the mysql distribution. Coded by monty */
21
#ifdef USE_PRAGMA_INTERFACE
22
#pragma interface /* gcc class implementation */
25
26
#ifndef NOT_FIXED_DEC
26
27
#define NOT_FIXED_DEC 31
30
#include <libdrizzle/drizzle_com.h>
31
#include <mysys/iocache.h>
30
34
int sortcmp(const String *a,const String *b, const CHARSET_INFO * const cs);
31
35
String *copy_if_not_alloced(String *a,String *b,uint32_t arg_length);
32
36
uint32_t copy_and_convert(char *to, uint32_t to_length, const CHARSET_INFO * const to_cs,
33
37
const char *from, uint32_t from_length,
34
const CHARSET_INFO * const from_cs, uint *errors);
38
const CHARSET_INFO * const from_cs, uint32_t *errors);
35
39
uint32_t well_formed_copy_nchars(const CHARSET_INFO * const to_cs,
36
char *to, uint to_length,
40
char *to, uint32_t to_length,
37
41
const CHARSET_INFO * const from_cs,
38
const char *from, uint from_length,
42
const char *from, uint32_t from_length,
40
44
const char **well_formed_error_pos,
41
45
const char **cannot_convert_error_pos,
42
46
const char **from_end_pos);
253
257
const CHARSET_INFO * const cs);
254
258
bool set_or_copy_aligned(const char *s, uint32_t arg_length, const CHARSET_INFO * const cs);
255
259
bool copy(const char*s,uint32_t arg_length, const CHARSET_INFO * const csfrom,
256
const CHARSET_INFO * const csto, uint *errors);
260
const CHARSET_INFO * const csto, uint32_t *errors);
257
261
bool append(const String &s);
258
262
bool append(const char *s);
259
263
bool append(const char *s,uint32_t arg_length);