X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Ffile-coding.h;h=8b0f997d8e6c66dc7b776b3adae537ea1367ba7d;hb=1894110054d123642709400d4e65c7d72c6e0134;hp=4b9c8769aa8a9e828a1e64c1689f348befb77a86;hpb=c8aa261a7bf3eb1389d2e018be1d715f73cacd66;p=chise%2Fxemacs-chise.git diff --git a/src/file-coding.h b/src/file-coding.h index 4b9c876..8b0f997 100644 --- a/src/file-coding.h +++ b/src/file-coding.h @@ -1,6 +1,7 @@ /* Header for code conversion stuff Copyright (C) 1991, 1995 Free Software Foundation, Inc. Copyright (C) 1995 Sun Microsystems, Inc. + Copyright (C) 1999,2000,2002 MORIOKA Tomohiko This file is part of XEmacs. @@ -139,7 +140,9 @@ struct Lisp_Coding_System } ccl; #endif #ifdef UTF2000 - char disable_composition; + unsigned int disable_composition :1; + unsigned int use_entity_reference :1; + Lisp_Object ccs_priority_list; #endif }; typedef struct Lisp_Coding_System Lisp_Coding_System; @@ -187,6 +190,10 @@ DECLARE_LRECORD (coding_system, Lisp_Coding_System); #ifdef UTF2000 #define CODING_SYSTEM_DISABLE_COMPOSITION(codesys) \ ((codesys)->disable_composition) +#define CODING_SYSTEM_USE_ENTITY_REFERENCE(codesys) \ + ((codesys)->use_entity_reference) +#define CODING_SYSTEM_CCS_PRIORITY_LIST(codesys) \ + ((codesys)->ccs_priority_list) #endif #define XCODING_SYSTEM_NAME(codesys) \ @@ -237,6 +244,8 @@ DECLARE_LRECORD (coding_system, Lisp_Coding_System); #ifdef UTF2000 #define XCODING_SYSTEM_DISABLE_COMPOSITION(codesys) \ CODING_SYSTEM_DISABLE_COMPOSITION (XCODING_SYSTEM (codesys)) +#define XCODING_SYSTEM_USE_ENTITY_REFERENCE(codesys) \ + CODING_SYSTEM_USE_ENTITY_REFERENCE (XCODING_SYSTEM (codesys)) #endif EXFUN (Fcoding_category_list, 0); @@ -419,32 +428,50 @@ enum iso_esc_flag #define ISO_CODE_CSI 0x9B /* control-sequence-introduce */ #endif /* MULE */ -/* For detecting the encoding of text */ +/* Distinguishable categories of encodings. + + This list determines the initial priority of the categories. + + For better or worse, currently Mule files are encoded in 7-bit ISO 2022. + For this reason, under Mule ISO_7 gets highest priority. + + Putting NO_CONVERSION second prevents "binary corruption" in the + default case in all but the (presumably) extremely rare case of a + binary file which contains redundant escape sequences but no 8-bit + characters. + + The remaining priorities are based on perceived "internationalization + political correctness." An exception is UCS-4 at the bottom, since + basically everything is compatible with UCS-4, but it is likely to + be very rare as an external encoding. */ + enum coding_category_type { + /* must be a contiguous range of values 0 -- CODING_CATEGORY_LAST - 1 */ #ifdef MULE - CODING_CATEGORY_SHIFT_JIS, CODING_CATEGORY_ISO_7, /* ISO2022 system using only seven-bit bytes, no locking shift */ - CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes, - no locking shift, no single shift, - using designation to switch charsets */ + CODING_CATEGORY_NO_CONVERSION, + CODING_CATEGORY_UTF8, CODING_CATEGORY_ISO_8_1, /* ISO2022 system using eight-bit bytes, no locking shift, no designation sequences, one-dimension characters in the upper half. */ CODING_CATEGORY_ISO_8_2, /* ISO2022 system using eight-bit bytes, no locking shift, no designation sequences, two-dimension characters in the upper half. */ + CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes, + no locking shift, no single shift, + using designation to switch charsets */ CODING_CATEGORY_ISO_LOCK_SHIFT, /* ISO2022 system using locking shift */ + CODING_CATEGORY_SHIFT_JIS, CODING_CATEGORY_BIG5, CODING_CATEGORY_UCS4, - CODING_CATEGORY_UTF8, +#else /* not MULE */ + CODING_CATEGORY_NO_CONVERSION, #endif /* MULE */ - CODING_CATEGORY_NO_CONVERSION + CODING_CATEGORY_LAST /* not a real coding category */ }; -#define CODING_CATEGORY_LAST CODING_CATEGORY_NO_CONVERSION - #ifdef MULE #define CODING_CATEGORY_SHIFT_JIS_MASK \ (1 << CODING_CATEGORY_SHIFT_JIS)