From 4f29597e4f3696a59bb08ffece07183c1568c4a5 Mon Sep 17 00:00:00 2001 From: tomo Date: Mon, 12 Jun 2000 08:11:02 +0000 Subject: [PATCH] (CHAR_TO_CHARC): New inline function. --- src/char-1byte.h | 11 +++++++++++ src/char-lb.h | 10 ++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/char-1byte.h b/src/char-1byte.h index 75aaab6..d31c89c 100644 --- a/src/char-1byte.h +++ b/src/char-1byte.h @@ -90,6 +90,17 @@ typedef struct Charc unsigned char code_point; } Charc; +INLINE_HEADER Charc CHAR_TO_CHARC (Emchar ch); +INLINE_HEADER Charc +CHAR_TO_CHARC (Emchar ch) +{ + Charc cc; + + cc.charset = Vcharset_ascii; + cc.code_point = ch; + return cc; +} + /************************************************************************/ /* Exported functions */ diff --git a/src/char-lb.h b/src/char-lb.h index 156ba93..f358560 100644 --- a/src/char-lb.h +++ b/src/char-lb.h @@ -75,4 +75,14 @@ typedef struct Charc unsigned short code_point; } Charc; +INLINE_HEADER Charc CHAR_TO_CHARC (Emchar ch); +INLINE_HEADER Charc +CHAR_TO_CHARC (Emchar ch) +{ + Charc cc; + + cc.code_point = encode_char_1 (ch, &cc.charset); + return cc; +} + #endif /* _XEMACS_CHAR_LB_H */ -- 1.7.10.4