]> code.delx.au - gnu-emacs/commitdiff
(Vscript_alist): New variable.
authorKenichi Handa <handa@m17n.org>
Mon, 22 Jul 2002 06:46:17 +0000 (06:46 +0000)
committerKenichi Handa <handa@m17n.org>
Mon, 22 Jul 2002 06:46:17 +0000 (06:46 +0000)
(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.

src/ChangeLog
src/character.c

index fa3828089bf3462cc478ad779f3adb29e1b45632..a73ec8fdd3e8309a2fca681ceea2e01782c0f224 100644 (file)
@@ -5,6 +5,12 @@
        (string_char_with_unification): Fix prototype.
        (Vscript_alist): Extern it.
 
+       * character.c (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.
+
        * charset.h (Vcharset_ordered_list): Extern it.
        (charset_ordered_list_tick): Extern it.
        (EMACS_MULE_LEADING_CODE_PRIVATE_11,
index 07a50ce797c79d26ac0429e62f103b00a8e2b04b..6af2698d6b05b3db6b31b7a354fe98ccb640fbff 100644 (file)
@@ -77,6 +77,9 @@ Lisp_Object Vchar_direction_table;
 unsigned char *_fetch_multibyte_char_p;
 int _fetch_multibyte_char_len;
 
+/* Alist of scripts vs character ranges.  */
+Lisp_Object Vscript_alist;
+
 \f
 
 int
@@ -116,11 +119,12 @@ char_string_with_unification (c, p)
 
 int
 string_char_with_unification (p, advanced, len)
-     unsigned char *p, **advanced;
+     const unsigned char *p;
+     const unsigned char **advanced;
      int *len;
 {
   int c;
-  unsigned char *saved_p = p;
+  const unsigned char *saved_p = p;
 
   if (*p < 0x80 || ! (*p & 0x20) || ! (*p & 0x10))
     {
@@ -711,8 +715,8 @@ str_as_unibyte (str, bytes)
      unsigned char *str;
      int bytes;
 {
-  unsigned char *p = str, *endp = str + bytes;
-  unsigned char *to = str;
+  const unsigned char *p = str, *endp = str + bytes;
+  unsigned char *to;
   int c, len;
 
   while (p < endp)
@@ -723,7 +727,7 @@ str_as_unibyte (str, bytes)
        break;
       p += len;
     }
-  to = p;
+  to = str + (p - str);
   while (p < endp)      
     {
       c = *p;
@@ -780,7 +784,8 @@ string_escape_byte8 (string)
   int nbytes = STRING_BYTES (XSTRING (string));
   int multibyte = STRING_MULTIBYTE (string);
   int byte8_count;
-  unsigned char *src, *src_end, *dst;
+  const unsigned char *src, *src_end;
+  unsigned char *dst;
   Lisp_Object val;
   int c, len;
 
@@ -914,6 +919,14 @@ A char-table for width (columns) of each character.  */);
   DEFVAR_LISP ("printable-chars", &Vprintable_chars,
               doc: /* A char-table for each printable character.  */);
   Vprintable_chars = Fmake_char_table (Qnil, Qnil);
+
+  DEFVAR_LISP ("script-alist", &Vscript_alist,
+              doc: /* Alist of scripts vs the corresponding character ranges.
+Each element has this form:
+       ( SCRIPT (FROM-1 . TO-1) (FROM-2 . TO-2) ...)
+SCRIPT is a symbol representing a script name.
+FROM-n and TO-n specifies ranges of characters that belongs to SCRIPT.  */);
+  Vscript_alist = Qnil;
 }
 
 #endif /* emacs */