aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann2001-07-13 09:31:16 +0000
committerGerd Moellmann2001-07-13 09:31:16 +0000
commite06aa1f90f1f2e9cf3b85ff600b3b7c1ee2f8251 (patch)
tree62b82c5a12b55d1bcf069036fcb820e0091ff669 /src
parent12bcae05840abde621f9de6c3917224c96d91a04 (diff)
downloademacs-e06aa1f90f1f2e9cf3b85ff600b3b7c1ee2f8251.tar.gz
emacs-e06aa1f90f1f2e9cf3b85ff600b3b7c1ee2f8251.zip
(CHAR_STRING_NO_SIGNAL): New macro.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/charset.h12
2 files changed, 23 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 0174ffd8d80..06e678f4350 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12001-07-13 Gerd Moellmann <gerd@gnu.org>
2
3 * xdisp.c (get_next_display_element): Use CHAR_STRING_NO_SIGNAL
4 instead of CHAR_STRING which can signal an error.
5
6 * charset.c (char_to_string_1): Extracted from char_to_string.
7 Return -1 instead of signaling an error.
8 (char_to_string): Use it.
9
10 * charset.h (CHAR_STRING_NO_SIGNAL): New macro.
11
12001-07-12 Stefan Monnier <monnier@cs.yale.edu> 122001-07-12 Stefan Monnier <monnier@cs.yale.edu>
2 13
3 * coding.c (Ffind_coding_systems_region_internal): If safe_codings 14 * coding.c (Ffind_coding_systems_region_internal): If safe_codings
diff --git a/src/charset.h b/src/charset.h
index e086c056282..961bb60afcb 100644
--- a/src/charset.h
+++ b/src/charset.h
@@ -1,6 +1,7 @@
1/* Header for multibyte character handler. 1/* Header for multibyte character handler.
2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN. 2 Copyright (C) 1995, 1997, 1998 Electrotechnical Laboratory, JAPAN.
3 Licensed to the Free Software Foundation. 3 Licensed to the Free Software Foundation.
4 Copyright (C) 2001 Free Software Foundation, Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -531,6 +532,16 @@ extern int iso_charset_table[2][2][128];
531 : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \ 532 : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \
532 : char_to_string (c, (unsigned char *) str)) 533 : char_to_string (c, (unsigned char *) str))
533 534
535/* Like CHAR_STRING but don't signal an error if C is invalid.
536 Value is -1 in this case. */
537
538#define CHAR_STRING_NO_SIGNAL(c, str) \
539 (SINGLE_BYTE_CHAR_P (c) \
540 ? ((ASCII_BYTE_P (c) || c >= 0xA0) \
541 ? (*(str) = (unsigned char)(c), 1) \
542 : (*(str) = LEADING_CODE_8_BIT_CONTROL, *((str)+ 1) = c + 0x20, 2)) \
543 : char_to_string_1 (c, (unsigned char *) str))
544
534/* Return a character code of the character of which multi-byte form 545/* Return a character code of the character of which multi-byte form
535 is at STR and the length is LEN. If STR doesn't contain valid 546 is at STR and the length is LEN. If STR doesn't contain valid
536 multi-byte form, only the first byte in STR is returned. */ 547 multi-byte form, only the first byte in STR is returned. */
@@ -775,6 +786,7 @@ extern int translate_char P_ ((Lisp_Object, int, int, int, int));
775extern int split_string P_ ((const unsigned char *, int, int *, 786extern int split_string P_ ((const unsigned char *, int, int *,
776 unsigned char *, unsigned char *)); 787 unsigned char *, unsigned char *));
777extern int char_to_string P_ ((int, unsigned char *)); 788extern int char_to_string P_ ((int, unsigned char *));
789extern int char_to_string_1 P_ ((int, unsigned char *));
778extern int string_to_char P_ ((const unsigned char *, int, int *)); 790extern int string_to_char P_ ((const unsigned char *, int, int *));
779extern int char_printable_p P_ ((int c)); 791extern int char_printable_p P_ ((int c));
780extern int multibyte_form_length P_ ((const unsigned char *, int)); 792extern int multibyte_form_length P_ ((const unsigned char *, int));