Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
7529d57a
Commit
7529d57a
authored
Aug 06, 2002
by
bar@bar.udmsearch.izhnet.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New file to generate a html page to review a charset
parent
3be1219f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
106 additions
and
1 deletion
+106
-1
.bzrignore
.bzrignore
+1
-0
mysys/Makefile.am
mysys/Makefile.am
+5
-1
mysys/charset2html.c
mysys/charset2html.c
+100
-0
No files found.
.bzrignore
View file @
7529d57a
...
@@ -479,3 +479,4 @@ vio/test-sslclient
...
@@ -479,3 +479,4 @@ vio/test-sslclient
vio/test-sslserver
vio/test-sslserver
vio/viotest-ssl
vio/viotest-ssl
tests/client_test
tests/client_test
mysys/charset2html
mysys/Makefile.am
View file @
7529d57a
...
@@ -53,10 +53,11 @@ EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
...
@@ -53,10 +53,11 @@ EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c
thr_mutex.c thr_rwlock.c
libmysys_a_LIBADD
=
@THREAD_LOBJECTS@
libmysys_a_LIBADD
=
@THREAD_LOBJECTS@
# test_fn removed 980815 since it not upp to date test_dir
# test_fn removed 980815 since it not upp to date test_dir
noinst_PROGRAMS
=
test_charset @THREAD_LPROGRAMS@
noinst_PROGRAMS
=
test_charset
charset2html
@THREAD_LPROGRAMS@
# test_dir_DEPENDENCIES= $(LIBRARIES)
# test_dir_DEPENDENCIES= $(LIBRARIES)
# testhash_DEPENDENCIES= $(LIBRARIES)
# testhash_DEPENDENCIES= $(LIBRARIES)
test_charset_DEPENDENCIES
=
$(LIBRARIES)
test_charset_DEPENDENCIES
=
$(LIBRARIES)
charset2html_DEPENDENCIES
=
$(LIBRARIES)
EXTRA_PROGRAMS
=
EXTRA_PROGRAMS
=
DEFS
=
-DDEFAULT_BASEDIR
=
\"
$(prefix)
\"
\
DEFS
=
-DDEFAULT_BASEDIR
=
\"
$(prefix)
\"
\
-DDATADIR
=
"
\"
$(MYSQLDATAdir)
\"
"
\
-DDATADIR
=
"
\"
$(MYSQLDATAdir)
\"
"
\
...
@@ -109,6 +110,9 @@ test_dir: test_dir.c $(LIBRARIES)
...
@@ -109,6 +110,9 @@ test_dir: test_dir.c $(LIBRARIES)
test_charset
:
test_charset.c $(LIBRARIES)
test_charset
:
test_charset.c $(LIBRARIES)
$(LINK)
$(FLAGS)
-DMAIN
$(srcdir)
/test_charset.c
$(LDADD)
$(LIBS)
$(LINK)
$(FLAGS)
-DMAIN
$(srcdir)
/test_charset.c
$(LDADD)
$(LIBS)
charset2html
:
charset2html.c $(LIBRARIES)
$(LINK)
$(FLAGS)
-DMAIN
$(srcdir)
/charset2html.c
$(LDADD)
$(LIBS)
testhash
:
testhash.c $(LIBRARIES)
testhash
:
testhash.c $(LIBRARIES)
$(LINK)
$(FLAGS)
-DMAIN
$(srcdir)
/testhash.c
$(LDADD)
$(LIBS)
$(LINK)
$(FLAGS)
-DMAIN
$(srcdir)
/testhash.c
$(LDADD)
$(LIBS)
...
...
mysys/charset2html.c
0 → 100644
View file @
7529d57a
/* Copyright (C) 2000 MySQL AB
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
/*
Written by Alexander Barkov to check what
a charset is in your favorite web browser
*/
#include <my_global.h>
#include <m_ctype.h>
#include <my_sys.h>
#include <mysql_version.h>
#include <stdio.h>
typedef
struct
char_info_st
{
int
srt
;
int
uni
;
int
low
;
int
upp
;
int
ctp
;
}
MY_CH
;
static
int
chcmp
(
const
void
*
vf
,
const
void
*
vs
)
{
const
MY_CH
*
f
=
vf
;
const
MY_CH
*
s
=
vs
;
return
f
->
srt
-
s
->
srt
?
f
->
srt
-
s
->
srt
:
f
->
uni
-
s
->
uni
;
}
static
void
print_cs
(
CHARSET_INFO
*
cs
)
{
uint
i
;
MY_CH
ch
[
256
];
printf
(
"<HTML>
\n
"
);
printf
(
"<HEAD>
\n
"
);
printf
(
"</HEAD>
\n
"
);
printf
(
"<BODY><PRE>
\n
"
);
printf
(
"Charset %s
\n
"
,
cs
->
name
);
for
(
i
=
0
;
i
<
256
;
i
++
)
{
ch
[
i
].
srt
=
cs
->
sort_order
[
i
];
ch
[
i
].
uni
=
cs
->
tab_to_uni
[
i
];
ch
[
i
].
low
=
cs
->
tab_to_uni
[
cs
->
to_lower
[
i
]];
ch
[
i
].
upp
=
cs
->
tab_to_uni
[
cs
->
to_upper
[
i
]];
ch
[
i
].
ctp
=
cs
->
ctype
[
i
+
1
];
}
qsort
(
ch
,
256
,
sizeof
(
MY_CH
),
&
chcmp
);
for
(
i
=
1
;
i
<
256
;
i
++
)
{
printf
(
"%d %d &#%d; &#%d; &#%d;
\n
"
,
ch
[
i
].
srt
,
ch
[
i
].
ctp
,
ch
[
i
].
uni
,
ch
[
i
].
low
,
ch
[
i
].
upp
);
}
printf
(
"</PRE></BODY>
\n
"
);
printf
(
"</HTML>
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
const
char
*
the_set
=
MYSQL_CHARSET
;
int
argcnt
=
1
;
my_init
();
if
(
argc
>
argcnt
&&
argv
[
argcnt
][
0
]
==
'-'
&&
argv
[
argcnt
][
1
]
==
'#'
)
DBUG_PUSH
(
argv
[
argcnt
++
]
+
2
);
if
(
argc
>
argcnt
)
the_set
=
argv
[
argcnt
++
];
if
(
argc
>
argcnt
)
charsets_dir
=
argv
[
argcnt
++
];
if
(
set_default_charset_by_name
(
the_set
,
MYF
(
MY_WME
)))
return
1
;
print_cs
(
default_charset_info
);
return
0
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment