From: tomo Date: Mon, 12 Jun 2000 08:11:02 +0000 (+0000) Subject: (CHAR_TO_CHARC): New inline function. X-Git-Tag: r21-2-34-utf-2000-0_16-1~45 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4f29597e4f3696a59bb08ffece07183c1568c4a5;p=chise%2Fxemacs-chise.git.1 (CHAR_TO_CHARC): New inline function. --- 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 */