#include <my_global.h>#include <m_ctype.h>#include <my_sys.h>#include <mysql_version.h>#include <stdio.h>Include dependency graph for charset2html.c:

Go to the source code of this file.
Classes | |
| struct | char_info_st |
Typedefs | |
| typedef char_info_st | MY_CH |
Functions | |
| static int | chcmp (const void *vf, const void *vs) |
| static void | print_cs (CHARSET_INFO *cs) |
| static void | print_index () |
| int | main (int argc, char **argv) |
| typedef struct char_info_st MY_CH |
| static int chcmp | ( | const void * | vf, | |
| const void * | vs | |||
| ) | [static] |
Definition at line 40 of file charset2html.c.
References f, char_info_st::srt, and char_info_st::uni.
Referenced by print_cs().
00041 { 00042 const MY_CH *f=vf; 00043 const MY_CH *s=vs; 00044 00045 return f->srt-s->srt ? f->srt-s->srt : f->uni-s->uni; 00046 }
Here is the caller graph for this function:

| int main | ( | int | argc, | |
| char ** | argv | |||
| ) |
Definition at line 145 of file charset2html.c.
References charsets_dir, DBUG_PUSH, get_charset_by_name(), getenv(), my_init(), MY_WME, MYF, NULL, print_cs(), and print_index().
00145 { 00146 const char *the_set = NULL; 00147 int argcnt = 1; 00148 CHARSET_INFO *cs; 00149 00150 if (getenv("SCRIPT_NAME")) 00151 { 00152 printf("Content-Type: text/html\r\n\r\n"); 00153 } 00154 my_init(); 00155 00156 if (argc > argcnt && argv[argcnt][0] == '-' && argv[argcnt][1] == '#') 00157 DBUG_PUSH(argv[argcnt++]+2); 00158 00159 if (argc > argcnt) 00160 the_set = argv[argcnt++]; 00161 00162 if (argc > argcnt) 00163 charsets_dir = argv[argcnt++]; 00164 00165 if (!the_set) 00166 { 00167 print_index(); 00168 return 0; 00169 } 00170 00171 if (!(cs= get_charset_by_name(the_set, MYF(MY_WME)))) 00172 return 1; 00173 00174 print_cs(cs); 00175 00176 return 0; 00177 }
Here is the call graph for this function:

| static void print_cs | ( | CHARSET_INFO * | cs | ) | [static] |
Definition at line 48 of file charset2html.c.
References _MY_B, _MY_CTR, _MY_L, _MY_NMR, _MY_PNT, _MY_SPC, _MY_U, _MY_X, chcmp(), char_info_st::ctp, charset_info_st::ctype, char_info_st::low, charset_info_st::name, qsort(), charset_info_st::sort_order, char_info_st::srt, charset_info_st::tab_to_uni, charset_info_st::to_lower, charset_info_st::to_upper, char_info_st::uni, and char_info_st::upp.
Referenced by main().
00049 { 00050 uint i; 00051 int srt; 00052 int clr=0; 00053 MY_CH ch[256]; 00054 00055 printf("<HTML>\n"); 00056 printf("<HEAD>\n"); 00057 printf("</HEAD>\n"); 00058 printf("<BODY><PRE>\n"); 00059 printf("Charset %s\n",cs->name); 00060 00061 printf("<TABLE>\n"); 00062 printf("<TR><TH>Code<TH>Uni<TH>Sort<TH>Ctype<TH>Ch<TH>Lo<TH>Up</TR>"); 00063 00064 for (i=0; i<256; i++) 00065 { 00066 ch[i].cod=i; 00067 ch[i].srt=cs->sort_order ? cs->sort_order[i] : i; 00068 ch[i].uni=cs->tab_to_uni[i]; 00069 ch[i].low=cs->tab_to_uni[cs->to_lower[i]]; 00070 ch[i].upp=cs->tab_to_uni[cs->to_upper[i]]; 00071 ch[i].ctp=cs->ctype[i+1]; 00072 } 00073 00074 qsort(ch,256,sizeof(MY_CH),&chcmp); 00075 srt=ch[0].srt; 00076 00077 for (i=0; i<256; i++) 00078 { 00079 clr = (srt!=ch[i].srt) ? !clr : clr; 00080 00081 printf("<TR bgcolor=#%s>",clr ? "DDDDDD" : "EEEE99"); 00082 printf("<TD>%02X",ch[i].cod); 00083 printf("<TD>%04X",ch[i].uni); 00084 printf("<TD>%02X",ch[i].srt); 00085 00086 printf("<TD>%s%s%s%s%s%s%s%s", 00087 ch[i].ctp & _MY_U ? "U" : "", 00088 ch[i].ctp & _MY_L ? "L" : "", 00089 ch[i].ctp & _MY_NMR ? "N" : "", 00090 ch[i].ctp & _MY_SPC ? "S" : "", 00091 ch[i].ctp & _MY_PNT ? "P" : "", 00092 ch[i].ctp & _MY_CTR ? "C" : "", 00093 ch[i].ctp & _MY_B ? "B" : "", 00094 ch[i].ctp & _MY_X ? "X" : ""); 00095 00096 if ((ch[i].uni >= 0x80) && (ch[i].uni <= 0x9F)) 00097 { 00098 /* 00099 Control characters 0x0080..0x009F are dysplayed by some 00100 browers as if they were letters. Don't print them to 00101 avoid confusion. 00102 */ 00103 printf("<TD>ctrl<TD>ctrl<TD>ctrl"); 00104 } 00105 else 00106 { 00107 printf("<TD>&#%d;",ch[i].uni); 00108 printf("<TD>&#%d;",ch[i].low); 00109 printf("<TD>&#%d;",ch[i].upp); 00110 } 00111 printf("</TR>\n"); 00112 srt=ch[i].srt; 00113 } 00114 printf("</TABLE>\n"); 00115 printf("</PRE></BODY>\n"); 00116 printf("</HTML>\n"); 00117 }
Here is the call graph for this function:

Here is the caller graph for this function:

| static void print_index | ( | ) | [static] |
Definition at line 119 of file charset2html.c.
References all_charsets, comment, get_charset_by_name(), MY_CS_BINSORT, MY_CS_COMPILED, MY_CS_PRIMARY, MYF, and name.
Referenced by main().
00120 { 00121 CHARSET_INFO **cs; 00122 int clr=0; 00123 00124 get_charset_by_name("",MYF(0)); /* To execute init_available_charsets */ 00125 00126 printf("All charsets\n"); 00127 printf("<table border=1>\n"); 00128 printf("<tr bgcolor=EEEE99><th>ID<th>Charset<th>Collation<th>Def<th>Bin<th>Com<th>Comment\n"); 00129 for (cs=all_charsets ; cs < all_charsets+256; cs++) 00130 { 00131 if (!cs[0]) 00132 continue; 00133 printf("<tr bgcolor=#%s><td><a href=\"?%s\">%d</a><td>%s<td>%s<td>%s<td>%s<td>%s<td>%s\n", 00134 (clr= !clr) ? "DDDDDD" : "EEEE99", 00135 cs[0]->name,cs[0]->number,cs[0]->csname, 00136 cs[0]->name, 00137 (cs[0]->state & MY_CS_PRIMARY) ? "def " : " ", 00138 (cs[0]->state & MY_CS_BINSORT) ? "bin " : " ", 00139 (cs[0]->state & MY_CS_COMPILED) ? "com " : " ", 00140 cs[0]->comment); 00141 } 00142 printf("</table>\n"); 00143 }
Here is the call graph for this function:

Here is the caller graph for this function:

1.4.7

