summaryrefslogtreecommitdiff
path: root/mysys/test_charset.c
diff options
context:
space:
mode:
authorunknown <bar@bar.udmsearch.izhnet.ru>2002-07-30 11:03:08 +0500
committerunknown <bar@bar.udmsearch.izhnet.ru>2002-07-30 11:03:08 +0500
commitebdc990b69455548fa412a22286b302f0c1a1322 (patch)
tree8e5d7e5a5ae5d35be085b25c8465af32a78bce59 /mysys/test_charset.c
parent8059cfabe04f97bc7acbf2b88de9306f1c5651cd (diff)
downloadmariadb-git-ebdc990b69455548fa412a22286b302f0c1a1322.tar.gz
move _print_charset to proper place
Diffstat (limited to 'mysys/test_charset.c')
-rw-r--r--mysys/test_charset.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/mysys/test_charset.c b/mysys/test_charset.c
index 224a4120614..5e623584355 100644
--- a/mysys/test_charset.c
+++ b/mysys/test_charset.c
@@ -21,7 +21,38 @@
#include <stdio.h>
-extern void _print_csinfo(CHARSET_INFO *cs);
+static void _print_array(uint8 *data, uint size)
+{
+ uint i;
+ for (i = 0; i < size; ++i)
+ {
+ if (i == 0 || i % 16 == size % 16) printf(" ");
+ printf(" %02x", data[i]);
+ if ((i+1) % 16 == size % 16) printf("\n");
+ }
+}
+
+static void _print_csinfo(CHARSET_INFO *cs)
+{
+ printf("%s #%d\n", cs->name, cs->number);
+ printf("ctype:\n"); _print_array(cs->ctype, 257);
+ printf("to_lower:\n"); _print_array(cs->to_lower, 256);
+ printf("to_upper:\n"); _print_array(cs->to_upper, 256);
+ printf("sort_order:\n"); _print_array(cs->sort_order, 256);
+ printf("collate: %3s (%d, %p, %p, %p)\n",
+ cs->strxfrm_multiply ? "yes" : "no",
+ cs->strxfrm_multiply,
+ cs->strnncoll,
+ cs->strnxfrm,
+ cs->like_range);
+ printf("multi-byte: %3s (%d, %p, %p, %p)\n",
+ cs->mbmaxlen ? "yes" : "no",
+ cs->mbmaxlen,
+ cs->ismbchar,
+ cs->ismbhead,
+ cs->mbcharlen);
+}
+
int main(int argc, char **argv) {
const char *the_set = MYSQL_CHARSET;