diff options
| author | Richard M. Stallman | 1998-01-05 17:23:54 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-01-05 17:23:54 +0000 |
| commit | 520afed181d4639b12155362aa6faa7e09531230 (patch) | |
| tree | 3e72b3896cfd78c78d98c265f072520c554c0699 /src | |
| parent | 0c8533c604b6c5a51b6e1a9e8e45434de5cc9021 (diff) | |
| download | emacs-520afed181d4639b12155362aa6faa7e09531230.tar.gz emacs-520afed181d4639b12155362aa6faa7e09531230.zip | |
(FETCH_STRING_CHAR_ADVANCE): New macro.
Diffstat (limited to 'src')
| -rw-r--r-- | src/charset.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/charset.h b/src/charset.h index d2e500a83a7..684ae2ff93f 100644 --- a/src/charset.h +++ b/src/charset.h | |||
| @@ -560,6 +560,34 @@ extern int iso_charset_table[2][2][128]; | |||
| 560 | ? (actual_len = 1), (unsigned char) *(str) \ | 560 | ? (actual_len = 1), (unsigned char) *(str) \ |
| 561 | : string_to_non_ascii_char (str, len, &actual_len)) | 561 | : string_to_non_ascii_char (str, len, &actual_len)) |
| 562 | 562 | ||
| 563 | /* Fetch the "next" multibyte character from Lisp string STRING | ||
| 564 | at byte position BYTEIDX, character position CHARIDX. | ||
| 565 | Store it into OUTPUT. | ||
| 566 | |||
| 567 | All the args must be side-effect-free. | ||
| 568 | BYTEIDX and CHARIDX must be lvalues; | ||
| 569 | we increment them past the character fetched. */ | ||
| 570 | |||
| 571 | #define FETCH_STRING_CHAR_ADVANCE(OUTPUT, STRING, CHARIDX, BYTEIDX) \ | ||
| 572 | if (1) \ | ||
| 573 | { \ | ||
| 574 | unsigned char *fetch_string_char_ptr = &XSTRING (STRING)->data[BYTEIDX]; \ | ||
| 575 | int fetch_string_char_space_left = XSTRING (STRING)->size_byte - BYTEIDX; \ | ||
| 576 | int actual_len; \ | ||
| 577 | \ | ||
| 578 | OUTPUT \ | ||
| 579 | = STRING_CHAR_AND_LENGTH (fetch_string_char_ptr, \ | ||
| 580 | fetch_string_char_space_left, actual_len); \ | ||
| 581 | \ | ||
| 582 | BYTEIDX += actual_len; \ | ||
| 583 | CHARIDX++; \ | ||
| 584 | } \ | ||
| 585 | else | ||
| 586 | |||
| 587 | /* Nonzero enables use of dialog boxes for questions | ||
| 588 | asked by mouse commands. */ | ||
| 589 | int use_dialog_box; | ||
| 590 | |||
| 563 | /* Return the length of the multi-byte form at string STR of length LEN. */ | 591 | /* Return the length of the multi-byte form at string STR of length LEN. */ |
| 564 | 592 | ||
| 565 | #define MULTIBYTE_FORM_LENGTH(str, len) \ | 593 | #define MULTIBYTE_FORM_LENGTH(str, len) \ |