From: cuz Date: Wed, 29 Nov 2000 15:18:39 +0000 (+0000) Subject: New TgtTranslateBuf function X-Git-Tag: V2.12.0~3045 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c45592efbf11481ae06d62fc0422315683614f93;p=cc65 New TgtTranslateBuf function git-svn-id: svn://svn.cc65.org/cc65/trunk@492 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/common/tgttrans.c b/src/common/tgttrans.c index ba4e3f5e0..022dafede 100644 --- a/src/common/tgttrans.c +++ b/src/common/tgttrans.c @@ -150,3 +150,23 @@ char* TgtTranslateStr (char* S) +char* TgtTranslateBuf (char* Buf, unsigned Len) +/* Translate a buffer of the given length from the source character set into + * the target system character set. + */ +{ + /* Translate */ + if (Tab) { + unsigned char* B = (unsigned char*)Buf; + while (Len--) { + *B = Tab[*B]; + ++B; + } + } + + /* Return the argument string */ + return Buf; +} + + + diff --git a/src/common/tgttrans.h b/src/common/tgttrans.h index fc5f8aeba..38bdefae8 100644 --- a/src/common/tgttrans.h +++ b/src/common/tgttrans.h @@ -57,6 +57,11 @@ char* TgtTranslateStr (char* S); * system character set. */ +char* TgtTranslateBuf (char* Buf, unsigned Len); +/* Translate a buffer of the given length from the source character set into + * the target system character set. + */ + /* End of tgttrans.h */