del_range_both (wordstart, wordstart_byte, wordend, wordend_byte, 1);
insert_from_string (expansion, 0, 0, XSTRING (expansion)->size,
- XSTRING (expansion)->size_byte, 1);
+ STRING_BYTES (XSTRING (expansion)), 1);
SET_PT (PT + whitecnt);
if (uccount && !lccount)
if (!STRINGP (val))
error ("value of abbrev-symbol must be a string");
zv_before = ZV;
- del_range_byte (PT_BYTE, PT_BYTE + XSTRING (val)->size_byte, 1);
+ del_range_byte (PT_BYTE, PT_BYTE + STRING_BYTES (XSTRING (val)), 1);
/* Don't inherit properties here; just copy from old contents. */
insert_from_string (Vlast_abbrev_text, 0, 0,
XSTRING (Vlast_abbrev_text)->size,
- XSTRING (Vlast_abbrev_text)->size_byte, 0);
+ STRING_BYTES (XSTRING (Vlast_abbrev_text)), 0);
Vlast_abbrev_text = Qnil;
/* Total number of characters deleted. */
adjust = ZV - zv_before;
string_chars_consed += fullsize;
XSTRING (val)->size = length;
- XSTRING (val)->size_byte = length_byte;
+ SET_STRING_BYTES (XSTRING (val), length_byte);
XSTRING (val)->data[length_byte] = 0;
INITIALIZE_INTERVAL (XSTRING (val), NULL_INTERVAL);
error ("Pure Lisp storage exhausted");
XSETSTRING (new, PUREBEG + pureptr);
XSTRING (new)->size = length;
- XSTRING (new)->size_byte = length_byte;
+ SET_STRING_BYTES (XSTRING (new), length_byte);
bcopy (data, XSTRING (new)->data, length_byte);
XSTRING (new)->data[length_byte] = 0;
#endif /* LISP_FLOAT_TYPE */
else if (STRINGP (obj))
return make_pure_string (XSTRING (obj)->data, XSTRING (obj)->size,
- XSTRING (obj)->size_byte);
+ STRING_BYTES (XSTRING (obj)));
else if (COMPILEDP (obj) || VECTORP (obj))
{
register struct Lisp_Vector *vec;
register struct Lisp_String *newaddr;
register EMACS_INT size = nextstr->size;
- EMACS_INT size_byte = nextstr->size_byte;
+ EMACS_INT size_byte = STRING_BYTES (nextstr);
/* NEXTSTR is the old address of the next string.
Just skip it if it isn't marked. */
nbytes = XSTRING (str)->size;
else if (! STRING_MULTIBYTE (str))
nbytes = count_size_as_multibyte (XSTRING (str)->data,
- XSTRING (str)->size_byte);
+ STRING_BYTES (XSTRING (str)));
else
- nbytes = XSTRING (str)->size_byte;
+ nbytes = STRING_BYTES (XSTRING (str));
ssl->bytes += nbytes;
nbytes = XSTRING (str2)->size;
else if (! STRING_MULTIBYTE (str2))
nbytes = count_size_as_multibyte (XSTRING (str2)->data,
- XSTRING (str2)->size_byte);
+ STRING_BYTES (XSTRING (str2)));
else
- nbytes = XSTRING (str2)->size_byte;
+ nbytes = STRING_BYTES (XSTRING (str2));
ssl->bytes += nbytes;
}
{
int nbytes;
tem = overlay_tails.buf[i].string;
- nbytes = copy_text (XSTRING (tem)->data, p, XSTRING (tem)->size_byte,
+ nbytes = copy_text (XSTRING (tem)->data, p,
+ STRING_BYTES (XSTRING (tem)),
STRING_MULTIBYTE (tem), multibyte);
p += nbytes;
}
{
int nbytes;
tem = overlay_heads.buf[i].string;
- nbytes = copy_text (XSTRING (tem)->data, p, XSTRING (tem)->size_byte,
+ nbytes = copy_text (XSTRING (tem)->data, p,
+ STRING_BYTES (XSTRING (tem)),
STRING_MULTIBYTE (tem), multibyte);
p += nbytes;
tem = overlay_heads.buf[i].string2;
if (STRINGP (tem))
{
nbytes = copy_text (XSTRING (tem)->data, p,
- XSTRING (tem)->size_byte,
+ STRING_BYTES (XSTRING (tem)),
STRING_MULTIBYTE (tem), multibyte);
p += nbytes;
}
/* Cached address of beginning of string,
valid if BYTESTR equals STRING_SAVED. */
register unsigned char *strbeg;
- int bytestr_length = XSTRING (bytestr)->size_byte;
+ int bytestr_length = STRING_BYTES (XSTRING (bytestr));
CHECK_STRING (bytestr, 0);
if (!VECTORP (vector))
{
/* Make a copy of string so that if a GC relocates specs,
`string' will still be valid. */
- string = (unsigned char *) alloca (XSTRING (specs)->size_byte + 1);
- bcopy (XSTRING (specs)->data, string, XSTRING (specs)->size_byte + 1);
+ string = (unsigned char *) alloca (STRING_BYTES (XSTRING (specs)) + 1);
+ bcopy (XSTRING (specs)->data, string,
+ STRING_BYTES (XSTRING (specs)) + 1);
}
else if (string == 0)
{
for (i = 4; i < nargs; i++)
{
int size = encoding_buffer_size (&argument_coding,
- XSTRING (args[i])->size_byte);
+ STRING_BYTES (XSTRING (args[i])));
unsigned char *dummy1 = (unsigned char *) alloca (size);
int dummy;
encode_coding (&argument_coding,
XSTRING (args[i])->data,
new_argv[i - 3],
- XSTRING (args[i])->size_byte,
+ STRING_BYTES (XSTRING (args[i])),
size);
new_argv[i - 3][argument_coding.produced] = 0;
}
strcat (tempfile, "detmp.XXX");
#endif
#else /* not DOS_NT */
- char *tempfile = (char *) alloca (XSTRING (Vtemp_file_name_pattern)->size_byte + 1);
+ char *tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1);
bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile,
- XSTRING (Vtemp_file_name_pattern)->size_byte + 1);
+ STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1);
#endif /* not DOS_NT */
mktemp (tempfile);
register char *temp;
register int i;
- i = XSTRING (current_dir)->size_byte;
+ i = STRING_BYTES (XSTRING (current_dir));
pwd_var = (char *) alloca (i + 6);
temp = pwd_var + 4;
bcopy ("PWD=", pwd_var, 4);
entry = XCONS (scan)->car;
if (STRINGP (entry)
- && XSTRING (entry)->size_byte > varlen
+ && STRING_BYTES (XSTRING (entry)) > varlen
&& XSTRING (entry)->data[varlen] == '='
#ifdef WINDOWSNT
/* NT environment variables are case insensitive. */
)
{
*value = (char *) XSTRING (entry)->data + (varlen + 1);
- *valuelen = XSTRING (entry)->size_byte - (varlen + 1);
+ *valuelen = STRING_BYTES (XSTRING (entry)) - (varlen + 1);
return 1;
}
}
int valuelen;
CHECK_STRING (var, 0);
- if (getenv_internal (XSTRING (var)->data, XSTRING (var)->size_byte,
+ if (getenv_internal (XSTRING (var)->data, STRING_BYTES (XSTRING (var)),
&value, &valuelen))
return make_string (value, valuelen);
else
int multibyte = STRING_MULTIBYTE (obj);
obj = Fcopy_sequence (obj);
- len = XSTRING (obj)->size_byte;
+ len = STRING_BYTES (XSTRING (obj));
/* Scan all single-byte characters from start of string. */
for (i = 0; i < len;)
mnemonics = Fcategory_set_mnemonics (value);
insert_from_string (mnemonics, 0, 0, XSTRING (mnemonics)->size,
- XSTRING (mnemonics)->size_byte, 0);
+ STRING_BYTES (XSTRING (mnemonics)), 0);
insert_string ("\n");
return;
}
insert_char (i + 32);
insert (": ", 2);
insert_from_string (elt, 0, 0, XSTRING (elt)->size,
- XSTRING (elt)->size_byte, 0);
+ STRING_BYTES (XSTRING (elt)), 0);
insert ("\n", 1);
}
}
if (ccl.ic < i && i < ccl.size)
ccl.ic = i;
}
- outbufsize = XSTRING (str)->size_byte * ccl.buf_magnification + 256;
+ outbufsize = STRING_BYTES (XSTRING (str)) * ccl.buf_magnification + 256;
outbuf = (char *) xmalloc (outbufsize);
if (!outbuf)
error ("Not enough memory");
ccl.last_block = NILP (contin);
produced = ccl_driver (&ccl, XSTRING (str)->data, outbuf,
- XSTRING (str)->size_byte, outbufsize, (int *)0);
+ STRING_BYTES (XSTRING (str)), outbufsize, (int *)0);
for (i = 0; i < 8; i++)
XSET (XVECTOR (status)->contents[i], Lisp_Int, ccl.reg[i]);
XSETINT (XVECTOR (status)->contents[8], ccl.ic);
return Qnil;
bzero (charsets, (MAX_CHARSET + 1) * sizeof (int));
- find_charset_in_str (XSTRING (str)->data, XSTRING (str)->size_byte,
+ find_charset_in_str (XSTRING (str)->data, STRING_BYTES (XSTRING (str)),
charsets, table);
val = Qnil;
for (i = MAX_CHARSET; i >= 0; i--)
Lisp_Object val;
CHECK_STRING (str, 0);
- XSETFASTINT (val, strwidth (XSTRING (str)->data, XSTRING (str)->size_byte));
+ XSETFASTINT (val, strwidth (XSTRING (str)->data,
+ STRING_BYTES (XSTRING (str))));
return val;
}
buf[0] = LEADING_CODE_COMPOSITION;
p = XSTRING (str)->data;
- pend = p + XSTRING (str)->size_byte;
+ pend = p + STRING_BYTES (XSTRING (str));
i = 1;
while (p < pend)
{
{
int len;
char *buf;
- int from = 0, to = XSTRING (str)->size, to_byte = XSTRING (str)->size_byte;
+ int from = 0, to = XSTRING (str)->size;
+ int to_byte = STRING_BYTES (XSTRING (str));
struct gcpro gcpro1;
Lisp_Object saved_coding_symbol = Qnil;
int result;
len = encoding_buffer_size (coding, to_byte - from);
else
len = decoding_buffer_size (coding, to_byte - from);
- len += from + XSTRING (str)->size_byte - to_byte;
+ len += from + STRING_BYTES (XSTRING (str)) - to_byte;
GCPRO1 (str);
buf = get_conversion_buffer (len);
UNGCPRO;
}
bcopy (XSTRING (str)->data + to_byte, buf + from + coding->produced,
- XSTRING (str)->size_byte - to_byte);
+ STRING_BYTES (XSTRING (str)) - to_byte);
- len = from + XSTRING (str)->size_byte - to_byte;
+ len = from + STRING_BYTES (XSTRING (str)) - to_byte;
if (encodep)
str = make_unibyte_string (buf, len + coding->produced);
else
CHECK_STRING (string, 0);
return detect_coding_system (XSTRING (string)->data,
- XSTRING (string)->size_byte,
+ STRING_BYTES (XSTRING (string)),
!NILP (highest));
}
idxval_byte = string_char_to_byte (array, idxval);
c = STRING_CHAR (&XSTRING (array)->data[idxval_byte],
- XSTRING (array)->size_byte - idxval_byte);
+ STRING_BYTES (XSTRING (array)) - idxval_byte);
return make_number (c);
}
else if (BOOL_VECTOR_P (array))
p = &XSTRING (array)->data[idxval_byte];
actual_len
- = MULTIBYTE_FORM_LENGTH (p, XSTRING (array)->size_byte - idxval_byte);
+ = MULTIBYTE_FORM_LENGTH (p, STRING_BYTES (XSTRING (array)) - idxval_byte);
new_len = Fchar_bytes (newelt);
if (actual_len != XINT (new_len))
error ("Attempt to change byte length of a string");
{
/* ??? Perhaps we should do something special for multibyte strings here. */
CHECK_STRING (string, 0);
- fwrite (XSTRING (string)->data, 1, XSTRING (string)->size_byte, stdout);
+ fwrite (XSTRING (string)->data, 1, STRING_BYTES (XSTRING (string)), stdout);
fflush (stdout);
if (termscript)
{
- fwrite (XSTRING (string)->data, 1, XSTRING (string)->size_byte, termscript);
+ fwrite (XSTRING (string)->data, 1, STRING_BYTES (XSTRING (string)),
+ termscript);
fflush (termscript);
}
return Qnil;
if (NILP (keymap))
keymap = Voverriding_local_map;
- bsize = XSTRING (string)->size_byte;
+ bsize = STRING_BYTES (XSTRING (string));
bufp = buf = (unsigned char *) xmalloc (bsize);
strp = (unsigned char *) XSTRING (string)->data;
- while (strp < XSTRING (string)->data + XSTRING (string)->size_byte)
+ while (strp < XSTRING (string)->data + STRING_BYTES (XSTRING (string)))
{
if (strp[0] == '\\' && strp[1] == '=')
{
if (multibyte)
{
int len;
- int maxlen = XSTRING (string)->data + XSTRING (string)->size_byte - strp;
+ int maxlen = XSTRING (string)->data + STRING_BYTES (XSTRING (string)) - strp;
STRING_CHAR_AND_LENGTH (strp, maxlen, len);
if (len == 1)
start = strp;
while ((strp - (unsigned char *) XSTRING (string)->data
- < XSTRING (string)->size_byte)
+ < STRING_BYTES (XSTRING (string)))
&& *strp != ']')
strp++;
length_byte = strp - start;
insert_string ("\nUses keymap \"");
insert_from_string (name, 0, 0,
XSTRING (name)->size,
- XSTRING (name)->size_byte, 1);
+ STRING_BYTES (XSTRING (name)), 1);
insert_string ("\", which is not currently defined.\n");
if (start[-1] == '<') keymap = Qnil;
}
subst_string:
start = XSTRING (tem)->data;
length = XSTRING (tem)->size;
- length_byte = XSTRING (tem)->size_byte;
+ length_byte = STRING_BYTES (XSTRING (tem));
subst:
new = (unsigned char *) xrealloc (buf, bsize += length_byte);
bufp += new - buf;
else
{
int len;
- int maxlen = XSTRING (string)->data + XSTRING (string)->size_byte - strp;
+ int maxlen = XSTRING (string)->data + STRING_BYTES (XSTRING (string)) - strp;
STRING_CHAR_AND_LENGTH (strp, maxlen, len);
if (len == 1)
#ifdef DOS_NT
beg = strcpy (alloca (strlen (beg) + 1), beg);
#endif
- p = beg + XSTRING (filename)->size_byte;
+ p = beg + STRING_BYTES (XSTRING (filename));
while (p != beg && !IS_DIRECTORY_SEP (p[-1])
#ifdef VMS
return call2 (handler, Qfile_name_nondirectory, filename);
beg = XSTRING (filename)->data;
- end = p = beg + XSTRING (filename)->size_byte;
+ end = p = beg + STRING_BYTES (XSTRING (filename));
while (p != beg && !IS_DIRECTORY_SEP (p[-1])
#ifdef VMS
if (!NILP (handler))
return call2 (handler, Qfile_name_as_directory, file);
- buf = (char *) alloca (XSTRING (file)->size_byte + 10);
+ buf = (char *) alloca (STRING_BYTES (XSTRING (file)) + 10);
return build_string (file_name_as_directory (buf, XSTRING (file)->data));
}
\f
/* 20 extra chars is insufficient for VMS, since we might perform a
logical name translation. an equivalence string can be up to 255
chars long, so grab that much extra space... - sss */
- buf = (char *) alloca (XSTRING (directory)->size_byte + 20 + 255);
+ buf = (char *) alloca (STRING_BYTES (XSTRING (directory)) + 20 + 255);
#else
- buf = (char *) alloca (XSTRING (directory)->size_byte + 20);
+ buf = (char *) alloca (STRING_BYTES (XSTRING (directory)) + 20);
#endif
directory_file_name (XSTRING (directory)->data, buf);
return build_string (buf);
CORRECT_DIR_SEPS (nm);
substituted = (strcmp (nm, XSTRING (filename)->data) != 0);
#endif
- endp = nm + XSTRING (filename)->size_byte;
+ endp = nm + STRING_BYTES (XSTRING (filename));
/* If /~ or // appears, discard everything through first slash. */
/* If substitution required, recopy the string and do it */
/* Make space in stack frame for the new copy */
- xnm = (unsigned char *) alloca (XSTRING (filename)->size_byte + total + 1);
+ xnm = (unsigned char *) alloca (STRING_BYTES (XSTRING (filename)) + total + 1);
x = xnm;
/* Copy the rest of the name through, replacing $ constructs with values */
absname = Fexpand_file_name (filename, defdir);
#ifdef VMS
{
- register int c = XSTRING (absname)->data[XSTRING (absname)->size_byte - 1];
+ register int c = XSTRING (absname)->data[STRING_BYTES (XSTRING (absname)) - 1];
if (c == ':' || c == ']' || c == '>')
absname = Fdirectory_file_name (absname);
}
/* Remove final slash, if any (unless this is the root dir).
stat behaves differently depending! */
if (XSTRING (absname)->size > 1
- && IS_DIRECTORY_SEP (XSTRING (absname)->data[XSTRING (absname)->size_byte - 1])
- && !IS_DEVICE_SEP (XSTRING (absname)->data[XSTRING (absname)->size_byte-2]))
+ && IS_DIRECTORY_SEP (XSTRING (absname)->data[STRING_BYTES (XSTRING (absname)) - 1])
+ && !IS_DEVICE_SEP (XSTRING (absname)->data[STRING_BYTES (XSTRING (absname))-2]))
/* We cannot take shortcuts; they might be wrong for magic file names. */
absname = Fdirectory_file_name (absname);
#endif
if (STRINGP (start))
{
failure = 0 > a_write (desc, XSTRING (start)->data,
- XSTRING (start)->size_byte, 0, &annotations,
+ STRING_BYTES (XSTRING (start)), 0, &annotations,
&coding);
save_errno = errno;
}
tem = Fcdr (Fcar (*annot));
if (STRINGP (tem))
{
- if (0 > e_write (desc, XSTRING (tem)->data, XSTRING (tem)->size_byte,
+ if (0 > e_write (desc, XSTRING (tem)->data, STRING_BYTES (XSTRING (tem)),
coding))
return -1;
}
if (!NILP (b->filename))
{
fwrite (XSTRING (b->filename)->data, 1,
- XSTRING (b->filename)->size_byte, stream);
+ STRING_BYTES (XSTRING (b->filename)), stream);
}
putc ('\n', stream);
fwrite (XSTRING (b->auto_save_file_name)->data, 1,
- XSTRING (b->auto_save_file_name)->size_byte, stream);
+ STRING_BYTES (XSTRING (b->auto_save_file_name)), stream);
putc ('\n', stream);
}
register int n;
int osize, count;
- osize = XSTRING (val)->size_byte;
+ osize = STRING_BYTES (XSTRING (val));
/* Count the number of $ characters. */
for (n = osize, count = 0, old = XSTRING (val)->data; n > 0; n--)
&& IS_DIRECTORY_SEP (XSTRING (dir)->data[strlen (homedir)]))
{
dir = make_string (XSTRING (dir)->data + strlen (homedir) - 1,
- XSTRING (dir)->size_byte - strlen (homedir) + 1);
+ STRING_BYTES (XSTRING (dir)) - strlen (homedir) + 1);
XSTRING (dir)->data[0] = '~';
}
/* Write the name of the lock file for FN into LFNAME. Length will be
that of FN plus two more for the leading `.#' plus one for the null. */
#define MAKE_LOCK_NAME(lock, file) \
- (lock = (char *) alloca (XSTRING (file)->size_byte + 2 + 1), \
+ (lock = (char *) alloca (STRING_BYTES (XSTRING (file)) + 2 + 1), \
fill_in_lock_file_name (lock, (file)))
static void
Lisp_Object string;
{
CHECK_STRING (string, 1);
- return make_number (XSTRING (string)->size_byte);
+ return make_number (STRING_BYTES (XSTRING (string)));
}
DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0,
CHECK_STRING (s2, 1);
if (XSTRING (s1)->size != XSTRING (s2)->size
- || XSTRING (s1)->size_byte != XSTRING (s2)->size_byte
- || bcmp (XSTRING (s1)->data, XSTRING (s2)->data, XSTRING (s1)->size_byte))
+ || STRING_BYTES (XSTRING (s1)) != STRING_BYTES (XSTRING (s2))
+ || bcmp (XSTRING (s1)->data, XSTRING (s2)->data, STRING_BYTES (XSTRING (s1))))
return Qnil;
return Qt;
}
if (STRING_MULTIBYTE (this))
{
some_multibyte = 1;
- result_len_byte += XSTRING (this)->size_byte;
+ result_len_byte += STRING_BYTES (XSTRING (this));
}
else
result_len_byte += count_size_as_multibyte (XSTRING (this)->data,
if (STRINGP (this) && STRINGP (val)
&& STRING_MULTIBYTE (this) == some_multibyte)
{
- int thislen_byte = XSTRING (this)->size_byte;
+ int thislen_byte = STRING_BYTES (XSTRING (this));
bcopy (XSTRING (this)->data, XSTRING (val)->data + toindex_byte,
- XSTRING (this)->size_byte);
+ STRING_BYTES (XSTRING (this)));
toindex_byte += thislen_byte;
toindex += thisleni;
}
best_below = best_below_byte = 0;
best_above = XSTRING (string)->size;
- best_above_byte = XSTRING (string)->size_byte;
+ best_above_byte = STRING_BYTES (XSTRING (string));
if (EQ (string, string_char_byte_cache_string))
{
best_below = best_below_byte = 0;
best_above = XSTRING (string)->size;
- best_above_byte = XSTRING (string)->size_byte;
+ best_above_byte = STRING_BYTES (XSTRING (string));
if (EQ (string, string_char_byte_cache_string))
{
XSTRING (string)->size);
/* If all the chars are ASCII, they won't need any more bytes
once converted. In that case, we can return STRING itself. */
- if (nbytes == XSTRING (string)->size_byte)
+ if (nbytes == STRING_BYTES (XSTRING (string)))
return string;
buf = (unsigned char *) alloca (nbytes);
- copy_text (XSTRING (string)->data, buf, XSTRING (string)->size_byte,
+ copy_text (XSTRING (string)->data, buf, STRING_BYTES (XSTRING (string)),
0, 1);
return make_multibyte_string (buf, XSTRING (string)->size, nbytes);
buf = (unsigned char *) alloca (XSTRING (string)->size);
- copy_text (XSTRING (string)->data, buf, XSTRING (string)->size_byte,
+ copy_text (XSTRING (string)->data, buf, STRING_BYTES (XSTRING (string)),
1, 0);
return make_unibyte_string (buf, XSTRING (string)->size);
if (STRING_MULTIBYTE (string))
{
string = Fcopy_sequence (string);
- XSTRING (string)->size = XSTRING (string)->size_byte;
+ XSTRING (string)->size = STRING_BYTES (XSTRING (string));
}
return string;
}
if (! STRING_MULTIBYTE (string))
{
int newlen = multibyte_chars_in_text (XSTRING (string)->data,
- XSTRING (string)->size_byte);
+ STRING_BYTES (XSTRING (string)));
/* If all the chars are ASCII, STRING is already suitable. */
- if (newlen != XSTRING (string)->size_byte)
+ if (newlen != STRING_BYTES (XSTRING (string)))
{
string = Fcopy_sequence (string);
XSTRING (string)->size = newlen;
if (STRINGP (string))
{
size = XSTRING (string)->size;
- size_byte = XSTRING (string)->size_byte;
+ size_byte = STRING_BYTES (XSTRING (string));
}
else
size = XVECTOR (string)->size;
if (STRINGP (string))
{
size = XSTRING (string)->size;
- size_byte = XSTRING (string)->size_byte;
+ size_byte = STRING_BYTES (XSTRING (string));
}
else
size = XVECTOR (string)->size;
case Lisp_String:
if (XSTRING (o1)->size != XSTRING (o2)->size)
return 0;
- if (XSTRING (o1)->size_byte != XSTRING (o2)->size_byte)
+ if (STRING_BYTES (XSTRING (o1)) != STRING_BYTES (XSTRING (o2)))
return 0;
if (bcmp (XSTRING (o1)->data, XSTRING (o2)->data,
- XSTRING (o1)->size_byte))
+ STRING_BYTES (XSTRING (o1))))
return 0;
return 1;
}
else if (STRINGP (seq))
{
/* Multi-byte string. */
- int len_byte = XSTRING (seq)->size_byte;
+ int len_byte = STRING_BYTES (XSTRING (seq));
int i_byte;
for (i = 0, i_byte = 0; i < leni;)
/* Check for no change needed in this very common case
before we do any consing. */
if (frame_name_fnn_p (XSTRING (f->name)->data,
- XSTRING (f->name)->size_byte))
+ STRING_BYTES (XSTRING (f->name))))
return;
terminal_frame_count++;
/* Don't allow the user to set the frame name to F<num>, so it
doesn't clash with the names we generate for terminal frames. */
- if (frame_name_fnn_p (XSTRING (name)->data, XSTRING (name)->size_byte))
+ if (frame_name_fnn_p (XSTRING (name)->data, STRING_BYTES (XSTRING (name))))
error ("Frame names of the form F<num> are usurped by Emacs");
}
intervals = XSTRING (string)->intervals;
/* Get the intervals for the part of the string we are inserting--
not including the combined-before bytes. */
- if (nbytes < XSTRING (string)->size_byte)
+ if (nbytes < STRING_BYTES (XSTRING (string)))
intervals = copy_intervals (intervals, pos, nchars);
/* Insert those intervals. */
int from, to, prepare, inherit, nomarkers;
{
int inschars = XSTRING (new)->size;
- int insbytes = XSTRING (new)->size_byte;
+ int insbytes = STRING_BYTES (XSTRING (new));
int from_byte, to_byte;
int nbytes_del, nchars_del;
register Lisp_Object temp;
else if (SYMBOLP (c))
{
struct Lisp_String *name = XSYMBOL (c)->name;
- if ((ptr - current_kboard->echobuf) + name->size_byte + 4
+ if ((ptr - current_kboard->echobuf) + STRING_BYTES (name) + 4
> ECHOBUFSIZE)
return;
- bcopy (name->data, ptr, name->size_byte);
- ptr += name->size_byte;
+ bcopy (name->data, ptr, STRING_BYTES (name));
+ ptr += STRING_BYTES (name);
}
if (current_kboard->echoptr == current_kboard->echobuf
{
putc ('<', dribble);
fwrite (XSYMBOL (dribblee)->name->data, sizeof (char),
- XSYMBOL (dribblee)->name->size_byte,
+ STRING_BYTES (XSYMBOL (dribblee)->name),
dribble);
putc ('>', dribble);
}
modifiers = 0;
name = XSYMBOL (symbol)->name;
- for (i = 0; i+2 <= name->size_byte; )
+ for (i = 0; i+2 <= STRING_BYTES (name); )
{
int this_mod_end = 0;
int this_mod = 0;
/* Check there is a dash after the modifier, so that it
really is a modifier. */
- if (this_mod_end >= name->size_byte || name->data[this_mod_end] != '-')
+ if (this_mod_end >= STRING_BYTES (name)
+ || name->data[this_mod_end] != '-')
break;
/* This modifier is real; look for another. */
/* Should we include the `click' modifier? */
if (! (modifiers & (down_modifier | drag_modifier
| double_modifier | triple_modifier))
- && i + 7 == name->size_byte
+ && i + 7 == STRING_BYTES (name)
&& strncmp (name->data + i, "mouse-", 6) == 0
&& ('0' <= name->data[i + 6] && name->data[i + 6] <= '9'))
modifiers |= click_modifier;
Lisp_Object mask;
unmodified = Fintern (make_string (XSYMBOL (symbol)->name->data + end,
- XSYMBOL (symbol)->name->size_byte - end),
+ STRING_BYTES (XSYMBOL (symbol)->name) - end),
Qnil);
if (modifiers & ~(((EMACS_INT)1 << VALBITS) - 1))
new_symbol = apply_modifiers_uncached (modifiers,
XSYMBOL (base)->name->data,
XSYMBOL (base)->name->size,
- XSYMBOL (base)->name->size_byte);
+ STRING_BYTES (XSYMBOL (base)->name));
/* Add the new symbol to the base's cache. */
entry = Fcons (index, new_symbol);
switch (name->data[0])
{
#define SINGLE_LETTER_MOD(BIT) \
- if (name->size_byte == 1) \
+ if (STRING_BYTES (name) == 1) \
return BIT;
#define MULTI_LETTER_MOD(BIT, NAME, LEN) \
- if (LEN == name->size_byte \
+ if (LEN == STRING_BYTES (name) \
&& ! strncmp (name->data, NAME, LEN)) \
return BIT;
/* Prompt string always starts with map's prompt, and a space. */
strcpy (menu, XSTRING (name)->data);
- nlength = XSTRING (name)->size_byte;
+ nlength = STRING_BYTES (XSTRING (name));
menu[nlength++] = ':';
menu[nlength++] = ' ';
menu[nlength] = 0;
newmessage
= (char *) alloca (XSYMBOL (function)->name->size
- + XSTRING (binding)->size_byte
+ + STRING_BYTES (XSTRING (binding))
+ 100);
sprintf (newmessage, "You can run the command `%s' with %s",
XSYMBOL (function)->name->data,
register int count;
p = XSTRING (stuffstring)->data;
- count = XSTRING (stuffstring)->size_byte;
+ count = STRING_BYTES (XSTRING (stuffstring));
while (count-- > 0)
stuff_char (*p++);
stuff_char ('\n');
tem2 = CHARSET_TABLE_INFO (i - 128, CHARSET_SHORT_NAME_IDX);
if (STRINGP (tem2))
insert_from_string (tem2, 0, 0, XSTRING (tem2)->size,
- XSTRING (tem2)->size_byte, 0);
+ STRING_BYTES (XSTRING (tem2)), 0);
else
insert ("?", 1);
insert (">", 1);
CHECK_STRING (string,0);
if (NILP (end))
- endval = XSTRING (string)->size_byte;
+ endval = STRING_BYTES (XSTRING (string));
else
{
CHECK_NUMBER (end, 2);
endval = string_char_to_byte (string, XINT (end));
- if (endval < 0 || endval > XSTRING (string)->size_byte)
+ if (endval < 0 || endval > STRING_BYTES (XSTRING (string)))
args_out_of_range (string, end);
}
tem = oblookup (obarray, XSTRING (string)->data,
XSTRING (string)->size,
- XSTRING (string)->size_byte);
+ STRING_BYTES (XSTRING (string)));
if (!INTEGERP (tem))
return tem;
tem = oblookup (obarray, XSTRING (string)->data,
XSTRING (string)->size,
- XSTRING (string)->size_byte);
+ STRING_BYTES (XSTRING (string)));
if (!INTEGERP (tem))
return tem;
return Qnil;
tem = oblookup (obarray, XSTRING (string)->data,
XSTRING (string)->size,
- XSTRING (string)->size_byte);
+ STRING_BYTES (XSTRING (string)));
if (INTEGERP (tem))
return Qnil;
/* If arg was a symbol, don't delete anything but that symbol itself. */
else
for (tail = bucket; ; XSETSYMBOL (tail, XSYMBOL (tail)->next))
{
- if (XSYMBOL (tail)->name->size_byte == size_byte
+ if (STRING_BYTES (XSYMBOL (tail)->name) == size_byte
&& XSYMBOL (tail)->name->size == size
&& !bcmp (XSYMBOL (tail)->name->data, ptr, size_byte))
return tail;
/* Ignore trailing whitespace; any other trailing junk is an error. */
int i;
pos = string_char_to_byte (val, pos);
- for (i = pos; i < XSTRING (val)->size_byte; i++)
+ for (i = pos; i < STRING_BYTES (XSTRING (val)); i++)
{
int c = XSTRING (val)->data[i];
if (c != ' ' && c != '\t' && c != '\n')
/* Is this element a possible completion? */
if (STRINGP (eltstring)
- && XSTRING (string)->size_byte <= XSTRING (eltstring)->size_byte
+ && STRING_BYTES (XSTRING (string)) <= STRING_BYTES (XSTRING (eltstring))
&& 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data,
- XSTRING (string)->size_byte))
+ STRING_BYTES (XSTRING (string))))
{
/* Yes. */
Lisp_Object regexps;
if (NILP (bestmatch))
{
bestmatch = eltstring;
- bestmatchsize = XSTRING (eltstring)->size_byte;
+ bestmatchsize = STRING_BYTES (XSTRING (eltstring));
}
else
{
- compare = min (bestmatchsize, XSTRING (eltstring)->size_byte);
+ compare = min (bestmatchsize, STRING_BYTES (XSTRING (eltstring)));
matchsize = scmp (XSTRING (bestmatch)->data,
XSTRING (eltstring)->data,
compare);
use it as the best match rather than one that is not an
exact match. This way, we get the case pattern
of the actual match. */
- if ((matchsize == XSTRING (eltstring)->size_byte
- && matchsize < XSTRING (bestmatch)->size_byte)
+ if ((matchsize == STRING_BYTES (XSTRING (eltstring))
+ && matchsize < STRING_BYTES (XSTRING (bestmatch)))
||
/* If there is more than one exact match ignoring case,
and one of them is exact including case,
/* If there is no exact match ignoring case,
prefer a match that does not change the case
of the input. */
- ((matchsize == XSTRING (eltstring)->size_byte)
+ ((matchsize == STRING_BYTES (XSTRING (eltstring)))
==
- (matchsize == XSTRING (bestmatch)->size_byte)
+ (matchsize == STRING_BYTES (XSTRING (bestmatch)))
&& !bcmp (XSTRING (eltstring)->data,
XSTRING (string)->data,
- XSTRING (string)->size_byte)
+ STRING_BYTES (XSTRING (string)))
&& bcmp (XSTRING (bestmatch)->data,
XSTRING (string)->data,
- XSTRING (string)->size_byte)))
+ STRING_BYTES (XSTRING (string)))))
bestmatch = eltstring;
}
bestmatchsize = matchsize;
/* If we are ignoring case, and there is no exact match,
and no additional text was supplied,
don't change the case of what the user typed. */
- if (completion_ignore_case && bestmatchsize == XSTRING (string)->size_byte
- && XSTRING (bestmatch)->size_byte > bestmatchsize)
+ if (completion_ignore_case && bestmatchsize == STRING_BYTES (XSTRING (string))
+ && STRING_BYTES (XSTRING (bestmatch)) > bestmatchsize)
return string;
/* Return t if the supplied string is an exact match (counting case);
it does not require any change to be made. */
- if (matchcount == 1 && bestmatchsize == XSTRING (string)->size_byte
+ if (matchcount == 1 && bestmatchsize == STRING_BYTES (XSTRING (string))
&& !bcmp (XSTRING (bestmatch)->data, XSTRING (string)->data,
bestmatchsize))
return Qt;
/* Is this element a possible completion? */
if (STRINGP (eltstring)
- && XSTRING (string)->size_byte <= XSTRING (eltstring)->size_byte
+ && STRING_BYTES (XSTRING (string)) <= STRING_BYTES (XSTRING (eltstring))
/* If HIDE_SPACES, reject alternatives that start with space
unless the input starts with space. */
- && ((XSTRING (string)->size_byte > 0
+ && ((STRING_BYTES (XSTRING (string)) > 0
&& XSTRING (string)->data[0] == ' ')
|| XSTRING (eltstring)->data[0] != ' '
|| NILP (hide_spaces))
&& 0 > scmp (XSTRING (eltstring)->data, XSTRING (string)->data,
- XSTRING (string)->size_byte))
+ STRING_BYTES (XSTRING (string))))
{
/* Yes. */
Lisp_Object regexps;
tem = oblookup (Vminibuffer_completion_table,
XSTRING (txt)->data,
XSTRING (txt)->size,
- XSTRING (txt)->size_byte);
+ STRING_BYTES (XSTRING (txt)));
if (!SYMBOLP (tem))
return Qnil;
else if (!NILP (Vminibuffer_completion_predicate))
tem = substituted;
Ferase_buffer ();
insert_from_string (tem, 0, 0, XSTRING (tem)->size,
- XSTRING (tem)->size_byte, 0);
+ STRING_BYTES (XSTRING (tem)), 0);
}
}
buffer_string = XSTRING (tem)->data;
completion_string = XSTRING (completion)->data;
- buffer_nbytes = XSTRING (tem)->size_byte; /* ie ZV_BYTE - BEGV_BYTE */
- completion_nbytes = XSTRING (completion)->size_byte;
+ buffer_nbytes = STRING_BYTES (XSTRING (tem)); /* ie ZV_BYTE - BEGV_BYTE */
+ completion_nbytes = STRING_BYTES (XSTRING (completion));
i_byte = buffer_nbytes - completion_nbytes;
if (i_byte > 0 ||
0 <= scmp (buffer_string, completion_string, buffer_nbytes))
int len, c;
completion_string = XSTRING (completion)->data;
- for (; i_byte < XSTRING (completion)->size_byte; i_byte += len, i++)
+ for (; i_byte < STRING_BYTES (XSTRING (completion)); i_byte += len, i++)
{
c = STRING_CHAR_AND_LENGTH (completion_string + i_byte,
XSTRING (completion)->size - i_byte,
/* strout is safe for output to a frame (echo area) or to print_buffer. */
strout (XSTRING (string)->data,
XSTRING (string)->size,
- XSTRING (string)->size_byte,
+ STRING_BYTES (XSTRING (string)),
printcharfun, STRING_MULTIBYTE (string));
else
{
So re-fetch the string address for each character. */
int i;
int size = XSTRING (string)->size;
- int size_byte = XSTRING (string)->size_byte;
+ int size_byte = STRING_BYTES (XSTRING (string));
struct gcpro gcpro1;
GCPRO1 (string);
if (size == size_byte)
#endif
PRINTCHAR ('\"');
- size_byte = XSTRING (obj)->size_byte;
+ size_byte = STRING_BYTES (XSTRING (obj));
for (i = 0, i_byte = 0; i_byte < size_byte;)
{
{
register int confusing;
register unsigned char *p = XSYMBOL (obj)->name->data;
- register unsigned char *end = p + XSYMBOL (obj)->name->size_byte;
+ register unsigned char *end = p + STRING_BYTES (XSYMBOL (obj)->name);
register int c;
int i, i_byte, size_byte;
Lisp_Object name;
PRINTCHAR (':');
}
- size_byte = XSTRING (name)->size_byte;
+ size_byte = STRING_BYTES (XSTRING (name));
for (i = 0, i_byte = 0; i_byte < size_byte;)
{
#ifdef VMS
/* Make a one member argv with all args concatenated
together separated by a blank. */
- len = XSTRING (program)->size_byte + 2;
+ len = STRING_BYTES (XSTRING (program)) + 2;
for (i = 3; i < nargs; i++)
{
tem = args[i];
CHECK_STRING (tem, i);
- len += XSTRING (tem)->size_byte + 1; /* count the blank */
+ len += STRING_BYTES (XSTRING (tem)) + 1; /* count the blank */
}
new_argv = (unsigned char *) alloca (len);
strcpy (new_argv, XSTRING (program)->data);
char *buf = (char *) xmalloc (nbytes + carryover);
bcopy (XSTRING (p->decoding_buf)->data
- + XSTRING (p->decoding_buf)->size_byte - carryover,
+ + STRING_BYTES (XSTRING (p->decoding_buf)) - carryover,
buf, carryover);
bcopy (chars, buf + carryover, nbytes);
chars = buf;
if (carryover)
/* See the comment above. */
bcopy (XSTRING (p->decoding_buf)->data
- + XSTRING (p->decoding_buf)->size_byte - carryover,
+ + STRING_BYTES (XSTRING (p->decoding_buf)) - carryover,
buf, carryover);
if (proc_buffered_char[channel] < 0)
int require = decoding_buffer_size (coding, nbytes);
int result;
- if (XSTRING (p->decoding_buf)->size_byte < require)
+ if (STRING_BYTES (XSTRING (p->decoding_buf)) < require)
p->decoding_buf = make_uninit_string (require);
result = decode_coding (coding, chars, XSTRING (p->decoding_buf)->data,
- nbytes, XSTRING (p->decoding_buf)->size_byte);
+ nbytes, STRING_BYTES (XSTRING (p->decoding_buf)));
carryover = nbytes - coding->consumed;
/* A new coding system might be found by `decode_coding'. */
offset = -1;
}
bcopy ((XSTRING (XPROCESS (proc)->encoding_buf)->data
- + XSTRING (XPROCESS (proc)->encoding_buf)->size_byte
+ + STRING_BYTES (XSTRING (XPROCESS (proc)->encoding_buf))
- carryover),
temp_buf,
carryover);
buf = temp_buf;
}
- if (XSTRING (XPROCESS (proc)->encoding_buf)->size_byte < require)
+ if (STRING_BYTES (XSTRING (XPROCESS (proc)->encoding_buf)) < require)
{
XPROCESS (proc)->encoding_buf = make_uninit_string (require);
}
object = XPROCESS (proc)->encoding_buf;
encode_coding (coding, buf, XSTRING (object)->data,
- len, XSTRING (object)->size_byte);
+ len, STRING_BYTES (XSTRING (object)));
len = coding->produced;
buf = XSTRING (object)->data;
if (temp_buf)
CHECK_STRING (string, 1);
proc = get_process (process);
send_process (proc, XSTRING (string)->data,
- XSTRING (string)->size_byte, string);
+ STRING_BYTES (XSTRING (string)), string);
return Qnil;
}
\f
if (multibyte == STRING_MULTIBYTE (pattern))
{
raw_pattern = (char *) XSTRING (pattern)->data;
- raw_pattern_size = XSTRING (pattern)->size_byte;
+ raw_pattern_size = STRING_BYTES (XSTRING (pattern));
}
else if (multibyte)
{
raw_pattern_size = XSTRING (pattern)->size;
raw_pattern = (char *) alloca (raw_pattern_size + 1);
copy_text (XSTRING (pattern)->data, raw_pattern,
- XSTRING (pattern)->size_byte, 1, 0);
+ STRING_BYTES (XSTRING (pattern)), 1, 0);
}
cp->regexp = Qnil;
re_match_object = string;
val = re_search (bufp, (char *) XSTRING (string)->data,
- XSTRING (string)->size_byte, pos_byte,
- XSTRING (string)->size_byte - pos_byte,
+ STRING_BYTES (XSTRING (string)), pos_byte,
+ STRING_BYTES (XSTRING (string)) - pos_byte,
&search_regs);
immediate_quit = 0;
last_thing_searched = Qt;
re_match_object = string;
val = re_search (bufp, (char *) XSTRING (string)->data,
- XSTRING (string)->size_byte, 0, XSTRING (string)->size_byte,
- 0);
+ STRING_BYTES (XSTRING (string)), 0,
+ STRING_BYTES (XSTRING (string)), 0);
immediate_quit = 0;
return val;
}
trivial_regexp_p (regexp)
Lisp_Object regexp;
{
- int len = XSTRING (regexp)->size_byte;
+ int len = STRING_BYTES (XSTRING (regexp));
unsigned char *s = XSTRING (regexp)->data;
unsigned char c;
while (--len >= 0)
int posix;
{
int len = XSTRING (string)->size;
- int len_byte = XSTRING (string)->size_byte;
+ int len_byte = STRING_BYTES (XSTRING (string));
register int i;
if (running_asynch_code)
{
raw_pattern = (char *) XSTRING (string)->data;
raw_pattern_size = XSTRING (string)->size;
- raw_pattern_size_byte = XSTRING (string)->size_byte;
+ raw_pattern_size_byte = STRING_BYTES (XSTRING (string));
}
else if (multibyte)
{
raw_pattern_size_byte = XSTRING (string)->size;
raw_pattern = (char *) alloca (raw_pattern_size + 1);
copy_text (XSTRING (string)->data, raw_pattern,
- XSTRING (string)->size_byte, 1, 0);
+ STRING_BYTES (XSTRING (string)), 1, 0);
}
/* Copy and optionally translate the pattern. */
adjust = - punct_count + 5 * (word_count - 1) + 4;
val = make_uninit_multibyte_string (len + adjust,
- XSTRING (string)->size_byte + adjust);
+ STRING_BYTES (XSTRING (string)) + adjust);
o = XSTRING (val)->data;
*o++ = '\\';
*o++ = 'b';
- for (i = 0; i < XSTRING (val)->size_byte; i++)
+ for (i = 0; i < STRING_BYTES (XSTRING (val)); i++)
if (SYNTAX (p[i]) == Sword)
*o++ = p[i];
else if (i > 0 && SYNTAX (p[i-1]) == Sword && --word_count)
accum = Qnil;
- for (pos_byte = 0, pos = 0; pos_byte < XSTRING (newtext)->size_byte;)
+ for (pos_byte = 0, pos = 0; pos_byte < STRING_BYTES (XSTRING (newtext));)
{
int substart = -1;
int subend;
CHECK_STRING (string, 0);
- temp = (unsigned char *) alloca (XSTRING (string)->size_byte * 2);
+ temp = (unsigned char *) alloca (STRING_BYTES (XSTRING (string)) * 2);
/* Now copy the data into the new string, inserting escapes. */
in = XSTRING (string)->data;
- end = in + XSTRING (string)->size_byte;
+ end = in + STRING_BYTES (XSTRING (string));
out = temp;
for (; in != end; in++)
already wasted too much time by walking through the list with
display_mode_element, then we might need to optimize at a higher
level than this.) */
- if (! STRINGP (f->name) || XSTRING (f->name)->size_byte != len
+ if (! STRINGP (f->name) || STRING_BYTES (XSTRING (f->name)) != len
|| bcmp (frame_title_buf, XSTRING (f->name)->data, len) != 0)
x_implicitly_set_name (f, make_string (frame_title_buf, len), Qnil);
}
minibuf_prompt_width
= (display_string (w, vpos, XSTRING (minibuf_prompt)->data,
- XSTRING (minibuf_prompt)->size_byte,
+ STRING_BYTES (XSTRING (minibuf_prompt)),
hpos + WINDOW_LEFT_MARGIN (w),
/* Display a space if we truncate. */
' ',
if (hpos < maxendcol)
hpos = display_string (w, vpos,
XSTRING (string)->data,
- XSTRING (string)->size_byte,
+ STRING_BYTES (XSTRING (string)),
hpos, 0, 0, hpos, maxendcol,
STRING_MULTIBYTE (string));
/* Put a space between items. */
minendcol, maxendcol);
else
hpos = display_string (w, vpos, XSTRING (tem)->data,
- XSTRING (tem)->size_byte,
+ STRING_BYTES (XSTRING (tem)),
hpos, 0, 1, minendcol, maxendcol,
STRING_MULTIBYTE (tem));
}
case 'b':
obj = b->name;
#if 0
- if (maxwidth >= 3 && XSTRING (obj)->size_byte > maxwidth)
+ if (maxwidth >= 3 && STRING_BYTES (XSTRING (obj)) > maxwidth)
{
bcopy (XSTRING (obj)->data, decode_mode_spec_buf, maxwidth - 1);
decode_mode_spec_buf[maxwidth - 1] = '\\';
#if 0
if (NILP (obj))
return "[none]";
- else if (STRINGP (obj) && XSTRING (obj)->size_byte > maxwidth)
+ else if (STRINGP (obj) && STRING_BYTES (XSTRING (obj)) > maxwidth)
{
bcopy ("...", decode_mode_spec_buf, 3);
- bcopy (XSTRING (obj)->data + XSTRING (obj)->size_byte - maxwidth + 3,
+ bcopy (XSTRING (obj)->data + STRING_BYTES (XSTRING (obj)) - maxwidth + 3,
decode_mode_spec_buf + 3, maxwidth - 3);
return decode_mode_spec_buf;
}
dpyinfo->bitmaps[id - 1].pixmap = bitmap;
dpyinfo->bitmaps[id - 1].refcount = 1;
dpyinfo->bitmaps[id - 1].file
- = (char *) xmalloc (XSTRING (file)->size_byte + 1);
+ = (char *) xmalloc (STRING_BYTES (XSTRING (file)) + 1);
dpyinfo->bitmaps[id - 1].depth = 1;
dpyinfo->bitmaps[id - 1].height = height;
dpyinfo->bitmaps[id - 1].width = width;
text.value = XSTRING (name)->data;
text.encoding = XA_STRING;
text.format = 8;
- text.nitems = XSTRING (name)->size_byte;
+ text.nitems = STRING_BYTES (XSTRING (name));
icon_name = (!NILP (f->icon_name) ? f->icon_name : name);
icon.value = XSTRING (icon_name)->data;
icon.encoding = XA_STRING;
icon.format = 8;
- icon.nitems = XSTRING (icon_name)->size_byte;
+ icon.nitems = STRING_BYTES (XSTRING (icon_name));
#ifdef USE_X_TOOLKIT
XSetWMName (FRAME_X_DISPLAY (f),
XtWindow (f->output_data.x->widget), &text);
text.value = XSTRING (name)->data;
text.encoding = XA_STRING;
text.format = 8;
- text.nitems = XSTRING (name)->size_byte;
+ text.nitems = STRING_BYTES (XSTRING (name));
icon_name = (!NILP (f->icon_name) ? f->icon_name : name);
icon.value = XSTRING (icon_name)->data;
icon.encoding = XA_STRING;
icon.format = 8;
- icon.nitems = XSTRING (icon_name)->size_byte;
+ icon.nitems = STRING_BYTES (XSTRING (icon_name));
#ifdef USE_X_TOOLKIT
XSetWMName (FRAME_X_DISPLAY (f),
XtWindow (f->output_data.x->widget), &text);
unsigned char *p = XSTRING (Vx_resource_name)->data;
int i;
- len = XSTRING (Vx_resource_name)->size_byte;
+ len = STRING_BYTES (XSTRING (Vx_resource_name));
/* Only letters, digits, - and _ are valid in resource names.
Count the valid characters and count the invalid ones. */
/* Allocate space for the components, the dots which separate them,
and the final '\0'. Make them big enough for the worst case. */
- name_key = (char *) alloca (XSTRING (Vx_resource_name)->size_byte
+ name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name))
+ (STRINGP (component)
- ? XSTRING (component)->size_byte : 0)
- + XSTRING (attribute)->size_byte
+ ? STRING_BYTES (XSTRING (component)) : 0)
+ + STRING_BYTES (XSTRING (attribute))
+ 3);
- class_key = (char *) alloca (XSTRING (Vx_resource_class)->size_byte
- + XSTRING (class)->size_byte
+ class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class))
+ + STRING_BYTES (XSTRING (class))
+ (STRINGP (subclass)
- ? XSTRING (subclass)->size_byte : 0)
+ ? STRING_BYTES (XSTRING (subclass)) : 0)
+ 3);
/* Start with emacs.FRAMENAME for the name (the specific one)
/* Allocate space for the components, the dots which separate them,
and the final '\0'. Make them big enough for the worst case. */
- name_key = (char *) alloca (XSTRING (Vx_resource_name)->size_byte
+ name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name))
+ (STRINGP (component)
- ? XSTRING (component)->size_byte : 0)
- + XSTRING (attribute)->size_byte
+ ? STRING_BYTES (XSTRING (component)) : 0)
+ + STRING_BYTES (XSTRING (attribute))
+ 3);
- class_key = (char *) alloca (XSTRING (Vx_resource_class)->size_byte
- + XSTRING (class)->size_byte
+ class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class))
+ + STRING_BYTES (XSTRING (class))
+ (STRINGP (subclass)
- ? XSTRING (subclass)->size_byte : 0)
+ ? STRING_BYTES (XSTRING (subclass)) : 0)
+ 3);
/* Start with emacs.FRAMENAME for the name (the specific one)
/* Allocate space for the components, the dots which separate them,
and the final '\0'. */
- name_key = (char *) alloca (XSTRING (Vinvocation_name)->size_byte
+ name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name))
+ strlen (attribute) + 2);
class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1)
+ strlen (class) + 2);
if (NILP (modifiers))
XRebindKeysym (x_current_display, keysym, modifier_list, 0,
- XSTRING (newstring)->data, XSTRING (newstring)->size_byte);
+ XSTRING (newstring)->data,
+ STRING_BYTES (XSTRING (newstring)));
else
{
register Lisp_Object rest, mod;
}
XRebindKeysym (x_current_display, keysym, modifier_list, i,
- XSTRING (newstring)->data, XSTRING (newstring)->size_byte);
+ XSTRING (newstring)->data,
+ STRING_BYTES (XSTRING (newstring)));
}
return Qnil;
if (!NILP (item))
{
CHECK_STRING (item, 2);
- strsize = XSTRING (item)->size_byte;
+ strsize = STRING_BYTES (XSTRING (item));
rawstring = (unsigned char *) xmalloc (strsize);
bcopy (XSTRING (item)->data, rawstring, strsize);
modifier[1] = 1 << i;
j++;
continue;
}
- width = XSTRING (item)->size_byte;
+ width = STRING_BYTES (XSTRING (item));
if (width > maxwidth)
maxwidth = width;
= XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
if (!NILP (descrip))
{
- int gap = maxwidth - XSTRING (item_name)->size_byte;
+ int gap = maxwidth - STRING_BYTES (XSTRING (item_name));
#ifdef C_ALLOCA
Lisp_Object spacer;
spacer = Fmake_string (make_number (gap), make_number (' '));
to reduce gc needs. */
item_data
= (unsigned char *) alloca (maxwidth
- + XSTRING (descrip)->size_byte + 1);
+ + STRING_BYTES (XSTRING (descrip)) + 1);
bcopy (XSTRING (item_name)->data, item_data,
- XSTRING (item_name)->size_byte);
+ STRING_BYTES (XSTRING (item_name)));
for (j = XSTRING (item_name)->size; j < maxwidth; j++)
item_data[j] = ' ';
bcopy (XSTRING (descrip)->data, item_data + j,
- XSTRING (descrip)->size_byte);
- item_data[j + XSTRING (descrip)->size_byte] = 0;
+ STRING_BYTES (XSTRING (descrip)));
+ item_data[j + STRING_BYTES (XSTRING (descrip))] = 0;
#endif
}
else
int num;
*format_ret = 8;
- *size_ret = XSTRING (obj)->size_byte;
+ *size_ret = STRING_BYTES (XSTRING (obj));
*data_ret = XSTRING (obj)->data;
bzero (charsets, (MAX_CHARSET + 1) * sizeof (int));
num = ((*size_ret <= 1 /* Check the possibility of short cut. */
buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (selected_frame),
display, buffer);
data = (unsigned char *) XSTRING (string)->data;
- bytes = XSTRING (string)->size_byte;
+ bytes = STRING_BYTES (XSTRING (string));
bytes_remaining = bytes;
if (! FRAME_X_DISPLAY_INFO (selected_frame)->cut_buffers_initialized)
#endif /* ! 0 */
dpyinfo->x_id_name
- = (char *) xmalloc (XSTRING (Vinvocation_name)->size_byte
- + XSTRING (Vsystem_name)->size_byte
+ = (char *) xmalloc (STRING_BYTES (XSTRING (Vinvocation_name))
+ + STRING_BYTES (XSTRING (Vsystem_name))
+ 2);
sprintf (dpyinfo->x_id_name, "%s@%s",
XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data);