/* Basic character support.
Copyright (C) 1995, 1997, 1998, 2001 Electrotechnical Laboratory, JAPAN.
- Licensed to the Free Software Foundation.
+ Licensed to the Free Software Foundation.
Copyright (C) 2001 Free Software Foundation, Inc.
- Copyright (C) 2001, 2002
+ Copyright (C) 2003
National Institute of Advanced Industrial Science and Technology (AIST)
Registration Number H13PRO009
int
c_string_width (str, len, precision, nchars, nbytes)
- unsigned char *str;
+ const unsigned char *str;
int precision, *nchars, *nbytes;
{
int i = 0, i_byte = 0;
Lisp_Object string;
int precision, *nchars, *nbytes;
{
- int len = XSTRING (string)->size;
- unsigned char *str = XSTRING (string)->data;
+ int len = SCHARS (string);
+ unsigned char *str = SDATA (string);
int i = 0, i_byte = 0;
int width = 0;
struct Lisp_Char_Table *dp = buffer_display_table ();
int
chars_in_text (ptr, nbytes)
- unsigned char *ptr;
+ const unsigned char *ptr;
int nbytes;
{
/* current_buffer is null at early stages of Emacs initialization. */
int
multibyte_chars_in_text (ptr, nbytes)
- unsigned char *ptr;
+ const unsigned char *ptr;
int nbytes;
{
- unsigned char *endp = ptr + nbytes;
+ const unsigned char *endp = ptr + nbytes;
int chars = 0;
while (ptr < endp)
void
parse_str_as_multibyte (str, len, nchars, nbytes)
- unsigned char *str;
+ const unsigned char *str;
int len, *nchars, *nbytes;
{
- unsigned char *endp = str + len;
+ const unsigned char *endp = str + len;
int n, chars = 0, bytes = 0;
if (len >= MAX_MULTIBYTE_LENGTH)
{
- unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH;
+ const unsigned char *adjusted_endp = endp - MAX_MULTIBYTE_LENGTH;
while (str < adjusted_endp)
{
if ((n = MULTIBYTE_LENGTH_NO_CHECK (str)) > 0)
{
while (n--)
*to++ = *p++;
- }
+ }
else
{
int c = *p++;
endp = str + len;
safe_bcopy ((char *) p, (char *) (endp - bytes), bytes);
p = endp - bytes;
- while (p < endp)
+ while (p < endp)
{
int c = *p++;
p += len;
}
to = str + (p - str);
- while (p < endp)
+ while (p < endp)
{
c = *p;
len = BYTES_BY_CHAR_HEAD (c);
Lisp_Object string;
{
int multibyte = STRING_MULTIBYTE (string);
- int nbytes = STRING_BYTES (XSTRING (string));
- unsigned char *p = XSTRING (string)->data;
+ int nbytes = SBYTES (string);
+ unsigned char *p = SDATA (string);
unsigned char *pend = p + nbytes;
int count = 0;
int c, len;
string_escape_byte8 (string)
Lisp_Object string;
{
- int nchars = XSTRING (string)->size;
- int nbytes = STRING_BYTES (XSTRING (string));
+ int nchars = SCHARS (string);
+ int nbytes = SBYTES (string);
int multibyte = STRING_MULTIBYTE (string);
int byte8_count;
const unsigned char *src, *src_end;
/* Convert 1-byte sequence of byte8 chars to 4-byte octal. */
val = make_uninit_string (nbytes + byte8_count * 3);
- src = XSTRING (string)->data;
+ src = SDATA (string);
src_end = src + nbytes;
- dst = XSTRING (val)->data;
+ dst = SDATA (val);
if (multibyte)
while (src < src_end)
{
}
\f
-DEFUN ("string", Fstring, Sstring, 1, MANY, 0,
+DEFUN ("string", Fstring, Sstring, 0, MANY, 0,
doc: /*
Concatenate all the argument characters and make the result a string.
usage: (string &rest CHARACTERS) */)