aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2002-07-22 06:46:17 +0000
committerKenichi Handa2002-07-22 06:46:17 +0000
commit15843e6fa9baf3b6216e0c46c873364ca8c25ea5 (patch)
tree966f27657871d5e8d115fba4390f37f1c35b58ac /src
parent7c78e5423a65db9b20f9eb5d90ea94ab00d4af23 (diff)
downloademacs-15843e6fa9baf3b6216e0c46c873364ca8c25ea5.tar.gz
emacs-15843e6fa9baf3b6216e0c46c873364ca8c25ea5.zip
(Vscript_alist): New variable.
(string_char_with_unification): Add `const' to local variables. (str_as_unibyte): Likewise. (string_escape_byte8): Likewise. (syms_of_character): Declare script-alist as a Lisp variable.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/character.c25
2 files changed, 25 insertions, 6 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index fa3828089bf..a73ec8fdd3e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -5,6 +5,12 @@
5 (string_char_with_unification): Fix prototype. 5 (string_char_with_unification): Fix prototype.
6 (Vscript_alist): Extern it. 6 (Vscript_alist): Extern it.
7 7
8 * character.c (Vscript_alist): New variable.
9 (string_char_with_unification): Add `const' to local variables.
10 (str_as_unibyte): Likewise.
11 (string_escape_byte8): Likewise.
12 (syms_of_character): Declare script-alist as a Lisp variable.
13
8 * charset.h (Vcharset_ordered_list): Extern it. 14 * charset.h (Vcharset_ordered_list): Extern it.
9 (charset_ordered_list_tick): Extern it. 15 (charset_ordered_list_tick): Extern it.
10 (EMACS_MULE_LEADING_CODE_PRIVATE_11, 16 (EMACS_MULE_LEADING_CODE_PRIVATE_11,
diff --git a/src/character.c b/src/character.c
index 07a50ce797c..6af2698d6b0 100644
--- a/src/character.c
+++ b/src/character.c
@@ -77,6 +77,9 @@ Lisp_Object Vchar_direction_table;
77unsigned char *_fetch_multibyte_char_p; 77unsigned char *_fetch_multibyte_char_p;
78int _fetch_multibyte_char_len; 78int _fetch_multibyte_char_len;
79 79
80/* Alist of scripts vs character ranges. */
81Lisp_Object Vscript_alist;
82
80 83
81 84
82int 85int
@@ -116,11 +119,12 @@ char_string_with_unification (c, p)
116 119
117int 120int
118string_char_with_unification (p, advanced, len) 121string_char_with_unification (p, advanced, len)
119 unsigned char *p, **advanced; 122 const unsigned char *p;
123 const unsigned char **advanced;
120 int *len; 124 int *len;
121{ 125{
122 int c; 126 int c;
123 unsigned char *saved_p = p; 127 const unsigned char *saved_p = p;
124 128
125 if (*p < 0x80 || ! (*p & 0x20) || ! (*p & 0x10)) 129 if (*p < 0x80 || ! (*p & 0x20) || ! (*p & 0x10))
126 { 130 {
@@ -711,8 +715,8 @@ str_as_unibyte (str, bytes)
711 unsigned char *str; 715 unsigned char *str;
712 int bytes; 716 int bytes;
713{ 717{
714 unsigned char *p = str, *endp = str + bytes; 718 const unsigned char *p = str, *endp = str + bytes;
715 unsigned char *to = str; 719 unsigned char *to;
716 int c, len; 720 int c, len;
717 721
718 while (p < endp) 722 while (p < endp)
@@ -723,7 +727,7 @@ str_as_unibyte (str, bytes)
723 break; 727 break;
724 p += len; 728 p += len;
725 } 729 }
726 to = p; 730 to = str + (p - str);
727 while (p < endp) 731 while (p < endp)
728 { 732 {
729 c = *p; 733 c = *p;
@@ -780,7 +784,8 @@ string_escape_byte8 (string)
780 int nbytes = STRING_BYTES (XSTRING (string)); 784 int nbytes = STRING_BYTES (XSTRING (string));
781 int multibyte = STRING_MULTIBYTE (string); 785 int multibyte = STRING_MULTIBYTE (string);
782 int byte8_count; 786 int byte8_count;
783 unsigned char *src, *src_end, *dst; 787 const unsigned char *src, *src_end;
788 unsigned char *dst;
784 Lisp_Object val; 789 Lisp_Object val;
785 int c, len; 790 int c, len;
786 791
@@ -914,6 +919,14 @@ A char-table for width (columns) of each character. */);
914 DEFVAR_LISP ("printable-chars", &Vprintable_chars, 919 DEFVAR_LISP ("printable-chars", &Vprintable_chars,
915 doc: /* A char-table for each printable character. */); 920 doc: /* A char-table for each printable character. */);
916 Vprintable_chars = Fmake_char_table (Qnil, Qnil); 921 Vprintable_chars = Fmake_char_table (Qnil, Qnil);
922
923 DEFVAR_LISP ("script-alist", &Vscript_alist,
924 doc: /* Alist of scripts vs the corresponding character ranges.
925Each element has this form:
926 ( SCRIPT (FROM-1 . TO-1) (FROM-2 . TO-2) ...)
927SCRIPT is a symbol representing a script name.
928FROM-n and TO-n specifies ranges of characters that belongs to SCRIPT. */);
929 Vscript_alist = Qnil;
917} 930}
918 931
919#endif /* emacs */ 932#endif /* emacs */