From c45592efbf11481ae06d62fc0422315683614f93 Mon Sep 17 00:00:00 2001 From: cuz Date: Wed, 29 Nov 2000 15:18:39 +0000 Subject: [PATCH] New TgtTranslateBuf function git-svn-id: svn://svn.cc65.org/cc65/trunk@492 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/common/tgttrans.c | 20 ++++++++++++++++++++ src/common/tgttrans.h | 5 +++++ 2 files changed, 25 insertions(+) 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 */ -- 2.39.5