comparison src/file-coding.h @ 412:697ef44129c6 r21-2-14

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