1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-18 08:51:45 -08:00
Commit graph

56 commits

Author SHA1 Message Date
Kenichi Handa
f164d9b522 (MAKE_CHAR): Return reasonable code even if CHARSET is undefined. 2000-07-18 12:48:53 +00:00
Kenichi Handa
aa01a892df (EMACS_CHARSET_H): Renamed from _CHARSET_H. 2000-06-11 23:41:07 +00:00
Kenichi Handa
88b837a212 (CHARSET_8_BIT_GRAPHIC): Define as 0x80.
(UNIBYTE_STR_AS_MULTIBYTE_P): Fix for an invalid multibyte
sequence.
2000-06-10 00:13:13 +00:00
Kenichi Handa
6e4dc3e1c3 (LEADING_CODE_8_BIT_CONTROL, CHARSET_8_BIT_CONTROL,
CHARSET_8_BIT_GRAPHIC): New macros.
(SINGLE_BYTE_CHAR_P): Make it faster by using casting.
(CHARSET_ISO_GRAPHIC_PLANE): Use XINT instead of XFASTINT.
(CHARSET_REVERSE_CHARSET): Likewise.
(CHARSET_VALID_P): Handle new charsets; eight-bit-control and
eight-bit-graphic.
(BYTES_BY_CHAR_HEAD, WIDTH_BY_CHAR_HEAD): Optimize for ASCII.
(CHAR_CHARSET, MAKE_CHAR, SPLIT_CHAR, CHAR_BYTES): Likewise.
(PARSE_MULTIBYTE_SEQ) [BYTE_COMBINING_DEBUG]: Abort if we
encounter an invalid multibyte sequence.
(PARSE_MULTIBYTE_SEQ) [not BYTE_COMBINING_DEBUG]: Assume multibyte
sequence is always valid.
(MAKE_NON_ASCII_CHAR, SPLIT_NON_ASCII_CHAR): These macros Deleted.
(UNIBYTE_STR_AS_MULTIBYTE_P, MULTIBYTE_STR_AS_UNIBYTE_P): New
macros.
(CHAR_STRING): For 8-bit characters, call char_to_string.
(INC_POS) [not BYTE_COMBINING_DEBUG]: Faster version.  Assume
multibyte sequence is always valid.
(BUF_INC_POS) [not BYTE_COMBINING_DEBUG]: Likewise.
(parse_str_as_multibyte, str_as_multibyte, str_to_multibyte,
str_as_unibyte): Extern them.
(BCOPY_SHORT): Fix a bug.
(CHAR_LEN): This macro deleted.  Callers changed to use
CHAR_BYTES.
(FETCH_STRING_CHAR_ADVANCE): Check multibyteness of STRING.
(FETCH_STRING_CHAR_ADVANCE_NO_CHECK): New macro.
(FETCH_CHAR_ADVANCE): Check multibyteness of the current buffer.
2000-05-19 23:54:05 +00:00
Ken Raeburn
a3f4e3d921 (CHARSET_TABLE_ENTRY): Fix comment -- argument is a C int, not a lisp integer. 2000-04-08 19:35:24 +00:00
Stefan Monnier
2d1675e45c * regex.c (PTR_TO_OFFSET) [!emacs]: Remove.
(RE_MULTIBYTE_P, RE_STRING_CHAR_AND_LENGTH): New macros.
(GET_CHAR_BEFORE_2): Moved from charset.h plus fixed minor bug when
we are between str1 and str2.
(MAX_MULTIBYTE_LENGTH, CHAR_STRING) [!emacs]: Provide trivial default.
(PATFETCH): Use `TRANSLATE'.
(PATFETCH_RAW): Fetch multibyte char if applicable.
(PATUNFETCH): Remove.
(regex_compile): Rely on PATFETCH to do most of the multibyte magic.
When writing a char, write it directly into the pattern buffer rather
than going needlessly through a temp char-array.
(re_match_2_internal): Similarly, rely on RE_STRING_CHAR to do the
multibyte magic and remove the useless `#ifdef emacs'.
(bcmp_translate): Don't compare as multibyte chars when in a unibyte
buffer.
* regex.h (struct re_pattern_buffer): Make field `multibyte'
conditional on `emacs'.
* charset.h (GET_CHAR_BEFORE_2): Moved to regex.c.
2000-04-02 23:56:46 +00:00
Stefan Monnier
66f0296e48 * regex.c: Declare a new type `re_char' used throughout the code for the
string char type.  It's `const unsigned char' to match the rest of Emacs.
Consistently make sure all pointers to strings use it and make sure all
pointers into the pattern use `unsigned char'.
(re_match_2_internal): Use `PREFETCH+STRING_CHAR' instead of
GET_CHAR_AFTER_2.
Also merge wordbound and notwordbound to reduce code duplication.
* charset.h (GET_CHAR_AFTER_2): Remove.
(GET_CHAR_BEFORE_2): Use unsigned chars, like everywhere else.
2000-03-14 00:27:57 +00:00
Kenichi Handa
07129d9eaf (CHAR_BYTES): Use ((1 << CHARACTERBITS) - 1) instead
of GLYPH_MASK_CHAR.
1999-12-27 05:04:23 +00:00
Kenichi Handa
f49b37c9a3 In this entry, just `Modified' means that codes for a
composite character is deleted.
(LEADING_CODE_COMPOSITION) (CHARSET_COMPOSITION)
(charset_composition) (MIN_CHAR_COMPOSITION)
(MAX_CHAR_COMPOSITION) (GENERIC_COMPOSITION_CHAR)
(COMPOSITE_CHAR_P) (MAKE_COMPOSITE_CHAR) (COMPOSITE_CHAR_ID)
(PARSE_COMPOSITE_SEQ) (PARSE_CHARACTER_SEQ): Deleted.
(MAX_CHAR) (CHARSET_VALID_P) (CHARSET_DEFINED_P) (CHARSET_AT)
(FIRST_CHARSET_AT) (SAME_CHARSET_P) (MAKE_NON_ASCII_CHAR)
(PARSE_MULTIBYTE_SEQ) (SPLIT_NON_ASCII_CHAR) (CHAR_PRINTABLE_P):
Modified.
(SPLIT_STRING): Call split_string, not split_non_ascii_string.
(CHAR_STRING): Delete WORKBUF argument.  Call char_string, not
non_ascii_char_to_string.
(STRING_CHAR): Call string_to_char, not string_to_non_ascii_char.
(STRING_CHAR_AND_LENGTH): Likewise.
(FETCH_CHAR_ADVANCE): New macro.
(MAX_COMPONENT_COUNT) (struct cmpchar_info): Deleted.
(MAX_MULTIBYTE_LENGTH): New macro.
(MAX_LENGTH_OF_MULTI_BYTE_FORM): Deleted.
(find_charset_in_str): Argument adjusted.
(CHAR_LEN): Modified.
1999-12-15 00:04:14 +00:00
Ken Raeburn
e35efe896b (GET_TRANSLATION_TABLE): Use XCDR. 1999-09-11 18:35:57 +00:00
Kenichi Handa
9dd2aa1a51 Lots of comments fixed.
(PARSE_MULTIBYTE_SEQ): Make it work also for ASCII string.
(STRING_CHAR_AND_CHAR_LENGTH): This macro removed.
1999-09-07 12:18:57 +00:00
Kenichi Handa
384107f281 (MAKE_NON_ASCII_CHAR): Handle the case that C1 or C2
are negative.
(MAKE_CHAR): Don't set MSBs of C1 and C2 to 0.
(VALID_MULTIBYTE_CHAR_P): This macro deleted.
(PARSE_COMPOSITE_SEQ): New macro.
(PARSE_CHARACTER_SEQ): New macro.
(PARSE_MULTIBYTE_SEQ): New macro.
(CHAR_PRINTABLE_P): New macro.
(STRING_CHAR): Adjusted for the change of string_to_non_ascii_char.
(STRING_CHAR_AND_LENGTH): Likewise.
(STRING_CHAR_AND_CHAR_LENGTH): Define it as STRING_CHAR_AND_LENGTH.
(INC_POS): Use the macro PARSE_MULTIBYTE_SEQ.
(DEC_POS, BUF_INC_POS, BUF_DEC_POS): Likewise,
1999-09-03 01:28:42 +00:00
Karl Heuer
ae53401aeb (BCOPY_SHORT): Fix typo `unsigined'. 1999-08-10 17:30:22 +00:00
Gerd Moellmann
3dc9587ac1 (CHAR_LEN): Moved here from dispextern.h. 1999-07-21 21:43:52 +00:00
Kenichi Handa
0c01c27ea5 Fix previous change. 1999-05-26 08:03:16 +00:00
Kenichi Handa
28d0c844b2 (Vcharset_table): Comment fixed. 1999-05-26 07:15:39 +00:00
Kenichi Handa
8c5b01cc4b (find_charset_in_str): Update declaration. 1998-12-15 04:35:38 +00:00
Andreas Schwab
c2d1e590cf Declare char_valid_p. 1998-12-03 09:22:52 +00:00
Kenichi Handa
43229ac34b (CHAR_BYTES): If C has modifier bits, return 1. 1998-11-26 08:12:12 +00:00
Kenichi Handa
72b718d765 (SINGLE_BYTE_CHAR_P): Check if C is negative or not. 1998-11-16 06:26:27 +00:00
Kenichi Handa
cf36cf3f21 (cmpchar_component): Proto-type adjusted. 1998-11-10 00:24:40 +00:00
Kenichi Handa
dfd57aa70f (SPLIT_NON_ASCII_CHAR): Check dimension of an invalid
character correctly.
(STRING_CHAR): Handle an invalid charater correctly.
1998-11-06 10:59:09 +00:00
Kenichi Handa
d6127b83e3 (MAKE_NON_ASCII_CHAR): Check validity of CHARSET. 1998-11-06 00:44:16 +00:00
Kenichi Handa
69535a4bd5 (Vauto_fill_chars): Extern it. 1998-10-19 00:40:10 +00:00
Kenichi Handa
8783b77f5b (STRING_CHAR_AND_LENGTH): Return correct value in
ACTUAL_LEN even if LEN is too short to have a valid multibyte
form.
(STRING_CHAR_AND_CHAR_LENGTH): Likewise.
1998-09-07 13:39:15 +00:00
Kenichi Handa
3124bc0ed3 (CHAR_BYTES): New macro. 1998-08-28 12:22:39 +00:00
Kenichi Handa
4c0fbc0814 (MAX_CHAR_COMPOSITION): Defined as (GLYPH_MASK_CHAR -
1), one less than the previous value.
(GENERIC_COMPOSITION_CHAR): New macro.
1998-07-06 06:33:55 +00:00
Karl Heuer
94487c4e37 Doc fixes. 1998-06-20 22:06:30 +00:00
Kenichi Handa
d74d0ca5a8 (STRING_CHAR_AND_CHAR_LENGTH): New macro.
(string_to_non_ascii_char): Adjusted for the new arg.
1998-05-22 09:44:27 +00:00
Kenichi Handa
3f639f8562 (find_charset_in_str): Number of arguments fixed. 1998-05-21 01:48:52 +00:00
Kenichi Handa
62c6686f98 Change terms unify/unification to
translate/translation respectively throughtout the file.
(GET_TRANSLATION_TABLE): Name changed from UNIFICATION_ID_TABLE.
1998-05-18 00:59:38 +00:00
Kenichi Handa
d121936ff0 (MULTIBYTE_FORM_LENGTH): Don't check LEN here. 1998-04-09 05:40:23 +00:00
Karl Heuer
8867de6748 (string_to_non_ascii_char, multibyte_form_length)
(split_non_ascii_string, str_cmpchar_id): Make the STR argument
const unsigned char *.
1998-04-08 06:55:55 +00:00
Karl Heuer
54c182d14b (CHAR_STRING): Cast to unsigned char ** explicitly. 1998-04-08 06:50:18 +00:00
Kenichi Handa
54e15bb98c (NONASCII_INSERT_OFFSET): New macro.
(VALID_MULTIBYTE_CHAR_P): New macro.
1998-03-03 01:29:16 +00:00
Kenichi Handa
bb5999ae96 (INC_POS): Use macro BASE_LEADING_CODE_P.
(DEC_POS): Make the behaviour consistent with INC_POS.
(BUF_INC_POS, BUF_DEC_POS): Likewise.
1998-02-20 01:40:47 +00:00
Richard M. Stallman
d619ee06f2 (INC_BOTH, DEC_BOTH): In unibyte mode, simply increment bytepos. 1998-02-16 03:01:16 +00:00
Kenichi Handa
1a248d47c9 Delete garbage line "int use_dialog_box". 1998-01-23 10:54:49 +00:00
Kenichi Handa
c1f6608b5f (BCOPY_SHORT): New macro.
(MAX_CHAR_COMPOSITION): New macro.
(CHAR_CHARSET): Check more strictly.
(CODING_FLAG_ISO_DESIGNATION): New macro.
(Vcharacter_unification_table_vector): Extern it.
(UNIFICATION_ID_TABLE): New macro.
1998-01-22 01:26:45 +00:00
Richard M. Stallman
4a2f9c6aef Update copyright year. 1998-01-21 23:32:12 +00:00
Richard M. Stallman
520afed181 (FETCH_STRING_CHAR_ADVANCE): New macro. 1998-01-05 17:23:54 +00:00
Richard M. Stallman
c399b46133 (CHAR_HEAD_P): Take char, not pointer, as arg.
(INC_POS, DEC_POS): Fix because arg is a bufpos.
(BUF_INC_POS, BUF_DEC_POS): New macros.
(INC_BOTH, DEC_BOTH): New macros.
1997-12-31 21:49:31 +00:00
Andreas Schwab
f6469851ec (SPLIT_STRING): Remove extra argument to
split_non_ascii_string.
1997-11-25 14:09:14 +00:00
Andreas Schwab
c04809fb5b Add more prototypes and function declarations. 1997-11-21 14:42:33 +00:00
Karl Heuer
7614f779e0 (ASCII_BYTE_P): New macro. 1997-11-15 20:23:21 +00:00
Kenichi Handa
15979e9ebc (CHAR_VALID_P): Renamed from VALID_CHAR_P, new
argument GENERICP.  Call char_valid_p for a non-ASCII character.
1997-10-23 12:01:50 +00:00
Kenichi Handa
5c6257e54f (LEADING_CODE_PRIVATE_22): Comment fixed. 1997-09-01 07:15:46 +00:00
Richard M. Stallman
feb453faa3 Comment changes. 1997-08-12 16:11:31 +00:00
Richard M. Stallman
75c8c59233 Change copyright notices. 1997-06-20 06:30:29 +00:00
Kenichi Handa
c6112b99dc (VALID_CHAR_P): New macro.
(CHAR_STRING):  Comment modified
1997-05-16 00:43:26 +00:00