4 * Revision 1.1 2001/04/04 05:43:38 wang
5 * First commit: compiles on Linux, Amiga, Windows, Windows CE, generic gcc
7 * Revision 1.2 1999/03/01 11:07:22 bnv
8 * Added '{..}' to avoid nesting if () {} else {} errors.
10 * Revision 1.1 1998/07/02 17:18:00 bnv
17 /* ---------------- Ltranslate ------------------- */
19 Ltranslate( const PLstr to
, const PLstr from
,
20 const PLstr tableout
, const PLstr tablein
, const char pad
)
25 Lstrcpy(to
,from
); L2STR(to
);
30 if (tableout
) L2STR(tableout
);
31 if (tablein
) L2STR(tablein
);
34 for (i
=LLEN(*tablein
)-1; i
>=0; i
--)
36 if (i
>=LLEN(*tableout
))
37 table
[(byte
)LSTR(*tablein
)[i
]]=pad
;
39 table
[(byte
)LSTR(*tablein
)[i
]]=LSTR(*tableout
)[i
];
41 table
[(byte
)LSTR(*tablein
)[i
]] = pad
;
45 if (i
>= LLEN(*tableout
))
48 table
[i
] = LSTR(*tableout
)[i
];
52 for (i
=0; i
<LLEN(*to
); i
++)
53 LSTR(*to
)[i
] = table
[ (byte
) LSTR(*to
)[i
] ];