(CHAR_TO_CHARC): New inline function.
authortomo <tomo>
Mon, 12 Jun 2000 08:11:02 +0000 (08:11 +0000)
committertomo <tomo>
Mon, 12 Jun 2000 08:11:02 +0000 (08:11 +0000)
src/char-1byte.h
src/char-lb.h

index 75aaab6..d31c89c 100644 (file)
@@ -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;
+}
+
 \f
 /************************************************************************/
 /*                            Exported functions                        */
index 156ba93..f358560 100644 (file)
@@ -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 */