comparison src/coding.h @ 102423:f23ca4ed51bd

Include "composite.h". (enum compisition_state): New enum. (struct compisition_status): New struct. (struct iso_2022_spec): New member cmp_status. (struct emacs_mule_spec): New struct. (struct coding_system): New members ctext_extended_segment_len and embedded_utf_8. Change the union member spec.emacs_mule_full_support to spec.emacs_mule.
author Kenichi Handa <handa@m17n.org>
date Fri, 06 Mar 2009 07:52:06 +0000
parents a12d39ca6870
children 578826d532dc
comparison
equal deleted inserted replaced
102422:82f82b92314e 102423:f23ca4ed51bd
304 304
305 /* If set, it means that the encoding routines produces some safe 305 /* If set, it means that the encoding routines produces some safe
306 ASCII characters (usually '?') for unsupported characters. */ 306 ASCII characters (usually '?') for unsupported characters. */
307 #define CODING_MODE_SAFE_ENCODING 0x20 307 #define CODING_MODE_SAFE_ENCODING 0x20
308 308
309 /* For handling composition sequence. */
310 #include "composite.h"
311
312 enum composition_state
313 {
314 COMPOSING_NO,
315 COMPOSING_CHAR,
316 COMPOSING_RULE,
317 COMPOSING_COMPONENT_CHAR,
318 COMPOSING_COMPONENT_RULE
319 };
320
321 /* Structure for the current composition status. */
322 struct composition_status
323 {
324 enum composition_state state;
325 enum composition_method method;
326 int old_form; /* 0:pre-21 form, 1:post-21 form */
327 int length; /* number of elements produced in charbuf */
328 int nchars; /* number of characters composed */
329 int ncomps; /* number of composition components */
330 /* Maximum carryover is for the case of COMPOSITION_WITH_RULE_ALTCHARS.
331 See the comment in coding.c. */
332 int carryover[4 /* annotation header */
333 + MAX_COMPOSITION_COMPONENTS * 3 - 2 /* ALTs and RULEs */
334 + 2 /* intermediate -1 -1 */
335 + MAX_COMPOSITION_COMPONENTS /* CHARs */
336 ];
337 };
338
339
309 /* Structure of the field `spec.iso_2022' in the structure 340 /* Structure of the field `spec.iso_2022' in the structure
310 `coding_system'. */ 341 `coding_system'. */
311 struct iso_2022_spec 342 struct iso_2022_spec
312 { 343 {
313 /* Bit-wise-or of CODING_ISO_FLAG_XXX. */ 344 /* Bit-wise-or of CODING_ISO_FLAG_XXX. */
325 by single-shift while encoding. */ 356 by single-shift while encoding. */
326 int single_shifting; 357 int single_shifting;
327 358
328 /* Set to 1 temporarily only when processing at beginning of line. */ 359 /* Set to 1 temporarily only when processing at beginning of line. */
329 int bol; 360 int bol;
361
362 /* If positive, we are now scanning CTEXT extended segment. */
363 int ctext_extended_segment_len;
364
365 /* If nonzero, we are now scanning embedded UTF-8 sequence. */
366 int embedded_utf_8;
367
368 /* The current composition. */
369 struct composition_status cmp_status;
370 };
371
372 struct emacs_mule_spec
373 {
374 int full_support;
375 struct composition_status cmp_status;
330 }; 376 };
331 377
332 struct ccl_spec; 378 struct ccl_spec;
333 379
334 enum utf_bom_type 380 enum utf_bom_type
385 { 431 {
386 struct iso_2022_spec iso_2022; 432 struct iso_2022_spec iso_2022;
387 struct ccl_spec *ccl; /* Defined in ccl.h. */ 433 struct ccl_spec *ccl; /* Defined in ccl.h. */
388 struct utf_16_spec utf_16; 434 struct utf_16_spec utf_16;
389 enum utf_bom_type utf_8_bom; 435 enum utf_bom_type utf_8_bom;
390 int emacs_mule_full_support; 436 struct emacs_mule_spec emacs_mule;
391 } spec; 437 } spec;
392 438
393 int max_charset_id; 439 int max_charset_id;
394 unsigned char *safe_charsets; 440 unsigned char *safe_charsets;
395 441