aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2009-03-06 07:52:40 +0000
committerKenichi Handa2009-03-06 07:52:40 +0000
commit825d08758787822e136ea21224f684c8620ff1dd (patch)
tree4bff31b0120c60ec235c00a20374cf995d5b3d36 /src
parente951386e3862e77b38b96e00652b8ce4ba788aff (diff)
downloademacs-825d08758787822e136ea21224f684c8620ff1dd.tar.gz
emacs-825d08758787822e136ea21224f684c8620ff1dd.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog51
-rw-r--r--src/coding.h48
2 files changed, 98 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 876b8887876..77f6e0278d2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,54 @@
12009-03-06 Kenichi Handa <handa@m17n.org>
2
3 These changes are to detect incorrect composition sequence without
4 looking ahead the source.
5
6 * coding.h: Include "composite.h".
7 (enum compisition_state): New enum.
8 (struct compisition_status): New struct.
9 (struct iso_2022_spec): New member cmp_status.
10 (struct emacs_mule_spec): New struct.
11 (struct coding_system): New members ctext_extended_segment_len and
12 embedded_utf_8. Change the union member
13 spec.emacs_mule_full_support to spec.emacs_mule.
14
15 * coding.c (CODING_ISO_CMP_STATUS): New macro.
16 (CODING_ISO_EXTSEGMENT_LEN, CODING_ISO_EMBEDDED_UTF_8): New macros.
17 (MAX_ANNOTATION_LENGTH): Defined to 5.
18 (ADD_COMPOSITION_DATA): New arg nbytes.
19 (emacs_mule_char): New arg cmp_status.
20 (DECODE_EMACS_MULE_COMPOSITION_CHAR): Delete it.
21 (DECODE_EMACS_MULE_COMPOSITION_RULE_20): New arg c.
22 (DECODE_EMACS_MULE_COMPOSITION_RULE_21): New arg c.
23 (DECODE_EMACS_MULE_21_COMPOSITION): Delete the arg c.
24 (DECODE_EMACS_MULE_20_RELATIVE_COMPOSITION): Likewise.
25 (DECODE_EMACS_MULE_20_RULEBASE_COMPOSITION): Likewise.
26 (DECODE_EMACS_MULE_COMPOSITION_START): New macro.
27 (EMACS_MULE_COMPOSITION_END): New macro.
28 (emacs_mule_finish_composition): New function.
29 (EMACS_MULE_MAYBE_FINISH_COMPOSITION): New macro.
30 (decode_coding_emacs_mule): Avoid long looking ahead while
31 handling composition.
32 (DECODE_COMPOSITION_RULE): Argument changed to rule and nbytes.
33 (ENCODE_COMPOSITION_RULE): New macro.
34 (finish_composition): New function.
35 (MAYBE_FINISH_COMPOSITION): Call finish_composition.
36 (DECODE_COMPOSITION_START): New implementation.
37 (DECODE_COMPOSITION_END): Likewise.
38 (STORE_COMPOSITION_RULE): New macro.
39 (decode_coding_iso_2022): Avoid long looking ahead while handling
40 composition, CTEXT extended segment, and embedded UTF-8.
41 (setup_coding_system): For a coding of type iso-2022, reset
42 CODING_ISO_EXTSEGMENT_LEN (coding) and
43 CODING_ISO_EMBEDDED_UTF_8 (coding).
44 (get_translation): Delete arguments last_block, from_nchars,
45 to_nchars. Callers changed.
46 (produce_chars): Don't modify charbuf. Adjusted for the change of
47 get_translation.
48 (produce_composition): Adjusted for the new annotation sequence.
49 (handle_composition_annotation): Likewise.
50 (consume_chars): Adjusted for the change of get_translation.
51
12009-03-05 Adrian Robert <Adrian.B.Robert@gmail.com> 522009-03-05 Adrian Robert <Adrian.B.Robert@gmail.com>
2 53
3 * nsterm.m (ns_select): Shortcircuit if reentrant call. 54 * nsterm.m (ns_select): Shortcircuit if reentrant call.
diff --git a/src/coding.h b/src/coding.h
index 3daf4a725f2..153ec952093 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -306,6 +306,37 @@ enum coding_result_code
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
312enum 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. */
322struct 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'. */
311struct iso_2022_spec 342struct iso_2022_spec
@@ -327,6 +358,21 @@ struct iso_2022_spec
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
372struct emacs_mule_spec
373{
374 int full_support;
375 struct composition_status cmp_status;
330}; 376};
331 377
332struct ccl_spec; 378struct ccl_spec;
@@ -387,7 +433,7 @@ struct coding_system
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;