(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,
unsigned char *_fetch_multibyte_char_p;
int _fetch_multibyte_char_len;
+/* Alist of scripts vs character ranges. */
+Lisp_Object Vscript_alist;
+
\f
int
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))
{
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)
break;
p += len;
}
- to = p;
+ to = str + (p - str);
while (p < endp)
{
c = *p;
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;
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 */