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 */
17
* make a charset .conf file out of a ctype-charset.c file.
21
#error You must define the charset, e.g.: -DCHARSET=latin1
24
/* some pre-processor tricks to get us going */
25
#define _STRINGIZE_HELPER(x) #x
26
#define STRINGIZE(x) _STRINGIZE_HELPER(x)
28
#define _JOIN_WORDS_HELPER(a, b) a ## b
29
#define JOIN_WORDS(a, b) _JOIN_WORDS_HELPER(a, b)
31
#define CH_SRC ctype- ## CHARSET ## .c
32
#define CH_INCLUDE STRINGIZE(CH_SRC)
34
/* aaaah, that's better */
35
#include <my_my_global.h>
43
void print_array(const char *name, const uchar *array, uint size);
47
printf("# Configuration file for the "
51
print_array("ctype", JOIN_WORDS(ctype_, CHARSET), 257);
52
print_array("to_lower", JOIN_WORDS(to_lower_, CHARSET), 256);
53
print_array("to_upper", JOIN_WORDS(to_upper_, CHARSET), 256);
54
print_array("sort_order", JOIN_WORDS(sort_order_, CHARSET), 256);
59
void print_array(const char *name, const uchar *array, uint size)
63
printf("\n# The %s array must have %d elements.\n", name, size);
65
for (i = 0; i < size; ++i) {
66
printf(" %02X", array[i]);
68
if ((i+1) % ROW_LEN == size % ROW_LEN)