comparison src/file-coding.h @ 398:74fd4e045ea6 r21-2-29

Import from CVS: tag r21-2-29
author cvs
date Mon, 13 Aug 2007 11:13:30 +0200
parents 6719134a07c2
children 697ef44129c6
comparison
equal deleted inserted replaced
397:f4aeb21a5bad 398:74fd4e045ea6
22 /* Synched up with: Mule 2.3. Not in FSF. */ 22 /* Synched up with: Mule 2.3. Not in FSF. */
23 23
24 /* 91.10.09 written by K.Handa <handa@etl.go.jp> */ 24 /* 91.10.09 written by K.Handa <handa@etl.go.jp> */
25 /* Rewritten by Ben Wing <ben@xemacs.org>. */ 25 /* Rewritten by Ben Wing <ben@xemacs.org>. */
26 26
27 #ifndef _XEMACS_MULE_CODING_H_ 27 #ifndef INCLUDED_file_coding_h_
28 #define _XEMACS_MULE_CODING_H_ 28 #define INCLUDED_file_coding_h_
29 29
30 struct decoding_stream; 30 struct decoding_stream;
31 struct encoding_stream; 31 struct encoding_stream;
32 32
33 /* Coding system types. These go into the TYPE field of a 33 /* Coding system types. These go into the TYPE field of a
34 struct Lisp_Coding_System. */ 34 Lisp_Coding_System. */
35 35
36 enum coding_system_type 36 enum coding_system_type
37 { 37 {
38 CODESYS_AUTODETECT, /* Automatic conversion. */ 38 CODESYS_AUTODETECT, /* Automatic conversion. */
39 #ifdef MULE 39 #ifdef MULE
82 struct Lisp_Coding_System 82 struct Lisp_Coding_System
83 { 83 {
84 struct lcrecord_header header; 84 struct lcrecord_header header;
85 85
86 /* Name and doc string of this coding system. */ 86 /* Name and doc string of this coding system. */
87 Lisp_Object name, doc_string; 87 Lisp_Object name;
88 Lisp_Object doc_string;
88 89
89 /* This is the major type of the coding system -- one of Big5, ISO2022, 90 /* This is the major type of the coding system -- one of Big5, ISO2022,
90 Shift-JIS, etc. See the constants above. */ 91 Shift-JIS, etc. See the constants above. */
91 enum coding_system_type type; 92 enum coding_system_type type;
92 93
93 /* Mnemonic string displayed in the modeline when this coding 94 /* Mnemonic string displayed in the modeline when this coding
94 system is active for a particular buffer. */ 95 system is active for a particular buffer. */
95 Lisp_Object mnemonic; 96 Lisp_Object mnemonic;
96 97
97 Lisp_Object post_read_conversion, pre_write_conversion; 98 Lisp_Object post_read_conversion;
98 99 Lisp_Object pre_write_conversion;
99 enum eol_type eol_type; 100
101 eol_type_t eol_type;
100 102
101 /* Subsidiary coding systems that specify a particular type of EOL 103 /* Subsidiary coding systems that specify a particular type of EOL
102 marking, rather than autodetecting it. These will only be non-nil 104 marking, rather than autodetecting it. These will only be non-nil
103 if (eol_type == EOL_AUTODETECT). */ 105 if (eol_type == EOL_AUTODETECT). */
104 Lisp_Object eol_lf, eol_crlf, eol_cr; 106 Lisp_Object eol_lf;
107 Lisp_Object eol_crlf;
108 Lisp_Object eol_cr;
105 #ifdef MULE 109 #ifdef MULE
106 struct 110 struct
107 { 111 {
108 /* What are the charsets to be initially designated to G0, G1, 112 /* What are the charsets to be initially designated to G0, G1,
109 G2, G3? If t, no charset is initially designated. If nil, 113 G2, G3? If t, no charset is initially designated. If nil,
128 } iso2022; 132 } iso2022;
129 struct 133 struct
130 { 134 {
131 /* For a CCL coding system, these specify the CCL programs used for 135 /* For a CCL coding system, these specify the CCL programs used for
132 decoding (input) and encoding (output). */ 136 decoding (input) and encoding (output). */
133 Lisp_Object decode, encode; 137 Lisp_Object decode;
138 Lisp_Object encode;
134 } ccl; 139 } ccl;
135 #endif 140 #endif
136 }; 141 };
137 typedef struct Lisp_Coding_System Lisp_Coding_System; 142 typedef struct Lisp_Coding_System Lisp_Coding_System;
138 143
139 DECLARE_LRECORD (coding_system, struct Lisp_Coding_System); 144 DECLARE_LRECORD (coding_system, Lisp_Coding_System);
140 #define XCODING_SYSTEM(x) XRECORD (x, coding_system, struct Lisp_Coding_System) 145 #define XCODING_SYSTEM(x) XRECORD (x, coding_system, Lisp_Coding_System)
141 #define XSETCODING_SYSTEM(x, p) XSETRECORD (x, p, coding_system) 146 #define XSETCODING_SYSTEM(x, p) XSETRECORD (x, p, coding_system)
142 #define CODING_SYSTEMP(x) RECORDP (x, coding_system) 147 #define CODING_SYSTEMP(x) RECORDP (x, coding_system)
143 #define GC_CODING_SYSTEMP(x) GC_RECORDP (x, coding_system)
144 #define CHECK_CODING_SYSTEM(x) CHECK_RECORD (x, coding_system) 148 #define CHECK_CODING_SYSTEM(x) CHECK_RECORD (x, coding_system)
145 #define CONCHECK_CODING_SYSTEM(x) CONCHECK_RECORD (x, coding_system) 149 #define CONCHECK_CODING_SYSTEM(x) CONCHECK_RECORD (x, coding_system)
146 150
147 #define CODING_SYSTEM_NAME(codesys) ((codesys)->name) 151 #define CODING_SYSTEM_NAME(codesys) ((codesys)->name)
148 #define CODING_SYSTEM_DOC_STRING(codesys) ((codesys)->doc_string) 152 #define CODING_SYSTEM_DOC_STRING(codesys) ((codesys)->doc_string)
248 EXFUN (Fset_coding_category_system, 2); 252 EXFUN (Fset_coding_category_system, 2);
249 EXFUN (Fset_coding_priority_list, 1); 253 EXFUN (Fset_coding_priority_list, 1);
250 EXFUN (Fsubsidiary_coding_system, 2); 254 EXFUN (Fsubsidiary_coding_system, 2);
251 255
252 extern Lisp_Object Qucs4, Qutf8; 256 extern Lisp_Object Qucs4, Qutf8;
253 extern Lisp_Object Qbig5, Qbuffer_file_coding_system, Qccl, Qcharset_g0; 257 extern Lisp_Object Qbig5, Qccl, Qcharset_g0;
254 extern Lisp_Object Qcharset_g1, Qcharset_g2, Qcharset_g3, Qcoding_system_error; 258 extern Lisp_Object Qcharset_g1, Qcharset_g2, Qcharset_g3, Qcoding_system_error;
255 extern Lisp_Object Qcoding_system_p, Qcr, Qcrlf, Qctext, Qdecode, Qencode; 259 extern Lisp_Object Qcoding_systemp, Qcr, Qcrlf, Qdecode, Qencode;
256 extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qescape_quoted; 260 extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qescape_quoted;
257 extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output; 261 extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output;
258 extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output; 262 extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output;
259 extern Lisp_Object Qinput_charset_conversion, Qiso2022, Qlf, Qlock_shift; 263 extern Lisp_Object Qinput_charset_conversion, Qiso2022, Qlf, Qlock_shift;
260 extern Lisp_Object Qmnemonic, Qno_ascii_cntl, Qno_ascii_eol, Qno_conversion; 264 extern Lisp_Object Qmnemonic, Qno_ascii_cntl, Qno_ascii_eol, Qno_conversion;
265 extern Lisp_Object Qraw_text;
261 extern Lisp_Object Qno_iso6429, Qoutput_charset_conversion; 266 extern Lisp_Object Qno_iso6429, Qoutput_charset_conversion;
262 extern Lisp_Object Qpost_read_conversion, Qpre_write_conversion, Qseven; 267 extern Lisp_Object Qpost_read_conversion, Qpre_write_conversion, Qseven;
263 extern Lisp_Object Qshift_jis, Qshort, Vcoding_system_for_read; 268 extern Lisp_Object Qshift_jis, Qshort, Vcoding_system_for_read;
264 extern Lisp_Object Vcoding_system_for_write, Vcoding_system_hash_table; 269 extern Lisp_Object Vcoding_system_for_write, Vcoding_system_hash_table;
265 extern Lisp_Object Vfile_name_coding_system, Vkeyboard_coding_system; 270 extern Lisp_Object Vfile_name_coding_system, Vkeyboard_coding_system;
498 void set_decoding_stream_coding_system (Lstream *stream, 503 void set_decoding_stream_coding_system (Lstream *stream,
499 Lisp_Object codesys); 504 Lisp_Object codesys);
500 void set_encoding_stream_coding_system (Lstream *stream, 505 void set_encoding_stream_coding_system (Lstream *stream,
501 Lisp_Object codesys); 506 Lisp_Object codesys);
502 void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out, 507 void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out,
503 enum eol_type *eol_type_in_out); 508 eol_type_t *eol_type_in_out);
504 509
505 510
506 #ifndef MULE 511 #ifndef MULE
507 #define MIN_LEADING_BYTE 0x80 512 #define MIN_LEADING_BYTE 0x80
508 /* These need special treatment in a string and/or character */ 513 /* These need special treatment in a string and/or character */
513 #define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */ 518 #define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */
514 #define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20) 519 #define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20)
515 #define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0) 520 #define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0)
516 #define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c) 521 #define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c)
517 #endif /* not MULE */ 522 #endif /* not MULE */
518 #endif /* _XEMACS_MULE_CODING_H_ */ 523
519 524 #endif /* INCLUDED_file_coding_h_ */
525