X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Fmule-charset.h;h=30bc569cc218bfbba7a568a2bffa02526210f851;hb=2cbece6401b2279497293e6dc54cda607f49db2f;hp=3d51fdca643b306f8be6b8d7daddbb2e38725719;hpb=81572e9b4653c5545c2eb43e87dec439f356c19c;p=chise%2Fxemacs-chise.git- diff --git a/src/mule-charset.h b/src/mule-charset.h index 3d51fdc..30bc569 100644 --- a/src/mule-charset.h +++ b/src/mule-charset.h @@ -23,8 +23,8 @@ Boston, MA 02111-1307, USA. */ /* Rewritten by Ben Wing . */ -#ifndef _XEMACS_MULE_CHARSET_H -#define _XEMACS_MULE_CHARSET_H +#ifndef INCLUDED_mule_charset_h_ +#define INCLUDED_mule_charset_h_ /* 1. Character Sets @@ -324,7 +324,7 @@ Boston, MA 02111-1307, USA. */ /* Definition of leading bytes */ /************************************************************************/ -typedef int Charset_ID; +typedef unsigned char Charset_ID; #define MIN_LEADING_BYTE 0x80 /* These need special treatment in a string and/or character */ @@ -403,8 +403,8 @@ enum LEADING_BYTE_OFFICIAL_2 /* Is this a prefix for a private leading byte? */ -INLINE int LEADING_BYTE_PREFIX_P (unsigned char lb); -INLINE int +INLINE_HEADER int LEADING_BYTE_PREFIX_P (unsigned char lb); +INLINE_HEADER int LEADING_BYTE_PREFIX_P (unsigned char lb) { return (lb == PRE_LEADING_BYTE_PRIVATE_1 || @@ -458,7 +458,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; @@ -491,9 +494,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) @@ -552,9 +556,12 @@ DECLARE_LRECORD (charset, struct Lisp_Charset); struct charset_lookup { /* Table of charsets indexed by (leading byte - MIN_LEADING_BYTE). */ Lisp_Object charset_by_leading_byte[NUM_LEADING_BYTES]; - + /* Table of charsets indexed by type/final-byte/direction. */ Lisp_Object charset_by_attributes[4][128][2]; + + Charset_ID next_allocated_1_byte_leading_byte; + Charset_ID next_allocated_2_byte_leading_byte; }; extern struct charset_lookup *chlook; @@ -563,8 +570,8 @@ extern struct charset_lookup *chlook; /* 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 truncated. */ -INLINE Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); -INLINE Lisp_Object +INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (int lb); +INLINE_HEADER Lisp_Object CHARSET_BY_LEADING_BYTE (int lb) { assert (lb >= MIN_LEADING_BYTE && @@ -592,8 +599,8 @@ CHARSET_BY_LEADING_BYTE (int lb) 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 +INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE (int fb); +INLINE_HEADER int REP_BYTES_BY_FIRST_BYTE (int fb) { #ifdef ERROR_CHECK_TYPECHECK @@ -671,8 +678,8 @@ REP_BYTES_BY_FIRST_BYTE (int fb) FIELD2_TO_PRIVATE_LEADING_BYTE are the same. */ -INLINE Bufbyte CHAR_LEADING_BYTE (Emchar c); -INLINE Bufbyte +INLINE_HEADER Bufbyte CHAR_LEADING_BYTE (Emchar c); +INLINE_HEADER Bufbyte CHAR_LEADING_BYTE (Emchar c) { if (CHAR_ASCII_P (c)) @@ -706,8 +713,8 @@ CHAR_LEADING_BYTE (Emchar c) FIELD2_TO_PRIVATE_LEADING_BYTE are the same. */ -INLINE Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2); -INLINE Emchar +INLINE_HEADER Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2); +INLINE_HEADER Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2) { if (EQ (charset, Vcharset_ascii)) @@ -744,8 +751,8 @@ MAKE_CHAR (Lisp_Object charset, int c1, int c2) : ((c1) = CHAR_FIELD2 (c), \ (c2) = CHAR_FIELD3 (c)) -INLINE void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2); -INLINE void +INLINE_HEADER void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2); +INLINE_HEADER void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2) { *charset = CHAR_CHARSET (c); @@ -782,9 +789,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_ */