summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-11-04 22:29:00 +0100
committerunknown <serg@serg.mylan>2004-11-04 22:29:00 +0100
commit7b72401c5f469028b374a69783dd8fc5bbf84966 (patch)
treedd3f43e4363d187e0227964fdda2406de51190d0 /mysys
parent1ce11fe0416512f9a9a4133cd7feaf2c68a483d8 (diff)
downloadmariadb-git-7b72401c5f469028b374a69783dd8fc5bbf84966.tar.gz
dbug: DBUG_EXECUTE_IF macro, build user manual automatically, document all features
charset2html moved from mysys to extra ignore: new files added, garbage removed extra/charset2html.c: Rename: mysys/charset2html.c -> extra/charset2html.c configure.in: remove historical difference between test_thr_alarm, test_thr_lock and six newer mysys/test_* programs build dbug after mysys dbug/Makefile.am: build utils and examples, build manual dbug/dbug.c: cleanup DBUG_EXECUTE_IF macro dbug/dbug_analyze.c: fix it to run dbug/dbug_long.h: warning added dbug/main.c: fix it to run dbug/user.r: formating cleanup all undocumented features documented extra/Makefile.am: charset2html moved from mysys include/my_dbug.h: DBUG_EXECUTE_IF() macro mysys/Makefile.am: charset2html moved to extra BitKeeper/etc/ignore: new files added, garbage removed
Diffstat (limited to 'mysys')
-rw-r--r--mysys/Makefile.am4
-rw-r--r--mysys/charset2html.c177
2 files changed, 0 insertions, 181 deletions
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index 3ffeeab0411..8eae7551f34 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -57,7 +57,6 @@ libmysys_a_SOURCES = my_init.c my_getwd.c mf_getdate.c \
EXTRA_DIST = thr_alarm.c thr_lock.c my_pthread.c my_thr_init.c \
thr_mutex.c thr_rwlock.c
libmysys_a_LIBADD = @THREAD_LOBJECTS@
-noinst_PROGRAMS = charset2html @THREAD_LPROGRAMS@
# test_dir_DEPENDENCIES= $(LIBRARIES)
# testhash_DEPENDENCIES= $(LIBRARIES)
# test_charset_DEPENDENCIES= $(LIBRARIES)
@@ -105,9 +104,6 @@ test_dir$(EXEEXT): test_dir.c $(LIBRARIES)
test_charset$(EXEEXT): test_charset.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_charset.c $(LDADD) $(LIBS)
-charset2html$(EXEEXT): charset2html.c $(LIBRARIES)
- $(LINK) $(FLAGS) -DMAIN $(srcdir)/charset2html.c $(LDADD) $(LIBS)
-
testhash$(EXEEXT): testhash.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/testhash.c $(LDADD) $(LIBS)
diff --git a/mysys/charset2html.c b/mysys/charset2html.c
deleted file mode 100644
index 96862ff16a1..00000000000
--- a/mysys/charset2html.c
+++ /dev/null
@@ -1,177 +0,0 @@
-/* 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 cod;
- 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;
- int srt;
- int clr=0;
- MY_CH ch[256];
-
- printf("<HTML>\n");
- printf("<HEAD>\n");
- printf("</HEAD>\n");
- printf("<BODY><PRE>\n");
- printf("Charset %s\n",cs->name);
-
- printf("<TABLE>\n");
- printf("<TR><TH>Code<TH>Uni<TH>Sort<TH>Ctype<TH>Ch<TH>Lo<TH>Up</TR>");
-
- for (i=0; i<256; i++)
- {
- ch[i].cod=i;
- ch[i].srt=cs->sort_order ? cs->sort_order[i] : 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);
- srt=ch[0].srt;
-
- for (i=0; i<256; i++)
- {
- clr = (srt!=ch[i].srt) ? !clr : clr;
-
- printf("<TR bgcolor=#%s>",clr ? "DDDDDD" : "EEEE99");
- printf("<TD>%02X",ch[i].cod);
- printf("<TD>%04X",ch[i].uni);
- printf("<TD>%02X",ch[i].srt);
-
- printf("<TD>%s%s%s%s%s%s%s%s",
- ch[i].ctp & _MY_U ? "U" : "",
- ch[i].ctp & _MY_L ? "L" : "",
- ch[i].ctp & _MY_NMR ? "N" : "",
- ch[i].ctp & _MY_SPC ? "S" : "",
- ch[i].ctp & _MY_PNT ? "P" : "",
- ch[i].ctp & _MY_CTR ? "C" : "",
- ch[i].ctp & _MY_B ? "B" : "",
- ch[i].ctp & _MY_X ? "X" : "");
-
- if ((ch[i].uni >= 0x80) && (ch[i].uni <= 0x9F))
- {
- /*
- Control characters 0x0080..0x009F are dysplayed by some
- browers as if they were letters. Don't print them to
- avoid confusion.
- */
- printf("<TD>ctrl<TD>ctrl<TD>ctrl");
- }
- else
- {
- printf("<TD>&#%d;",ch[i].uni);
- printf("<TD>&#%d;",ch[i].low);
- printf("<TD>&#%d;",ch[i].upp);
- }
- printf("</TR>\n");
- srt=ch[i].srt;
- }
- printf("</TABLE>\n");
- printf("</PRE></BODY>\n");
- printf("</HTML>\n");
-}
-
-static void print_index()
-{
- CHARSET_INFO **cs;
- int clr=0;
-
- get_charset_by_name("",MYF(0)); /* To execute init_available_charsets */
-
- printf("All charsets\n");
- printf("<table border=1>\n");
- printf("<tr bgcolor=EEEE99><th>ID<th>Charset<th>Collation<th>Def<th>Bin<th>Com<th>Comment\n");
- for (cs=all_charsets ; cs < all_charsets+256; cs++)
- {
- if (!cs[0])
- continue;
- printf("<tr bgcolor=#%s><td><a href=\"?%s\">%d</a><td>%s<td>%s<td>%s<td>%s<td>%s<td>%s\n",
- (clr= !clr) ? "DDDDDD" : "EEEE99",
- cs[0]->name,cs[0]->number,cs[0]->csname,
- cs[0]->name,
- (cs[0]->state & MY_CS_PRIMARY) ? "def " : "&nbsp;",
- (cs[0]->state & MY_CS_BINSORT) ? "bin " : "&nbsp;",
- (cs[0]->state & MY_CS_COMPILED) ? "com " : "&nbsp;",
- cs[0]->comment);
- }
- printf("</table>\n");
-}
-
-int main(int argc, char **argv) {
- const char *the_set = NULL;
- int argcnt = 1;
- CHARSET_INFO *cs;
-
- if (getenv("SCRIPT_NAME"))
- {
- printf("Content-Type: text/html\r\n\r\n");
- }
- 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 (!the_set)
- {
- print_index();
- return 0;
- }
-
- if (!(cs= get_charset_by_name(the_set, MYF(MY_WME))))
- return 1;
-
- print_cs(cs);
-
- return 0;
-}