version 1.66, 2008/08/21 21:01:47 |
version 1.67, 2010/03/25 18:52:29 |
|
|
unsigned char sch, dch; |
unsigned char sch, dch; |
static char frombis[257]; |
static char frombis[257]; |
static char tobis[257]; |
static char tobis[257]; |
|
int i; |
|
char seen[256]; |
static unsigned char mapvec[256] = { |
static unsigned char mapvec[256] = { |
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, |
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, |
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, |
19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, |
|
|
* create a mapping between "from" and |
* create a mapping between "from" and |
* "to" |
* "to" |
*/ |
*/ |
while (*from) |
for (i = 0; i < 256; i++) |
mapvec[(unsigned char)(*from++)] = (*to) ? |
seen[i] = 0; |
(unsigned char)(*to++) : 0; |
while (*from) { |
|
if (!seen[(unsigned char)(*from)]) { |
|
mapvec[(unsigned char)(*from)] = (unsigned char)(*to); |
|
seen[(unsigned char)(*from)] = 1; |
|
} |
|
from++; |
|
if (*to) |
|
to++; |
|
} |
|
|
while (*src) { |
while (*src) { |
sch = (unsigned char)(*src++); |
sch = (unsigned char)(*src++); |