XEmacs 21.2.29 "Hestia".
[chise/xemacs-chise.git.1] / src / mule-charset.h
index 07f72df..9e1ee3b 100644 (file)
@@ -23,8 +23,8 @@ Boston, MA 02111-1307, USA.  */
 
 /* Rewritten by Ben Wing <ben@xemacs.org>. */
 
-#ifndef _XEMACS_MULE_CHARSET_H
-#define _XEMACS_MULE_CHARSET_H
+#ifndef INCLUDED_mule_charset_h_
+#define INCLUDED_mule_charset_h_
 
 /*
    1. Character Sets
@@ -239,7 +239,7 @@ Boston, MA 02111-1307, USA.  */
 
    Character set               Encoding (PC == position-code)
    -------------               -------- (LB == leading-byte)
-   ASCII                       PC1 |
+   ASCII                       PC1  |
    Control-1                   LB   | PC1 + 0xA0
    Dimension-1 official                LB   | PC1 + 0x80
    Dimension-1 private         0x9E | LB         | PC1 + 0x80
@@ -456,7 +456,10 @@ struct Lisp_Charset
 
   int id;
   Lisp_Object name;
-  Lisp_Object doc_string, registry, short_name, long_name;
+  Lisp_Object doc_string;
+  Lisp_Object registry;
+  Lisp_Object short_name;
+  Lisp_Object long_name;
 
   Lisp_Object reverse_direction_charset;
 
@@ -489,9 +492,10 @@ struct Lisp_Charset
   /* Which half of font to be used to display this character set */
   unsigned int graphic;
 };
+typedef struct Lisp_Charset Lisp_Charset;
 
-DECLARE_LRECORD (charset, struct Lisp_Charset);
-#define XCHARSET(x) XRECORD (x, charset, struct Lisp_Charset)
+DECLARE_LRECORD (charset, Lisp_Charset);
+#define XCHARSET(x) XRECORD (x, charset, Lisp_Charset)
 #define XSETCHARSET(x, p) XSETRECORD (x, p, charset)
 #define CHARSETP(x) RECORDP (x, charset)
 #define CHECK_CHARSET(x) CHECK_RECORD (x, charset)
@@ -550,24 +554,13 @@ DECLARE_LRECORD (charset, struct Lisp_Charset);
 struct charset_lookup {
   /* Table of charsets indexed by leading byte. */
   Lisp_Object charset_by_leading_byte[128];
-  
+
   /* Table of charsets indexed by type/final-byte/direction. */
   Lisp_Object charset_by_attributes[4][128][2];
 };
 
 extern struct charset_lookup *chlook;
 
-/* Table of number of bytes in the string representation of a character
-   indexed by the first byte of that representation.
-
-   This value can be derived other ways -- e.g. something like
-
-   (BYTE_ASCII_P (first_byte) ? 1 :
-    XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (first_byte)))
-
-   but it's faster this way. */
-extern Bytecount rep_bytes_by_first_byte[0xA0];
-
 #ifdef ERROR_CHECK_TYPECHECK
 /* int not Bufbyte even though that is the actual type of a leading byte.
    This way, out-ot-range values will get caught rather than automatically
@@ -589,21 +582,26 @@ CHARSET_BY_LEADING_BYTE (int lb)
 #define CHARSET_BY_ATTRIBUTES(type, final, dir) \
   (chlook->charset_by_attributes[type][final][dir])
 
-#ifdef ERROR_CHECK_TYPECHECK
 
-/* Number of bytes in the string representation of a character */
+/* Table of number of bytes in the string representation of a character
+   indexed by the first byte of that representation.
+
+   This value can be derived in other ways -- e.g. something like
+   XCHARSET_REP_BYTES (CHARSET_BY_LEADING_BYTE (first_byte))
+   but it's faster this way. */
+extern const Bytecount rep_bytes_by_first_byte[0xA0];
+
+/* Number of bytes in the string representation of a character. */
 INLINE int REP_BYTES_BY_FIRST_BYTE (int fb);
 INLINE int
 REP_BYTES_BY_FIRST_BYTE (int fb)
 {
-  assert (fb >= 0 && fb < 0xA0);
+#ifdef ERROR_CHECK_TYPECHECK
+  assert (0 <= fb && fb < 0xA0);
+#endif
   return rep_bytes_by_first_byte[fb];
 }
 
-#else
-#define REP_BYTES_BY_FIRST_BYTE(fb) (rep_bytes_by_first_byte[fb])
-#endif
-
 \f
 /************************************************************************/
 /*                        Dealing with characters                       */
@@ -788,9 +786,9 @@ Emchar Lstream_get_emchar_1 (Lstream *stream, int first_char);
 int Lstream_fput_emchar (Lstream *stream, Emchar ch);
 void Lstream_funget_emchar (Lstream *stream, Emchar ch);
 
-int copy_internal_to_external (CONST Bufbyte *internal, Bytecount len,
+int copy_internal_to_external (const Bufbyte *internal, Bytecount len,
                               unsigned char *external);
-Bytecount copy_external_to_internal (CONST unsigned char *external,
+Bytecount copy_external_to_internal (const unsigned char *external,
                                     int len, Bufbyte *internal);
 
-#endif /* _XEMACS_MULE_CHARSET_H */
+#endif /* INCLUDED_mule_charset_h_ */