Mercurial > emacs
comparison src/charset.h @ 20589:3acb053e757e
(FETCH_STRING_CHAR_ADVANCE): New macro.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 05 Jan 1998 17:23:54 +0000 |
parents | f019e056ad9a |
children | ed9ed828415e |
comparison
equal
deleted
inserted
replaced
20588:138c95482e6b | 20589:3acb053e757e |
---|---|
558 ((BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1 \ | 558 ((BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) == 1 \ |
559 || BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) > (len)) \ | 559 || BYTES_BY_CHAR_HEAD ((unsigned char) *(str)) > (len)) \ |
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) \ |
566 ((BYTES_BY_CHAR_HEAD (*(unsigned char *)(str)) == 1 \ | 594 ((BYTES_BY_CHAR_HEAD (*(unsigned char *)(str)) == 1 \ |
567 || BYTES_BY_CHAR_HEAD (*(unsigned char *)(str)) > (len)) \ | 595 || BYTES_BY_CHAR_HEAD (*(unsigned char *)(str)) > (len)) \ |