comparison src/coding.h @ 89330:ee0338e83a2b

(struct coding_detection_info): New structure. (struct coding_system): Prototype of the member `detector' adjusted. (CODING_ANNOTATE_CHARSET_MASK): New macro.
author Kenichi Handa <handa@m17n.org>
date Mon, 06 Jan 2003 11:36:42 +0000
parents 0da59936bc31
children 95c081cdbd5f
comparison
equal deleted inserted replaced
89329:09b1e9e39787 89330:ee0338e83a2b
289 enum utf_16_bom_type bom; 289 enum utf_16_bom_type bom;
290 enum utf_16_endian_type endian; 290 enum utf_16_endian_type endian;
291 int surrogate; 291 int surrogate;
292 }; 292 };
293 293
294 struct coding_detection_info
295 {
296 /* Values of these members are bitwise-OR of CATEGORY_MASK_XXXs. */
297 /* Which categories are already checked. */
298 int checked;
299 /* Which categories are strongly found. */
300 int found;
301 /* Which categories are rejected. */
302 int rejected;
303 };
304
305
294 struct coding_system 306 struct coding_system
295 { 307 {
296 /* ID number of the coding system. This is an index to 308 /* ID number of the coding system. This is an index to
297 Vcoding_system_hash_table. This value is set by 309 Vcoding_system_hash_table. This value is set by
298 setup_coding_system. At the early stage of building time, this 310 setup_coding_system. At the early stage of building time, this
381 unsigned char carryover[64]; 393 unsigned char carryover[64];
382 int carryover_bytes; 394 int carryover_bytes;
383 395
384 int default_char; 396 int default_char;
385 397
386 int (*detector) P_ ((struct coding_system *, int *)); 398 int (*detector) P_ ((struct coding_system *,
399 struct coding_detection_info *));
387 void (*decoder) P_ ((struct coding_system *)); 400 void (*decoder) P_ ((struct coding_system *));
388 int (*encoder) P_ ((struct coding_system *)); 401 int (*encoder) P_ ((struct coding_system *));
389 }; 402 };
390 403
391 /* Meanings of bits in the member `common_flags' of the structure 404 /* Meanings of bits in the member `common_flags' of the structure
392 coding_system. The lowest 8 bits are reserved for various kind of 405 coding_system. The lowest 8 bits are reserved for various kind of
393 annotations (currently two of them are used). */ 406 annotations (currently two of them are used). */
394 #define CODING_ANNOTATION_MASK 0x00FF 407 #define CODING_ANNOTATION_MASK 0x00FF
395 #define CODING_ANNOTATE_COMPOSITION_MASK 0x0001 408 #define CODING_ANNOTATE_COMPOSITION_MASK 0x0001
396 #define CODING_ANNOTATE_DIRECTION_MASK 0x0002 409 #define CODING_ANNOTATE_DIRECTION_MASK 0x0002
410 #define CODING_ANNOTATE_CHARSET_MASK 0x0003
397 #define CODING_FOR_UNIBYTE_MASK 0x0100 411 #define CODING_FOR_UNIBYTE_MASK 0x0100
398 #define CODING_REQUIRE_FLUSHING_MASK 0x0200 412 #define CODING_REQUIRE_FLUSHING_MASK 0x0200
399 #define CODING_REQUIRE_DECODING_MASK 0x0400 413 #define CODING_REQUIRE_DECODING_MASK 0x0400
400 #define CODING_REQUIRE_ENCODING_MASK 0x0800 414 #define CODING_REQUIRE_ENCODING_MASK 0x0800
401 #define CODING_REQUIRE_DETECTION_MASK 0x1000 415 #define CODING_REQUIRE_DETECTION_MASK 0x1000