diff options
| author | Ken Raeburn | 2002-07-15 00:01:34 +0000 |
|---|---|---|
| committer | Ken Raeburn | 2002-07-15 00:01:34 +0000 |
| commit | d5db40779d7505244d37476b4f046641f07eea2b (patch) | |
| tree | 5c8bf4dad41639287e722cb7cbdc0709e47a9e53 /src | |
| parent | 491c2516d32fa8b9ba9422ec142c8925dd82af00 (diff) | |
| download | emacs-d5db40779d7505244d37476b4f046641f07eea2b.tar.gz emacs-d5db40779d7505244d37476b4f046641f07eea2b.zip | |
Most uses of XSTRING combined with STRING_BYTES or indirection changed to
SCHARS, SBYTES, STRING_INTERVALS, SREF, SDATA; explicit size_byte references
left unchanged for now.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 22 | ||||
| -rw-r--r-- | src/abbrev.c | 10 | ||||
| -rw-r--r-- | src/alloc.c | 34 | ||||
| -rw-r--r-- | src/buffer.c | 58 | ||||
| -rw-r--r-- | src/bytecode.c | 10 | ||||
| -rw-r--r-- | src/callint.c | 12 | ||||
| -rw-r--r-- | src/callproc.c | 58 | ||||
| -rw-r--r-- | src/casefiddle.c | 12 | ||||
| -rw-r--r-- | src/category.c | 4 | ||||
| -rw-r--r-- | src/ccl.c | 6 | ||||
| -rw-r--r-- | src/charset.c | 16 | ||||
| -rw-r--r-- | src/charset.h | 6 | ||||
| -rw-r--r-- | src/coding.c | 82 | ||||
| -rw-r--r-- | src/composite.c | 12 | ||||
| -rw-r--r-- | src/data.c | 50 | ||||
| -rw-r--r-- | src/dired.c | 70 | ||||
| -rw-r--r-- | src/dispnew.c | 12 | ||||
| -rw-r--r-- | src/disptab.h | 4 | ||||
| -rw-r--r-- | src/doc.c | 68 | ||||
| -rw-r--r-- | src/dosfns.c | 4 | ||||
| -rw-r--r-- | src/editfns.c | 77 | ||||
| -rw-r--r-- | src/emacs.c | 22 | ||||
| -rw-r--r-- | src/eval.c | 10 | ||||
| -rw-r--r-- | src/fileio.c | 278 | ||||
| -rw-r--r-- | src/filelock.c | 16 | ||||
| -rw-r--r-- | src/fns.c | 204 | ||||
| -rw-r--r-- | src/fontset.c | 38 | ||||
| -rw-r--r-- | src/frame.c | 34 | ||||
| -rw-r--r-- | src/indent.c | 6 | ||||
| -rw-r--r-- | src/insdel.c | 22 | ||||
| -rw-r--r-- | src/intervals.c | 18 | ||||
| -rw-r--r-- | src/keyboard.c | 80 | ||||
| -rw-r--r-- | src/keymap.c | 34 | ||||
| -rw-r--r-- | src/lread.c | 102 | ||||
| -rw-r--r-- | src/mac.c | 12 | ||||
| -rw-r--r-- | src/macfns.c | 192 | ||||
| -rw-r--r-- | src/macmenu.c | 26 | ||||
| -rw-r--r-- | src/macterm.c | 30 | ||||
| -rw-r--r-- | src/minibuf.c | 106 | ||||
| -rw-r--r-- | src/msdos.c | 10 | ||||
| -rw-r--r-- | src/print.c | 56 | ||||
| -rw-r--r-- | src/process.c | 132 | ||||
| -rw-r--r-- | src/search.c | 96 | ||||
| -rw-r--r-- | src/sound.c | 16 | ||||
| -rw-r--r-- | src/sunfns.c | 12 | ||||
| -rw-r--r-- | src/syntax.c | 20 | ||||
| -rw-r--r-- | src/syntax.h | 2 | ||||
| -rw-r--r-- | src/sysdep.c | 8 | ||||
| -rw-r--r-- | src/textprop.c | 16 | ||||
| -rw-r--r-- | src/undo.c | 6 | ||||
| -rw-r--r-- | src/w16select.c | 10 | ||||
| -rw-r--r-- | src/w32.c | 4 | ||||
| -rw-r--r-- | src/w32fns.c | 254 | ||||
| -rw-r--r-- | src/w32menu.c | 26 | ||||
| -rw-r--r-- | src/w32proc.c | 8 | ||||
| -rw-r--r-- | src/w32select.c | 12 | ||||
| -rw-r--r-- | src/w32term.c | 26 | ||||
| -rw-r--r-- | src/window.c | 2 | ||||
| -rw-r--r-- | src/xdisp.c | 8 | ||||
| -rw-r--r-- | src/xfaces.c | 114 | ||||
| -rw-r--r-- | src/xfns.c | 272 | ||||
| -rw-r--r-- | src/xmenu.c | 60 | ||||
| -rw-r--r-- | src/xselect.c | 16 | ||||
| -rw-r--r-- | src/xsmfns.c | 18 | ||||
| -rw-r--r-- | src/xterm.c | 56 |
65 files changed, 1569 insertions, 1548 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 5486ef8bf75..791c4f36150 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,25 @@ | |||
| 1 | 2002-07-14 Ken Raeburn <raeburn@gnu.org> | ||
| 2 | |||
| 3 | * lisp.h (SMBP): Deleted. All uses changed to STRING_MULTIBYTE. | ||
| 4 | (STRING_SET_UNIBYTE): New macro. | ||
| 5 | (SET_STRING_BYTES): Deleted. Callers (all of which supplied a | ||
| 6 | length of -1) changed to use STRING_SET_UNIBYTE. | ||
| 7 | |||
| 8 | * abbrev.c, alloc.c, buffer.c, bytecode.c, callint.c, callproc.c, | ||
| 9 | casefiddle.c, category.c, ccl.c, charset.c, charset.h, coding.c, | ||
| 10 | composite.c, data.c, dired.c, dispnew.c, disptab.h, doc.c, | ||
| 11 | dosfns.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fn.c, | ||
| 12 | fontset.c, frame.c, indent.c, insdel.c, intervals.c, keyboard.c, | ||
| 13 | keymap.c, lread.c, mac.c, macfns.c, macmenu.c, macterm.c, | ||
| 14 | minibuf.c, msdos.c, print.c, process.c, search.c, sound.c, | ||
| 15 | sunfns.c, syntax.c, syntax.h, sysdep.c, textprop.c, undo.c, | ||
| 16 | w16select.c, w32.c, w32fns.c, w32menu.c, w32proc.c, w32select.c, | ||
| 17 | w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, | ||
| 18 | xselect.c, xsmfns.c, xterm.c: Most uses of XSTRING combined with | ||
| 19 | STRING_BYTES or indirection changed to SCHARS, SBYTES, | ||
| 20 | STRING_INTERVALS, SREF, SDATA; explicit size_byte references left | ||
| 21 | unchanged for now. | ||
| 22 | |||
| 1 | 2002-07-13 Kim F. Storm <storm@cua.dk> | 23 | 2002-07-13 Kim F. Storm <storm@cua.dk> |
| 2 | 24 | ||
| 3 | * keyboard.c (command_loop_1): Invert check on Vmemory_full. | 25 | * keyboard.c (command_loop_1): Invert check on Vmemory_full. |
diff --git a/src/abbrev.c b/src/abbrev.c index 8cf1c3ebb6f..6e973e9c307 100644 --- a/src/abbrev.c +++ b/src/abbrev.c | |||
| @@ -344,8 +344,8 @@ Returns the abbrev symbol, if expansion took place. */) | |||
| 344 | 344 | ||
| 345 | del_range_both (wordstart, wordstart_byte, wordend, wordend_byte, 1); | 345 | del_range_both (wordstart, wordstart_byte, wordend, wordend_byte, 1); |
| 346 | 346 | ||
| 347 | insert_from_string (expansion, 0, 0, XSTRING (expansion)->size, | 347 | insert_from_string (expansion, 0, 0, SCHARS (expansion), |
| 348 | STRING_BYTES (XSTRING (expansion)), 1); | 348 | SBYTES (expansion), 1); |
| 349 | SET_PT (PT + whitecnt); | 349 | SET_PT (PT + whitecnt); |
| 350 | 350 | ||
| 351 | if (uccount && !lccount) | 351 | if (uccount && !lccount) |
| @@ -427,11 +427,11 @@ is not undone. */) | |||
| 427 | if (!STRINGP (val)) | 427 | if (!STRINGP (val)) |
| 428 | error ("value of abbrev-symbol must be a string"); | 428 | error ("value of abbrev-symbol must be a string"); |
| 429 | zv_before = ZV; | 429 | zv_before = ZV; |
| 430 | del_range_byte (PT_BYTE, PT_BYTE + STRING_BYTES (XSTRING (val)), 1); | 430 | del_range_byte (PT_BYTE, PT_BYTE + SBYTES (val), 1); |
| 431 | /* Don't inherit properties here; just copy from old contents. */ | 431 | /* Don't inherit properties here; just copy from old contents. */ |
| 432 | insert_from_string (Vlast_abbrev_text, 0, 0, | 432 | insert_from_string (Vlast_abbrev_text, 0, 0, |
| 433 | XSTRING (Vlast_abbrev_text)->size, | 433 | SCHARS (Vlast_abbrev_text), |
| 434 | STRING_BYTES (XSTRING (Vlast_abbrev_text)), 0); | 434 | SBYTES (Vlast_abbrev_text), 0); |
| 435 | Vlast_abbrev_text = Qnil; | 435 | Vlast_abbrev_text = Qnil; |
| 436 | /* Total number of characters deleted. */ | 436 | /* Total number of characters deleted. */ |
| 437 | adjust = ZV - zv_before; | 437 | adjust = ZV - zv_before; |
diff --git a/src/alloc.c b/src/alloc.c index 5bb636b549c..80b63345459 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -1684,8 +1684,8 @@ Both LENGTH and INIT must be numbers. */) | |||
| 1684 | { | 1684 | { |
| 1685 | nbytes = XINT (length); | 1685 | nbytes = XINT (length); |
| 1686 | val = make_uninit_string (nbytes); | 1686 | val = make_uninit_string (nbytes); |
| 1687 | p = XSTRING (val)->data; | 1687 | p = SDATA (val); |
| 1688 | end = p + XSTRING (val)->size; | 1688 | end = p + SCHARS (val); |
| 1689 | while (p != end) | 1689 | while (p != end) |
| 1690 | *p++ = c; | 1690 | *p++ = c; |
| 1691 | } | 1691 | } |
| @@ -1696,7 +1696,7 @@ Both LENGTH and INIT must be numbers. */) | |||
| 1696 | 1696 | ||
| 1697 | nbytes = len * XINT (length); | 1697 | nbytes = len * XINT (length); |
| 1698 | val = make_uninit_multibyte_string (XINT (length), nbytes); | 1698 | val = make_uninit_multibyte_string (XINT (length), nbytes); |
| 1699 | p = XSTRING (val)->data; | 1699 | p = SDATA (val); |
| 1700 | end = p + nbytes; | 1700 | end = p + nbytes; |
| 1701 | while (p != end) | 1701 | while (p != end) |
| 1702 | { | 1702 | { |
| @@ -1783,8 +1783,8 @@ make_unibyte_string (contents, length) | |||
| 1783 | { | 1783 | { |
| 1784 | register Lisp_Object val; | 1784 | register Lisp_Object val; |
| 1785 | val = make_uninit_string (length); | 1785 | val = make_uninit_string (length); |
| 1786 | bcopy (contents, XSTRING (val)->data, length); | 1786 | bcopy (contents, SDATA (val), length); |
| 1787 | SET_STRING_BYTES (XSTRING (val), -1); | 1787 | STRING_SET_UNIBYTE (val); |
| 1788 | return val; | 1788 | return val; |
| 1789 | } | 1789 | } |
| 1790 | 1790 | ||
| @@ -1799,7 +1799,7 @@ make_multibyte_string (contents, nchars, nbytes) | |||
| 1799 | { | 1799 | { |
| 1800 | register Lisp_Object val; | 1800 | register Lisp_Object val; |
| 1801 | val = make_uninit_multibyte_string (nchars, nbytes); | 1801 | val = make_uninit_multibyte_string (nchars, nbytes); |
| 1802 | bcopy (contents, XSTRING (val)->data, nbytes); | 1802 | bcopy (contents, SDATA (val), nbytes); |
| 1803 | return val; | 1803 | return val; |
| 1804 | } | 1804 | } |
| 1805 | 1805 | ||
| @@ -1814,9 +1814,9 @@ make_string_from_bytes (contents, nchars, nbytes) | |||
| 1814 | { | 1814 | { |
| 1815 | register Lisp_Object val; | 1815 | register Lisp_Object val; |
| 1816 | val = make_uninit_multibyte_string (nchars, nbytes); | 1816 | val = make_uninit_multibyte_string (nchars, nbytes); |
| 1817 | bcopy (contents, XSTRING (val)->data, nbytes); | 1817 | bcopy (contents, SDATA (val), nbytes); |
| 1818 | if (STRING_BYTES (XSTRING (val)) == XSTRING (val)->size) | 1818 | if (SBYTES (val) == SCHARS (val)) |
| 1819 | SET_STRING_BYTES (XSTRING (val), -1); | 1819 | STRING_SET_UNIBYTE (val); |
| 1820 | return val; | 1820 | return val; |
| 1821 | } | 1821 | } |
| 1822 | 1822 | ||
| @@ -1833,9 +1833,9 @@ make_specified_string (contents, nchars, nbytes, multibyte) | |||
| 1833 | { | 1833 | { |
| 1834 | register Lisp_Object val; | 1834 | register Lisp_Object val; |
| 1835 | val = make_uninit_multibyte_string (nchars, nbytes); | 1835 | val = make_uninit_multibyte_string (nchars, nbytes); |
| 1836 | bcopy (contents, XSTRING (val)->data, nbytes); | 1836 | bcopy (contents, SDATA (val), nbytes); |
| 1837 | if (!multibyte) | 1837 | if (!multibyte) |
| 1838 | SET_STRING_BYTES (XSTRING (val), -1); | 1838 | STRING_SET_UNIBYTE (val); |
| 1839 | return val; | 1839 | return val; |
| 1840 | } | 1840 | } |
| 1841 | 1841 | ||
| @@ -1860,7 +1860,7 @@ make_uninit_string (length) | |||
| 1860 | { | 1860 | { |
| 1861 | Lisp_Object val; | 1861 | Lisp_Object val; |
| 1862 | val = make_uninit_multibyte_string (length, length); | 1862 | val = make_uninit_multibyte_string (length, length); |
| 1863 | SET_STRING_BYTES (XSTRING (val), -1); | 1863 | STRING_SET_UNIBYTE (val); |
| 1864 | return val; | 1864 | return val; |
| 1865 | } | 1865 | } |
| 1866 | 1866 | ||
| @@ -2701,10 +2701,10 @@ make_event_array (nargs, args) | |||
| 2701 | result = Fmake_string (make_number (nargs), make_number (0)); | 2701 | result = Fmake_string (make_number (nargs), make_number (0)); |
| 2702 | for (i = 0; i < nargs; i++) | 2702 | for (i = 0; i < nargs; i++) |
| 2703 | { | 2703 | { |
| 2704 | XSTRING (result)->data[i] = XINT (args[i]); | 2704 | SREF (result, i) = XINT (args[i]); |
| 2705 | /* Move the meta bit to the right place for a string char. */ | 2705 | /* Move the meta bit to the right place for a string char. */ |
| 2706 | if (XINT (args[i]) & CHAR_META) | 2706 | if (XINT (args[i]) & CHAR_META) |
| 2707 | XSTRING (result)->data[i] |= 0x80; | 2707 | SREF (result, i) |= 0x80; |
| 2708 | } | 2708 | } |
| 2709 | 2709 | ||
| 2710 | return result; | 2710 | return result; |
| @@ -3955,8 +3955,8 @@ Does not copy symbols. Copies strings without text properties. */) | |||
| 3955 | else if (FLOATP (obj)) | 3955 | else if (FLOATP (obj)) |
| 3956 | return make_pure_float (XFLOAT_DATA (obj)); | 3956 | return make_pure_float (XFLOAT_DATA (obj)); |
| 3957 | else if (STRINGP (obj)) | 3957 | else if (STRINGP (obj)) |
| 3958 | return make_pure_string (XSTRING (obj)->data, XSTRING (obj)->size, | 3958 | return make_pure_string (SDATA (obj), SCHARS (obj), |
| 3959 | STRING_BYTES (XSTRING (obj)), | 3959 | SBYTES (obj), |
| 3960 | STRING_MULTIBYTE (obj)); | 3960 | STRING_MULTIBYTE (obj)); |
| 3961 | else if (COMPILEDP (obj) || VECTORP (obj)) | 3961 | else if (COMPILEDP (obj) || VECTORP (obj)) |
| 3962 | { | 3962 | { |
| @@ -4700,7 +4700,7 @@ mark_object (argptr) | |||
| 4700 | 4700 | ||
| 4701 | if (!PURE_POINTER_P (XSTRING (ptr->xname))) | 4701 | if (!PURE_POINTER_P (XSTRING (ptr->xname))) |
| 4702 | MARK_STRING (XSTRING (ptr->xname)); | 4702 | MARK_STRING (XSTRING (ptr->xname)); |
| 4703 | MARK_INTERVAL_TREE (XSTRING (ptr->xname)->intervals); | 4703 | MARK_INTERVAL_TREE (STRING_INTERVALS (ptr->xname)); |
| 4704 | 4704 | ||
| 4705 | /* Note that we do not mark the obarray of the symbol. | 4705 | /* Note that we do not mark the obarray of the symbol. |
| 4706 | It is safe not to do so because nothing accesses that | 4706 | It is safe not to do so because nothing accesses that |
diff --git a/src/buffer.c b/src/buffer.c index a5bc8532cfb..8ee60578311 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -193,7 +193,7 @@ nsberror (spec) | |||
| 193 | Lisp_Object spec; | 193 | Lisp_Object spec; |
| 194 | { | 194 | { |
| 195 | if (STRINGP (spec)) | 195 | if (STRINGP (spec)) |
| 196 | error ("No buffer named %s", XSTRING (spec)->data); | 196 | error ("No buffer named %s", SDATA (spec)); |
| 197 | error ("Invalid buffer argument"); | 197 | error ("Invalid buffer argument"); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| @@ -341,7 +341,7 @@ The value is never nil. */) | |||
| 341 | if (!NILP (buf)) | 341 | if (!NILP (buf)) |
| 342 | return buf; | 342 | return buf; |
| 343 | 343 | ||
| 344 | if (XSTRING (name)->size == 0) | 344 | if (SCHARS (name) == 0) |
| 345 | error ("Empty string for buffer name is not allowed"); | 345 | error ("Empty string for buffer name is not allowed"); |
| 346 | 346 | ||
| 347 | b = (struct buffer *) allocate_buffer (); | 347 | b = (struct buffer *) allocate_buffer (); |
| @@ -397,10 +397,10 @@ The value is never nil. */) | |||
| 397 | b->zv_marker = Qnil; | 397 | b->zv_marker = Qnil; |
| 398 | 398 | ||
| 399 | name = Fcopy_sequence (name); | 399 | name = Fcopy_sequence (name); |
| 400 | XSTRING (name)->intervals = NULL_INTERVAL; | 400 | STRING_INTERVALS (name) = NULL_INTERVAL; |
| 401 | b->name = name; | 401 | b->name = name; |
| 402 | 402 | ||
| 403 | if (XSTRING (name)->data[0] != ' ') | 403 | if (SREF (name, 0) != ' ') |
| 404 | b->undo_list = Qnil; | 404 | b->undo_list = Qnil; |
| 405 | else | 405 | else |
| 406 | b->undo_list = Qt; | 406 | b->undo_list = Qt; |
| @@ -520,13 +520,13 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 520 | 520 | ||
| 521 | buf = Fget_buffer (name); | 521 | buf = Fget_buffer (name); |
| 522 | if (!NILP (buf)) | 522 | if (!NILP (buf)) |
| 523 | error ("Buffer name `%s' is in use", XSTRING (name)->data); | 523 | error ("Buffer name `%s' is in use", SDATA (name)); |
| 524 | 524 | ||
| 525 | base_buffer = Fget_buffer (base_buffer); | 525 | base_buffer = Fget_buffer (base_buffer); |
| 526 | if (NILP (base_buffer)) | 526 | if (NILP (base_buffer)) |
| 527 | error ("No such buffer: `%s'", XSTRING (name)->data); | 527 | error ("No such buffer: `%s'", SDATA (name)); |
| 528 | 528 | ||
| 529 | if (XSTRING (name)->size == 0) | 529 | if (SCHARS (name) == 0) |
| 530 | error ("Empty string for buffer name is not allowed"); | 530 | error ("Empty string for buffer name is not allowed"); |
| 531 | 531 | ||
| 532 | b = (struct buffer *) allocate_buffer (); | 532 | b = (struct buffer *) allocate_buffer (); |
| @@ -556,7 +556,7 @@ CLONE nil means the indirect buffer's state is reset to default values. */) | |||
| 556 | all_buffers = b; | 556 | all_buffers = b; |
| 557 | 557 | ||
| 558 | name = Fcopy_sequence (name); | 558 | name = Fcopy_sequence (name); |
| 559 | XSTRING (name)->intervals = NULL_INTERVAL; | 559 | STRING_INTERVALS (name) = NULL_INTERVAL; |
| 560 | b->name = name; | 560 | b->name = name; |
| 561 | 561 | ||
| 562 | reset_buffer (b); | 562 | reset_buffer (b); |
| @@ -1091,7 +1091,7 @@ This does not change the name of the visited file (if any). */) | |||
| 1091 | 1091 | ||
| 1092 | CHECK_STRING (newname); | 1092 | CHECK_STRING (newname); |
| 1093 | 1093 | ||
| 1094 | if (XSTRING (newname)->size == 0) | 1094 | if (SCHARS (newname) == 0) |
| 1095 | error ("Empty string is invalid as a buffer name"); | 1095 | error ("Empty string is invalid as a buffer name"); |
| 1096 | 1096 | ||
| 1097 | tem = Fget_buffer (newname); | 1097 | tem = Fget_buffer (newname); |
| @@ -1106,7 +1106,7 @@ This does not change the name of the visited file (if any). */) | |||
| 1106 | if (!NILP (unique)) | 1106 | if (!NILP (unique)) |
| 1107 | newname = Fgenerate_new_buffer_name (newname, current_buffer->name); | 1107 | newname = Fgenerate_new_buffer_name (newname, current_buffer->name); |
| 1108 | else | 1108 | else |
| 1109 | error ("Buffer name `%s' is in use", XSTRING (newname)->data); | 1109 | error ("Buffer name `%s' is in use", SDATA (newname)); |
| 1110 | } | 1110 | } |
| 1111 | 1111 | ||
| 1112 | current_buffer->name = newname; | 1112 | current_buffer->name = newname; |
| @@ -1163,7 +1163,7 @@ If BUFFER is omitted or nil, some interesting buffer is returned. */) | |||
| 1163 | buf = Fcdr (Fcar (tail)); | 1163 | buf = Fcdr (Fcar (tail)); |
| 1164 | if (EQ (buf, buffer)) | 1164 | if (EQ (buf, buffer)) |
| 1165 | continue; | 1165 | continue; |
| 1166 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') | 1166 | if (SDATA (XBUFFER (buf)->name)[0] == ' ') |
| 1167 | continue; | 1167 | continue; |
| 1168 | /* If the selected frame has a buffer_predicate, | 1168 | /* If the selected frame has a buffer_predicate, |
| 1169 | disregard buffers that don't fit the predicate. */ | 1169 | disregard buffers that don't fit the predicate. */ |
| @@ -1289,7 +1289,7 @@ with SIGHUP. */) | |||
| 1289 | { | 1289 | { |
| 1290 | GCPRO1 (buf); | 1290 | GCPRO1 (buf); |
| 1291 | tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", | 1291 | tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", |
| 1292 | XSTRING (b->name)->data)); | 1292 | SDATA (b->name))); |
| 1293 | UNGCPRO; | 1293 | UNGCPRO; |
| 1294 | if (NILP (tem)) | 1294 | if (NILP (tem)) |
| 1295 | return Qnil; | 1295 | return Qnil; |
| @@ -1535,7 +1535,7 @@ the current buffer's major mode. */) | |||
| 1535 | Lisp_Object function; | 1535 | Lisp_Object function; |
| 1536 | 1536 | ||
| 1537 | if (STRINGP (XBUFFER (buffer)->name) | 1537 | if (STRINGP (XBUFFER (buffer)->name) |
| 1538 | && strcmp (XSTRING (XBUFFER (buffer)->name)->data, "*scratch*") == 0) | 1538 | && strcmp (SDATA (XBUFFER (buffer)->name), "*scratch*") == 0) |
| 1539 | function = find_symbol_value (intern ("initial-major-mode")); | 1539 | function = find_symbol_value (intern ("initial-major-mode")); |
| 1540 | else | 1540 | else |
| 1541 | { | 1541 | { |
| @@ -2883,24 +2883,24 @@ record_overlay_string (ssl, str, str2, pri, size) | |||
| 2883 | ssl->used++; | 2883 | ssl->used++; |
| 2884 | 2884 | ||
| 2885 | if (NILP (current_buffer->enable_multibyte_characters)) | 2885 | if (NILP (current_buffer->enable_multibyte_characters)) |
| 2886 | nbytes = XSTRING (str)->size; | 2886 | nbytes = SCHARS (str); |
| 2887 | else if (! STRING_MULTIBYTE (str)) | 2887 | else if (! STRING_MULTIBYTE (str)) |
| 2888 | nbytes = count_size_as_multibyte (XSTRING (str)->data, | 2888 | nbytes = count_size_as_multibyte (SDATA (str), |
| 2889 | STRING_BYTES (XSTRING (str))); | 2889 | SBYTES (str)); |
| 2890 | else | 2890 | else |
| 2891 | nbytes = STRING_BYTES (XSTRING (str)); | 2891 | nbytes = SBYTES (str); |
| 2892 | 2892 | ||
| 2893 | ssl->bytes += nbytes; | 2893 | ssl->bytes += nbytes; |
| 2894 | 2894 | ||
| 2895 | if (STRINGP (str2)) | 2895 | if (STRINGP (str2)) |
| 2896 | { | 2896 | { |
| 2897 | if (NILP (current_buffer->enable_multibyte_characters)) | 2897 | if (NILP (current_buffer->enable_multibyte_characters)) |
| 2898 | nbytes = XSTRING (str2)->size; | 2898 | nbytes = SCHARS (str2); |
| 2899 | else if (! STRING_MULTIBYTE (str2)) | 2899 | else if (! STRING_MULTIBYTE (str2)) |
| 2900 | nbytes = count_size_as_multibyte (XSTRING (str2)->data, | 2900 | nbytes = count_size_as_multibyte (SDATA (str2), |
| 2901 | STRING_BYTES (XSTRING (str2))); | 2901 | SBYTES (str2)); |
| 2902 | else | 2902 | else |
| 2903 | nbytes = STRING_BYTES (XSTRING (str2)); | 2903 | nbytes = SBYTES (str2); |
| 2904 | 2904 | ||
| 2905 | ssl->bytes += nbytes; | 2905 | ssl->bytes += nbytes; |
| 2906 | } | 2906 | } |
| @@ -3012,8 +3012,8 @@ overlay_strings (pos, w, pstr) | |||
| 3012 | { | 3012 | { |
| 3013 | int nbytes; | 3013 | int nbytes; |
| 3014 | tem = overlay_tails.buf[i].string; | 3014 | tem = overlay_tails.buf[i].string; |
| 3015 | nbytes = copy_text (XSTRING (tem)->data, p, | 3015 | nbytes = copy_text (SDATA (tem), p, |
| 3016 | STRING_BYTES (XSTRING (tem)), | 3016 | SBYTES (tem), |
| 3017 | STRING_MULTIBYTE (tem), multibyte); | 3017 | STRING_MULTIBYTE (tem), multibyte); |
| 3018 | p += nbytes; | 3018 | p += nbytes; |
| 3019 | } | 3019 | } |
| @@ -3021,15 +3021,15 @@ overlay_strings (pos, w, pstr) | |||
| 3021 | { | 3021 | { |
| 3022 | int nbytes; | 3022 | int nbytes; |
| 3023 | tem = overlay_heads.buf[i].string; | 3023 | tem = overlay_heads.buf[i].string; |
| 3024 | nbytes = copy_text (XSTRING (tem)->data, p, | 3024 | nbytes = copy_text (SDATA (tem), p, |
| 3025 | STRING_BYTES (XSTRING (tem)), | 3025 | SBYTES (tem), |
| 3026 | STRING_MULTIBYTE (tem), multibyte); | 3026 | STRING_MULTIBYTE (tem), multibyte); |
| 3027 | p += nbytes; | 3027 | p += nbytes; |
| 3028 | tem = overlay_heads.buf[i].string2; | 3028 | tem = overlay_heads.buf[i].string2; |
| 3029 | if (STRINGP (tem)) | 3029 | if (STRINGP (tem)) |
| 3030 | { | 3030 | { |
| 3031 | nbytes = copy_text (XSTRING (tem)->data, p, | 3031 | nbytes = copy_text (SDATA (tem), p, |
| 3032 | STRING_BYTES (XSTRING (tem)), | 3032 | SBYTES (tem), |
| 3033 | STRING_MULTIBYTE (tem), multibyte); | 3033 | STRING_MULTIBYTE (tem), multibyte); |
| 3034 | p += nbytes; | 3034 | p += nbytes; |
| 3035 | } | 3035 | } |
| @@ -4282,7 +4282,7 @@ buffer_slot_type_mismatch (offset) | |||
| 4282 | 4282 | ||
| 4283 | sym = PER_BUFFER_SYMBOL (offset); | 4283 | sym = PER_BUFFER_SYMBOL (offset); |
| 4284 | error ("Only %s should be stored in the buffer-local variable %s", | 4284 | error ("Only %s should be stored in the buffer-local variable %s", |
| 4285 | type_name, XSTRING (SYMBOL_NAME (sym))->data); | 4285 | type_name, SDATA (SYMBOL_NAME (sym))); |
| 4286 | } | 4286 | } |
| 4287 | 4287 | ||
| 4288 | 4288 | ||
| @@ -5066,7 +5066,7 @@ init_buffer () | |||
| 5066 | because of the ange-ftp completion handler. | 5066 | because of the ange-ftp completion handler. |
| 5067 | However, it is not necessary to turn / into /:/. | 5067 | However, it is not necessary to turn / into /:/. |
| 5068 | So avoid doing that. */ | 5068 | So avoid doing that. */ |
| 5069 | && strcmp ("/", XSTRING (current_buffer->directory)->data)) | 5069 | && strcmp ("/", SDATA (current_buffer->directory))) |
| 5070 | current_buffer->directory | 5070 | current_buffer->directory |
| 5071 | = concat2 (build_string ("/:"), current_buffer->directory); | 5071 | = concat2 (build_string ("/:"), current_buffer->directory); |
| 5072 | 5072 | ||
diff --git a/src/bytecode.c b/src/bytecode.c index 7f58b4d17ab..bcb80596944 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -327,10 +327,10 @@ unmark_byte_stack () | |||
| 327 | XUNMARK (stack->byte_string); | 327 | XUNMARK (stack->byte_string); |
| 328 | XUNMARK (stack->constants); | 328 | XUNMARK (stack->constants); |
| 329 | 329 | ||
| 330 | if (stack->byte_string_start != XSTRING (stack->byte_string)->data) | 330 | if (stack->byte_string_start != SDATA (stack->byte_string)) |
| 331 | { | 331 | { |
| 332 | int offset = stack->pc - stack->byte_string_start; | 332 | int offset = stack->pc - stack->byte_string_start; |
| 333 | stack->byte_string_start = XSTRING (stack->byte_string)->data; | 333 | stack->byte_string_start = SDATA (stack->byte_string); |
| 334 | stack->pc = stack->byte_string_start + offset; | 334 | stack->pc = stack->byte_string_start + offset; |
| 335 | } | 335 | } |
| 336 | } | 336 | } |
| @@ -460,11 +460,11 @@ If the third argument is incorrect, Emacs may crash. */) | |||
| 460 | convert them back to the originally intended unibyte form. */ | 460 | convert them back to the originally intended unibyte form. */ |
| 461 | bytestr = Fstring_as_unibyte (bytestr); | 461 | bytestr = Fstring_as_unibyte (bytestr); |
| 462 | 462 | ||
| 463 | bytestr_length = STRING_BYTES (XSTRING (bytestr)); | 463 | bytestr_length = SBYTES (bytestr); |
| 464 | vectorp = XVECTOR (vector)->contents; | 464 | vectorp = XVECTOR (vector)->contents; |
| 465 | 465 | ||
| 466 | stack.byte_string = bytestr; | 466 | stack.byte_string = bytestr; |
| 467 | stack.pc = stack.byte_string_start = XSTRING (bytestr)->data; | 467 | stack.pc = stack.byte_string_start = SDATA (bytestr); |
| 468 | stack.constants = vector; | 468 | stack.constants = vector; |
| 469 | stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth) | 469 | stack.bottom = (Lisp_Object *) alloca (XFASTINT (maxdepth) |
| 470 | * sizeof (Lisp_Object)); | 470 | * sizeof (Lisp_Object)); |
| @@ -896,7 +896,7 @@ If the third argument is incorrect, Emacs may crash. */) | |||
| 896 | case Btemp_output_buffer_setup: | 896 | case Btemp_output_buffer_setup: |
| 897 | BEFORE_POTENTIAL_GC (); | 897 | BEFORE_POTENTIAL_GC (); |
| 898 | CHECK_STRING (TOP); | 898 | CHECK_STRING (TOP); |
| 899 | temp_output_buffer_setup (XSTRING (TOP)->data); | 899 | temp_output_buffer_setup (SDATA (TOP)); |
| 900 | AFTER_POTENTIAL_GC (); | 900 | AFTER_POTENTIAL_GC (); |
| 901 | TOP = Vstandard_output; | 901 | TOP = Vstandard_output; |
| 902 | break; | 902 | break; |
diff --git a/src/callint.c b/src/callint.c index 4bb5cd57ccf..a1c28ca1b13 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -288,9 +288,9 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 288 | { | 288 | { |
| 289 | /* Make a copy of string so that if a GC relocates specs, | 289 | /* Make a copy of string so that if a GC relocates specs, |
| 290 | `string' will still be valid. */ | 290 | `string' will still be valid. */ |
| 291 | string = (unsigned char *) alloca (STRING_BYTES (XSTRING (specs)) + 1); | 291 | string = (unsigned char *) alloca (SBYTES (specs) + 1); |
| 292 | bcopy (XSTRING (specs)->data, string, | 292 | bcopy (SDATA (specs), string, |
| 293 | STRING_BYTES (XSTRING (specs)) + 1); | 293 | SBYTES (specs) + 1); |
| 294 | } | 294 | } |
| 295 | else if (string == 0) | 295 | else if (string == 0) |
| 296 | { | 296 | { |
| @@ -453,7 +453,7 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 453 | argstrings[j] | 453 | argstrings[j] |
| 454 | = (EQ (visargs[j], Qnil) | 454 | = (EQ (visargs[j], Qnil) |
| 455 | ? (unsigned char *) "" | 455 | ? (unsigned char *) "" |
| 456 | : XSTRING (visargs[j])->data); | 456 | : SDATA (visargs[j])); |
| 457 | 457 | ||
| 458 | /* Process the format-string in prompt1, putting the output | 458 | /* Process the format-string in prompt1, putting the output |
| 459 | into callint_message. Make callint_message bigger if necessary. | 459 | into callint_message. Make callint_message bigger if necessary. |
| @@ -599,7 +599,7 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 599 | if (next_event >= key_count) | 599 | if (next_event >= key_count) |
| 600 | error ("%s must be bound to an event with parameters", | 600 | error ("%s must be bound to an event with parameters", |
| 601 | (SYMBOLP (function) | 601 | (SYMBOLP (function) |
| 602 | ? (char *) XSTRING (SYMBOL_NAME (function))->data | 602 | ? (char *) SDATA (SYMBOL_NAME (function)) |
| 603 | : "command")); | 603 | : "command")); |
| 604 | args[i] = XVECTOR (keys)->contents[next_event++]; | 604 | args[i] = XVECTOR (keys)->contents[next_event++]; |
| 605 | varies[i] = -1; | 605 | varies[i] = -1; |
| @@ -644,7 +644,7 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 644 | tem = Fread_from_minibuffer (build_string (callint_message), | 644 | tem = Fread_from_minibuffer (build_string (callint_message), |
| 645 | Qnil, Qnil, Qnil, Qnil, Qnil, | 645 | Qnil, Qnil, Qnil, Qnil, Qnil, |
| 646 | Qnil); | 646 | Qnil); |
| 647 | if (! STRINGP (tem) || XSTRING (tem)->size == 0) | 647 | if (! STRINGP (tem) || SCHARS (tem) == 0) |
| 648 | args[i] = Qnil; | 648 | args[i] = Qnil; |
| 649 | else | 649 | else |
| 650 | args[i] = Fread (tem); | 650 | args[i] = Fread (tem); |
diff --git a/src/callproc.c b/src/callproc.c index c95055c67aa..68c4306b9ca 100644 --- a/src/callproc.c +++ b/src/callproc.c | |||
| @@ -159,8 +159,8 @@ call_process_cleanup (fdpid) | |||
| 159 | register Lisp_Object file; | 159 | register Lisp_Object file; |
| 160 | file = Fcdr (fdpid); | 160 | file = Fcdr (fdpid); |
| 161 | emacs_close (XFASTINT (Fcar (fdpid))); | 161 | emacs_close (XFASTINT (Fcar (fdpid))); |
| 162 | if (strcmp (XSTRING (file)-> data, NULL_DEVICE) != 0) | 162 | if (strcmp (SDATA (file), NULL_DEVICE) != 0) |
| 163 | unlink (XSTRING (file)->data); | 163 | unlink (SDATA (file)); |
| 164 | #else /* not MSDOS and not MAC_OS8 */ | 164 | #else /* not MSDOS and not MAC_OS8 */ |
| 165 | register int pid = XFASTINT (Fcdr (fdpid)); | 165 | register int pid = XFASTINT (Fcdr (fdpid)); |
| 166 | 166 | ||
| @@ -371,7 +371,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 371 | 371 | ||
| 372 | display = nargs >= 4 ? args[3] : Qnil; | 372 | display = nargs >= 4 ? args[3] : Qnil; |
| 373 | 373 | ||
| 374 | filefd = emacs_open (XSTRING (infile)->data, O_RDONLY, 0); | 374 | filefd = emacs_open (SDATA (infile), O_RDONLY, 0); |
| 375 | if (filefd < 0) | 375 | if (filefd < 0) |
| 376 | { | 376 | { |
| 377 | report_file_error ("Opening process input file", Fcons (infile, Qnil)); | 377 | report_file_error ("Opening process input file", Fcons (infile, Qnil)); |
| @@ -389,7 +389,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 389 | emacs_close (filefd); | 389 | emacs_close (filefd); |
| 390 | report_file_error ("Searching for program", Fcons (args[0], Qnil)); | 390 | report_file_error ("Searching for program", Fcons (args[0], Qnil)); |
| 391 | } | 391 | } |
| 392 | new_argv[0] = XSTRING (path)->data; | 392 | new_argv[0] = SDATA (path); |
| 393 | if (nargs > 4) | 393 | if (nargs > 4) |
| 394 | { | 394 | { |
| 395 | register int i; | 395 | register int i; |
| @@ -407,7 +407,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 407 | if (argument_coding.type == coding_type_ccl) | 407 | if (argument_coding.type == coding_type_ccl) |
| 408 | setup_ccl_program (&(argument_coding.spec.ccl.encoder), Qnil); | 408 | setup_ccl_program (&(argument_coding.spec.ccl.encoder), Qnil); |
| 409 | } | 409 | } |
| 410 | new_argv[i - 3] = XSTRING (args[i])->data; | 410 | new_argv[i - 3] = SDATA (args[i]); |
| 411 | } | 411 | } |
| 412 | UNGCPRO; | 412 | UNGCPRO; |
| 413 | new_argv[nargs - 3] = 0; | 413 | new_argv[nargs - 3] = 0; |
| @@ -443,9 +443,9 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 443 | #ifdef MAC_OS8 | 443 | #ifdef MAC_OS8 |
| 444 | /* Since we don't have pipes on the Mac, create a temporary file to | 444 | /* Since we don't have pipes on the Mac, create a temporary file to |
| 445 | hold the output of the subprocess. */ | 445 | hold the output of the subprocess. */ |
| 446 | tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); | 446 | tempfile = (char *) alloca (SBYTES (Vtemp_file_name_pattern) + 1); |
| 447 | bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile, | 447 | bcopy (SDATA (Vtemp_file_name_pattern), tempfile, |
| 448 | STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); | 448 | SBYTES (Vtemp_file_name_pattern) + 1); |
| 449 | 449 | ||
| 450 | mktemp (tempfile); | 450 | mktemp (tempfile); |
| 451 | 451 | ||
| @@ -505,11 +505,11 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 505 | else if (STRINGP (error_file)) | 505 | else if (STRINGP (error_file)) |
| 506 | { | 506 | { |
| 507 | #ifdef DOS_NT | 507 | #ifdef DOS_NT |
| 508 | fd_error = emacs_open (XSTRING (error_file)->data, | 508 | fd_error = emacs_open (SDATA (error_file), |
| 509 | O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, | 509 | O_WRONLY | O_TRUNC | O_CREAT | O_TEXT, |
| 510 | S_IREAD | S_IWRITE); | 510 | S_IREAD | S_IWRITE); |
| 511 | #else /* not DOS_NT */ | 511 | #else /* not DOS_NT */ |
| 512 | fd_error = creat (XSTRING (error_file)->data, 0666); | 512 | fd_error = creat (SDATA (error_file), 0666); |
| 513 | #endif /* not DOS_NT */ | 513 | #endif /* not DOS_NT */ |
| 514 | } | 514 | } |
| 515 | 515 | ||
| @@ -545,15 +545,15 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) | |||
| 545 | close (fd_error); | 545 | close (fd_error); |
| 546 | fd1 = -1; /* No harm in closing that one! */ | 546 | fd1 = -1; /* No harm in closing that one! */ |
| 547 | 547 | ||
| 548 | infn = XSTRING (infile)->data; | 548 | infn = SDATA (infile); |
| 549 | outfn = tempfile; | 549 | outfn = tempfile; |
| 550 | if (NILP (error_file)) | 550 | if (NILP (error_file)) |
| 551 | errfn = NULL_DEVICE; | 551 | errfn = NULL_DEVICE; |
| 552 | else if (EQ (Qt, error_file)) | 552 | else if (EQ (Qt, error_file)) |
| 553 | errfn = outfn; | 553 | errfn = outfn; |
| 554 | else | 554 | else |
| 555 | errfn = XSTRING (error_file)->data; | 555 | errfn = SDATA (error_file); |
| 556 | currdn = XSTRING (current_dir)->data; | 556 | currdn = SDATA (current_dir); |
| 557 | pid = run_mac_command (new_argv, currdn, infn, outfn, errfn); | 557 | pid = run_mac_command (new_argv, currdn, infn, outfn, errfn); |
| 558 | 558 | ||
| 559 | /* Record that the synchronous process exited and note its | 559 | /* Record that the synchronous process exited and note its |
| @@ -1047,9 +1047,9 @@ usage: (call-process-region START END PROGRAM &optional DELETE BUFFER DISPLAY &r | |||
| 1047 | strcat (tempfile, "detmp.XXX"); | 1047 | strcat (tempfile, "detmp.XXX"); |
| 1048 | #endif | 1048 | #endif |
| 1049 | #else /* not DOS_NT */ | 1049 | #else /* not DOS_NT */ |
| 1050 | char *tempfile = (char *) alloca (STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); | 1050 | char *tempfile = (char *) alloca (SBYTES (Vtemp_file_name_pattern) + 1); |
| 1051 | bcopy (XSTRING (Vtemp_file_name_pattern)->data, tempfile, | 1051 | bcopy (SDATA (Vtemp_file_name_pattern), tempfile, |
| 1052 | STRING_BYTES (XSTRING (Vtemp_file_name_pattern)) + 1); | 1052 | SBYTES (Vtemp_file_name_pattern) + 1); |
| 1053 | #endif /* not DOS_NT */ | 1053 | #endif /* not DOS_NT */ |
| 1054 | 1054 | ||
| 1055 | coding_systems = Qt; | 1055 | coding_systems = Qt; |
| @@ -1188,7 +1188,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 1188 | register char *temp; | 1188 | register char *temp; |
| 1189 | register int i; | 1189 | register int i; |
| 1190 | 1190 | ||
| 1191 | i = STRING_BYTES (XSTRING (current_dir)); | 1191 | i = SBYTES (current_dir); |
| 1192 | #ifdef MSDOS | 1192 | #ifdef MSDOS |
| 1193 | /* MSDOS must have all environment variables malloc'ed, because | 1193 | /* MSDOS must have all environment variables malloc'ed, because |
| 1194 | low-level libc functions that launch subsidiary processes rely | 1194 | low-level libc functions that launch subsidiary processes rely |
| @@ -1199,7 +1199,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 1199 | #endif | 1199 | #endif |
| 1200 | temp = pwd_var + 4; | 1200 | temp = pwd_var + 4; |
| 1201 | bcopy ("PWD=", pwd_var, 4); | 1201 | bcopy ("PWD=", pwd_var, 4); |
| 1202 | bcopy (XSTRING (current_dir)->data, temp, i); | 1202 | bcopy (SDATA (current_dir), temp, i); |
| 1203 | if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP; | 1203 | if (!IS_DIRECTORY_SEP (temp[i - 1])) temp[i++] = DIRECTORY_SEP; |
| 1204 | temp[i] = 0; | 1204 | temp[i] = 0; |
| 1205 | 1205 | ||
| @@ -1253,7 +1253,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 1253 | tem = XCDR (tem)) | 1253 | tem = XCDR (tem)) |
| 1254 | { | 1254 | { |
| 1255 | char **ep = env; | 1255 | char **ep = env; |
| 1256 | char *string = (char *) XSTRING (XCAR (tem))->data; | 1256 | char *string = (char *) SDATA (XCAR (tem)); |
| 1257 | /* See if this string duplicates any string already in the env. | 1257 | /* See if this string duplicates any string already in the env. |
| 1258 | If so, don't put it in. | 1258 | If so, don't put it in. |
| 1259 | When an env var has multiple definitions, | 1259 | When an env var has multiple definitions, |
| @@ -1280,7 +1280,7 @@ child_setup (in, out, err, new_argv, set_pgrp, current_dir) | |||
| 1280 | } | 1280 | } |
| 1281 | #ifdef WINDOWSNT | 1281 | #ifdef WINDOWSNT |
| 1282 | prepare_standard_handles (in, out, err, handles); | 1282 | prepare_standard_handles (in, out, err, handles); |
| 1283 | set_process_dir (XSTRING (current_dir)->data); | 1283 | set_process_dir (SDATA (current_dir)); |
| 1284 | #else /* not WINDOWSNT */ | 1284 | #else /* not WINDOWSNT */ |
| 1285 | /* Make sure that in, out, and err are not actually already in | 1285 | /* Make sure that in, out, and err are not actually already in |
| 1286 | descriptors zero, one, or two; this could happen if Emacs is | 1286 | descriptors zero, one, or two; this could happen if Emacs is |
| @@ -1405,18 +1405,18 @@ getenv_internal (var, varlen, value, valuelen) | |||
| 1405 | 1405 | ||
| 1406 | entry = XCAR (scan); | 1406 | entry = XCAR (scan); |
| 1407 | if (STRINGP (entry) | 1407 | if (STRINGP (entry) |
| 1408 | && STRING_BYTES (XSTRING (entry)) > varlen | 1408 | && SBYTES (entry) > varlen |
| 1409 | && XSTRING (entry)->data[varlen] == '=' | 1409 | && SREF (entry, varlen) == '=' |
| 1410 | #ifdef WINDOWSNT | 1410 | #ifdef WINDOWSNT |
| 1411 | /* NT environment variables are case insensitive. */ | 1411 | /* NT environment variables are case insensitive. */ |
| 1412 | && ! strnicmp (XSTRING (entry)->data, var, varlen) | 1412 | && ! strnicmp (SDATA (entry), var, varlen) |
| 1413 | #else /* not WINDOWSNT */ | 1413 | #else /* not WINDOWSNT */ |
| 1414 | && ! bcmp (XSTRING (entry)->data, var, varlen) | 1414 | && ! bcmp (SDATA (entry), var, varlen) |
| 1415 | #endif /* not WINDOWSNT */ | 1415 | #endif /* not WINDOWSNT */ |
| 1416 | ) | 1416 | ) |
| 1417 | { | 1417 | { |
| 1418 | *value = (char *) XSTRING (entry)->data + (varlen + 1); | 1418 | *value = (char *) SDATA (entry) + (varlen + 1); |
| 1419 | *valuelen = STRING_BYTES (XSTRING (entry)) - (varlen + 1); | 1419 | *valuelen = SBYTES (entry) - (varlen + 1); |
| 1420 | return 1; | 1420 | return 1; |
| 1421 | } | 1421 | } |
| 1422 | } | 1422 | } |
| @@ -1435,7 +1435,7 @@ This function consults the variable ``process-environment'' for its value. */) | |||
| 1435 | int valuelen; | 1435 | int valuelen; |
| 1436 | 1436 | ||
| 1437 | CHECK_STRING (var); | 1437 | CHECK_STRING (var); |
| 1438 | if (getenv_internal (XSTRING (var)->data, STRING_BYTES (XSTRING (var)), | 1438 | if (getenv_internal (SDATA (var), SBYTES (var), |
| 1439 | &value, &valuelen)) | 1439 | &value, &valuelen)) |
| 1440 | return make_string (value, valuelen); | 1440 | return make_string (value, valuelen); |
| 1441 | else | 1441 | else |
| @@ -1550,13 +1550,13 @@ init_callproc () | |||
| 1550 | #endif | 1550 | #endif |
| 1551 | { | 1551 | { |
| 1552 | tempdir = Fdirectory_file_name (Vexec_directory); | 1552 | tempdir = Fdirectory_file_name (Vexec_directory); |
| 1553 | if (access (XSTRING (tempdir)->data, 0) < 0) | 1553 | if (access (SDATA (tempdir), 0) < 0) |
| 1554 | dir_warning ("Warning: arch-dependent data dir (%s) does not exist.\n", | 1554 | dir_warning ("Warning: arch-dependent data dir (%s) does not exist.\n", |
| 1555 | Vexec_directory); | 1555 | Vexec_directory); |
| 1556 | } | 1556 | } |
| 1557 | 1557 | ||
| 1558 | tempdir = Fdirectory_file_name (Vdata_directory); | 1558 | tempdir = Fdirectory_file_name (Vdata_directory); |
| 1559 | if (access (XSTRING (tempdir)->data, 0) < 0) | 1559 | if (access (SDATA (tempdir), 0) < 0) |
| 1560 | dir_warning ("Warning: arch-independent data dir (%s) does not exist.\n", | 1560 | dir_warning ("Warning: arch-independent data dir (%s) does not exist.\n", |
| 1561 | Vdata_directory); | 1561 | Vdata_directory); |
| 1562 | 1562 | ||
diff --git a/src/casefiddle.c b/src/casefiddle.c index c449547bf1d..78c3bb2e8c7 100644 --- a/src/casefiddle.c +++ b/src/casefiddle.c | |||
| @@ -68,12 +68,12 @@ casify_object (flag, obj) | |||
| 68 | int multibyte = STRING_MULTIBYTE (obj); | 68 | int multibyte = STRING_MULTIBYTE (obj); |
| 69 | 69 | ||
| 70 | obj = Fcopy_sequence (obj); | 70 | obj = Fcopy_sequence (obj); |
| 71 | len = STRING_BYTES (XSTRING (obj)); | 71 | len = SBYTES (obj); |
| 72 | 72 | ||
| 73 | /* Scan all single-byte characters from start of string. */ | 73 | /* Scan all single-byte characters from start of string. */ |
| 74 | for (i = 0; i < len;) | 74 | for (i = 0; i < len;) |
| 75 | { | 75 | { |
| 76 | c = XSTRING (obj)->data[i]; | 76 | c = SREF (obj, i); |
| 77 | 77 | ||
| 78 | if (multibyte && c >= 0x80) | 78 | if (multibyte && c >= 0x80) |
| 79 | /* A multibyte character can't be handled in this | 79 | /* A multibyte character can't be handled in this |
| @@ -90,7 +90,7 @@ casify_object (flag, obj) | |||
| 90 | : ! SINGLE_BYTE_CHAR_P (c)) | 90 | : ! SINGLE_BYTE_CHAR_P (c)) |
| 91 | break; | 91 | break; |
| 92 | 92 | ||
| 93 | XSTRING (obj)->data[i] = c; | 93 | SREF (obj, i) = c; |
| 94 | if ((int) flag >= (int) CASE_CAPITALIZE) | 94 | if ((int) flag >= (int) CASE_CAPITALIZE) |
| 95 | inword = SYNTAX (c) == Sword; | 95 | inword = SYNTAX (c) == Sword; |
| 96 | i++; | 96 | i++; |
| @@ -107,12 +107,12 @@ casify_object (flag, obj) | |||
| 107 | = (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i); | 107 | = (char *) alloca ((len - i) * MAX_MULTIBYTE_LENGTH + i); |
| 108 | 108 | ||
| 109 | /* Copy data already handled. */ | 109 | /* Copy data already handled. */ |
| 110 | bcopy (XSTRING (obj)->data, buf, i); | 110 | bcopy (SDATA (obj), buf, i); |
| 111 | 111 | ||
| 112 | /* From now on, I counts bytes. */ | 112 | /* From now on, I counts bytes. */ |
| 113 | while (i < len) | 113 | while (i < len) |
| 114 | { | 114 | { |
| 115 | c = STRING_CHAR_AND_LENGTH (XSTRING (obj)->data + i, | 115 | c = STRING_CHAR_AND_LENGTH (SDATA (obj) + i, |
| 116 | len - i, fromlen); | 116 | len - i, fromlen); |
| 117 | if (inword && flag != CASE_CAPITALIZE_UP) | 117 | if (inword && flag != CASE_CAPITALIZE_UP) |
| 118 | c = DOWNCASE (c); | 118 | c = DOWNCASE (c); |
| @@ -124,7 +124,7 @@ casify_object (flag, obj) | |||
| 124 | if ((int) flag >= (int) CASE_CAPITALIZE) | 124 | if ((int) flag >= (int) CASE_CAPITALIZE) |
| 125 | inword = SYNTAX (c) == Sword; | 125 | inword = SYNTAX (c) == Sword; |
| 126 | } | 126 | } |
| 127 | obj = make_multibyte_string (buf, XSTRING (obj)->size, | 127 | obj = make_multibyte_string (buf, SCHARS (obj), |
| 128 | j_byte); | 128 | j_byte); |
| 129 | } | 129 | } |
| 130 | return obj; | 130 | return obj; |
diff --git a/src/category.c b/src/category.c index bbd4686ed86..c7ae2ccf90d 100644 --- a/src/category.c +++ b/src/category.c | |||
| @@ -69,12 +69,12 @@ those categories. */) | |||
| 69 | if (STRING_MULTIBYTE (categories)) | 69 | if (STRING_MULTIBYTE (categories)) |
| 70 | error ("Multibyte string in make-category-set"); | 70 | error ("Multibyte string in make-category-set"); |
| 71 | 71 | ||
| 72 | len = XSTRING (categories)->size; | 72 | len = SCHARS (categories); |
| 73 | while (--len >= 0) | 73 | while (--len >= 0) |
| 74 | { | 74 | { |
| 75 | Lisp_Object category; | 75 | Lisp_Object category; |
| 76 | 76 | ||
| 77 | XSETFASTINT (category, XSTRING (categories)->data[len]); | 77 | XSETFASTINT (category, SREF (categories, len)); |
| 78 | CHECK_CATEGORY (category); | 78 | CHECK_CATEGORY (category); |
| 79 | SET_CATEGORY_SET (val, category, Qt); | 79 | SET_CATEGORY_SET (val, category, Qt); |
| 80 | } | 80 | } |
| @@ -2198,12 +2198,12 @@ See the documentation of `define-ccl-program' for the detail of CCL program. */ | |||
| 2198 | if (ccl.ic < i && i < ccl.size) | 2198 | if (ccl.ic < i && i < ccl.size) |
| 2199 | ccl.ic = i; | 2199 | ccl.ic = i; |
| 2200 | } | 2200 | } |
| 2201 | outbufsize = STRING_BYTES (XSTRING (str)) * ccl.buf_magnification + 256; | 2201 | outbufsize = SBYTES (str) * ccl.buf_magnification + 256; |
| 2202 | outbuf = (char *) xmalloc (outbufsize); | 2202 | outbuf = (char *) xmalloc (outbufsize); |
| 2203 | ccl.last_block = NILP (contin); | 2203 | ccl.last_block = NILP (contin); |
| 2204 | ccl.multibyte = STRING_MULTIBYTE (str); | 2204 | ccl.multibyte = STRING_MULTIBYTE (str); |
| 2205 | produced = ccl_driver (&ccl, XSTRING (str)->data, outbuf, | 2205 | produced = ccl_driver (&ccl, SDATA (str), outbuf, |
| 2206 | STRING_BYTES (XSTRING (str)), outbufsize, (int *) 0); | 2206 | SBYTES (str), outbufsize, (int *) 0); |
| 2207 | for (i = 0; i < 8; i++) | 2207 | for (i = 0; i < 8; i++) |
| 2208 | XSET (AREF (status, i), Lisp_Int, ccl.reg[i]); | 2208 | XSET (AREF (status, i), Lisp_Int, ccl.reg[i]); |
| 2209 | XSETINT (AREF (status, 8), ccl.ic); | 2209 | XSETINT (AREF (status, 8), ccl.ic); |
diff --git a/src/charset.c b/src/charset.c index 493c50545ac..191bef85a95 100644 --- a/src/charset.c +++ b/src/charset.c | |||
| @@ -700,14 +700,14 @@ DESCRIPTION (string) is the description string of the charset. */) | |||
| 700 | || !STRINGP (vec[7]) | 700 | || !STRINGP (vec[7]) |
| 701 | || !STRINGP (vec[8])) | 701 | || !STRINGP (vec[8])) |
| 702 | error ("Invalid info-vector argument for defining charset %s", | 702 | error ("Invalid info-vector argument for defining charset %s", |
| 703 | XSTRING (SYMBOL_NAME (charset_symbol))->data); | 703 | SDATA (SYMBOL_NAME (charset_symbol))); |
| 704 | 704 | ||
| 705 | if (NILP (charset_id)) | 705 | if (NILP (charset_id)) |
| 706 | { | 706 | { |
| 707 | charset_id = get_new_private_charset_id (XINT (vec[0]), XINT (vec[2])); | 707 | charset_id = get_new_private_charset_id (XINT (vec[0]), XINT (vec[2])); |
| 708 | if (XINT (charset_id) == 0) | 708 | if (XINT (charset_id) == 0) |
| 709 | error ("There's no room for a new private charset %s", | 709 | error ("There's no room for a new private charset %s", |
| 710 | XSTRING (SYMBOL_NAME (charset_symbol))->data); | 710 | SDATA (SYMBOL_NAME (charset_symbol))); |
| 711 | } | 711 | } |
| 712 | 712 | ||
| 713 | update_charset_table (charset_id, vec[0], vec[1], vec[2], vec[3], | 713 | update_charset_table (charset_id, vec[0], vec[1], vec[2], vec[3], |
| @@ -779,7 +779,7 @@ CHARSET should be defined by `defined-charset' in advance. */) | |||
| 779 | if (XINT (final_char) < '0' || XFASTINT (final_char) > '~') | 779 | if (XINT (final_char) < '0' || XFASTINT (final_char) > '~') |
| 780 | error ("Invalid FINAL-CHAR %c, it should be `0'..`~'", XINT (chars)); | 780 | error ("Invalid FINAL-CHAR %c, it should be `0'..`~'", XINT (chars)); |
| 781 | if ((charset = get_charset_id (charset_symbol)) < 0) | 781 | if ((charset = get_charset_id (charset_symbol)) < 0) |
| 782 | error ("Invalid charset %s", XSTRING (SYMBOL_NAME (charset_symbol))->data); | 782 | error ("Invalid charset %s", SDATA (SYMBOL_NAME (charset_symbol))); |
| 783 | 783 | ||
| 784 | ISO_CHARSET_TABLE (dimension, chars, final_char) = charset; | 784 | ISO_CHARSET_TABLE (dimension, chars, final_char) = charset; |
| 785 | return Qnil; | 785 | return Qnil; |
| @@ -943,8 +943,8 @@ only `ascii', `eight-bit-control', and `eight-bit-graphic'. */) | |||
| 943 | CHECK_STRING (str); | 943 | CHECK_STRING (str); |
| 944 | 944 | ||
| 945 | bzero (charsets, (MAX_CHARSET + 1) * sizeof (int)); | 945 | bzero (charsets, (MAX_CHARSET + 1) * sizeof (int)); |
| 946 | find_charset_in_text (XSTRING (str)->data, XSTRING (str)->size, | 946 | find_charset_in_text (SDATA (str), SCHARS (str), |
| 947 | STRING_BYTES (XSTRING (str)), charsets, table); | 947 | SBYTES (str), charsets, table); |
| 948 | 948 | ||
| 949 | val = Qnil; | 949 | val = Qnil; |
| 950 | if (charsets[1]) | 950 | if (charsets[1]) |
| @@ -1335,9 +1335,9 @@ lisp_string_width (string, precision, nchars, nbytes) | |||
| 1335 | Lisp_Object string; | 1335 | Lisp_Object string; |
| 1336 | int precision, *nchars, *nbytes; | 1336 | int precision, *nchars, *nbytes; |
| 1337 | { | 1337 | { |
| 1338 | int len = XSTRING (string)->size; | 1338 | int len = SCHARS (string); |
| 1339 | int len_byte = STRING_BYTES (XSTRING (string)); | 1339 | int len_byte = SBYTES (string); |
| 1340 | unsigned char *str = XSTRING (string)->data; | 1340 | unsigned char *str = SDATA (string); |
| 1341 | int i = 0, i_byte = 0; | 1341 | int i = 0, i_byte = 0; |
| 1342 | int width = 0; | 1342 | int width = 0; |
| 1343 | struct Lisp_Char_Table *dp = buffer_display_table (); | 1343 | struct Lisp_Char_Table *dp = buffer_display_table (); |
diff --git a/src/charset.h b/src/charset.h index 42ab2308d68..62383e603ba 100644 --- a/src/charset.h +++ b/src/charset.h | |||
| @@ -573,7 +573,7 @@ if (1) \ | |||
| 573 | CHARIDX++; \ | 573 | CHARIDX++; \ |
| 574 | if (STRING_MULTIBYTE (STRING)) \ | 574 | if (STRING_MULTIBYTE (STRING)) \ |
| 575 | { \ | 575 | { \ |
| 576 | unsigned char *ptr = &XSTRING (STRING)->data[BYTEIDX]; \ | 576 | unsigned char *ptr = &SREF (STRING, BYTEIDX); \ |
| 577 | int space_left = XSTRING (STRING)->size_byte - BYTEIDX; \ | 577 | int space_left = XSTRING (STRING)->size_byte - BYTEIDX; \ |
| 578 | int actual_len; \ | 578 | int actual_len; \ |
| 579 | \ | 579 | \ |
| @@ -581,7 +581,7 @@ if (1) \ | |||
| 581 | BYTEIDX += actual_len; \ | 581 | BYTEIDX += actual_len; \ |
| 582 | } \ | 582 | } \ |
| 583 | else \ | 583 | else \ |
| 584 | OUTPUT = XSTRING (STRING)->data[BYTEIDX++]; \ | 584 | OUTPUT = SREF (STRING, BYTEIDX++); \ |
| 585 | } \ | 585 | } \ |
| 586 | else | 586 | else |
| 587 | 587 | ||
| @@ -590,7 +590,7 @@ else | |||
| 590 | #define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \ | 590 | #define FETCH_STRING_CHAR_ADVANCE_NO_CHECK(OUTPUT, STRING, CHARIDX, BYTEIDX) \ |
| 591 | if (1) \ | 591 | if (1) \ |
| 592 | { \ | 592 | { \ |
| 593 | unsigned char *fetch_string_char_ptr = &XSTRING (STRING)->data[BYTEIDX]; \ | 593 | unsigned char *fetch_string_char_ptr = &SREF (STRING, BYTEIDX); \ |
| 594 | int fetch_string_char_space_left = XSTRING (STRING)->size_byte - BYTEIDX; \ | 594 | int fetch_string_char_space_left = XSTRING (STRING)->size_byte - BYTEIDX; \ |
| 595 | int actual_len; \ | 595 | int actual_len; \ |
| 596 | \ | 596 | \ |
diff --git a/src/coding.c b/src/coding.c index af23b636764..0afe0b3ac42 100644 --- a/src/coding.c +++ b/src/coding.c | |||
| @@ -5224,7 +5224,7 @@ coding_save_composition (coding, from, to, obj) | |||
| 5224 | else if (VECTORP (val) || STRINGP (val)) | 5224 | else if (VECTORP (val) || STRINGP (val)) |
| 5225 | { | 5225 | { |
| 5226 | int len = (VECTORP (val) | 5226 | int len = (VECTORP (val) |
| 5227 | ? XVECTOR (val)->size : XSTRING (val)->size); | 5227 | ? XVECTOR (val)->size : SCHARS (val)); |
| 5228 | int i; | 5228 | int i; |
| 5229 | for (i = 0; i < len; i++) | 5229 | for (i = 0; i < len; i++) |
| 5230 | { | 5230 | { |
| @@ -5832,7 +5832,7 @@ run_pre_post_conversion_on_str (str, coding, encodep) | |||
| 5832 | buf->enable_multibyte_characters = multibyte ? Qt : Qnil; | 5832 | buf->enable_multibyte_characters = multibyte ? Qt : Qnil; |
| 5833 | 5833 | ||
| 5834 | insert_from_string (str, 0, 0, | 5834 | insert_from_string (str, 0, 0, |
| 5835 | XSTRING (str)->size, STRING_BYTES (XSTRING (str)), 0); | 5835 | SCHARS (str), SBYTES (str), 0); |
| 5836 | UNGCPRO; | 5836 | UNGCPRO; |
| 5837 | inhibit_pre_post_conversion = 1; | 5837 | inhibit_pre_post_conversion = 1; |
| 5838 | if (encodep) | 5838 | if (encodep) |
| @@ -5864,7 +5864,7 @@ decode_coding_string (str, coding, nocopy) | |||
| 5864 | int consumed, consumed_char, produced, produced_char; | 5864 | int consumed, consumed_char, produced, produced_char; |
| 5865 | 5865 | ||
| 5866 | from = 0; | 5866 | from = 0; |
| 5867 | to_byte = STRING_BYTES (XSTRING (str)); | 5867 | to_byte = SBYTES (str); |
| 5868 | 5868 | ||
| 5869 | saved_coding_symbol = coding->symbol; | 5869 | saved_coding_symbol = coding->symbol; |
| 5870 | coding->src_multibyte = STRING_MULTIBYTE (str); | 5870 | coding->src_multibyte = STRING_MULTIBYTE (str); |
| @@ -5874,7 +5874,7 @@ decode_coding_string (str, coding, nocopy) | |||
| 5874 | /* See the comments in code_convert_region. */ | 5874 | /* See the comments in code_convert_region. */ |
| 5875 | if (coding->type == coding_type_undecided) | 5875 | if (coding->type == coding_type_undecided) |
| 5876 | { | 5876 | { |
| 5877 | detect_coding (coding, XSTRING (str)->data, to_byte); | 5877 | detect_coding (coding, SDATA (str), to_byte); |
| 5878 | if (coding->type == coding_type_undecided) | 5878 | if (coding->type == coding_type_undecided) |
| 5879 | { | 5879 | { |
| 5880 | coding->type = coding_type_emacs_mule; | 5880 | coding->type = coding_type_emacs_mule; |
| @@ -5889,7 +5889,7 @@ decode_coding_string (str, coding, nocopy) | |||
| 5889 | && coding->type != coding_type_ccl) | 5889 | && coding->type != coding_type_ccl) |
| 5890 | { | 5890 | { |
| 5891 | saved_coding_symbol = coding->symbol; | 5891 | saved_coding_symbol = coding->symbol; |
| 5892 | detect_eol (coding, XSTRING (str)->data, to_byte); | 5892 | detect_eol (coding, SDATA (str), to_byte); |
| 5893 | if (coding->eol_type == CODING_EOL_UNDECIDED) | 5893 | if (coding->eol_type == CODING_EOL_UNDECIDED) |
| 5894 | coding->eol_type = CODING_EOL_LF; | 5894 | coding->eol_type = CODING_EOL_LF; |
| 5895 | /* We had better recover the original eol format if we | 5895 | /* We had better recover the original eol format if we |
| @@ -5908,7 +5908,7 @@ decode_coding_string (str, coding, nocopy) | |||
| 5908 | { | 5908 | { |
| 5909 | /* Decoding routines expect the source text to be unibyte. */ | 5909 | /* Decoding routines expect the source text to be unibyte. */ |
| 5910 | str = Fstring_as_unibyte (str); | 5910 | str = Fstring_as_unibyte (str); |
| 5911 | to_byte = STRING_BYTES (XSTRING (str)); | 5911 | to_byte = SBYTES (str); |
| 5912 | nocopy = 1; | 5912 | nocopy = 1; |
| 5913 | coding->src_multibyte = 0; | 5913 | coding->src_multibyte = 0; |
| 5914 | } | 5914 | } |
| @@ -5916,24 +5916,24 @@ decode_coding_string (str, coding, nocopy) | |||
| 5916 | /* Try to skip the heading and tailing ASCIIs. */ | 5916 | /* Try to skip the heading and tailing ASCIIs. */ |
| 5917 | if (require_decoding && coding->type != coding_type_ccl) | 5917 | if (require_decoding && coding->type != coding_type_ccl) |
| 5918 | { | 5918 | { |
| 5919 | SHRINK_CONVERSION_REGION (&from, &to_byte, coding, XSTRING (str)->data, | 5919 | SHRINK_CONVERSION_REGION (&from, &to_byte, coding, SDATA (str), |
| 5920 | 0); | 5920 | 0); |
| 5921 | if (from == to_byte) | 5921 | if (from == to_byte) |
| 5922 | require_decoding = 0; | 5922 | require_decoding = 0; |
| 5923 | shrinked_bytes = from + (STRING_BYTES (XSTRING (str)) - to_byte); | 5923 | shrinked_bytes = from + (SBYTES (str) - to_byte); |
| 5924 | } | 5924 | } |
| 5925 | 5925 | ||
| 5926 | if (!require_decoding) | 5926 | if (!require_decoding) |
| 5927 | { | 5927 | { |
| 5928 | coding->consumed = STRING_BYTES (XSTRING (str)); | 5928 | coding->consumed = SBYTES (str); |
| 5929 | coding->consumed_char = XSTRING (str)->size; | 5929 | coding->consumed_char = SCHARS (str); |
| 5930 | if (coding->dst_multibyte) | 5930 | if (coding->dst_multibyte) |
| 5931 | { | 5931 | { |
| 5932 | str = Fstring_as_multibyte (str); | 5932 | str = Fstring_as_multibyte (str); |
| 5933 | nocopy = 1; | 5933 | nocopy = 1; |
| 5934 | } | 5934 | } |
| 5935 | coding->produced = STRING_BYTES (XSTRING (str)); | 5935 | coding->produced = SBYTES (str); |
| 5936 | coding->produced_char = XSTRING (str)->size; | 5936 | coding->produced_char = SCHARS (str); |
| 5937 | return (nocopy ? str : Fcopy_sequence (str)); | 5937 | return (nocopy ? str : Fcopy_sequence (str)); |
| 5938 | } | 5938 | } |
| 5939 | 5939 | ||
| @@ -5945,7 +5945,7 @@ decode_coding_string (str, coding, nocopy) | |||
| 5945 | consumed = consumed_char = produced = produced_char = 0; | 5945 | consumed = consumed_char = produced = produced_char = 0; |
| 5946 | while (1) | 5946 | while (1) |
| 5947 | { | 5947 | { |
| 5948 | result = decode_coding (coding, XSTRING (str)->data + from + consumed, | 5948 | result = decode_coding (coding, SDATA (str) + from + consumed, |
| 5949 | buf.data + produced, to_byte - from - consumed, | 5949 | buf.data + produced, to_byte - from - consumed, |
| 5950 | buf.size - produced); | 5950 | buf.size - produced); |
| 5951 | consumed += coding->consumed; | 5951 | consumed += coding->consumed; |
| @@ -6014,11 +6014,11 @@ decode_coding_string (str, coding, nocopy) | |||
| 6014 | else | 6014 | else |
| 6015 | newstr = make_uninit_string (produced + shrinked_bytes); | 6015 | newstr = make_uninit_string (produced + shrinked_bytes); |
| 6016 | if (from > 0) | 6016 | if (from > 0) |
| 6017 | bcopy (XSTRING (str)->data, XSTRING (newstr)->data, from); | 6017 | bcopy (SDATA (str), SDATA (newstr), from); |
| 6018 | bcopy (buf.data, XSTRING (newstr)->data + from, produced); | 6018 | bcopy (buf.data, SDATA (newstr) + from, produced); |
| 6019 | if (shrinked_bytes > from) | 6019 | if (shrinked_bytes > from) |
| 6020 | bcopy (XSTRING (str)->data + to_byte, | 6020 | bcopy (SDATA (str) + to_byte, |
| 6021 | XSTRING (newstr)->data + from + produced, | 6021 | SDATA (newstr) + from + produced, |
| 6022 | shrinked_bytes - from); | 6022 | shrinked_bytes - from); |
| 6023 | free_conversion_buffer (&buf); | 6023 | free_conversion_buffer (&buf); |
| 6024 | 6024 | ||
| @@ -6052,8 +6052,8 @@ encode_coding_string (str, coding, nocopy) | |||
| 6052 | str = run_pre_post_conversion_on_str (str, coding, 1); | 6052 | str = run_pre_post_conversion_on_str (str, coding, 1); |
| 6053 | 6053 | ||
| 6054 | from = 0; | 6054 | from = 0; |
| 6055 | to = XSTRING (str)->size; | 6055 | to = SCHARS (str); |
| 6056 | to_byte = STRING_BYTES (XSTRING (str)); | 6056 | to_byte = SBYTES (str); |
| 6057 | 6057 | ||
| 6058 | /* Encoding routines determine the multibyteness of the source text | 6058 | /* Encoding routines determine the multibyteness of the source text |
| 6059 | by coding->src_multibyte. */ | 6059 | by coding->src_multibyte. */ |
| @@ -6061,15 +6061,15 @@ encode_coding_string (str, coding, nocopy) | |||
| 6061 | coding->dst_multibyte = 0; | 6061 | coding->dst_multibyte = 0; |
| 6062 | if (! CODING_REQUIRE_ENCODING (coding)) | 6062 | if (! CODING_REQUIRE_ENCODING (coding)) |
| 6063 | { | 6063 | { |
| 6064 | coding->consumed = STRING_BYTES (XSTRING (str)); | 6064 | coding->consumed = SBYTES (str); |
| 6065 | coding->consumed_char = XSTRING (str)->size; | 6065 | coding->consumed_char = SCHARS (str); |
| 6066 | if (STRING_MULTIBYTE (str)) | 6066 | if (STRING_MULTIBYTE (str)) |
| 6067 | { | 6067 | { |
| 6068 | str = Fstring_as_unibyte (str); | 6068 | str = Fstring_as_unibyte (str); |
| 6069 | nocopy = 1; | 6069 | nocopy = 1; |
| 6070 | } | 6070 | } |
| 6071 | coding->produced = STRING_BYTES (XSTRING (str)); | 6071 | coding->produced = SBYTES (str); |
| 6072 | coding->produced_char = XSTRING (str)->size; | 6072 | coding->produced_char = SCHARS (str); |
| 6073 | return (nocopy ? str : Fcopy_sequence (str)); | 6073 | return (nocopy ? str : Fcopy_sequence (str)); |
| 6074 | } | 6074 | } |
| 6075 | 6075 | ||
| @@ -6079,11 +6079,11 @@ encode_coding_string (str, coding, nocopy) | |||
| 6079 | /* Try to skip the heading and tailing ASCIIs. */ | 6079 | /* Try to skip the heading and tailing ASCIIs. */ |
| 6080 | if (coding->type != coding_type_ccl) | 6080 | if (coding->type != coding_type_ccl) |
| 6081 | { | 6081 | { |
| 6082 | SHRINK_CONVERSION_REGION (&from, &to_byte, coding, XSTRING (str)->data, | 6082 | SHRINK_CONVERSION_REGION (&from, &to_byte, coding, SDATA (str), |
| 6083 | 1); | 6083 | 1); |
| 6084 | if (from == to_byte) | 6084 | if (from == to_byte) |
| 6085 | return (nocopy ? str : Fcopy_sequence (str)); | 6085 | return (nocopy ? str : Fcopy_sequence (str)); |
| 6086 | shrinked_bytes = from + (STRING_BYTES (XSTRING (str)) - to_byte); | 6086 | shrinked_bytes = from + (SBYTES (str) - to_byte); |
| 6087 | } | 6087 | } |
| 6088 | 6088 | ||
| 6089 | len = encoding_buffer_size (coding, to_byte - from); | 6089 | len = encoding_buffer_size (coding, to_byte - from); |
| @@ -6092,7 +6092,7 @@ encode_coding_string (str, coding, nocopy) | |||
| 6092 | consumed = consumed_char = produced = produced_char = 0; | 6092 | consumed = consumed_char = produced = produced_char = 0; |
| 6093 | while (1) | 6093 | while (1) |
| 6094 | { | 6094 | { |
| 6095 | result = encode_coding (coding, XSTRING (str)->data + from + consumed, | 6095 | result = encode_coding (coding, SDATA (str) + from + consumed, |
| 6096 | buf.data + produced, to_byte - from - consumed, | 6096 | buf.data + produced, to_byte - from - consumed, |
| 6097 | buf.size - produced); | 6097 | buf.size - produced); |
| 6098 | consumed += coding->consumed; | 6098 | consumed += coding->consumed; |
| @@ -6114,11 +6114,11 @@ encode_coding_string (str, coding, nocopy) | |||
| 6114 | 6114 | ||
| 6115 | newstr = make_uninit_string (produced + shrinked_bytes); | 6115 | newstr = make_uninit_string (produced + shrinked_bytes); |
| 6116 | if (from > 0) | 6116 | if (from > 0) |
| 6117 | bcopy (XSTRING (str)->data, XSTRING (newstr)->data, from); | 6117 | bcopy (SDATA (str), SDATA (newstr), from); |
| 6118 | bcopy (buf.data, XSTRING (newstr)->data + from, produced); | 6118 | bcopy (buf.data, SDATA (newstr) + from, produced); |
| 6119 | if (shrinked_bytes > from) | 6119 | if (shrinked_bytes > from) |
| 6120 | bcopy (XSTRING (str)->data + to_byte, | 6120 | bcopy (SDATA (str) + to_byte, |
| 6121 | XSTRING (newstr)->data + from + produced, | 6121 | SDATA (newstr) + from + produced, |
| 6122 | shrinked_bytes - from); | 6122 | shrinked_bytes - from); |
| 6123 | 6123 | ||
| 6124 | free_conversion_buffer (&buf); | 6124 | free_conversion_buffer (&buf); |
| @@ -6160,7 +6160,7 @@ DEFUN ("read-non-nil-coding-system", Fread_non_nil_coding_system, | |||
| 6160 | val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil, | 6160 | val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil, |
| 6161 | Qt, Qnil, Qcoding_system_history, Qnil, Qnil); | 6161 | Qt, Qnil, Qcoding_system_history, Qnil, Qnil); |
| 6162 | } | 6162 | } |
| 6163 | while (XSTRING (val)->size == 0); | 6163 | while (SCHARS (val) == 0); |
| 6164 | return (Fintern (val, Qnil)); | 6164 | return (Fintern (val, Qnil)); |
| 6165 | } | 6165 | } |
| 6166 | 6166 | ||
| @@ -6176,7 +6176,7 @@ If the user enters null input, return second argument DEFAULT-CODING-SYSTEM. */ | |||
| 6176 | val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil, | 6176 | val = Fcompleting_read (prompt, Vcoding_system_alist, Qnil, |
| 6177 | Qt, Qnil, Qcoding_system_history, | 6177 | Qt, Qnil, Qcoding_system_history, |
| 6178 | default_coding_system, Qnil); | 6178 | default_coding_system, Qnil); |
| 6179 | return (XSTRING (val)->size == 0 ? Qnil : Fintern (val, Qnil)); | 6179 | return (SCHARS (val) == 0 ? Qnil : Fintern (val, Qnil)); |
| 6180 | } | 6180 | } |
| 6181 | 6181 | ||
| 6182 | DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system, | 6182 | DEFUN ("check-coding-system", Fcheck_coding_system, Scheck_coding_system, |
| @@ -6318,12 +6318,12 @@ highest priority. */) | |||
| 6318 | { | 6318 | { |
| 6319 | CHECK_STRING (string); | 6319 | CHECK_STRING (string); |
| 6320 | 6320 | ||
| 6321 | return detect_coding_system (XSTRING (string)->data, | 6321 | return detect_coding_system (SDATA (string), |
| 6322 | /* "+ 1" is to include the anchor byte | 6322 | /* "+ 1" is to include the anchor byte |
| 6323 | `\0'. With this, code detectors can | 6323 | `\0'. With this, code detectors can |
| 6324 | handle the tailing bytes more | 6324 | handle the tailing bytes more |
| 6325 | accurately. */ | 6325 | accurately. */ |
| 6326 | STRING_BYTES (XSTRING (string)) + 1, | 6326 | SBYTES (string) + 1, |
| 6327 | !NILP (highest), | 6327 | !NILP (highest), |
| 6328 | STRING_MULTIBYTE (string)); | 6328 | STRING_MULTIBYTE (string)); |
| 6329 | } | 6329 | } |
| @@ -6420,9 +6420,9 @@ DEFUN ("find-coding-systems-region-internal", | |||
| 6420 | { | 6420 | { |
| 6421 | if (!STRING_MULTIBYTE (start)) | 6421 | if (!STRING_MULTIBYTE (start)) |
| 6422 | return Qt; | 6422 | return Qt; |
| 6423 | p1 = XSTRING (start)->data, p1end = p1 + STRING_BYTES (XSTRING (start)); | 6423 | p1 = SDATA (start), p1end = p1 + SBYTES (start); |
| 6424 | p2 = p2end = p1end; | 6424 | p2 = p2end = p1end; |
| 6425 | if (XSTRING (start)->size != STRING_BYTES (XSTRING (start))) | 6425 | if (SCHARS (start) != SBYTES (start)) |
| 6426 | non_ascii_p = 1; | 6426 | non_ascii_p = 1; |
| 6427 | } | 6427 | } |
| 6428 | else | 6428 | else |
| @@ -6508,7 +6508,7 @@ code_convert_region1 (start, end, coding_system, encodep) | |||
| 6508 | return make_number (to - from); | 6508 | return make_number (to - from); |
| 6509 | 6509 | ||
| 6510 | if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) | 6510 | if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) |
| 6511 | error ("Invalid coding system: %s", XSTRING (SYMBOL_NAME (coding_system))->data); | 6511 | error ("Invalid coding system: %s", SDATA (SYMBOL_NAME (coding_system))); |
| 6512 | 6512 | ||
| 6513 | coding.mode |= CODING_MODE_LAST_BLOCK; | 6513 | coding.mode |= CODING_MODE_LAST_BLOCK; |
| 6514 | coding.src_multibyte = coding.dst_multibyte | 6514 | coding.src_multibyte = coding.dst_multibyte |
| @@ -6563,7 +6563,7 @@ code_convert_string1 (string, coding_system, nocopy, encodep) | |||
| 6563 | return (NILP (nocopy) ? Fcopy_sequence (string) : string); | 6563 | return (NILP (nocopy) ? Fcopy_sequence (string) : string); |
| 6564 | 6564 | ||
| 6565 | if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) | 6565 | if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) |
| 6566 | error ("Invalid coding system: %s", XSTRING (SYMBOL_NAME (coding_system))->data); | 6566 | error ("Invalid coding system: %s", SDATA (SYMBOL_NAME (coding_system))); |
| 6567 | 6567 | ||
| 6568 | coding.mode |= CODING_MODE_LAST_BLOCK; | 6568 | coding.mode |= CODING_MODE_LAST_BLOCK; |
| 6569 | string = (encodep | 6569 | string = (encodep |
| @@ -6622,7 +6622,7 @@ code_convert_string_norecord (string, coding_system, encodep) | |||
| 6622 | return string; | 6622 | return string; |
| 6623 | 6623 | ||
| 6624 | if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) | 6624 | if (setup_coding_system (Fcheck_coding_system (coding_system), &coding) < 0) |
| 6625 | error ("Invalid coding system: %s", XSTRING (SYMBOL_NAME (coding_system))->data); | 6625 | error ("Invalid coding system: %s", SDATA (SYMBOL_NAME (coding_system))); |
| 6626 | 6626 | ||
| 6627 | coding.composing = COMPOSITION_DISABLED; | 6627 | coding.composing = COMPOSITION_DISABLED; |
| 6628 | coding.mode |= CODING_MODE_LAST_BLOCK; | 6628 | coding.mode |= CODING_MODE_LAST_BLOCK; |
| @@ -6867,7 +6867,7 @@ usage: (find-operation-coding-system OPERATION ARGUMENTS ...) */) | |||
| 6867 | error ("Invalid first argument"); | 6867 | error ("Invalid first argument"); |
| 6868 | if (nargs < 1 + XINT (target_idx)) | 6868 | if (nargs < 1 + XINT (target_idx)) |
| 6869 | error ("Too few arguments for operation: %s", | 6869 | error ("Too few arguments for operation: %s", |
| 6870 | XSTRING (SYMBOL_NAME (operation))->data); | 6870 | SDATA (SYMBOL_NAME (operation))); |
| 6871 | target = args[XINT (target_idx) + 1]; | 6871 | target = args[XINT (target_idx) + 1]; |
| 6872 | if (!(STRINGP (target) | 6872 | if (!(STRINGP (target) |
| 6873 | || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) | 6873 | || (EQ (operation, Qopen_network_stream) && INTEGERP (target)))) |
| @@ -7430,7 +7430,7 @@ emacs_strerror (error_number) | |||
| 7430 | Lisp_Object dec = code_convert_string_norecord (build_string (str), | 7430 | Lisp_Object dec = code_convert_string_norecord (build_string (str), |
| 7431 | Vlocale_coding_system, | 7431 | Vlocale_coding_system, |
| 7432 | 0); | 7432 | 0); |
| 7433 | str = (char *) XSTRING (dec)->data; | 7433 | str = (char *) SDATA (dec); |
| 7434 | } | 7434 | } |
| 7435 | 7435 | ||
| 7436 | return str; | 7436 | return str; |
diff --git a/src/composite.c b/src/composite.c index 8a8406587e2..1b40810a3aa 100644 --- a/src/composite.c +++ b/src/composite.c | |||
| @@ -615,8 +615,8 @@ compose_chars_in_text (start, end, string) | |||
| 615 | count = SPECPDL_INDEX (); | 615 | count = SPECPDL_INDEX (); |
| 616 | GCPRO1 (string); | 616 | GCPRO1 (string); |
| 617 | stop = end; | 617 | stop = end; |
| 618 | ptr = XSTRING (string)->data + string_char_to_byte (string, start); | 618 | ptr = SDATA (string) + string_char_to_byte (string, start); |
| 619 | pend = ptr + STRING_BYTES (XSTRING (string)); | 619 | pend = ptr + SBYTES (string); |
| 620 | } | 620 | } |
| 621 | else | 621 | else |
| 622 | { | 622 | { |
| @@ -650,7 +650,7 @@ compose_chars_in_text (start, end, string) | |||
| 650 | break; | 650 | break; |
| 651 | stop = end; | 651 | stop = end; |
| 652 | if (STRINGP (string)) | 652 | if (STRINGP (string)) |
| 653 | ptr = XSTRING (string)->data + string_char_to_byte (string, start); | 653 | ptr = SDATA (string) + string_char_to_byte (string, start); |
| 654 | else | 654 | else |
| 655 | ptr = CHAR_POS_ADDR (start); | 655 | ptr = CHAR_POS_ADDR (start); |
| 656 | } | 656 | } |
| @@ -680,7 +680,7 @@ compose_chars_in_text (start, end, string) | |||
| 680 | { | 680 | { |
| 681 | start += XINT (val); | 681 | start += XINT (val); |
| 682 | if (STRINGP (string)) | 682 | if (STRINGP (string)) |
| 683 | ptr = XSTRING (string)->data + string_char_to_byte (string, start); | 683 | ptr = SDATA (string) + string_char_to_byte (string, start); |
| 684 | else | 684 | else |
| 685 | ptr = CHAR_POS_ADDR (start); | 685 | ptr = CHAR_POS_ADDR (start); |
| 686 | } | 686 | } |
| @@ -746,7 +746,7 @@ for the composition. See `compose-string' for more detail. */) | |||
| 746 | 746 | ||
| 747 | if (XINT (start) < 0 || | 747 | if (XINT (start) < 0 || |
| 748 | XINT (start) > XINT (end) | 748 | XINT (start) > XINT (end) |
| 749 | || XINT (end) > XSTRING (string)->size) | 749 | || XINT (end) > SCHARS (string)) |
| 750 | args_out_of_range (start, end); | 750 | args_out_of_range (start, end); |
| 751 | 751 | ||
| 752 | compose_text (XINT (start), XINT (end), components, mod_func, string); | 752 | compose_text (XINT (start), XINT (end), components, mod_func, string); |
| @@ -779,7 +779,7 @@ See `find-composition' for more detail. */) | |||
| 779 | if (!NILP (string)) | 779 | if (!NILP (string)) |
| 780 | { | 780 | { |
| 781 | CHECK_STRING (string); | 781 | CHECK_STRING (string); |
| 782 | if (XINT (pos) < 0 || XINT (pos) > XSTRING (string)->size) | 782 | if (XINT (pos) < 0 || XINT (pos) > SCHARS (string)) |
| 783 | args_out_of_range (string, pos); | 783 | args_out_of_range (string, pos); |
| 784 | } | 784 | } |
| 785 | else | 785 | else |
diff --git a/src/data.c b/src/data.c index f2c13dd9749..700395808cc 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -311,7 +311,7 @@ interned in the initial obarray. */) | |||
| 311 | Lisp_Object object; | 311 | Lisp_Object object; |
| 312 | { | 312 | { |
| 313 | if (SYMBOLP (object) | 313 | if (SYMBOLP (object) |
| 314 | && XSTRING (SYMBOL_NAME (object))->data[0] == ':' | 314 | && SREF (SYMBOL_NAME (object), 0) == ':' |
| 315 | && SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (object)) | 315 | && SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P (object)) |
| 316 | return Qt; | 316 | return Qt; |
| 317 | return Qnil; | 317 | return Qnil; |
| @@ -873,7 +873,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf) | |||
| 873 | *XINTFWD (valcontents)->intvar = XINT (newval); | 873 | *XINTFWD (valcontents)->intvar = XINT (newval); |
| 874 | if (*XINTFWD (valcontents)->intvar != XINT (newval)) | 874 | if (*XINTFWD (valcontents)->intvar != XINT (newval)) |
| 875 | error ("Value out of range for variable `%s'", | 875 | error ("Value out of range for variable `%s'", |
| 876 | XSTRING (SYMBOL_NAME (symbol))->data); | 876 | SDATA (SYMBOL_NAME (symbol))); |
| 877 | break; | 877 | break; |
| 878 | 878 | ||
| 879 | case Lisp_Misc_Boolfwd: | 879 | case Lisp_Misc_Boolfwd: |
| @@ -891,7 +891,7 @@ store_symval_forwarding (symbol, valcontents, newval, buf) | |||
| 891 | 891 | ||
| 892 | type = PER_BUFFER_TYPE (offset); | 892 | type = PER_BUFFER_TYPE (offset); |
| 893 | if (XINT (type) == -1) | 893 | if (XINT (type) == -1) |
| 894 | error ("Variable %s is read-only", XSTRING (SYMBOL_NAME (symbol))->data); | 894 | error ("Variable %s is read-only", SDATA (SYMBOL_NAME (symbol))); |
| 895 | 895 | ||
| 896 | if (! NILP (type) && ! NILP (newval) | 896 | if (! NILP (type) && ! NILP (newval) |
| 897 | && XTYPE (newval) != XINT (type)) | 897 | && XTYPE (newval) != XINT (type)) |
| @@ -1447,7 +1447,7 @@ The function `default-value' gets the default value and `set-default' sets it. | |||
| 1447 | 1447 | ||
| 1448 | valcontents = SYMBOL_VALUE (variable); | 1448 | valcontents = SYMBOL_VALUE (variable); |
| 1449 | if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) | 1449 | if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) |
| 1450 | error ("Symbol %s may not be buffer-local", XSTRING (SYMBOL_NAME (variable))->data); | 1450 | error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); |
| 1451 | 1451 | ||
| 1452 | if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) | 1452 | if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) |
| 1453 | return variable; | 1453 | return variable; |
| @@ -1500,7 +1500,7 @@ Instead, use `add-hook' and specify t for the LOCAL argument. */) | |||
| 1500 | 1500 | ||
| 1501 | valcontents = SYMBOL_VALUE (variable); | 1501 | valcontents = SYMBOL_VALUE (variable); |
| 1502 | if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) | 1502 | if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents)) |
| 1503 | error ("Symbol %s may not be buffer-local", XSTRING (SYMBOL_NAME (variable))->data); | 1503 | error ("Symbol %s may not be buffer-local", SDATA (SYMBOL_NAME (variable))); |
| 1504 | 1504 | ||
| 1505 | if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) | 1505 | if (BUFFER_LOCAL_VALUEP (valcontents) || BUFFER_OBJFWDP (valcontents)) |
| 1506 | { | 1506 | { |
| @@ -1643,7 +1643,7 @@ See `modify-frame-parameters'. */) | |||
| 1643 | valcontents = SYMBOL_VALUE (variable); | 1643 | valcontents = SYMBOL_VALUE (variable); |
| 1644 | if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents) | 1644 | if (EQ (variable, Qnil) || EQ (variable, Qt) || KBOARD_OBJFWDP (valcontents) |
| 1645 | || BUFFER_OBJFWDP (valcontents)) | 1645 | || BUFFER_OBJFWDP (valcontents)) |
| 1646 | error ("Symbol %s may not be frame-local", XSTRING (SYMBOL_NAME (variable))->data); | 1646 | error ("Symbol %s may not be frame-local", SDATA (SYMBOL_NAME (variable))); |
| 1647 | 1647 | ||
| 1648 | if (BUFFER_LOCAL_VALUEP (valcontents) | 1648 | if (BUFFER_LOCAL_VALUEP (valcontents) |
| 1649 | || SOME_BUFFER_LOCAL_VALUEP (valcontents)) | 1649 | || SOME_BUFFER_LOCAL_VALUEP (valcontents)) |
| @@ -1827,14 +1827,14 @@ or a byte-code object. IDX starts at 0. */) | |||
| 1827 | { | 1827 | { |
| 1828 | int c, idxval_byte; | 1828 | int c, idxval_byte; |
| 1829 | 1829 | ||
| 1830 | if (idxval < 0 || idxval >= XSTRING (array)->size) | 1830 | if (idxval < 0 || idxval >= SCHARS (array)) |
| 1831 | args_out_of_range (array, idx); | 1831 | args_out_of_range (array, idx); |
| 1832 | if (! STRING_MULTIBYTE (array)) | 1832 | if (! STRING_MULTIBYTE (array)) |
| 1833 | return make_number ((unsigned char) XSTRING (array)->data[idxval]); | 1833 | return make_number ((unsigned char) SREF (array, idxval)); |
| 1834 | idxval_byte = string_char_to_byte (array, idxval); | 1834 | idxval_byte = string_char_to_byte (array, idxval); |
| 1835 | 1835 | ||
| 1836 | c = STRING_CHAR (&XSTRING (array)->data[idxval_byte], | 1836 | c = STRING_CHAR (&SREF (array, idxval_byte), |
| 1837 | STRING_BYTES (XSTRING (array)) - idxval_byte); | 1837 | SBYTES (array) - idxval_byte); |
| 1838 | return make_number (c); | 1838 | return make_number (c); |
| 1839 | } | 1839 | } |
| 1840 | else if (BOOL_VECTOR_P (array)) | 1840 | else if (BOOL_VECTOR_P (array)) |
| @@ -2026,29 +2026,29 @@ IDX starts at 0. */) | |||
| 2026 | int idxval_byte, prev_bytes, new_bytes; | 2026 | int idxval_byte, prev_bytes, new_bytes; |
| 2027 | unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; | 2027 | unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; |
| 2028 | 2028 | ||
| 2029 | if (idxval < 0 || idxval >= XSTRING (array)->size) | 2029 | if (idxval < 0 || idxval >= SCHARS (array)) |
| 2030 | args_out_of_range (array, idx); | 2030 | args_out_of_range (array, idx); |
| 2031 | CHECK_NUMBER (newelt); | 2031 | CHECK_NUMBER (newelt); |
| 2032 | 2032 | ||
| 2033 | idxval_byte = string_char_to_byte (array, idxval); | 2033 | idxval_byte = string_char_to_byte (array, idxval); |
| 2034 | p1 = &XSTRING (array)->data[idxval_byte]; | 2034 | p1 = &SREF (array, idxval_byte); |
| 2035 | PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes); | 2035 | PARSE_MULTIBYTE_SEQ (p1, nbytes - idxval_byte, prev_bytes); |
| 2036 | new_bytes = CHAR_STRING (XINT (newelt), p0); | 2036 | new_bytes = CHAR_STRING (XINT (newelt), p0); |
| 2037 | if (prev_bytes != new_bytes) | 2037 | if (prev_bytes != new_bytes) |
| 2038 | { | 2038 | { |
| 2039 | /* We must relocate the string data. */ | 2039 | /* We must relocate the string data. */ |
| 2040 | int nchars = XSTRING (array)->size; | 2040 | int nchars = SCHARS (array); |
| 2041 | int nbytes = STRING_BYTES (XSTRING (array)); | 2041 | int nbytes = SBYTES (array); |
| 2042 | unsigned char *str; | 2042 | unsigned char *str; |
| 2043 | 2043 | ||
| 2044 | str = (nbytes <= MAX_ALLOCA | 2044 | str = (nbytes <= MAX_ALLOCA |
| 2045 | ? (unsigned char *) alloca (nbytes) | 2045 | ? (unsigned char *) alloca (nbytes) |
| 2046 | : (unsigned char *) xmalloc (nbytes)); | 2046 | : (unsigned char *) xmalloc (nbytes)); |
| 2047 | bcopy (XSTRING (array)->data, str, nbytes); | 2047 | bcopy (SDATA (array), str, nbytes); |
| 2048 | allocate_string_data (XSTRING (array), nchars, | 2048 | allocate_string_data (XSTRING (array), nchars, |
| 2049 | nbytes + new_bytes - prev_bytes); | 2049 | nbytes + new_bytes - prev_bytes); |
| 2050 | bcopy (str, XSTRING (array)->data, idxval_byte); | 2050 | bcopy (str, SDATA (array), idxval_byte); |
| 2051 | p1 = XSTRING (array)->data + idxval_byte; | 2051 | p1 = SDATA (array) + idxval_byte; |
| 2052 | bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, | 2052 | bcopy (str + idxval_byte + prev_bytes, p1 + new_bytes, |
| 2053 | nbytes - (idxval_byte + prev_bytes)); | 2053 | nbytes - (idxval_byte + prev_bytes)); |
| 2054 | if (nbytes > MAX_ALLOCA) | 2054 | if (nbytes > MAX_ALLOCA) |
| @@ -2060,36 +2060,36 @@ IDX starts at 0. */) | |||
| 2060 | } | 2060 | } |
| 2061 | else | 2061 | else |
| 2062 | { | 2062 | { |
| 2063 | if (idxval < 0 || idxval >= XSTRING (array)->size) | 2063 | if (idxval < 0 || idxval >= SCHARS (array)) |
| 2064 | args_out_of_range (array, idx); | 2064 | args_out_of_range (array, idx); |
| 2065 | CHECK_NUMBER (newelt); | 2065 | CHECK_NUMBER (newelt); |
| 2066 | 2066 | ||
| 2067 | if (XINT (newelt) < 0 || SINGLE_BYTE_CHAR_P (XINT (newelt))) | 2067 | if (XINT (newelt) < 0 || SINGLE_BYTE_CHAR_P (XINT (newelt))) |
| 2068 | XSTRING (array)->data[idxval] = XINT (newelt); | 2068 | SREF (array, idxval) = XINT (newelt); |
| 2069 | else | 2069 | else |
| 2070 | { | 2070 | { |
| 2071 | /* We must relocate the string data while converting it to | 2071 | /* We must relocate the string data while converting it to |
| 2072 | multibyte. */ | 2072 | multibyte. */ |
| 2073 | int idxval_byte, prev_bytes, new_bytes; | 2073 | int idxval_byte, prev_bytes, new_bytes; |
| 2074 | unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; | 2074 | unsigned char workbuf[MAX_MULTIBYTE_LENGTH], *p0 = workbuf, *p1; |
| 2075 | unsigned char *origstr = XSTRING (array)->data, *str; | 2075 | unsigned char *origstr = SDATA (array), *str; |
| 2076 | int nchars, nbytes; | 2076 | int nchars, nbytes; |
| 2077 | 2077 | ||
| 2078 | nchars = XSTRING (array)->size; | 2078 | nchars = SCHARS (array); |
| 2079 | nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval); | 2079 | nbytes = idxval_byte = count_size_as_multibyte (origstr, idxval); |
| 2080 | nbytes += count_size_as_multibyte (origstr + idxval, | 2080 | nbytes += count_size_as_multibyte (origstr + idxval, |
| 2081 | nchars - idxval); | 2081 | nchars - idxval); |
| 2082 | str = (nbytes <= MAX_ALLOCA | 2082 | str = (nbytes <= MAX_ALLOCA |
| 2083 | ? (unsigned char *) alloca (nbytes) | 2083 | ? (unsigned char *) alloca (nbytes) |
| 2084 | : (unsigned char *) xmalloc (nbytes)); | 2084 | : (unsigned char *) xmalloc (nbytes)); |
| 2085 | copy_text (XSTRING (array)->data, str, nchars, 0, 1); | 2085 | copy_text (SDATA (array), str, nchars, 0, 1); |
| 2086 | PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte, | 2086 | PARSE_MULTIBYTE_SEQ (str + idxval_byte, nbytes - idxval_byte, |
| 2087 | prev_bytes); | 2087 | prev_bytes); |
| 2088 | new_bytes = CHAR_STRING (XINT (newelt), p0); | 2088 | new_bytes = CHAR_STRING (XINT (newelt), p0); |
| 2089 | allocate_string_data (XSTRING (array), nchars, | 2089 | allocate_string_data (XSTRING (array), nchars, |
| 2090 | nbytes + new_bytes - prev_bytes); | 2090 | nbytes + new_bytes - prev_bytes); |
| 2091 | bcopy (str, XSTRING (array)->data, idxval_byte); | 2091 | bcopy (str, SDATA (array), idxval_byte); |
| 2092 | p1 = XSTRING (array)->data + idxval_byte; | 2092 | p1 = SDATA (array) + idxval_byte; |
| 2093 | while (new_bytes--) | 2093 | while (new_bytes--) |
| 2094 | *p1++ = *p0++; | 2094 | *p1++ = *p0++; |
| 2095 | bcopy (str + idxval_byte + prev_bytes, p1, | 2095 | bcopy (str + idxval_byte + prev_bytes, p1, |
| @@ -2339,7 +2339,7 @@ If the base used is not 10, floating point is not recognized. */) | |||
| 2339 | 2339 | ||
| 2340 | /* Skip any whitespace at the front of the number. Some versions of | 2340 | /* Skip any whitespace at the front of the number. Some versions of |
| 2341 | atoi do this anyway, so we might as well make Emacs lisp consistent. */ | 2341 | atoi do this anyway, so we might as well make Emacs lisp consistent. */ |
| 2342 | p = XSTRING (string)->data; | 2342 | p = SDATA (string); |
| 2343 | while (*p == ' ' || *p == '\t') | 2343 | while (*p == ' ' || *p == '\t') |
| 2344 | p++; | 2344 | p++; |
| 2345 | 2345 | ||
diff --git a/src/dired.c b/src/dired.c index 0a119afb5eb..ec1686ffe14 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -188,7 +188,7 @@ directory_files_internal (directory, full, match, nosort, attrs) | |||
| 188 | unwind_protect to do so would be a pain. */ | 188 | unwind_protect to do so would be a pain. */ |
| 189 | retry: | 189 | retry: |
| 190 | 190 | ||
| 191 | d = opendir (XSTRING (dirfilename)->data); | 191 | d = opendir (SDATA (dirfilename)); |
| 192 | if (d == NULL) | 192 | if (d == NULL) |
| 193 | report_file_error ("Opening directory", Fcons (directory, Qnil)); | 193 | report_file_error ("Opening directory", Fcons (directory, Qnil)); |
| 194 | 194 | ||
| @@ -199,13 +199,13 @@ directory_files_internal (directory, full, match, nosort, attrs) | |||
| 199 | Fcons (make_number (((unsigned long) d) >> 16), | 199 | Fcons (make_number (((unsigned long) d) >> 16), |
| 200 | make_number (((unsigned long) d) & 0xffff))); | 200 | make_number (((unsigned long) d) & 0xffff))); |
| 201 | 201 | ||
| 202 | directory_nbytes = STRING_BYTES (XSTRING (directory)); | 202 | directory_nbytes = SBYTES (directory); |
| 203 | re_match_object = Qt; | 203 | re_match_object = Qt; |
| 204 | 204 | ||
| 205 | /* Decide whether we need to add a directory separator. */ | 205 | /* Decide whether we need to add a directory separator. */ |
| 206 | #ifndef VMS | 206 | #ifndef VMS |
| 207 | if (directory_nbytes == 0 | 207 | if (directory_nbytes == 0 |
| 208 | || !IS_ANY_SEP (XSTRING (directory)->data[directory_nbytes - 1])) | 208 | || !IS_ANY_SEP (SREF (directory, directory_nbytes - 1))) |
| 209 | needsep = 1; | 209 | needsep = 1; |
| 210 | #endif /* not VMS */ | 210 | #endif /* not VMS */ |
| 211 | 211 | ||
| @@ -237,7 +237,7 @@ directory_files_internal (directory, full, match, nosort, attrs) | |||
| 237 | /* Note: ENCODE_FILE can GC; it should protect its argument, | 237 | /* Note: ENCODE_FILE can GC; it should protect its argument, |
| 238 | though. */ | 238 | though. */ |
| 239 | name = DECODE_FILE (name); | 239 | name = DECODE_FILE (name); |
| 240 | len = STRING_BYTES (XSTRING (name)); | 240 | len = SBYTES (name); |
| 241 | 241 | ||
| 242 | /* Now that we have unwind_protect in place, we might as well | 242 | /* Now that we have unwind_protect in place, we might as well |
| 243 | allow matching to be interrupted. */ | 243 | allow matching to be interrupted. */ |
| @@ -245,7 +245,7 @@ directory_files_internal (directory, full, match, nosort, attrs) | |||
| 245 | QUIT; | 245 | QUIT; |
| 246 | 246 | ||
| 247 | if (NILP (match) | 247 | if (NILP (match) |
| 248 | || (0 <= re_search (bufp, XSTRING (name)->data, len, 0, len, 0))) | 248 | || (0 <= re_search (bufp, SDATA (name), len, 0, len, 0))) |
| 249 | wanted = 1; | 249 | wanted = 1; |
| 250 | 250 | ||
| 251 | immediate_quit = 0; | 251 | immediate_quit = 0; |
| @@ -259,25 +259,25 @@ directory_files_internal (directory, full, match, nosort, attrs) | |||
| 259 | int nchars; | 259 | int nchars; |
| 260 | 260 | ||
| 261 | fullname = make_uninit_multibyte_string (nbytes, nbytes); | 261 | fullname = make_uninit_multibyte_string (nbytes, nbytes); |
| 262 | bcopy (XSTRING (directory)->data, XSTRING (fullname)->data, | 262 | bcopy (SDATA (directory), SDATA (fullname), |
| 263 | directory_nbytes); | 263 | directory_nbytes); |
| 264 | 264 | ||
| 265 | if (needsep) | 265 | if (needsep) |
| 266 | XSTRING (fullname)->data[directory_nbytes] = DIRECTORY_SEP; | 266 | SREF (fullname, directory_nbytes) = DIRECTORY_SEP; |
| 267 | 267 | ||
| 268 | bcopy (XSTRING (name)->data, | 268 | bcopy (SDATA (name), |
| 269 | XSTRING (fullname)->data + directory_nbytes + needsep, | 269 | SDATA (fullname) + directory_nbytes + needsep, |
| 270 | len); | 270 | len); |
| 271 | 271 | ||
| 272 | nchars = chars_in_text (XSTRING (fullname)->data, nbytes); | 272 | nchars = chars_in_text (SDATA (fullname), nbytes); |
| 273 | 273 | ||
| 274 | /* Some bug somewhere. */ | 274 | /* Some bug somewhere. */ |
| 275 | if (nchars > nbytes) | 275 | if (nchars > nbytes) |
| 276 | abort (); | 276 | abort (); |
| 277 | 277 | ||
| 278 | XSTRING (fullname)->size = nchars; | 278 | SCHARS (fullname) = nchars; |
| 279 | if (nchars == nbytes) | 279 | if (nchars == nbytes) |
| 280 | SET_STRING_BYTES (XSTRING (fullname), -1); | 280 | STRING_SET_UNIBYTE (fullname); |
| 281 | 281 | ||
| 282 | finalname = fullname; | 282 | finalname = fullname; |
| 283 | } | 283 | } |
| @@ -519,7 +519,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 519 | 519 | ||
| 520 | for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++) | 520 | for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++) |
| 521 | { | 521 | { |
| 522 | d = opendir (XSTRING (Fdirectory_file_name (encoded_dir))->data); | 522 | d = opendir (SDATA (Fdirectory_file_name (encoded_dir))); |
| 523 | if (!d) | 523 | if (!d) |
| 524 | report_file_error ("Opening directory", Fcons (dirname, Qnil)); | 524 | report_file_error ("Opening directory", Fcons (dirname, Qnil)); |
| 525 | 525 | ||
| @@ -542,9 +542,9 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 542 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) | 542 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) |
| 543 | goto quit; | 543 | goto quit; |
| 544 | if (! DIRENTRY_NONEMPTY (dp) | 544 | if (! DIRENTRY_NONEMPTY (dp) |
| 545 | || len < XSTRING (encoded_file)->size | 545 | || len < SCHARS (encoded_file) |
| 546 | || 0 <= scmp (dp->d_name, XSTRING (encoded_file)->data, | 546 | || 0 <= scmp (dp->d_name, SDATA (encoded_file), |
| 547 | XSTRING (encoded_file)->size)) | 547 | SCHARS (encoded_file))) |
| 548 | continue; | 548 | continue; |
| 549 | 549 | ||
| 550 | if (file_name_completion_stat (encoded_dir, dp, &st) < 0) | 550 | if (file_name_completion_stat (encoded_dir, dp, &st) < 0) |
| @@ -561,7 +561,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 561 | actually in the way in a directory contains only one file. */ | 561 | actually in the way in a directory contains only one file. */ |
| 562 | if (!passcount && TRIVIAL_DIRECTORY_ENTRY (dp->d_name)) | 562 | if (!passcount && TRIVIAL_DIRECTORY_ENTRY (dp->d_name)) |
| 563 | continue; | 563 | continue; |
| 564 | if (!passcount && len > XSTRING (encoded_file)->size) | 564 | if (!passcount && len > SCHARS (encoded_file)) |
| 565 | /* Ignore directories if they match an element of | 565 | /* Ignore directories if they match an element of |
| 566 | completion-ignored-extensions which ends in a slash. */ | 566 | completion-ignored-extensions which ends in a slash. */ |
| 567 | for (tem = Vcompletion_ignored_extensions; | 567 | for (tem = Vcompletion_ignored_extensions; |
| @@ -575,10 +575,10 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 575 | /* Need to encode ELT, since scmp compares unibyte | 575 | /* Need to encode ELT, since scmp compares unibyte |
| 576 | strings only. */ | 576 | strings only. */ |
| 577 | elt = ENCODE_FILE (elt); | 577 | elt = ENCODE_FILE (elt); |
| 578 | elt_len = XSTRING (elt)->size - 1; /* -1 for trailing / */ | 578 | elt_len = SCHARS (elt) - 1; /* -1 for trailing / */ |
| 579 | if (elt_len <= 0) | 579 | if (elt_len <= 0) |
| 580 | continue; | 580 | continue; |
| 581 | p1 = XSTRING (elt)->data; | 581 | p1 = SDATA (elt); |
| 582 | if (p1[elt_len] != '/') | 582 | if (p1[elt_len] != '/') |
| 583 | continue; | 583 | continue; |
| 584 | skip = len - elt_len; | 584 | skip = len - elt_len; |
| @@ -594,7 +594,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 594 | { | 594 | { |
| 595 | /* Compare extensions-to-be-ignored against end of this file name */ | 595 | /* Compare extensions-to-be-ignored against end of this file name */ |
| 596 | /* if name is not an exact match against specified string */ | 596 | /* if name is not an exact match against specified string */ |
| 597 | if (!passcount && len > XSTRING (encoded_file)->size) | 597 | if (!passcount && len > SCHARS (encoded_file)) |
| 598 | /* and exit this for loop if a match is found */ | 598 | /* and exit this for loop if a match is found */ |
| 599 | for (tem = Vcompletion_ignored_extensions; | 599 | for (tem = Vcompletion_ignored_extensions; |
| 600 | CONSP (tem); tem = XCDR (tem)) | 600 | CONSP (tem); tem = XCDR (tem)) |
| @@ -604,12 +604,12 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 604 | /* Need to encode ELT, since scmp compares unibyte | 604 | /* Need to encode ELT, since scmp compares unibyte |
| 605 | strings only. */ | 605 | strings only. */ |
| 606 | elt = ENCODE_FILE (elt); | 606 | elt = ENCODE_FILE (elt); |
| 607 | skip = len - XSTRING (elt)->size; | 607 | skip = len - SCHARS (elt); |
| 608 | if (skip < 0) continue; | 608 | if (skip < 0) continue; |
| 609 | 609 | ||
| 610 | if (0 <= scmp (dp->d_name + skip, | 610 | if (0 <= scmp (dp->d_name + skip, |
| 611 | XSTRING (elt)->data, | 611 | SDATA (elt), |
| 612 | XSTRING (elt)->size)) | 612 | SCHARS (elt))) |
| 613 | continue; | 613 | continue; |
| 614 | break; | 614 | break; |
| 615 | } | 615 | } |
| @@ -661,13 +661,13 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 661 | else | 661 | else |
| 662 | { | 662 | { |
| 663 | bestmatch = name; | 663 | bestmatch = name; |
| 664 | bestmatchsize = XSTRING (name)->size; | 664 | bestmatchsize = SCHARS (name); |
| 665 | } | 665 | } |
| 666 | } | 666 | } |
| 667 | else | 667 | else |
| 668 | { | 668 | { |
| 669 | compare = min (bestmatchsize, len); | 669 | compare = min (bestmatchsize, len); |
| 670 | p1 = XSTRING (bestmatch)->data; | 670 | p1 = SDATA (bestmatch); |
| 671 | p2 = (unsigned char *) dp->d_name; | 671 | p2 = (unsigned char *) dp->d_name; |
| 672 | matchsize = scmp(p1, p2, compare); | 672 | matchsize = scmp(p1, p2, compare); |
| 673 | if (matchsize < 0) | 673 | if (matchsize < 0) |
| @@ -682,7 +682,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 682 | but BESTMATCH is not (it is too long). */ | 682 | but BESTMATCH is not (it is too long). */ |
| 683 | if ((matchsize == len | 683 | if ((matchsize == len |
| 684 | && matchsize + !!directoryp | 684 | && matchsize + !!directoryp |
| 685 | < XSTRING (bestmatch)->size) | 685 | < SCHARS (bestmatch)) |
| 686 | || | 686 | || |
| 687 | /* If there is no exact match ignoring case, | 687 | /* If there is no exact match ignoring case, |
| 688 | prefer a match that does not change the case | 688 | prefer a match that does not change the case |
| @@ -695,9 +695,9 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 695 | (((matchsize == len) | 695 | (((matchsize == len) |
| 696 | == | 696 | == |
| 697 | (matchsize + !!directoryp | 697 | (matchsize + !!directoryp |
| 698 | == XSTRING (bestmatch)->size)) | 698 | == SCHARS (bestmatch))) |
| 699 | && !bcmp (p2, XSTRING (encoded_file)->data, XSTRING (encoded_file)->size) | 699 | && !bcmp (p2, SDATA (encoded_file), SCHARS (encoded_file)) |
| 700 | && bcmp (p1, XSTRING (encoded_file)->data, XSTRING (encoded_file)->size))) | 700 | && bcmp (p1, SDATA (encoded_file), SCHARS (encoded_file)))) |
| 701 | { | 701 | { |
| 702 | bestmatch = make_string (dp->d_name, len); | 702 | bestmatch = make_string (dp->d_name, len); |
| 703 | if (directoryp) | 703 | if (directoryp) |
| @@ -727,7 +727,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 727 | bestmatch = DECODE_FILE (bestmatch); | 727 | bestmatch = DECODE_FILE (bestmatch); |
| 728 | return bestmatch; | 728 | return bestmatch; |
| 729 | } | 729 | } |
| 730 | if (matchcount == 1 && bestmatchsize == XSTRING (file)->size) | 730 | if (matchcount == 1 && bestmatchsize == SCHARS (file)) |
| 731 | return Qt; | 731 | return Qt; |
| 732 | bestmatch = Fsubstring (bestmatch, make_number (0), | 732 | bestmatch = Fsubstring (bestmatch, make_number (0), |
| 733 | make_number (bestmatchsize)); | 733 | make_number (bestmatchsize)); |
| @@ -777,7 +777,7 @@ file_name_completion_stat (dirname, dp, st_addr) | |||
| 777 | struct stat *st_addr; | 777 | struct stat *st_addr; |
| 778 | { | 778 | { |
| 779 | int len = NAMLEN (dp); | 779 | int len = NAMLEN (dp); |
| 780 | int pos = XSTRING (dirname)->size; | 780 | int pos = SCHARS (dirname); |
| 781 | int value; | 781 | int value; |
| 782 | char *fullname = (char *) alloca (len + pos + 2); | 782 | char *fullname = (char *) alloca (len + pos + 2); |
| 783 | 783 | ||
| @@ -794,7 +794,7 @@ file_name_completion_stat (dirname, dp, st_addr) | |||
| 794 | #endif /* __DJGPP__ > 1 */ | 794 | #endif /* __DJGPP__ > 1 */ |
| 795 | #endif /* MSDOS */ | 795 | #endif /* MSDOS */ |
| 796 | 796 | ||
| 797 | bcopy (XSTRING (dirname)->data, fullname, pos); | 797 | bcopy (SDATA (dirname), fullname, pos); |
| 798 | #ifndef VMS | 798 | #ifndef VMS |
| 799 | if (!IS_DIRECTORY_SEP (fullname[pos - 1])) | 799 | if (!IS_DIRECTORY_SEP (fullname[pos - 1])) |
| 800 | fullname[pos++] = DIRECTORY_SEP; | 800 | fullname[pos++] = DIRECTORY_SEP; |
| @@ -847,7 +847,7 @@ Returns nil if the file cannot be opened or if there is no version limit. */) | |||
| 847 | filename = Fexpand_file_name (filename, Qnil); | 847 | filename = Fexpand_file_name (filename, Qnil); |
| 848 | fab = cc$rms_fab; | 848 | fab = cc$rms_fab; |
| 849 | xabfhc = cc$rms_xabfhc; | 849 | xabfhc = cc$rms_xabfhc; |
| 850 | fab.fab$l_fna = XSTRING (filename)->data; | 850 | fab.fab$l_fna = SDATA (filename); |
| 851 | fab.fab$b_fns = strlen (fab.fab$l_fna); | 851 | fab.fab$b_fns = strlen (fab.fab$l_fna); |
| 852 | fab.fab$l_xab = (char *) &xabfhc; | 852 | fab.fab$l_xab = (char *) &xabfhc; |
| 853 | status = sys$open (&fab, 0, 0); | 853 | status = sys$open (&fab, 0, 0); |
| @@ -916,7 +916,7 @@ If file does not exist, returns nil. */) | |||
| 916 | 916 | ||
| 917 | encoded = ENCODE_FILE (filename); | 917 | encoded = ENCODE_FILE (filename); |
| 918 | 918 | ||
| 919 | if (lstat (XSTRING (encoded)->data, &s) < 0) | 919 | if (lstat (SDATA (encoded), &s) < 0) |
| 920 | return Qnil; | 920 | return Qnil; |
| 921 | 921 | ||
| 922 | switch (s.st_mode & S_IFMT) | 922 | switch (s.st_mode & S_IFMT) |
| @@ -946,7 +946,7 @@ If file does not exist, returns nil. */) | |||
| 946 | dirname = Ffile_name_directory (filename); | 946 | dirname = Ffile_name_directory (filename); |
| 947 | if (! NILP (dirname)) | 947 | if (! NILP (dirname)) |
| 948 | encoded = ENCODE_FILE (dirname); | 948 | encoded = ENCODE_FILE (dirname); |
| 949 | if (! NILP (dirname) && stat (XSTRING (encoded)->data, &sdir) == 0) | 949 | if (! NILP (dirname) && stat (SDATA (encoded), &sdir) == 0) |
| 950 | values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil; | 950 | values[9] = (sdir.st_gid != s.st_gid) ? Qt : Qnil; |
| 951 | else /* if we can't tell, assume worst */ | 951 | else /* if we can't tell, assume worst */ |
| 952 | values[9] = Qt; | 952 | values[9] = Qt; |
diff --git a/src/dispnew.c b/src/dispnew.c index 59cc06b19ea..1467fd6eba7 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -379,7 +379,7 @@ add_window_display_history (w, msg, paused_p) | |||
| 379 | w, | 379 | w, |
| 380 | ((BUFFERP (w->buffer) | 380 | ((BUFFERP (w->buffer) |
| 381 | && STRINGP (XBUFFER (w->buffer)->name)) | 381 | && STRINGP (XBUFFER (w->buffer)->name)) |
| 382 | ? (char *) XSTRING (XBUFFER (w->buffer)->name)->data | 382 | ? (char *) SDATA (XBUFFER (w->buffer)->name) |
| 383 | : "???"), | 383 | : "???"), |
| 384 | paused_p ? " ***paused***" : ""); | 384 | paused_p ? " ***paused***" : ""); |
| 385 | strcat (buf, msg); | 385 | strcat (buf, msg); |
| @@ -6058,7 +6058,7 @@ FILE = nil means just close any termscript file currently open. */) | |||
| 6058 | if (! NILP (file)) | 6058 | if (! NILP (file)) |
| 6059 | { | 6059 | { |
| 6060 | file = Fexpand_file_name (file, Qnil); | 6060 | file = Fexpand_file_name (file, Qnil); |
| 6061 | termscript = fopen (XSTRING (file)->data, "w"); | 6061 | termscript = fopen (SDATA (file), "w"); |
| 6062 | if (termscript == 0) | 6062 | if (termscript == 0) |
| 6063 | report_file_error ("Opening termscript", Fcons (file, Qnil)); | 6063 | report_file_error ("Opening termscript", Fcons (file, Qnil)); |
| 6064 | } | 6064 | } |
| @@ -6075,11 +6075,11 @@ Control characters in STRING will have terminal-dependent effects. */) | |||
| 6075 | { | 6075 | { |
| 6076 | /* ??? Perhaps we should do something special for multibyte strings here. */ | 6076 | /* ??? Perhaps we should do something special for multibyte strings here. */ |
| 6077 | CHECK_STRING (string); | 6077 | CHECK_STRING (string); |
| 6078 | fwrite (XSTRING (string)->data, 1, STRING_BYTES (XSTRING (string)), stdout); | 6078 | fwrite (SDATA (string), 1, SBYTES (string), stdout); |
| 6079 | fflush (stdout); | 6079 | fflush (stdout); |
| 6080 | if (termscript) | 6080 | if (termscript) |
| 6081 | { | 6081 | { |
| 6082 | fwrite (XSTRING (string)->data, 1, STRING_BYTES (XSTRING (string)), | 6082 | fwrite (SDATA (string), 1, SBYTES (string), |
| 6083 | termscript); | 6083 | termscript); |
| 6084 | fflush (termscript); | 6084 | fflush (termscript); |
| 6085 | } | 6085 | } |
| @@ -6330,7 +6330,7 @@ the current state. */) | |||
| 6330 | { | 6330 | { |
| 6331 | buf = XCDR (XCAR (tail)); | 6331 | buf = XCDR (XCAR (tail)); |
| 6332 | /* Ignore buffers that aren't included in buffer lists. */ | 6332 | /* Ignore buffers that aren't included in buffer lists. */ |
| 6333 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') | 6333 | if (SREF (XBUFFER (buf)->name, 0) == ' ') |
| 6334 | continue; | 6334 | continue; |
| 6335 | if (!EQ (*vecp++, buf)) | 6335 | if (!EQ (*vecp++, buf)) |
| 6336 | goto changed; | 6336 | goto changed; |
| @@ -6364,7 +6364,7 @@ the current state. */) | |||
| 6364 | { | 6364 | { |
| 6365 | buf = XCDR (XCAR (tail)); | 6365 | buf = XCDR (XCAR (tail)); |
| 6366 | /* Ignore buffers that aren't included in buffer lists. */ | 6366 | /* Ignore buffers that aren't included in buffer lists. */ |
| 6367 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') | 6367 | if (SREF (XBUFFER (buf)->name, 0) == ' ') |
| 6368 | continue; | 6368 | continue; |
| 6369 | *vecp++ = buf; | 6369 | *vecp++ = buf; |
| 6370 | *vecp++ = XBUFFER (buf)->read_only; | 6370 | *vecp++ = XBUFFER (buf)->read_only; |
diff --git a/src/disptab.h b/src/disptab.h index 1fb6307a73a..526b1c4a9d3 100644 --- a/src/disptab.h +++ b/src/disptab.h | |||
| @@ -90,8 +90,8 @@ extern Lisp_Object Vglyph_table; | |||
| 90 | /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0, | 90 | /* Assuming that GLYPH_SIMPLE_P (BASE, LEN, G) is 0, |
| 91 | return the length and the address of the character-sequence | 91 | return the length and the address of the character-sequence |
| 92 | used for outputting GLYPH G. */ | 92 | used for outputting GLYPH G. */ |
| 93 | #define GLYPH_LENGTH(base,g) XSTRING (base[g])->size | 93 | #define GLYPH_LENGTH(base,g) SCHARS (base[g]) |
| 94 | #define GLYPH_STRING(base,g) XSTRING (base[g])->data | 94 | #define GLYPH_STRING(base,g) SDATA (base[g]) |
| 95 | 95 | ||
| 96 | /* GLYPH for a space character. */ | 96 | /* GLYPH for a space character. */ |
| 97 | 97 | ||
| @@ -158,18 +158,18 @@ get_doc_string (filepos, unibyte, definition) | |||
| 158 | tem = Ffile_name_absolute_p (file); | 158 | tem = Ffile_name_absolute_p (file); |
| 159 | if (NILP (tem)) | 159 | if (NILP (tem)) |
| 160 | { | 160 | { |
| 161 | minsize = XSTRING (Vdoc_directory)->size; | 161 | minsize = SCHARS (Vdoc_directory); |
| 162 | /* sizeof ("../etc/") == 8 */ | 162 | /* sizeof ("../etc/") == 8 */ |
| 163 | if (minsize < 8) | 163 | if (minsize < 8) |
| 164 | minsize = 8; | 164 | minsize = 8; |
| 165 | name = (char *) alloca (minsize + XSTRING (file)->size + 8); | 165 | name = (char *) alloca (minsize + SCHARS (file) + 8); |
| 166 | strcpy (name, XSTRING (Vdoc_directory)->data); | 166 | strcpy (name, SDATA (Vdoc_directory)); |
| 167 | strcat (name, XSTRING (file)->data); | 167 | strcat (name, SDATA (file)); |
| 168 | munge_doc_file_name (name); | 168 | munge_doc_file_name (name); |
| 169 | } | 169 | } |
| 170 | else | 170 | else |
| 171 | { | 171 | { |
| 172 | name = (char *) XSTRING (file)->data; | 172 | name = (char *) SDATA (file); |
| 173 | } | 173 | } |
| 174 | 174 | ||
| 175 | fd = emacs_open (name, O_RDONLY, 0); | 175 | fd = emacs_open (name, O_RDONLY, 0); |
| @@ -181,7 +181,7 @@ get_doc_string (filepos, unibyte, definition) | |||
| 181 | /* Preparing to dump; DOC file is probably not installed. | 181 | /* Preparing to dump; DOC file is probably not installed. |
| 182 | So check in ../etc. */ | 182 | So check in ../etc. */ |
| 183 | strcpy (name, "../etc/"); | 183 | strcpy (name, "../etc/"); |
| 184 | strcat (name, XSTRING (file)->data); | 184 | strcat (name, SDATA (file)); |
| 185 | munge_doc_file_name (name); | 185 | munge_doc_file_name (name); |
| 186 | 186 | ||
| 187 | fd = emacs_open (name, O_RDONLY, 0); | 187 | fd = emacs_open (name, O_RDONLY, 0); |
| @@ -590,17 +590,17 @@ the same file name is found in the `data-directory'. */) | |||
| 590 | (0) | 590 | (0) |
| 591 | #endif /* CANNOT_DUMP */ | 591 | #endif /* CANNOT_DUMP */ |
| 592 | { | 592 | { |
| 593 | name = (char *) alloca (XSTRING (filename)->size + 14); | 593 | name = (char *) alloca (SCHARS (filename) + 14); |
| 594 | strcpy (name, "../etc/"); | 594 | strcpy (name, "../etc/"); |
| 595 | } | 595 | } |
| 596 | else | 596 | else |
| 597 | { | 597 | { |
| 598 | CHECK_STRING (Vdoc_directory); | 598 | CHECK_STRING (Vdoc_directory); |
| 599 | name = (char *) alloca (XSTRING (filename)->size | 599 | name = (char *) alloca (SCHARS (filename) |
| 600 | + XSTRING (Vdoc_directory)->size + 1); | 600 | + SCHARS (Vdoc_directory) + 1); |
| 601 | strcpy (name, XSTRING (Vdoc_directory)->data); | 601 | strcpy (name, SDATA (Vdoc_directory)); |
| 602 | } | 602 | } |
| 603 | strcat (name, XSTRING (filename)->data); /*** Add this line ***/ | 603 | strcat (name, SDATA (filename)); /*** Add this line ***/ |
| 604 | #ifdef VMS | 604 | #ifdef VMS |
| 605 | #ifndef VMS4_4 | 605 | #ifndef VMS4_4 |
| 606 | /* For VMS versions with limited file name syntax, | 606 | /* For VMS versions with limited file name syntax, |
| @@ -722,11 +722,11 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 722 | if (NILP (keymap)) | 722 | if (NILP (keymap)) |
| 723 | keymap = Voverriding_local_map; | 723 | keymap = Voverriding_local_map; |
| 724 | 724 | ||
| 725 | bsize = STRING_BYTES (XSTRING (string)); | 725 | bsize = SBYTES (string); |
| 726 | bufp = buf = (unsigned char *) xmalloc (bsize); | 726 | bufp = buf = (unsigned char *) xmalloc (bsize); |
| 727 | 727 | ||
| 728 | strp = (unsigned char *) XSTRING (string)->data; | 728 | strp = (unsigned char *) SDATA (string); |
| 729 | while (strp < XSTRING (string)->data + STRING_BYTES (XSTRING (string))) | 729 | while (strp < SDATA (string) + SBYTES (string)) |
| 730 | { | 730 | { |
| 731 | if (strp[0] == '\\' && strp[1] == '=') | 731 | if (strp[0] == '\\' && strp[1] == '=') |
| 732 | { | 732 | { |
| @@ -737,7 +737,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 737 | if (multibyte) | 737 | if (multibyte) |
| 738 | { | 738 | { |
| 739 | int len; | 739 | int len; |
| 740 | int maxlen = XSTRING (string)->data + STRING_BYTES (XSTRING (string)) - strp; | 740 | int maxlen = SDATA (string) + SBYTES (string) - strp; |
| 741 | 741 | ||
| 742 | STRING_CHAR_AND_LENGTH (strp, maxlen, len); | 742 | STRING_CHAR_AND_LENGTH (strp, maxlen, len); |
| 743 | if (len == 1) | 743 | if (len == 1) |
| @@ -759,10 +759,10 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 759 | changed = 1; | 759 | changed = 1; |
| 760 | strp += 2; /* skip \[ */ | 760 | strp += 2; /* skip \[ */ |
| 761 | start = strp; | 761 | start = strp; |
| 762 | start_idx = start - XSTRING (string)->data; | 762 | start_idx = start - SDATA (string); |
| 763 | 763 | ||
| 764 | while ((strp - (unsigned char *) XSTRING (string)->data | 764 | while ((strp - (unsigned char *) SDATA (string) |
| 765 | < STRING_BYTES (XSTRING (string))) | 765 | < SBYTES (string)) |
| 766 | && *strp != ']') | 766 | && *strp != ']') |
| 767 | strp++; | 767 | strp++; |
| 768 | length_byte = strp - start; | 768 | length_byte = strp - start; |
| @@ -770,14 +770,14 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 770 | strp++; /* skip ] */ | 770 | strp++; /* skip ] */ |
| 771 | 771 | ||
| 772 | /* Save STRP in IDX. */ | 772 | /* Save STRP in IDX. */ |
| 773 | idx = strp - (unsigned char *) XSTRING (string)->data; | 773 | idx = strp - (unsigned char *) SDATA (string); |
| 774 | tem = Fintern (make_string (start, length_byte), Qnil); | 774 | tem = Fintern (make_string (start, length_byte), Qnil); |
| 775 | 775 | ||
| 776 | /* Note the Fwhere_is_internal can GC, so we have to take | 776 | /* Note the Fwhere_is_internal can GC, so we have to take |
| 777 | relocation of string contents into account. */ | 777 | relocation of string contents into account. */ |
| 778 | tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qnil); | 778 | tem = Fwhere_is_internal (tem, keymap, Qt, Qnil, Qnil); |
| 779 | strp = XSTRING (string)->data + idx; | 779 | strp = SDATA (string) + idx; |
| 780 | start = XSTRING (string)->data + start_idx; | 780 | start = SDATA (string) + start_idx; |
| 781 | 781 | ||
| 782 | /* Disregard menu bar bindings; it is positively annoying to | 782 | /* Disregard menu bar bindings; it is positively annoying to |
| 783 | mention them when there's no menu bar, and it isn't terribly | 783 | mention them when there's no menu bar, and it isn't terribly |
| @@ -819,10 +819,10 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 819 | changed = 1; | 819 | changed = 1; |
| 820 | strp += 2; /* skip \{ or \< */ | 820 | strp += 2; /* skip \{ or \< */ |
| 821 | start = strp; | 821 | start = strp; |
| 822 | start_idx = start - XSTRING (string)->data; | 822 | start_idx = start - SDATA (string); |
| 823 | 823 | ||
| 824 | while ((strp - (unsigned char *) XSTRING (string)->data | 824 | while ((strp - (unsigned char *) SDATA (string) |
| 825 | < XSTRING (string)->size) | 825 | < SCHARS (string)) |
| 826 | && *strp != '}' && *strp != '>') | 826 | && *strp != '}' && *strp != '>') |
| 827 | strp++; | 827 | strp++; |
| 828 | 828 | ||
| @@ -830,7 +830,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 830 | strp++; /* skip } or > */ | 830 | strp++; /* skip } or > */ |
| 831 | 831 | ||
| 832 | /* Save STRP in IDX. */ | 832 | /* Save STRP in IDX. */ |
| 833 | idx = strp - (unsigned char *) XSTRING (string)->data; | 833 | idx = strp - (unsigned char *) SDATA (string); |
| 834 | 834 | ||
| 835 | /* Get the value of the keymap in TEM, or nil if undefined. | 835 | /* Get the value of the keymap in TEM, or nil if undefined. |
| 836 | Do this while still in the user's current buffer | 836 | Do this while still in the user's current buffer |
| @@ -844,8 +844,8 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 844 | { | 844 | { |
| 845 | tem = get_keymap (tem, 0, 1); | 845 | tem = get_keymap (tem, 0, 1); |
| 846 | /* Note that get_keymap can GC. */ | 846 | /* Note that get_keymap can GC. */ |
| 847 | strp = XSTRING (string)->data + idx; | 847 | strp = SDATA (string) + idx; |
| 848 | start = XSTRING (string)->data + start_idx; | 848 | start = SDATA (string) + start_idx; |
| 849 | } | 849 | } |
| 850 | } | 850 | } |
| 851 | 851 | ||
| @@ -858,8 +858,8 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 858 | name = Fsymbol_name (name); | 858 | name = Fsymbol_name (name); |
| 859 | insert_string ("\nUses keymap \""); | 859 | insert_string ("\nUses keymap \""); |
| 860 | insert_from_string (name, 0, 0, | 860 | insert_from_string (name, 0, 0, |
| 861 | XSTRING (name)->size, | 861 | SCHARS (name), |
| 862 | STRING_BYTES (XSTRING (name)), 1); | 862 | SBYTES (name), 1); |
| 863 | insert_string ("\", which is not currently defined.\n"); | 863 | insert_string ("\", which is not currently defined.\n"); |
| 864 | if (start[-1] == '<') keymap = Qnil; | 864 | if (start[-1] == '<') keymap = Qnil; |
| 865 | } | 865 | } |
| @@ -872,9 +872,9 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 872 | set_buffer_internal (oldbuf); | 872 | set_buffer_internal (oldbuf); |
| 873 | 873 | ||
| 874 | subst_string: | 874 | subst_string: |
| 875 | start = XSTRING (tem)->data; | 875 | start = SDATA (tem); |
| 876 | length = XSTRING (tem)->size; | 876 | length = SCHARS (tem); |
| 877 | length_byte = STRING_BYTES (XSTRING (tem)); | 877 | length_byte = SBYTES (tem); |
| 878 | subst: | 878 | subst: |
| 879 | { | 879 | { |
| 880 | int offset = bufp - buf; | 880 | int offset = bufp - buf; |
| @@ -884,7 +884,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 884 | bufp += length_byte; | 884 | bufp += length_byte; |
| 885 | nchars += length; | 885 | nchars += length; |
| 886 | /* Check STRING again in case gc relocated it. */ | 886 | /* Check STRING again in case gc relocated it. */ |
| 887 | strp = (unsigned char *) XSTRING (string)->data + idx; | 887 | strp = (unsigned char *) SDATA (string) + idx; |
| 888 | } | 888 | } |
| 889 | } | 889 | } |
| 890 | else if (! multibyte) /* just copy other chars */ | 890 | else if (! multibyte) /* just copy other chars */ |
| @@ -892,7 +892,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 892 | else | 892 | else |
| 893 | { | 893 | { |
| 894 | int len; | 894 | int len; |
| 895 | int maxlen = XSTRING (string)->data + STRING_BYTES (XSTRING (string)) - strp; | 895 | int maxlen = SDATA (string) + SBYTES (string) - strp; |
| 896 | 896 | ||
| 897 | STRING_CHAR_AND_LENGTH (strp, maxlen, len); | 897 | STRING_CHAR_AND_LENGTH (strp, maxlen, len); |
| 898 | if (len == 1) | 898 | if (len == 1) |
diff --git a/src/dosfns.c b/src/dosfns.c index 428bde8e5d3..b2200ee507b 100644 --- a/src/dosfns.c +++ b/src/dosfns.c | |||
| @@ -503,7 +503,7 @@ x_set_title (f, name) | |||
| 503 | if (FRAME_MSDOS_P (f)) | 503 | if (FRAME_MSDOS_P (f)) |
| 504 | { | 504 | { |
| 505 | BLOCK_INPUT; | 505 | BLOCK_INPUT; |
| 506 | w95_set_virtual_machine_title (XSTRING (name)->data); | 506 | w95_set_virtual_machine_title (SDATA (name)); |
| 507 | UNBLOCK_INPUT; | 507 | UNBLOCK_INPUT; |
| 508 | } | 508 | } |
| 509 | } | 509 | } |
| @@ -525,7 +525,7 @@ If the underlying system call fails, value is nil. */) | |||
| 525 | filename = Fexpand_file_name (filename, Qnil); | 525 | filename = Fexpand_file_name (filename, Qnil); |
| 526 | encoded = ENCODE_FILE (filename); | 526 | encoded = ENCODE_FILE (filename); |
| 527 | 527 | ||
| 528 | if (statfs (XSTRING (encoded)->data, &stfs)) | 528 | if (statfs (SDATA (encoded), &stfs)) |
| 529 | value = Qnil; | 529 | value = Qnil; |
| 530 | else | 530 | else |
| 531 | value = list3 (make_float ((double) stfs.f_bsize * stfs.f_blocks), | 531 | value = list3 (make_float ((double) stfs.f_bsize * stfs.f_blocks), |
diff --git a/src/editfns.c b/src/editfns.c index 72da635a9b4..9c88d963eb3 100644 --- a/src/editfns.c +++ b/src/editfns.c | |||
| @@ -1202,7 +1202,7 @@ name, or nil if there is no such user. */) | |||
| 1202 | else if (NUMBERP (uid)) | 1202 | else if (NUMBERP (uid)) |
| 1203 | pw = (struct passwd *) getpwuid ((uid_t) XFLOATINT (uid)); | 1203 | pw = (struct passwd *) getpwuid ((uid_t) XFLOATINT (uid)); |
| 1204 | else if (STRINGP (uid)) | 1204 | else if (STRINGP (uid)) |
| 1205 | pw = (struct passwd *) getpwnam (XSTRING (uid)->data); | 1205 | pw = (struct passwd *) getpwnam (SDATA (uid)); |
| 1206 | else | 1206 | else |
| 1207 | error ("Invalid UID specification"); | 1207 | error ("Invalid UID specification"); |
| 1208 | 1208 | ||
| @@ -1215,7 +1215,7 @@ name, or nil if there is no such user. */) | |||
| 1215 | full = make_string (p, q ? q - p : strlen (p)); | 1215 | full = make_string (p, q ? q - p : strlen (p)); |
| 1216 | 1216 | ||
| 1217 | #ifdef AMPERSAND_FULL_NAME | 1217 | #ifdef AMPERSAND_FULL_NAME |
| 1218 | p = XSTRING (full)->data; | 1218 | p = SDATA (full); |
| 1219 | q = (unsigned char *) index (p, '&'); | 1219 | q = (unsigned char *) index (p, '&'); |
| 1220 | /* Substitute the login name for the &, upcasing the first character. */ | 1220 | /* Substitute the login name for the &, upcasing the first character. */ |
| 1221 | if (q) | 1221 | if (q) |
| @@ -1224,10 +1224,10 @@ name, or nil if there is no such user. */) | |||
| 1224 | Lisp_Object login; | 1224 | Lisp_Object login; |
| 1225 | 1225 | ||
| 1226 | login = Fuser_login_name (make_number (pw->pw_uid)); | 1226 | login = Fuser_login_name (make_number (pw->pw_uid)); |
| 1227 | r = (unsigned char *) alloca (strlen (p) + XSTRING (login)->size + 1); | 1227 | r = (unsigned char *) alloca (strlen (p) + SCHARS (login) + 1); |
| 1228 | bcopy (p, r, q - p); | 1228 | bcopy (p, r, q - p); |
| 1229 | r[q - p] = 0; | 1229 | r[q - p] = 0; |
| 1230 | strcat (r, XSTRING (login)->data); | 1230 | strcat (r, SDATA (login)); |
| 1231 | r[q - p] = UPCASE (r[q - p]); | 1231 | r[q - p] = UPCASE (r[q - p]); |
| 1232 | strcat (r, q + 1); | 1232 | strcat (r, q + 1); |
| 1233 | full = build_string (r); | 1233 | full = build_string (r); |
| @@ -1250,7 +1250,7 @@ char * | |||
| 1250 | get_system_name () | 1250 | get_system_name () |
| 1251 | { | 1251 | { |
| 1252 | if (STRINGP (Vsystem_name)) | 1252 | if (STRINGP (Vsystem_name)) |
| 1253 | return (char *) XSTRING (Vsystem_name)->data; | 1253 | return (char *) SDATA (Vsystem_name); |
| 1254 | else | 1254 | else |
| 1255 | return ""; | 1255 | return ""; |
| 1256 | } | 1256 | } |
| @@ -1479,7 +1479,7 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) | |||
| 1479 | Vlocale_coding_system, 1); | 1479 | Vlocale_coding_system, 1); |
| 1480 | 1480 | ||
| 1481 | /* This is probably enough. */ | 1481 | /* This is probably enough. */ |
| 1482 | size = STRING_BYTES (XSTRING (format_string)) * 6 + 50; | 1482 | size = SBYTES (format_string) * 6 + 50; |
| 1483 | 1483 | ||
| 1484 | tm = ut ? gmtime (&value) : localtime (&value); | 1484 | tm = ut ? gmtime (&value) : localtime (&value); |
| 1485 | if (! tm) | 1485 | if (! tm) |
| @@ -1493,8 +1493,8 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) | |||
| 1493 | int result; | 1493 | int result; |
| 1494 | 1494 | ||
| 1495 | buf[0] = '\1'; | 1495 | buf[0] = '\1'; |
| 1496 | result = emacs_memftimeu (buf, size, XSTRING (format_string)->data, | 1496 | result = emacs_memftimeu (buf, size, SDATA (format_string), |
| 1497 | STRING_BYTES (XSTRING (format_string)), | 1497 | SBYTES (format_string), |
| 1498 | tm, ut); | 1498 | tm, ut); |
| 1499 | if ((result > 0 && result < size) || (result == 0 && buf[0] == '\0')) | 1499 | if ((result > 0 && result < size) || (result == 0 && buf[0] == '\0')) |
| 1500 | return code_convert_string_norecord (make_string (buf, result), | 1500 | return code_convert_string_norecord (make_string (buf, result), |
| @@ -1502,8 +1502,8 @@ For example, to produce full ISO 8601 format, use "%Y-%m-%dT%T%z". */) | |||
| 1502 | 1502 | ||
| 1503 | /* If buffer was too small, make it bigger and try again. */ | 1503 | /* If buffer was too small, make it bigger and try again. */ |
| 1504 | result = emacs_memftimeu (NULL, (size_t) -1, | 1504 | result = emacs_memftimeu (NULL, (size_t) -1, |
| 1505 | XSTRING (format_string)->data, | 1505 | SDATA (format_string), |
| 1506 | STRING_BYTES (XSTRING (format_string)), | 1506 | SBYTES (format_string), |
| 1507 | tm, ut); | 1507 | tm, ut); |
| 1508 | size = result + 1; | 1508 | size = result + 1; |
| 1509 | } | 1509 | } |
| @@ -1610,7 +1610,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE) */) | |||
| 1610 | if (EQ (zone, Qt)) | 1610 | if (EQ (zone, Qt)) |
| 1611 | tzstring = "UTC0"; | 1611 | tzstring = "UTC0"; |
| 1612 | else if (STRINGP (zone)) | 1612 | else if (STRINGP (zone)) |
| 1613 | tzstring = (char *) XSTRING (zone)->data; | 1613 | tzstring = (char *) SDATA (zone); |
| 1614 | else if (INTEGERP (zone)) | 1614 | else if (INTEGERP (zone)) |
| 1615 | { | 1615 | { |
| 1616 | int abszone = abs (XINT (zone)); | 1616 | int abszone = abs (XINT (zone)); |
| @@ -1788,7 +1788,7 @@ If TZ is t, use Universal Time. */) | |||
| 1788 | else | 1788 | else |
| 1789 | { | 1789 | { |
| 1790 | CHECK_STRING (tz); | 1790 | CHECK_STRING (tz); |
| 1791 | tzstring = (char *) XSTRING (tz)->data; | 1791 | tzstring = (char *) SDATA (tz); |
| 1792 | } | 1792 | } |
| 1793 | 1793 | ||
| 1794 | set_time_zone_rule (tzstring); | 1794 | set_time_zone_rule (tzstring); |
| @@ -1934,8 +1934,8 @@ general_insert_function (insert_func, insert_from_string_func, | |||
| 1934 | else if (STRINGP (val)) | 1934 | else if (STRINGP (val)) |
| 1935 | { | 1935 | { |
| 1936 | (*insert_from_string_func) (val, 0, 0, | 1936 | (*insert_from_string_func) (val, 0, 0, |
| 1937 | XSTRING (val)->size, | 1937 | SCHARS (val), |
| 1938 | STRING_BYTES (XSTRING (val)), | 1938 | SBYTES (val), |
| 1939 | inherit); | 1939 | inherit); |
| 1940 | } | 1940 | } |
| 1941 | else | 1941 | else |
| @@ -2146,7 +2146,7 @@ make_buffer_string_both (start, start_byte, end, end_byte, props) | |||
| 2146 | result = make_uninit_multibyte_string (end - start, end_byte - start_byte); | 2146 | result = make_uninit_multibyte_string (end - start, end_byte - start_byte); |
| 2147 | else | 2147 | else |
| 2148 | result = make_uninit_string (end - start); | 2148 | result = make_uninit_string (end - start); |
| 2149 | bcopy (BYTE_POS_ADDR (start_byte), XSTRING (result)->data, | 2149 | bcopy (BYTE_POS_ADDR (start_byte), SDATA (result), |
| 2150 | end_byte - start_byte); | 2150 | end_byte - start_byte); |
| 2151 | 2151 | ||
| 2152 | /* If desired, update and copy the text properties. */ | 2152 | /* If desired, update and copy the text properties. */ |
| @@ -2659,8 +2659,8 @@ It returns the number of characters changed. */) | |||
| 2659 | validate_region (&start, &end); | 2659 | validate_region (&start, &end); |
| 2660 | CHECK_STRING (table); | 2660 | CHECK_STRING (table); |
| 2661 | 2661 | ||
| 2662 | size = STRING_BYTES (XSTRING (table)); | 2662 | size = SBYTES (table); |
| 2663 | tt = XSTRING (table)->data; | 2663 | tt = SDATA (table); |
| 2664 | 2664 | ||
| 2665 | pos_byte = CHAR_TO_BYTE (XINT (start)); | 2665 | pos_byte = CHAR_TO_BYTE (XINT (start)); |
| 2666 | stop = CHAR_TO_BYTE (XINT (end)); | 2666 | stop = CHAR_TO_BYTE (XINT (end)); |
| @@ -2929,7 +2929,7 @@ usage: (message STRING &rest ARGS) */) | |||
| 2929 | { | 2929 | { |
| 2930 | register Lisp_Object val; | 2930 | register Lisp_Object val; |
| 2931 | val = Fformat (nargs, args); | 2931 | val = Fformat (nargs, args); |
| 2932 | message3 (val, STRING_BYTES (XSTRING (val)), STRING_MULTIBYTE (val)); | 2932 | message3 (val, SBYTES (val), STRING_MULTIBYTE (val)); |
| 2933 | return val; | 2933 | return val; |
| 2934 | } | 2934 | } |
| 2935 | } | 2935 | } |
| @@ -2979,13 +2979,13 @@ usage: (message-box STRING &rest ARGS) */) | |||
| 2979 | message_text = (char *)xmalloc (80); | 2979 | message_text = (char *)xmalloc (80); |
| 2980 | message_length = 80; | 2980 | message_length = 80; |
| 2981 | } | 2981 | } |
| 2982 | if (STRING_BYTES (XSTRING (val)) > message_length) | 2982 | if (SBYTES (val) > message_length) |
| 2983 | { | 2983 | { |
| 2984 | message_length = STRING_BYTES (XSTRING (val)); | 2984 | message_length = SBYTES (val); |
| 2985 | message_text = (char *)xrealloc (message_text, message_length); | 2985 | message_text = (char *)xrealloc (message_text, message_length); |
| 2986 | } | 2986 | } |
| 2987 | bcopy (XSTRING (val)->data, message_text, STRING_BYTES (XSTRING (val))); | 2987 | bcopy (SDATA (val), message_text, SBYTES (val)); |
| 2988 | message2 (message_text, STRING_BYTES (XSTRING (val)), | 2988 | message2 (message_text, SBYTES (val), |
| 2989 | STRING_MULTIBYTE (val)); | 2989 | STRING_MULTIBYTE (val)); |
| 2990 | return val; | 2990 | return val; |
| 2991 | } | 2991 | } |
| @@ -3058,7 +3058,7 @@ usage: (propertize STRING &rest PROPERTIES) */) | |||
| 3058 | } | 3058 | } |
| 3059 | 3059 | ||
| 3060 | Fadd_text_properties (make_number (0), | 3060 | Fadd_text_properties (make_number (0), |
| 3061 | make_number (XSTRING (string)->size), | 3061 | make_number (SCHARS (string)), |
| 3062 | properties, string); | 3062 | properties, string); |
| 3063 | RETURN_UNGCPRO (string); | 3063 | RETURN_UNGCPRO (string); |
| 3064 | } | 3064 | } |
| @@ -3069,9 +3069,8 @@ usage: (propertize STRING &rest PROPERTIES) */) | |||
| 3069 | 3069 | ||
| 3070 | #define CONVERTED_BYTE_SIZE(MULTIBYTE, STRING) \ | 3070 | #define CONVERTED_BYTE_SIZE(MULTIBYTE, STRING) \ |
| 3071 | (((MULTIBYTE) && ! STRING_MULTIBYTE (STRING)) \ | 3071 | (((MULTIBYTE) && ! STRING_MULTIBYTE (STRING)) \ |
| 3072 | ? count_size_as_multibyte (XSTRING (STRING)->data, \ | 3072 | ? count_size_as_multibyte (SDATA (STRING), SBYTES (STRING)) \ |
| 3073 | STRING_BYTES (XSTRING (STRING))) \ | 3073 | : SBYTES (STRING)) |
| 3074 | : STRING_BYTES (XSTRING (STRING))) | ||
| 3075 | 3074 | ||
| 3076 | DEFUN ("format", Fformat, Sformat, 1, MANY, 0, | 3075 | DEFUN ("format", Fformat, Sformat, 1, MANY, 0, |
| 3077 | doc: /* Format a string out of a control-string and arguments. | 3076 | doc: /* Format a string out of a control-string and arguments. |
| @@ -3133,8 +3132,8 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3133 | and later find it has to be multibyte, we jump back to retry. */ | 3132 | and later find it has to be multibyte, we jump back to retry. */ |
| 3134 | retry: | 3133 | retry: |
| 3135 | 3134 | ||
| 3136 | format = XSTRING (args[0])->data; | 3135 | format = SDATA (args[0]); |
| 3137 | end = format + STRING_BYTES (XSTRING (args[0])); | 3136 | end = format + SBYTES (args[0]); |
| 3138 | longest_format = 0; | 3137 | longest_format = 0; |
| 3139 | 3138 | ||
| 3140 | /* Make room in result for all the non-%-codes in the control string. */ | 3139 | /* Make room in result for all the non-%-codes in the control string. */ |
| @@ -3255,7 +3254,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3255 | goto retry; | 3254 | goto retry; |
| 3256 | } | 3255 | } |
| 3257 | args[n] = Fchar_to_string (args[n]); | 3256 | args[n] = Fchar_to_string (args[n]); |
| 3258 | thissize = STRING_BYTES (XSTRING (args[n])); | 3257 | thissize = SBYTES (args[n]); |
| 3259 | } | 3258 | } |
| 3260 | } | 3259 | } |
| 3261 | else if (FLOATP (args[n]) && *format != 's') | 3260 | else if (FLOATP (args[n]) && *format != 's') |
| @@ -3303,7 +3302,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3303 | n = 0; | 3302 | n = 0; |
| 3304 | 3303 | ||
| 3305 | /* Scan the format and store result in BUF. */ | 3304 | /* Scan the format and store result in BUF. */ |
| 3306 | format = XSTRING (args[0])->data; | 3305 | format = SDATA (args[0]); |
| 3307 | maybe_combine_byte = 0; | 3306 | maybe_combine_byte = 0; |
| 3308 | while (format != end) | 3307 | while (format != end) |
| 3309 | { | 3308 | { |
| @@ -3353,13 +3352,13 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3353 | && multibyte | 3352 | && multibyte |
| 3354 | && !ASCII_BYTE_P (*((unsigned char *) p - 1)) | 3353 | && !ASCII_BYTE_P (*((unsigned char *) p - 1)) |
| 3355 | && STRING_MULTIBYTE (args[n]) | 3354 | && STRING_MULTIBYTE (args[n]) |
| 3356 | && !CHAR_HEAD_P (XSTRING (args[n])->data[0])) | 3355 | && !CHAR_HEAD_P (SREF (args[n], 0))) |
| 3357 | maybe_combine_byte = 1; | 3356 | maybe_combine_byte = 1; |
| 3358 | nbytes = copy_text (XSTRING (args[n])->data, p, | 3357 | nbytes = copy_text (SDATA (args[n]), p, |
| 3359 | STRING_BYTES (XSTRING (args[n])), | 3358 | SBYTES (args[n]), |
| 3360 | STRING_MULTIBYTE (args[n]), multibyte); | 3359 | STRING_MULTIBYTE (args[n]), multibyte); |
| 3361 | p += nbytes; | 3360 | p += nbytes; |
| 3362 | nchars += XSTRING (args[n])->size; | 3361 | nchars += SCHARS (args[n]); |
| 3363 | end = nchars; | 3362 | end = nchars; |
| 3364 | 3363 | ||
| 3365 | if (negative) | 3364 | if (negative) |
| @@ -3371,7 +3370,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3371 | 3370 | ||
| 3372 | /* If this argument has text properties, record where | 3371 | /* If this argument has text properties, record where |
| 3373 | in the result string it appears. */ | 3372 | in the result string it appears. */ |
| 3374 | if (XSTRING (args[n])->intervals) | 3373 | if (STRING_INTERVALS (args[n])) |
| 3375 | { | 3374 | { |
| 3376 | if (!info) | 3375 | if (!info) |
| 3377 | { | 3376 | { |
| @@ -3450,19 +3449,19 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3450 | arguments has text properties, set up text properties of the | 3449 | arguments has text properties, set up text properties of the |
| 3451 | result string. */ | 3450 | result string. */ |
| 3452 | 3451 | ||
| 3453 | if (XSTRING (args[0])->intervals || info) | 3452 | if (STRING_INTERVALS (args[0]) || info) |
| 3454 | { | 3453 | { |
| 3455 | Lisp_Object len, new_len, props; | 3454 | Lisp_Object len, new_len, props; |
| 3456 | struct gcpro gcpro1; | 3455 | struct gcpro gcpro1; |
| 3457 | 3456 | ||
| 3458 | /* Add text properties from the format string. */ | 3457 | /* Add text properties from the format string. */ |
| 3459 | len = make_number (XSTRING (args[0])->size); | 3458 | len = make_number (SCHARS (args[0])); |
| 3460 | props = text_property_list (args[0], make_number (0), len, Qnil); | 3459 | props = text_property_list (args[0], make_number (0), len, Qnil); |
| 3461 | GCPRO1 (props); | 3460 | GCPRO1 (props); |
| 3462 | 3461 | ||
| 3463 | if (CONSP (props)) | 3462 | if (CONSP (props)) |
| 3464 | { | 3463 | { |
| 3465 | new_len = make_number (XSTRING (val)->size); | 3464 | new_len = make_number (SCHARS (val)); |
| 3466 | extend_property_ranges (props, len, new_len); | 3465 | extend_property_ranges (props, len, new_len); |
| 3467 | add_text_properties_from_list (val, props, make_number (0)); | 3466 | add_text_properties_from_list (val, props, make_number (0)); |
| 3468 | } | 3467 | } |
| @@ -3472,7 +3471,7 @@ usage: (format STRING &rest OBJECTS) */) | |||
| 3472 | for (n = 1; n < nargs; ++n) | 3471 | for (n = 1; n < nargs; ++n) |
| 3473 | if (info[n].end) | 3472 | if (info[n].end) |
| 3474 | { | 3473 | { |
| 3475 | len = make_number (XSTRING (args[n])->size); | 3474 | len = make_number (SCHARS (args[n])); |
| 3476 | new_len = make_number (info[n].end - info[n].start); | 3475 | new_len = make_number (info[n].end - info[n].start); |
| 3477 | props = text_property_list (args[n], make_number (0), len, Qnil); | 3476 | props = text_property_list (args[n], make_number (0), len, Qnil); |
| 3478 | extend_property_ranges (props, len, new_len); | 3477 | extend_property_ranges (props, len, new_len); |
diff --git a/src/emacs.c b/src/emacs.c index f52af3e6fa6..4d03eab89b8 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -743,7 +743,7 @@ bug_reporting_address () | |||
| 743 | if (!STRINGP(temp)) | 743 | if (!STRINGP(temp)) |
| 744 | return REPORT_EMACS_BUG_ADDRESS; | 744 | return REPORT_EMACS_BUG_ADDRESS; |
| 745 | 745 | ||
| 746 | string = XSTRING (temp)->data; | 746 | string = SDATA (temp); |
| 747 | 747 | ||
| 748 | /* Count dots in `emacs-version'. */ | 748 | /* Count dots in `emacs-version'. */ |
| 749 | while (*string) | 749 | while (*string) |
| @@ -817,7 +817,7 @@ main (argc, argv, envp) | |||
| 817 | } | 817 | } |
| 818 | else | 818 | else |
| 819 | { | 819 | { |
| 820 | printf ("GNU Emacs %s\n", XSTRING (tem)->data); | 820 | printf ("GNU Emacs %s\n", SDATA (tem)); |
| 821 | printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n"); | 821 | printf ("Copyright (C) 2002 Free Software Foundation, Inc.\n"); |
| 822 | printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); | 822 | printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); |
| 823 | printf ("You may redistribute copies of Emacs\n"); | 823 | printf ("You may redistribute copies of Emacs\n"); |
| @@ -1908,7 +1908,7 @@ all of which are called before Emacs is actually killed. */) | |||
| 1908 | kill it because we are exiting Emacs deliberately (not crashing). | 1908 | kill it because we are exiting Emacs deliberately (not crashing). |
| 1909 | Do it after shut_down_emacs, which does an auto-save. */ | 1909 | Do it after shut_down_emacs, which does an auto-save. */ |
| 1910 | if (STRINGP (Vauto_save_list_file_name)) | 1910 | if (STRINGP (Vauto_save_list_file_name)) |
| 1911 | unlink (XSTRING (Vauto_save_list_file_name)->data); | 1911 | unlink (SDATA (Vauto_save_list_file_name)); |
| 1912 | 1912 | ||
| 1913 | exit (INTEGERP (arg) ? XINT (arg) | 1913 | exit (INTEGERP (arg) ? XINT (arg) |
| 1914 | #ifdef VMS | 1914 | #ifdef VMS |
| @@ -1977,8 +1977,8 @@ shut_down_emacs (sig, no_x, stuff) | |||
| 1977 | #ifdef HAVE_X_WINDOWS | 1977 | #ifdef HAVE_X_WINDOWS |
| 1978 | /* It's not safe to call intern here. Maybe we are crashing. */ | 1978 | /* It's not safe to call intern here. Maybe we are crashing. */ |
| 1979 | if (!noninteractive && SYMBOLP (Vwindow_system) | 1979 | if (!noninteractive && SYMBOLP (Vwindow_system) |
| 1980 | && XSTRING (SYMBOL_NAME (Vwindow_system))->size == 1 | 1980 | && SCHARS (SYMBOL_NAME (Vwindow_system)) == 1 |
| 1981 | && XSTRING (SYMBOL_NAME (Vwindow_system))->data[0] == 'x' | 1981 | && SREF (SYMBOL_NAME (Vwindow_system), 0) == 'x' |
| 1982 | && ! no_x) | 1982 | && ! no_x) |
| 1983 | Fx_close_current_connection (); | 1983 | Fx_close_current_connection (); |
| 1984 | #endif /* HAVE_X_WINDOWS */ | 1984 | #endif /* HAVE_X_WINDOWS */ |
| @@ -2036,7 +2036,7 @@ This function exists on systems that use HAVE_SHM. */) | |||
| 2036 | #ifndef SYSTEM_MALLOC | 2036 | #ifndef SYSTEM_MALLOC |
| 2037 | memory_warnings (my_edata, malloc_warning); | 2037 | memory_warnings (my_edata, malloc_warning); |
| 2038 | #endif | 2038 | #endif |
| 2039 | map_out_data (XSTRING (filename)->data); | 2039 | map_out_data (SDATA (filename)); |
| 2040 | 2040 | ||
| 2041 | Vpurify_flag = tem; | 2041 | Vpurify_flag = tem; |
| 2042 | 2042 | ||
| @@ -2075,7 +2075,7 @@ You must run Emacs in batch mode in order to dump it. */) | |||
| 2075 | if (!NILP (symfile)) | 2075 | if (!NILP (symfile)) |
| 2076 | { | 2076 | { |
| 2077 | CHECK_STRING (symfile); | 2077 | CHECK_STRING (symfile); |
| 2078 | if (XSTRING (symfile)->size) | 2078 | if (SCHARS (symfile)) |
| 2079 | symfile = Fexpand_file_name (symfile, Qnil); | 2079 | symfile = Fexpand_file_name (symfile, Qnil); |
| 2080 | } | 2080 | } |
| 2081 | 2081 | ||
| @@ -2092,7 +2092,7 @@ You must run Emacs in batch mode in order to dump it. */) | |||
| 2092 | 2092 | ||
| 2093 | fflush (stdout); | 2093 | fflush (stdout); |
| 2094 | #ifdef VMS | 2094 | #ifdef VMS |
| 2095 | mapout_data (XSTRING (filename)->data); | 2095 | mapout_data (SDATA (filename)); |
| 2096 | #else | 2096 | #else |
| 2097 | /* Tell malloc where start of impure now is. */ | 2097 | /* Tell malloc where start of impure now is. */ |
| 2098 | /* Also arrange for warnings when nearly out of space. */ | 2098 | /* Also arrange for warnings when nearly out of space. */ |
| @@ -2110,8 +2110,8 @@ You must run Emacs in batch mode in order to dump it. */) | |||
| 2110 | #ifdef USE_MMAP_FOR_BUFFERS | 2110 | #ifdef USE_MMAP_FOR_BUFFERS |
| 2111 | mmap_set_vars (0); | 2111 | mmap_set_vars (0); |
| 2112 | #endif | 2112 | #endif |
| 2113 | unexec (XSTRING (filename)->data, | 2113 | unexec (SDATA (filename), |
| 2114 | !NILP (symfile) ? XSTRING (symfile)->data : 0, my_edata, 0, 0); | 2114 | !NILP (symfile) ? SDATA (symfile) : 0, my_edata, 0, 0); |
| 2115 | #ifdef USE_MMAP_FOR_BUFFERS | 2115 | #ifdef USE_MMAP_FOR_BUFFERS |
| 2116 | mmap_set_vars (1); | 2116 | mmap_set_vars (1); |
| 2117 | #endif | 2117 | #endif |
| @@ -2151,7 +2151,7 @@ synchronize_locale (category, plocale, desired_locale) | |||
| 2151 | { | 2151 | { |
| 2152 | *plocale = desired_locale; | 2152 | *plocale = desired_locale; |
| 2153 | setlocale (category, (STRINGP (desired_locale) | 2153 | setlocale (category, (STRINGP (desired_locale) |
| 2154 | ? (char *)(XSTRING (desired_locale)->data) | 2154 | ? (char *)(SDATA (desired_locale)) |
| 2155 | : "")); | 2155 | : "")); |
| 2156 | } | 2156 | } |
| 2157 | } | 2157 | } |
diff --git a/src/eval.c b/src/eval.c index 4381901c896..3e3b3bd7d83 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -837,7 +837,7 @@ on its property list). */) | |||
| 837 | if (INTEGERP (documentation) && XINT (documentation) < 0) | 837 | if (INTEGERP (documentation) && XINT (documentation) < 0) |
| 838 | return Qt; | 838 | return Qt; |
| 839 | if (STRINGP (documentation) | 839 | if (STRINGP (documentation) |
| 840 | && ((unsigned char) XSTRING (documentation)->data[0] == '*')) | 840 | && ((unsigned char) SREF (documentation, 0) == '*')) |
| 841 | return Qt; | 841 | return Qt; |
| 842 | /* If it is (STRING . INTEGER), a negative integer means a user variable. */ | 842 | /* If it is (STRING . INTEGER), a negative integer means a user variable. */ |
| 843 | if (CONSP (documentation) | 843 | if (CONSP (documentation) |
| @@ -1554,7 +1554,7 @@ See also the function `condition-case'. */) | |||
| 1554 | data = Fcons (error_symbol, data); | 1554 | data = Fcons (error_symbol, data); |
| 1555 | 1555 | ||
| 1556 | string = Ferror_message_string (data); | 1556 | string = Ferror_message_string (data); |
| 1557 | fatal ("%s", XSTRING (string)->data, 0); | 1557 | fatal ("%s", SDATA (string), 0); |
| 1558 | } | 1558 | } |
| 1559 | 1559 | ||
| 1560 | /* Return nonzero iff LIST is a non-nil atom or | 1560 | /* Return nonzero iff LIST is a non-nil atom or |
| @@ -1920,7 +1920,7 @@ do_autoload (fundef, funname) | |||
| 1920 | of what files are preloaded and when. */ | 1920 | of what files are preloaded and when. */ |
| 1921 | if (! NILP (Vpurify_flag)) | 1921 | if (! NILP (Vpurify_flag)) |
| 1922 | error ("Attempt to autoload %s while preparing to dump", | 1922 | error ("Attempt to autoload %s while preparing to dump", |
| 1923 | XSTRING (SYMBOL_NAME (funname))->data); | 1923 | SDATA (SYMBOL_NAME (funname))); |
| 1924 | 1924 | ||
| 1925 | fun = funname; | 1925 | fun = funname; |
| 1926 | CHECK_SYMBOL (funname); | 1926 | CHECK_SYMBOL (funname); |
| @@ -1959,7 +1959,7 @@ do_autoload (fundef, funname) | |||
| 1959 | 1959 | ||
| 1960 | if (!NILP (Fequal (fun, fundef))) | 1960 | if (!NILP (Fequal (fun, fundef))) |
| 1961 | error ("Autoloading failed to define function %s", | 1961 | error ("Autoloading failed to define function %s", |
| 1962 | XSTRING (SYMBOL_NAME (funname))->data); | 1962 | SDATA (SYMBOL_NAME (funname))); |
| 1963 | UNGCPRO; | 1963 | UNGCPRO; |
| 1964 | } | 1964 | } |
| 1965 | 1965 | ||
| @@ -2938,7 +2938,7 @@ DEFUN ("fetch-bytecode", Ffetch_bytecode, Sfetch_bytecode, | |||
| 2938 | { | 2938 | { |
| 2939 | tem = AREF (object, COMPILED_BYTECODE); | 2939 | tem = AREF (object, COMPILED_BYTECODE); |
| 2940 | if (CONSP (tem) && STRINGP (XCAR (tem))) | 2940 | if (CONSP (tem) && STRINGP (XCAR (tem))) |
| 2941 | error ("Invalid byte code in %s", XSTRING (XCAR (tem))->data); | 2941 | error ("Invalid byte code in %s", SDATA (XCAR (tem))); |
| 2942 | else | 2942 | else |
| 2943 | error ("Invalid byte code"); | 2943 | error ("Invalid byte code"); |
| 2944 | } | 2944 | } |
diff --git a/src/fileio.c b/src/fileio.c index ce27fad4516..c3f82613d83 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -269,8 +269,8 @@ report_file_error (string, data) | |||
| 269 | default: | 269 | default: |
| 270 | /* System error messages are capitalized. Downcase the initial | 270 | /* System error messages are capitalized. Downcase the initial |
| 271 | unless it is followed by a slash. */ | 271 | unless it is followed by a slash. */ |
| 272 | if (XSTRING (errstring)->data[1] != '/') | 272 | if (SREF (errstring, 1) != '/') |
| 273 | XSTRING (errstring)->data[0] = DOWNCASE (XSTRING (errstring)->data[0]); | 273 | SREF (errstring, 0) = DOWNCASE (SREF (errstring, 0)); |
| 274 | 274 | ||
| 275 | Fsignal (Qfile_error, | 275 | Fsignal (Qfile_error, |
| 276 | Fcons (build_string (string), Fcons (errstring, data))); | 276 | Fcons (build_string (string), Fcons (errstring, data))); |
| @@ -408,11 +408,11 @@ on VMS, perhaps instead a string ending in `:', `]' or `>'. */) | |||
| 408 | #ifdef FILE_SYSTEM_CASE | 408 | #ifdef FILE_SYSTEM_CASE |
| 409 | filename = FILE_SYSTEM_CASE (filename); | 409 | filename = FILE_SYSTEM_CASE (filename); |
| 410 | #endif | 410 | #endif |
| 411 | beg = XSTRING (filename)->data; | 411 | beg = SDATA (filename); |
| 412 | #ifdef DOS_NT | 412 | #ifdef DOS_NT |
| 413 | beg = strcpy (alloca (strlen (beg) + 1), beg); | 413 | beg = strcpy (alloca (strlen (beg) + 1), beg); |
| 414 | #endif | 414 | #endif |
| 415 | p = beg + STRING_BYTES (XSTRING (filename)); | 415 | p = beg + SBYTES (filename); |
| 416 | 416 | ||
| 417 | while (p != beg && !IS_DIRECTORY_SEP (p[-1]) | 417 | while (p != beg && !IS_DIRECTORY_SEP (p[-1]) |
| 418 | #ifdef VMS | 418 | #ifdef VMS |
| @@ -480,8 +480,8 @@ or the entire name if it contains no slash. */) | |||
| 480 | if (!NILP (handler)) | 480 | if (!NILP (handler)) |
| 481 | return call2 (handler, Qfile_name_nondirectory, filename); | 481 | return call2 (handler, Qfile_name_nondirectory, filename); |
| 482 | 482 | ||
| 483 | beg = XSTRING (filename)->data; | 483 | beg = SDATA (filename); |
| 484 | end = p = beg + STRING_BYTES (XSTRING (filename)); | 484 | end = p = beg + SBYTES (filename); |
| 485 | 485 | ||
| 486 | while (p != beg && !IS_DIRECTORY_SEP (p[-1]) | 486 | while (p != beg && !IS_DIRECTORY_SEP (p[-1]) |
| 487 | #ifdef VMS | 487 | #ifdef VMS |
| @@ -637,8 +637,8 @@ On VMS, converts \"[X]FOO.DIR\" to \"[X.FOO]\", etc. */) | |||
| 637 | if (!NILP (handler)) | 637 | if (!NILP (handler)) |
| 638 | return call2 (handler, Qfile_name_as_directory, file); | 638 | return call2 (handler, Qfile_name_as_directory, file); |
| 639 | 639 | ||
| 640 | buf = (char *) alloca (STRING_BYTES (XSTRING (file)) + 10); | 640 | buf = (char *) alloca (SBYTES (file) + 10); |
| 641 | return build_string (file_name_as_directory (buf, XSTRING (file)->data)); | 641 | return build_string (file_name_as_directory (buf, SDATA (file))); |
| 642 | } | 642 | } |
| 643 | 643 | ||
| 644 | /* | 644 | /* |
| @@ -833,11 +833,11 @@ it returns a file name such as \"[X]Y.DIR.1\". */) | |||
| 833 | /* 20 extra chars is insufficient for VMS, since we might perform a | 833 | /* 20 extra chars is insufficient for VMS, since we might perform a |
| 834 | logical name translation. an equivalence string can be up to 255 | 834 | logical name translation. an equivalence string can be up to 255 |
| 835 | chars long, so grab that much extra space... - sss */ | 835 | chars long, so grab that much extra space... - sss */ |
| 836 | buf = (char *) alloca (STRING_BYTES (XSTRING (directory)) + 20 + 255); | 836 | buf = (char *) alloca (SBYTES (directory) + 20 + 255); |
| 837 | #else | 837 | #else |
| 838 | buf = (char *) alloca (STRING_BYTES (XSTRING (directory)) + 20); | 838 | buf = (char *) alloca (SBYTES (directory) + 20); |
| 839 | #endif | 839 | #endif |
| 840 | directory_file_name (XSTRING (directory)->data, buf); | 840 | directory_file_name (SDATA (directory), buf); |
| 841 | return build_string (buf); | 841 | return build_string (buf); |
| 842 | } | 842 | } |
| 843 | 843 | ||
| @@ -912,10 +912,10 @@ make_temp_name (prefix, base64_p) | |||
| 912 | #endif | 912 | #endif |
| 913 | } | 913 | } |
| 914 | 914 | ||
| 915 | len = XSTRING (prefix)->size; | 915 | len = SCHARS (prefix); |
| 916 | val = make_uninit_string (len + 3 + pidlen); | 916 | val = make_uninit_string (len + 3 + pidlen); |
| 917 | data = XSTRING (val)->data; | 917 | data = SDATA (val); |
| 918 | bcopy(XSTRING (prefix)->data, data, len); | 918 | bcopy(SDATA (prefix), data, len); |
| 919 | p = data + len; | 919 | p = data + len; |
| 920 | 920 | ||
| 921 | bcopy (pidbuf, p, pidlen); | 921 | bcopy (pidbuf, p, pidlen); |
| @@ -970,7 +970,7 @@ make_temp_name (prefix, base64_p) | |||
| 970 | } | 970 | } |
| 971 | 971 | ||
| 972 | error ("Cannot create temporary name for prefix `%s'", | 972 | error ("Cannot create temporary name for prefix `%s'", |
| 973 | XSTRING (prefix)->data); | 973 | SDATA (prefix)); |
| 974 | return Qnil; | 974 | return Qnil; |
| 975 | } | 975 | } |
| 976 | 976 | ||
| @@ -1073,7 +1073,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1073 | return call3 (handler, Qexpand_file_name, name, default_directory); | 1073 | return call3 (handler, Qexpand_file_name, name, default_directory); |
| 1074 | } | 1074 | } |
| 1075 | 1075 | ||
| 1076 | o = XSTRING (default_directory)->data; | 1076 | o = SDATA (default_directory); |
| 1077 | 1077 | ||
| 1078 | /* Make sure DEFAULT_DIRECTORY is properly expanded. | 1078 | /* Make sure DEFAULT_DIRECTORY is properly expanded. |
| 1079 | It would be better to do this down below where we actually use | 1079 | It would be better to do this down below where we actually use |
| @@ -1118,7 +1118,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1118 | name = FILE_SYSTEM_CASE (name); | 1118 | name = FILE_SYSTEM_CASE (name); |
| 1119 | #endif | 1119 | #endif |
| 1120 | 1120 | ||
| 1121 | nm = XSTRING (name)->data; | 1121 | nm = SDATA (name); |
| 1122 | 1122 | ||
| 1123 | #ifdef DOS_NT | 1123 | #ifdef DOS_NT |
| 1124 | /* We will force directory separators to be either all \ or /, so make | 1124 | /* We will force directory separators to be either all \ or /, so make |
| @@ -1292,21 +1292,21 @@ See also the function `substitute-in-file-name'. */) | |||
| 1292 | #ifdef WINDOWSNT | 1292 | #ifdef WINDOWSNT |
| 1293 | if (IS_DIRECTORY_SEP (nm[1])) | 1293 | if (IS_DIRECTORY_SEP (nm[1])) |
| 1294 | { | 1294 | { |
| 1295 | if (strcmp (nm, XSTRING (name)->data) != 0) | 1295 | if (strcmp (nm, SDATA (name)) != 0) |
| 1296 | name = build_string (nm); | 1296 | name = build_string (nm); |
| 1297 | } | 1297 | } |
| 1298 | else | 1298 | else |
| 1299 | #endif | 1299 | #endif |
| 1300 | /* drive must be set, so this is okay */ | 1300 | /* drive must be set, so this is okay */ |
| 1301 | if (strcmp (nm - 2, XSTRING (name)->data) != 0) | 1301 | if (strcmp (nm - 2, SDATA (name)) != 0) |
| 1302 | { | 1302 | { |
| 1303 | name = make_string (nm - 2, p - nm + 2); | 1303 | name = make_string (nm - 2, p - nm + 2); |
| 1304 | XSTRING (name)->data[0] = DRIVE_LETTER (drive); | 1304 | SREF (name, 0) = DRIVE_LETTER (drive); |
| 1305 | XSTRING (name)->data[1] = ':'; | 1305 | SREF (name, 1) = ':'; |
| 1306 | } | 1306 | } |
| 1307 | return name; | 1307 | return name; |
| 1308 | #else /* not DOS_NT */ | 1308 | #else /* not DOS_NT */ |
| 1309 | if (nm == XSTRING (name)->data) | 1309 | if (nm == SDATA (name)) |
| 1310 | return name; | 1310 | return name; |
| 1311 | return build_string (nm); | 1311 | return build_string (nm); |
| 1312 | #endif /* not DOS_NT */ | 1312 | #endif /* not DOS_NT */ |
| @@ -1419,7 +1419,7 @@ See also the function `substitute-in-file-name'. */) | |||
| 1419 | #endif | 1419 | #endif |
| 1420 | && !newdir) | 1420 | && !newdir) |
| 1421 | { | 1421 | { |
| 1422 | newdir = XSTRING (default_directory)->data; | 1422 | newdir = SDATA (default_directory); |
| 1423 | #ifdef DOS_NT | 1423 | #ifdef DOS_NT |
| 1424 | /* Note if special escape prefix is present, but remove for now. */ | 1424 | /* Note if special escape prefix is present, but remove for now. */ |
| 1425 | if (newdir[0] == '/' && newdir[1] == ':') | 1425 | if (newdir[0] == '/' && newdir[1] == ':') |
| @@ -1726,7 +1726,7 @@ See also the function `substitute-in-file-name'.") | |||
| 1726 | name = Fupcase (name); | 1726 | name = Fupcase (name); |
| 1727 | #endif | 1727 | #endif |
| 1728 | 1728 | ||
| 1729 | nm = XSTRING (name)->data; | 1729 | nm = SDATA (name); |
| 1730 | 1730 | ||
| 1731 | /* If nm is absolute, flush ...// and detect /./ and /../. | 1731 | /* If nm is absolute, flush ...// and detect /./ and /../. |
| 1732 | If no /./ or /../ we can return right away. */ | 1732 | If no /./ or /../ we can return right away. */ |
| @@ -1835,7 +1835,7 @@ See also the function `substitute-in-file-name'.") | |||
| 1835 | if (index (nm, '/')) | 1835 | if (index (nm, '/')) |
| 1836 | return build_string (sys_translate_unix (nm)); | 1836 | return build_string (sys_translate_unix (nm)); |
| 1837 | #endif /* VMS */ | 1837 | #endif /* VMS */ |
| 1838 | if (nm == XSTRING (name)->data) | 1838 | if (nm == SDATA (name)) |
| 1839 | return name; | 1839 | return name; |
| 1840 | return build_string (nm); | 1840 | return build_string (nm); |
| 1841 | } | 1841 | } |
| @@ -1896,7 +1896,7 @@ See also the function `substitute-in-file-name'.") | |||
| 1896 | if (NILP (defalt)) | 1896 | if (NILP (defalt)) |
| 1897 | defalt = current_buffer->directory; | 1897 | defalt = current_buffer->directory; |
| 1898 | CHECK_STRING (defalt); | 1898 | CHECK_STRING (defalt); |
| 1899 | newdir = XSTRING (defalt)->data; | 1899 | newdir = SDATA (defalt); |
| 1900 | } | 1900 | } |
| 1901 | 1901 | ||
| 1902 | /* Now concatenate the directory and name to new space in the stack frame */ | 1902 | /* Now concatenate the directory and name to new space in the stack frame */ |
| @@ -2046,13 +2046,13 @@ duplicates what `expand-file-name' does. */) | |||
| 2046 | if (!NILP (handler)) | 2046 | if (!NILP (handler)) |
| 2047 | return call2 (handler, Qsubstitute_in_file_name, filename); | 2047 | return call2 (handler, Qsubstitute_in_file_name, filename); |
| 2048 | 2048 | ||
| 2049 | nm = XSTRING (filename)->data; | 2049 | nm = SDATA (filename); |
| 2050 | #ifdef DOS_NT | 2050 | #ifdef DOS_NT |
| 2051 | nm = strcpy (alloca (strlen (nm) + 1), nm); | 2051 | nm = strcpy (alloca (strlen (nm) + 1), nm); |
| 2052 | CORRECT_DIR_SEPS (nm); | 2052 | CORRECT_DIR_SEPS (nm); |
| 2053 | substituted = (strcmp (nm, XSTRING (filename)->data) != 0); | 2053 | substituted = (strcmp (nm, SDATA (filename)) != 0); |
| 2054 | #endif | 2054 | #endif |
| 2055 | endp = nm + STRING_BYTES (XSTRING (filename)); | 2055 | endp = nm + SBYTES (filename); |
| 2056 | 2056 | ||
| 2057 | /* If /~ or // appears, discard everything through first slash. */ | 2057 | /* If /~ or // appears, discard everything through first slash. */ |
| 2058 | 2058 | ||
| @@ -2168,7 +2168,7 @@ duplicates what `expand-file-name' does. */) | |||
| 2168 | 2168 | ||
| 2169 | /* If substitution required, recopy the string and do it */ | 2169 | /* If substitution required, recopy the string and do it */ |
| 2170 | /* Make space in stack frame for the new copy */ | 2170 | /* Make space in stack frame for the new copy */ |
| 2171 | xnm = (unsigned char *) alloca (STRING_BYTES (XSTRING (filename)) + total + 1); | 2171 | xnm = (unsigned char *) alloca (SBYTES (filename) + total + 1); |
| 2172 | x = xnm; | 2172 | x = xnm; |
| 2173 | 2173 | ||
| 2174 | /* Copy the rest of the name through, replacing $ constructs with values */ | 2174 | /* Copy the rest of the name through, replacing $ constructs with values */ |
| @@ -2279,16 +2279,16 @@ expand_and_dir_to_file (filename, defdir) | |||
| 2279 | absname = Fexpand_file_name (filename, defdir); | 2279 | absname = Fexpand_file_name (filename, defdir); |
| 2280 | #ifdef VMS | 2280 | #ifdef VMS |
| 2281 | { | 2281 | { |
| 2282 | register int c = XSTRING (absname)->data[STRING_BYTES (XSTRING (absname)) - 1]; | 2282 | register int c = SREF (absname, SBYTES (absname) - 1); |
| 2283 | if (c == ':' || c == ']' || c == '>') | 2283 | if (c == ':' || c == ']' || c == '>') |
| 2284 | absname = Fdirectory_file_name (absname); | 2284 | absname = Fdirectory_file_name (absname); |
| 2285 | } | 2285 | } |
| 2286 | #else | 2286 | #else |
| 2287 | /* Remove final slash, if any (unless this is the root dir). | 2287 | /* Remove final slash, if any (unless this is the root dir). |
| 2288 | stat behaves differently depending! */ | 2288 | stat behaves differently depending! */ |
| 2289 | if (XSTRING (absname)->size > 1 | 2289 | if (SCHARS (absname) > 1 |
| 2290 | && IS_DIRECTORY_SEP (XSTRING (absname)->data[STRING_BYTES (XSTRING (absname)) - 1]) | 2290 | && IS_DIRECTORY_SEP (SREF (absname, SBYTES (absname) - 1)) |
| 2291 | && !IS_DEVICE_SEP (XSTRING (absname)->data[STRING_BYTES (XSTRING (absname))-2])) | 2291 | && !IS_DEVICE_SEP (SREF (absname, SBYTES (absname)-2))) |
| 2292 | /* We cannot take shortcuts; they might be wrong for magic file names. */ | 2292 | /* We cannot take shortcuts; they might be wrong for magic file names. */ |
| 2293 | absname = Fdirectory_file_name (absname); | 2293 | absname = Fdirectory_file_name (absname); |
| 2294 | #endif | 2294 | #endif |
| @@ -2323,7 +2323,7 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick) | |||
| 2323 | 2323 | ||
| 2324 | /* stat is a good way to tell whether the file exists, | 2324 | /* stat is a good way to tell whether the file exists, |
| 2325 | regardless of what access permissions it has. */ | 2325 | regardless of what access permissions it has. */ |
| 2326 | if (stat (XSTRING (encoded_filename)->data, &statbuf) >= 0) | 2326 | if (stat (SDATA (encoded_filename), &statbuf) >= 0) |
| 2327 | { | 2327 | { |
| 2328 | if (! interactive) | 2328 | if (! interactive) |
| 2329 | Fsignal (Qfile_already_exists, | 2329 | Fsignal (Qfile_already_exists, |
| @@ -2331,7 +2331,7 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick) | |||
| 2331 | Fcons (absname, Qnil))); | 2331 | Fcons (absname, Qnil))); |
| 2332 | GCPRO1 (absname); | 2332 | GCPRO1 (absname); |
| 2333 | tem = format1 ("File %s already exists; %s anyway? ", | 2333 | tem = format1 ("File %s already exists; %s anyway? ", |
| 2334 | XSTRING (absname)->data, querystring); | 2334 | SDATA (absname), querystring); |
| 2335 | if (quick) | 2335 | if (quick) |
| 2336 | tem = Fy_or_n_p (tem); | 2336 | tem = Fy_or_n_p (tem); |
| 2337 | else | 2337 | else |
| @@ -2404,12 +2404,12 @@ A prefix arg makes KEEP-TIME non-nil. */) | |||
| 2404 | || INTEGERP (ok_if_already_exists)) | 2404 | || INTEGERP (ok_if_already_exists)) |
| 2405 | barf_or_query_if_file_exists (encoded_newname, "copy to it", | 2405 | barf_or_query_if_file_exists (encoded_newname, "copy to it", |
| 2406 | INTEGERP (ok_if_already_exists), &out_st, 0); | 2406 | INTEGERP (ok_if_already_exists), &out_st, 0); |
| 2407 | else if (stat (XSTRING (encoded_newname)->data, &out_st) < 0) | 2407 | else if (stat (SDATA (encoded_newname), &out_st) < 0) |
| 2408 | out_st.st_mode = 0; | 2408 | out_st.st_mode = 0; |
| 2409 | 2409 | ||
| 2410 | #ifdef WINDOWSNT | 2410 | #ifdef WINDOWSNT |
| 2411 | if (!CopyFile (XSTRING (encoded_file)->data, | 2411 | if (!CopyFile (SDATA (encoded_file), |
| 2412 | XSTRING (encoded_newname)->data, | 2412 | SDATA (encoded_newname), |
| 2413 | FALSE)) | 2413 | FALSE)) |
| 2414 | report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil))); | 2414 | report_file_error ("Copying file", Fcons (file, Fcons (newname, Qnil))); |
| 2415 | else if (NILP (keep_time)) | 2415 | else if (NILP (keep_time)) |
| @@ -2419,7 +2419,7 @@ A prefix arg makes KEEP-TIME non-nil. */) | |||
| 2419 | char * filename; | 2419 | char * filename; |
| 2420 | 2420 | ||
| 2421 | EMACS_GET_TIME (now); | 2421 | EMACS_GET_TIME (now); |
| 2422 | filename = XSTRING (encoded_newname)->data; | 2422 | filename = SDATA (encoded_newname); |
| 2423 | 2423 | ||
| 2424 | /* Ensure file is writable while its modified time is set. */ | 2424 | /* Ensure file is writable while its modified time is set. */ |
| 2425 | attributes = GetFileAttributes (filename); | 2425 | attributes = GetFileAttributes (filename); |
| @@ -2436,7 +2436,7 @@ A prefix arg makes KEEP-TIME non-nil. */) | |||
| 2436 | SetFileAttributes (filename, attributes); | 2436 | SetFileAttributes (filename, attributes); |
| 2437 | } | 2437 | } |
| 2438 | #else /* not WINDOWSNT */ | 2438 | #else /* not WINDOWSNT */ |
| 2439 | ifd = emacs_open (XSTRING (encoded_file)->data, O_RDONLY, 0); | 2439 | ifd = emacs_open (SDATA (encoded_file), O_RDONLY, 0); |
| 2440 | if (ifd < 0) | 2440 | if (ifd < 0) |
| 2441 | report_file_error ("Opening input file", Fcons (file, Qnil)); | 2441 | report_file_error ("Opening input file", Fcons (file, Qnil)); |
| 2442 | 2442 | ||
| @@ -2472,13 +2472,13 @@ A prefix arg makes KEEP-TIME non-nil. */) | |||
| 2472 | 2472 | ||
| 2473 | #ifdef VMS | 2473 | #ifdef VMS |
| 2474 | /* Create the copy file with the same record format as the input file */ | 2474 | /* Create the copy file with the same record format as the input file */ |
| 2475 | ofd = sys_creat (XSTRING (encoded_newname)->data, 0666, ifd); | 2475 | ofd = sys_creat (SDATA (encoded_newname), 0666, ifd); |
| 2476 | #else | 2476 | #else |
| 2477 | #ifdef MSDOS | 2477 | #ifdef MSDOS |
| 2478 | /* System's default file type was set to binary by _fmode in emacs.c. */ | 2478 | /* System's default file type was set to binary by _fmode in emacs.c. */ |
| 2479 | ofd = creat (XSTRING (encoded_newname)->data, S_IREAD | S_IWRITE); | 2479 | ofd = creat (SDATA (encoded_newname), S_IREAD | S_IWRITE); |
| 2480 | #else /* not MSDOS */ | 2480 | #else /* not MSDOS */ |
| 2481 | ofd = creat (XSTRING (encoded_newname)->data, 0666); | 2481 | ofd = creat (SDATA (encoded_newname), 0666); |
| 2482 | #endif /* not MSDOS */ | 2482 | #endif /* not MSDOS */ |
| 2483 | #endif /* VMS */ | 2483 | #endif /* VMS */ |
| 2484 | if (ofd < 0) | 2484 | if (ofd < 0) |
| @@ -2504,14 +2504,14 @@ A prefix arg makes KEEP-TIME non-nil. */) | |||
| 2504 | EMACS_TIME atime, mtime; | 2504 | EMACS_TIME atime, mtime; |
| 2505 | EMACS_SET_SECS_USECS (atime, st.st_atime, 0); | 2505 | EMACS_SET_SECS_USECS (atime, st.st_atime, 0); |
| 2506 | EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); | 2506 | EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); |
| 2507 | if (set_file_times (XSTRING (encoded_newname)->data, | 2507 | if (set_file_times (SDATA (encoded_newname), |
| 2508 | atime, mtime)) | 2508 | atime, mtime)) |
| 2509 | Fsignal (Qfile_date_error, | 2509 | Fsignal (Qfile_date_error, |
| 2510 | Fcons (build_string ("Cannot set file date"), | 2510 | Fcons (build_string ("Cannot set file date"), |
| 2511 | Fcons (newname, Qnil))); | 2511 | Fcons (newname, Qnil))); |
| 2512 | } | 2512 | } |
| 2513 | #ifndef MSDOS | 2513 | #ifndef MSDOS |
| 2514 | chmod (XSTRING (encoded_newname)->data, st.st_mode & 07777); | 2514 | chmod (SDATA (encoded_newname), st.st_mode & 07777); |
| 2515 | #else /* MSDOS */ | 2515 | #else /* MSDOS */ |
| 2516 | #if defined (__DJGPP__) && __DJGPP__ > 1 | 2516 | #if defined (__DJGPP__) && __DJGPP__ > 1 |
| 2517 | /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, | 2517 | /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, |
| @@ -2519,7 +2519,7 @@ A prefix arg makes KEEP-TIME non-nil. */) | |||
| 2519 | get only the READ bit, which will make the copied file read-only, | 2519 | get only the READ bit, which will make the copied file read-only, |
| 2520 | so it's better not to chmod at all. */ | 2520 | so it's better not to chmod at all. */ |
| 2521 | if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) | 2521 | if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) |
| 2522 | chmod (XSTRING (encoded_newname)->data, st.st_mode & 07777); | 2522 | chmod (SDATA (encoded_newname), st.st_mode & 07777); |
| 2523 | #endif /* DJGPP version 2 or newer */ | 2523 | #endif /* DJGPP version 2 or newer */ |
| 2524 | #endif /* MSDOS */ | 2524 | #endif /* MSDOS */ |
| 2525 | } | 2525 | } |
| @@ -2553,7 +2553,7 @@ DEFUN ("make-directory-internal", Fmake_directory_internal, | |||
| 2553 | 2553 | ||
| 2554 | encoded_dir = ENCODE_FILE (directory); | 2554 | encoded_dir = ENCODE_FILE (directory); |
| 2555 | 2555 | ||
| 2556 | dir = XSTRING (encoded_dir)->data; | 2556 | dir = SDATA (encoded_dir); |
| 2557 | 2557 | ||
| 2558 | #ifdef WINDOWSNT | 2558 | #ifdef WINDOWSNT |
| 2559 | if (mkdir (dir) != 0) | 2559 | if (mkdir (dir) != 0) |
| @@ -2583,7 +2583,7 @@ DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete | |||
| 2583 | 2583 | ||
| 2584 | encoded_dir = ENCODE_FILE (directory); | 2584 | encoded_dir = ENCODE_FILE (directory); |
| 2585 | 2585 | ||
| 2586 | dir = XSTRING (encoded_dir)->data; | 2586 | dir = SDATA (encoded_dir); |
| 2587 | 2587 | ||
| 2588 | if (rmdir (dir) != 0) | 2588 | if (rmdir (dir) != 0) |
| 2589 | report_file_error ("Removing directory", Flist (1, &directory)); | 2589 | report_file_error ("Removing directory", Flist (1, &directory)); |
| @@ -2609,7 +2609,7 @@ If file has multiple names, it continues to exist with the other names. */) | |||
| 2609 | 2609 | ||
| 2610 | encoded_file = ENCODE_FILE (filename); | 2610 | encoded_file = ENCODE_FILE (filename); |
| 2611 | 2611 | ||
| 2612 | if (0 > unlink (XSTRING (encoded_file)->data)) | 2612 | if (0 > unlink (SDATA (encoded_file))) |
| 2613 | report_file_error ("Removing old name", Flist (1, &filename)); | 2613 | report_file_error ("Removing old name", Flist (1, &filename)); |
| 2614 | return Qnil; | 2614 | return Qnil; |
| 2615 | } | 2615 | } |
| @@ -2679,10 +2679,10 @@ This is what happens in interactive use with M-x. */) | |||
| 2679 | barf_or_query_if_file_exists (encoded_newname, "rename to it", | 2679 | barf_or_query_if_file_exists (encoded_newname, "rename to it", |
| 2680 | INTEGERP (ok_if_already_exists), 0, 0); | 2680 | INTEGERP (ok_if_already_exists), 0, 0); |
| 2681 | #ifndef BSD4_1 | 2681 | #ifndef BSD4_1 |
| 2682 | if (0 > rename (XSTRING (encoded_file)->data, XSTRING (encoded_newname)->data)) | 2682 | if (0 > rename (SDATA (encoded_file), SDATA (encoded_newname))) |
| 2683 | #else | 2683 | #else |
| 2684 | if (0 > link (XSTRING (encoded_file)->data, XSTRING (encoded_newname)->data) | 2684 | if (0 > link (SDATA (encoded_file), SDATA (encoded_newname)) |
| 2685 | || 0 > unlink (XSTRING (encoded_file)->data)) | 2685 | || 0 > unlink (SDATA (encoded_file))) |
| 2686 | #endif | 2686 | #endif |
| 2687 | { | 2687 | { |
| 2688 | if (errno == EXDEV) | 2688 | if (errno == EXDEV) |
| @@ -2754,8 +2754,8 @@ This is what happens in interactive use with M-x. */) | |||
| 2754 | barf_or_query_if_file_exists (encoded_newname, "make it a new name", | 2754 | barf_or_query_if_file_exists (encoded_newname, "make it a new name", |
| 2755 | INTEGERP (ok_if_already_exists), 0, 0); | 2755 | INTEGERP (ok_if_already_exists), 0, 0); |
| 2756 | 2756 | ||
| 2757 | unlink (XSTRING (newname)->data); | 2757 | unlink (SDATA (newname)); |
| 2758 | if (0 > link (XSTRING (encoded_file)->data, XSTRING (encoded_newname)->data)) | 2758 | if (0 > link (SDATA (encoded_file), SDATA (encoded_newname))) |
| 2759 | { | 2759 | { |
| 2760 | #ifdef NO_ARG_ARRAY | 2760 | #ifdef NO_ARG_ARRAY |
| 2761 | args[0] = file; | 2761 | args[0] = file; |
| @@ -2795,7 +2795,7 @@ This happens for interactive use with M-x. */) | |||
| 2795 | /* If the link target has a ~, we must expand it to get | 2795 | /* If the link target has a ~, we must expand it to get |
| 2796 | a truly valid file name. Otherwise, do not expand; | 2796 | a truly valid file name. Otherwise, do not expand; |
| 2797 | we want to permit links to relative file names. */ | 2797 | we want to permit links to relative file names. */ |
| 2798 | if (XSTRING (filename)->data[0] == '~') | 2798 | if (SREF (filename, 0) == '~') |
| 2799 | filename = Fexpand_file_name (filename, Qnil); | 2799 | filename = Fexpand_file_name (filename, Qnil); |
| 2800 | linkname = Fexpand_file_name (linkname, Qnil); | 2800 | linkname = Fexpand_file_name (linkname, Qnil); |
| 2801 | 2801 | ||
| @@ -2820,15 +2820,15 @@ This happens for interactive use with M-x. */) | |||
| 2820 | || INTEGERP (ok_if_already_exists)) | 2820 | || INTEGERP (ok_if_already_exists)) |
| 2821 | barf_or_query_if_file_exists (encoded_linkname, "make it a link", | 2821 | barf_or_query_if_file_exists (encoded_linkname, "make it a link", |
| 2822 | INTEGERP (ok_if_already_exists), 0, 0); | 2822 | INTEGERP (ok_if_already_exists), 0, 0); |
| 2823 | if (0 > symlink (XSTRING (encoded_filename)->data, | 2823 | if (0 > symlink (SDATA (encoded_filename), |
| 2824 | XSTRING (encoded_linkname)->data)) | 2824 | SDATA (encoded_linkname))) |
| 2825 | { | 2825 | { |
| 2826 | /* If we didn't complain already, silently delete existing file. */ | 2826 | /* If we didn't complain already, silently delete existing file. */ |
| 2827 | if (errno == EEXIST) | 2827 | if (errno == EEXIST) |
| 2828 | { | 2828 | { |
| 2829 | unlink (XSTRING (encoded_linkname)->data); | 2829 | unlink (SDATA (encoded_linkname)); |
| 2830 | if (0 <= symlink (XSTRING (encoded_filename)->data, | 2830 | if (0 <= symlink (SDATA (encoded_filename), |
| 2831 | XSTRING (encoded_linkname)->data)) | 2831 | SDATA (encoded_linkname))) |
| 2832 | { | 2832 | { |
| 2833 | UNGCPRO; | 2833 | UNGCPRO; |
| 2834 | return Qnil; | 2834 | return Qnil; |
| @@ -2860,15 +2860,15 @@ If STRING is nil or a null string, the logical name NAME is deleted. */) | |||
| 2860 | { | 2860 | { |
| 2861 | CHECK_STRING (name); | 2861 | CHECK_STRING (name); |
| 2862 | if (NILP (string)) | 2862 | if (NILP (string)) |
| 2863 | delete_logical_name (XSTRING (name)->data); | 2863 | delete_logical_name (SDATA (name)); |
| 2864 | else | 2864 | else |
| 2865 | { | 2865 | { |
| 2866 | CHECK_STRING (string); | 2866 | CHECK_STRING (string); |
| 2867 | 2867 | ||
| 2868 | if (XSTRING (string)->size == 0) | 2868 | if (SCHARS (string) == 0) |
| 2869 | delete_logical_name (XSTRING (name)->data); | 2869 | delete_logical_name (SDATA (name)); |
| 2870 | else | 2870 | else |
| 2871 | define_logical_name (XSTRING (name)->data, XSTRING (string)->data); | 2871 | define_logical_name (SDATA (name), SDATA (string)); |
| 2872 | } | 2872 | } |
| 2873 | 2873 | ||
| 2874 | return string; | 2874 | return string; |
| @@ -2887,7 +2887,7 @@ DEFUN ("sysnetunam", Fsysnetunam, Ssysnetunam, 2, 2, 0, | |||
| 2887 | CHECK_STRING (path); | 2887 | CHECK_STRING (path); |
| 2888 | CHECK_STRING (login); | 2888 | CHECK_STRING (login); |
| 2889 | 2889 | ||
| 2890 | netresult = netunam (XSTRING (path)->data, XSTRING (login)->data); | 2890 | netresult = netunam (SDATA (path), SDATA (login)); |
| 2891 | 2891 | ||
| 2892 | if (netresult == -1) | 2892 | if (netresult == -1) |
| 2893 | return Qnil; | 2893 | return Qnil; |
| @@ -2906,7 +2906,7 @@ On Unix, this is a name starting with a `/' or a `~'. */) | |||
| 2906 | unsigned char *ptr; | 2906 | unsigned char *ptr; |
| 2907 | 2907 | ||
| 2908 | CHECK_STRING (filename); | 2908 | CHECK_STRING (filename); |
| 2909 | ptr = XSTRING (filename)->data; | 2909 | ptr = SDATA (filename); |
| 2910 | if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' | 2910 | if (IS_DIRECTORY_SEP (*ptr) || *ptr == '~' |
| 2911 | #ifdef VMS | 2911 | #ifdef VMS |
| 2912 | /* ??? This criterion is probably wrong for '<'. */ | 2912 | /* ??? This criterion is probably wrong for '<'. */ |
| @@ -3003,7 +3003,7 @@ See also `file-readable-p' and `file-attributes'. */) | |||
| 3003 | 3003 | ||
| 3004 | absname = ENCODE_FILE (absname); | 3004 | absname = ENCODE_FILE (absname); |
| 3005 | 3005 | ||
| 3006 | return (stat (XSTRING (absname)->data, &statbuf) >= 0) ? Qt : Qnil; | 3006 | return (stat (SDATA (absname), &statbuf) >= 0) ? Qt : Qnil; |
| 3007 | } | 3007 | } |
| 3008 | 3008 | ||
| 3009 | DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0, | 3009 | DEFUN ("file-executable-p", Ffile_executable_p, Sfile_executable_p, 1, 1, 0, |
| @@ -3026,7 +3026,7 @@ For a directory, this means you can access files in that directory. */) | |||
| 3026 | 3026 | ||
| 3027 | absname = ENCODE_FILE (absname); | 3027 | absname = ENCODE_FILE (absname); |
| 3028 | 3028 | ||
| 3029 | return (check_executable (XSTRING (absname)->data) ? Qt : Qnil); | 3029 | return (check_executable (SDATA (absname)) ? Qt : Qnil); |
| 3030 | } | 3030 | } |
| 3031 | 3031 | ||
| 3032 | DEFUN ("file-readable-p", Ffile_readable_p, Sfile_readable_p, 1, 1, 0, | 3032 | DEFUN ("file-readable-p", Ffile_readable_p, Sfile_readable_p, 1, 1, 0, |
| @@ -3055,7 +3055,7 @@ See also `file-exists-p' and `file-attributes'. */) | |||
| 3055 | #if defined(DOS_NT) || defined(macintosh) | 3055 | #if defined(DOS_NT) || defined(macintosh) |
| 3056 | /* Under MS-DOS, Windows, and Macintosh, open does not work for | 3056 | /* Under MS-DOS, Windows, and Macintosh, open does not work for |
| 3057 | directories. */ | 3057 | directories. */ |
| 3058 | if (access (XSTRING (absname)->data, 0) == 0) | 3058 | if (access (SDATA (absname), 0) == 0) |
| 3059 | return Qt; | 3059 | return Qt; |
| 3060 | return Qnil; | 3060 | return Qnil; |
| 3061 | #else /* not DOS_NT and not macintosh */ | 3061 | #else /* not DOS_NT and not macintosh */ |
| @@ -3064,13 +3064,13 @@ See also `file-exists-p' and `file-attributes'. */) | |||
| 3064 | /* Opening a fifo without O_NONBLOCK can wait. | 3064 | /* Opening a fifo without O_NONBLOCK can wait. |
| 3065 | We don't want to wait. But we don't want to mess wth O_NONBLOCK | 3065 | We don't want to wait. But we don't want to mess wth O_NONBLOCK |
| 3066 | except in the case of a fifo, on a system which handles it. */ | 3066 | except in the case of a fifo, on a system which handles it. */ |
| 3067 | desc = stat (XSTRING (absname)->data, &statbuf); | 3067 | desc = stat (SDATA (absname), &statbuf); |
| 3068 | if (desc < 0) | 3068 | if (desc < 0) |
| 3069 | return Qnil; | 3069 | return Qnil; |
| 3070 | if (S_ISFIFO (statbuf.st_mode)) | 3070 | if (S_ISFIFO (statbuf.st_mode)) |
| 3071 | flags |= O_NONBLOCK; | 3071 | flags |= O_NONBLOCK; |
| 3072 | #endif | 3072 | #endif |
| 3073 | desc = emacs_open (XSTRING (absname)->data, flags, 0); | 3073 | desc = emacs_open (SDATA (absname), flags, 0); |
| 3074 | if (desc < 0) | 3074 | if (desc < 0) |
| 3075 | return Qnil; | 3075 | return Qnil; |
| 3076 | emacs_close (desc); | 3076 | emacs_close (desc); |
| @@ -3099,8 +3099,8 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, | |||
| 3099 | return call2 (handler, Qfile_writable_p, absname); | 3099 | return call2 (handler, Qfile_writable_p, absname); |
| 3100 | 3100 | ||
| 3101 | encoded = ENCODE_FILE (absname); | 3101 | encoded = ENCODE_FILE (absname); |
| 3102 | if (stat (XSTRING (encoded)->data, &statbuf) >= 0) | 3102 | if (stat (SDATA (encoded), &statbuf) >= 0) |
| 3103 | return (check_writable (XSTRING (encoded)->data) | 3103 | return (check_writable (SDATA (encoded)) |
| 3104 | ? Qt : Qnil); | 3104 | ? Qt : Qnil); |
| 3105 | 3105 | ||
| 3106 | dir = Ffile_name_directory (absname); | 3106 | dir = Ffile_name_directory (absname); |
| @@ -3118,11 +3118,11 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, | |||
| 3118 | /* The read-only attribute of the parent directory doesn't affect | 3118 | /* The read-only attribute of the parent directory doesn't affect |
| 3119 | whether a file or directory can be created within it. Some day we | 3119 | whether a file or directory can be created within it. Some day we |
| 3120 | should check ACLs though, which do affect this. */ | 3120 | should check ACLs though, which do affect this. */ |
| 3121 | if (stat (XSTRING (dir)->data, &statbuf) < 0) | 3121 | if (stat (SDATA (dir), &statbuf) < 0) |
| 3122 | return Qnil; | 3122 | return Qnil; |
| 3123 | return (statbuf.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil; | 3123 | return (statbuf.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil; |
| 3124 | #else | 3124 | #else |
| 3125 | return (check_writable (!NILP (dir) ? (char *) XSTRING (dir)->data : "") | 3125 | return (check_writable (!NILP (dir) ? (char *) SDATA (dir) : "") |
| 3126 | ? Qt : Qnil); | 3126 | ? Qt : Qnil); |
| 3127 | #endif | 3127 | #endif |
| 3128 | } | 3128 | } |
| @@ -3150,9 +3150,9 @@ If there is no error, we return nil. */) | |||
| 3150 | 3150 | ||
| 3151 | encoded_filename = ENCODE_FILE (absname); | 3151 | encoded_filename = ENCODE_FILE (absname); |
| 3152 | 3152 | ||
| 3153 | fd = emacs_open (XSTRING (encoded_filename)->data, O_RDONLY, 0); | 3153 | fd = emacs_open (SDATA (encoded_filename), O_RDONLY, 0); |
| 3154 | if (fd < 0) | 3154 | if (fd < 0) |
| 3155 | report_file_error (XSTRING (string)->data, Fcons (filename, Qnil)); | 3155 | report_file_error (SDATA (string), Fcons (filename, Qnil)); |
| 3156 | emacs_close (fd); | 3156 | emacs_close (fd); |
| 3157 | 3157 | ||
| 3158 | return Qnil; | 3158 | return Qnil; |
| @@ -3192,7 +3192,7 @@ Otherwise returns nil. */) | |||
| 3192 | bzero (buf, bufsize); | 3192 | bzero (buf, bufsize); |
| 3193 | 3193 | ||
| 3194 | errno = 0; | 3194 | errno = 0; |
| 3195 | valsize = readlink (XSTRING (filename)->data, buf, bufsize); | 3195 | valsize = readlink (SDATA (filename), buf, bufsize); |
| 3196 | if (valsize == -1) | 3196 | if (valsize == -1) |
| 3197 | { | 3197 | { |
| 3198 | #ifdef ERANGE | 3198 | #ifdef ERANGE |
| @@ -3241,7 +3241,7 @@ See `file-symlink-p' to distinguish symlinks. */) | |||
| 3241 | 3241 | ||
| 3242 | absname = ENCODE_FILE (absname); | 3242 | absname = ENCODE_FILE (absname); |
| 3243 | 3243 | ||
| 3244 | if (stat (XSTRING (absname)->data, &st) < 0) | 3244 | if (stat (SDATA (absname), &st) < 0) |
| 3245 | return Qnil; | 3245 | return Qnil; |
| 3246 | return (st.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil; | 3246 | return (st.st_mode & S_IFMT) == S_IFDIR ? Qt : Qnil; |
| 3247 | } | 3247 | } |
| @@ -3307,7 +3307,7 @@ This is the sort of file that holds an ordinary stream of data bytes. */) | |||
| 3307 | 3307 | ||
| 3308 | /* Tell stat to use expensive method to get accurate info. */ | 3308 | /* Tell stat to use expensive method to get accurate info. */ |
| 3309 | Vw32_get_true_file_attributes = Qt; | 3309 | Vw32_get_true_file_attributes = Qt; |
| 3310 | result = stat (XSTRING (absname)->data, &st); | 3310 | result = stat (SDATA (absname), &st); |
| 3311 | Vw32_get_true_file_attributes = tem; | 3311 | Vw32_get_true_file_attributes = tem; |
| 3312 | 3312 | ||
| 3313 | if (result < 0) | 3313 | if (result < 0) |
| @@ -3315,7 +3315,7 @@ This is the sort of file that holds an ordinary stream of data bytes. */) | |||
| 3315 | return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil; | 3315 | return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil; |
| 3316 | } | 3316 | } |
| 3317 | #else | 3317 | #else |
| 3318 | if (stat (XSTRING (absname)->data, &st) < 0) | 3318 | if (stat (SDATA (absname), &st) < 0) |
| 3319 | return Qnil; | 3319 | return Qnil; |
| 3320 | return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil; | 3320 | return (st.st_mode & S_IFMT) == S_IFREG ? Qt : Qnil; |
| 3321 | #endif | 3321 | #endif |
| @@ -3340,10 +3340,10 @@ DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0, | |||
| 3340 | 3340 | ||
| 3341 | absname = ENCODE_FILE (absname); | 3341 | absname = ENCODE_FILE (absname); |
| 3342 | 3342 | ||
| 3343 | if (stat (XSTRING (absname)->data, &st) < 0) | 3343 | if (stat (SDATA (absname), &st) < 0) |
| 3344 | return Qnil; | 3344 | return Qnil; |
| 3345 | #if defined (MSDOS) && __DJGPP__ < 2 | 3345 | #if defined (MSDOS) && __DJGPP__ < 2 |
| 3346 | if (check_executable (XSTRING (absname)->data)) | 3346 | if (check_executable (SDATA (absname))) |
| 3347 | st.st_mode |= S_IEXEC; | 3347 | st.st_mode |= S_IEXEC; |
| 3348 | #endif /* MSDOS && __DJGPP__ < 2 */ | 3348 | #endif /* MSDOS && __DJGPP__ < 2 */ |
| 3349 | 3349 | ||
| @@ -3370,7 +3370,7 @@ Only the 12 low bits of MODE are used. */) | |||
| 3370 | 3370 | ||
| 3371 | encoded_absname = ENCODE_FILE (absname); | 3371 | encoded_absname = ENCODE_FILE (absname); |
| 3372 | 3372 | ||
| 3373 | if (chmod (XSTRING (encoded_absname)->data, XINT (mode)) < 0) | 3373 | if (chmod (SDATA (encoded_absname), XINT (mode)) < 0) |
| 3374 | report_file_error ("Doing chmod", Fcons (absname, Qnil)); | 3374 | report_file_error ("Doing chmod", Fcons (absname, Qnil)); |
| 3375 | 3375 | ||
| 3376 | return Qnil; | 3376 | return Qnil; |
| @@ -3456,12 +3456,12 @@ otherwise, if FILE2 does not exist, the answer is t. */) | |||
| 3456 | absname2 = ENCODE_FILE (absname2); | 3456 | absname2 = ENCODE_FILE (absname2); |
| 3457 | UNGCPRO; | 3457 | UNGCPRO; |
| 3458 | 3458 | ||
| 3459 | if (stat (XSTRING (absname1)->data, &st) < 0) | 3459 | if (stat (SDATA (absname1), &st) < 0) |
| 3460 | return Qnil; | 3460 | return Qnil; |
| 3461 | 3461 | ||
| 3462 | mtime1 = st.st_mtime; | 3462 | mtime1 = st.st_mtime; |
| 3463 | 3463 | ||
| 3464 | if (stat (XSTRING (absname2)->data, &st) < 0) | 3464 | if (stat (SDATA (absname2), &st) < 0) |
| 3465 | return Qt; | 3465 | return Qt; |
| 3466 | 3466 | ||
| 3467 | return (mtime1 > st.st_mtime) ? Qt : Qnil; | 3467 | return (mtime1 > st.st_mtime) ? Qt : Qnil; |
| @@ -3640,15 +3640,15 @@ actually used. */) | |||
| 3640 | 3640 | ||
| 3641 | /* Tell stat to use expensive method to get accurate info. */ | 3641 | /* Tell stat to use expensive method to get accurate info. */ |
| 3642 | Vw32_get_true_file_attributes = Qt; | 3642 | Vw32_get_true_file_attributes = Qt; |
| 3643 | total = stat (XSTRING (filename)->data, &st); | 3643 | total = stat (SDATA (filename), &st); |
| 3644 | Vw32_get_true_file_attributes = tem; | 3644 | Vw32_get_true_file_attributes = tem; |
| 3645 | } | 3645 | } |
| 3646 | if (total < 0) | 3646 | if (total < 0) |
| 3647 | #else | 3647 | #else |
| 3648 | #ifndef APOLLO | 3648 | #ifndef APOLLO |
| 3649 | if (stat (XSTRING (filename)->data, &st) < 0) | 3649 | if (stat (SDATA (filename), &st) < 0) |
| 3650 | #else | 3650 | #else |
| 3651 | if ((fd = emacs_open (XSTRING (filename)->data, O_RDONLY, 0)) < 0 | 3651 | if ((fd = emacs_open (SDATA (filename), O_RDONLY, 0)) < 0 |
| 3652 | || fstat (fd, &st) < 0) | 3652 | || fstat (fd, &st) < 0) |
| 3653 | #endif /* not APOLLO */ | 3653 | #endif /* not APOLLO */ |
| 3654 | #endif /* WINDOWSNT */ | 3654 | #endif /* WINDOWSNT */ |
| @@ -3683,7 +3683,7 @@ actually used. */) | |||
| 3683 | #endif | 3683 | #endif |
| 3684 | 3684 | ||
| 3685 | if (fd < 0) | 3685 | if (fd < 0) |
| 3686 | if ((fd = emacs_open (XSTRING (filename)->data, O_RDONLY, 0)) < 0) | 3686 | if ((fd = emacs_open (SDATA (filename), O_RDONLY, 0)) < 0) |
| 3687 | goto badopen; | 3687 | goto badopen; |
| 3688 | 3688 | ||
| 3689 | /* Replacement should preserve point as it preserves markers. */ | 3689 | /* Replacement should preserve point as it preserves markers. */ |
| @@ -3779,7 +3779,7 @@ actually used. */) | |||
| 3779 | 3779 | ||
| 3780 | if (nread < 0) | 3780 | if (nread < 0) |
| 3781 | error ("IO error reading %s: %s", | 3781 | error ("IO error reading %s: %s", |
| 3782 | XSTRING (orig_filename)->data, emacs_strerror (errno)); | 3782 | SDATA (orig_filename), emacs_strerror (errno)); |
| 3783 | else if (nread > 0) | 3783 | else if (nread > 0) |
| 3784 | { | 3784 | { |
| 3785 | struct buffer *prev = current_buffer; | 3785 | struct buffer *prev = current_buffer; |
| @@ -3896,7 +3896,7 @@ actually used. */) | |||
| 3896 | nread = emacs_read (fd, buffer, sizeof buffer); | 3896 | nread = emacs_read (fd, buffer, sizeof buffer); |
| 3897 | if (nread < 0) | 3897 | if (nread < 0) |
| 3898 | error ("IO error reading %s: %s", | 3898 | error ("IO error reading %s: %s", |
| 3899 | XSTRING (orig_filename)->data, emacs_strerror (errno)); | 3899 | SDATA (orig_filename), emacs_strerror (errno)); |
| 3900 | else if (nread == 0) | 3900 | else if (nread == 0) |
| 3901 | break; | 3901 | break; |
| 3902 | 3902 | ||
| @@ -3967,7 +3967,7 @@ actually used. */) | |||
| 3967 | nread = emacs_read (fd, buffer + total_read, trial - total_read); | 3967 | nread = emacs_read (fd, buffer + total_read, trial - total_read); |
| 3968 | if (nread < 0) | 3968 | if (nread < 0) |
| 3969 | error ("IO error reading %s: %s", | 3969 | error ("IO error reading %s: %s", |
| 3970 | XSTRING (orig_filename)->data, emacs_strerror (errno)); | 3970 | SDATA (orig_filename), emacs_strerror (errno)); |
| 3971 | else if (nread == 0) | 3971 | else if (nread == 0) |
| 3972 | break; | 3972 | break; |
| 3973 | total_read += nread; | 3973 | total_read += nread; |
| @@ -4150,7 +4150,7 @@ actually used. */) | |||
| 4150 | 4150 | ||
| 4151 | if (how_much == -1) | 4151 | if (how_much == -1) |
| 4152 | error ("IO error reading %s: %s", | 4152 | error ("IO error reading %s: %s", |
| 4153 | XSTRING (orig_filename)->data, emacs_strerror (errno)); | 4153 | SDATA (orig_filename), emacs_strerror (errno)); |
| 4154 | else if (how_much == -2) | 4154 | else if (how_much == -2) |
| 4155 | error ("maximum buffer size exceeded"); | 4155 | error ("maximum buffer size exceeded"); |
| 4156 | } | 4156 | } |
| @@ -4370,7 +4370,7 @@ actually used. */) | |||
| 4370 | 4370 | ||
| 4371 | if (how_much < 0) | 4371 | if (how_much < 0) |
| 4372 | error ("IO error reading %s: %s", | 4372 | error ("IO error reading %s: %s", |
| 4373 | XSTRING (orig_filename)->data, emacs_strerror (errno)); | 4373 | SDATA (orig_filename), emacs_strerror (errno)); |
| 4374 | 4374 | ||
| 4375 | notfound: | 4375 | notfound: |
| 4376 | 4376 | ||
| @@ -4493,7 +4493,7 @@ actually used. */) | |||
| 4493 | if (!EQ (current_buffer->undo_list, Qt)) | 4493 | if (!EQ (current_buffer->undo_list, Qt)) |
| 4494 | current_buffer->undo_list = Qnil; | 4494 | current_buffer->undo_list = Qnil; |
| 4495 | #ifdef APOLLO | 4495 | #ifdef APOLLO |
| 4496 | stat (XSTRING (filename)->data, &st); | 4496 | stat (SDATA (filename), &st); |
| 4497 | #endif | 4497 | #endif |
| 4498 | 4498 | ||
| 4499 | if (NILP (handler)) | 4499 | if (NILP (handler)) |
| @@ -4880,7 +4880,7 @@ This does code conversion according to the value of | |||
| 4880 | 4880 | ||
| 4881 | encoded_filename = ENCODE_FILE (filename); | 4881 | encoded_filename = ENCODE_FILE (filename); |
| 4882 | 4882 | ||
| 4883 | fn = XSTRING (encoded_filename)->data; | 4883 | fn = SDATA (encoded_filename); |
| 4884 | desc = -1; | 4884 | desc = -1; |
| 4885 | if (!NILP (append)) | 4885 | if (!NILP (append)) |
| 4886 | #ifdef DOS_NT | 4886 | #ifdef DOS_NT |
| @@ -4897,7 +4897,7 @@ This does code conversion according to the value of | |||
| 4897 | desc = emacs_open (fn, O_RDWR, 0); | 4897 | desc = emacs_open (fn, O_RDWR, 0); |
| 4898 | if (desc < 0) | 4898 | if (desc < 0) |
| 4899 | desc = creat_copy_attrs (STRINGP (current_buffer->filename) | 4899 | desc = creat_copy_attrs (STRINGP (current_buffer->filename) |
| 4900 | ? XSTRING (current_buffer->filename)->data : 0, | 4900 | ? SDATA (current_buffer->filename) : 0, |
| 4901 | fn); | 4901 | fn); |
| 4902 | } | 4902 | } |
| 4903 | else /* Write to temporary name and rename if no errors */ | 4903 | else /* Write to temporary name and rename if no errors */ |
| @@ -4909,8 +4909,8 @@ This does code conversion according to the value of | |||
| 4909 | { | 4909 | { |
| 4910 | temp_name = Fmake_temp_name (concat2 (temp_name, | 4910 | temp_name = Fmake_temp_name (concat2 (temp_name, |
| 4911 | build_string ("$$SAVE$$"))); | 4911 | build_string ("$$SAVE$$"))); |
| 4912 | fname = XSTRING (filename)->data; | 4912 | fname = SDATA (filename); |
| 4913 | fn = XSTRING (temp_name)->data; | 4913 | fn = SDATA (temp_name); |
| 4914 | desc = creat_copy_attrs (fname, fn); | 4914 | desc = creat_copy_attrs (fname, fn); |
| 4915 | if (desc < 0) | 4915 | if (desc < 0) |
| 4916 | { | 4916 | { |
| @@ -5019,7 +5019,7 @@ This does code conversion according to the value of | |||
| 5019 | 5019 | ||
| 5020 | if (STRINGP (start)) | 5020 | if (STRINGP (start)) |
| 5021 | { | 5021 | { |
| 5022 | failure = 0 > a_write (desc, start, 0, XSTRING (start)->size, | 5022 | failure = 0 > a_write (desc, start, 0, SCHARS (start), |
| 5023 | &annotations, &coding); | 5023 | &annotations, &coding); |
| 5024 | save_errno = errno; | 5024 | save_errno = errno; |
| 5025 | } | 5025 | } |
| @@ -5129,7 +5129,7 @@ This does code conversion according to the value of | |||
| 5129 | current_buffer->modtime = st.st_mtime; | 5129 | current_buffer->modtime = st.st_mtime; |
| 5130 | 5130 | ||
| 5131 | if (failure) | 5131 | if (failure) |
| 5132 | error ("IO error writing %s: %s", XSTRING (filename)->data, | 5132 | error ("IO error writing %s: %s", SDATA (filename), |
| 5133 | emacs_strerror (save_errno)); | 5133 | emacs_strerror (save_errno)); |
| 5134 | 5134 | ||
| 5135 | if (visiting) | 5135 | if (visiting) |
| @@ -5304,7 +5304,7 @@ a_write (desc, string, pos, nchars, annot, coding) | |||
| 5304 | tem = Fcdr (Fcar (*annot)); | 5304 | tem = Fcdr (Fcar (*annot)); |
| 5305 | if (STRINGP (tem)) | 5305 | if (STRINGP (tem)) |
| 5306 | { | 5306 | { |
| 5307 | if (0 > e_write (desc, tem, 0, XSTRING (tem)->size, coding)) | 5307 | if (0 > e_write (desc, tem, 0, SCHARS (tem), coding)) |
| 5308 | return -1; | 5308 | return -1; |
| 5309 | } | 5309 | } |
| 5310 | *annot = Fcdr (*annot); | 5310 | *annot = Fcdr (*annot); |
| @@ -5340,8 +5340,8 @@ e_write (desc, string, start, end, coding) | |||
| 5340 | 5340 | ||
| 5341 | if (STRINGP (string)) | 5341 | if (STRINGP (string)) |
| 5342 | { | 5342 | { |
| 5343 | addr = XSTRING (string)->data; | 5343 | addr = SDATA (string); |
| 5344 | nbytes = STRING_BYTES (XSTRING (string)); | 5344 | nbytes = SBYTES (string); |
| 5345 | coding->src_multibyte = STRING_MULTIBYTE (string); | 5345 | coding->src_multibyte = STRING_MULTIBYTE (string); |
| 5346 | } | 5346 | } |
| 5347 | else if (start < end) | 5347 | else if (start < end) |
| @@ -5429,7 +5429,7 @@ This means that the file has not been changed since it was visited or saved. */ | |||
| 5429 | 5429 | ||
| 5430 | filename = ENCODE_FILE (b->filename); | 5430 | filename = ENCODE_FILE (b->filename); |
| 5431 | 5431 | ||
| 5432 | if (stat (XSTRING (filename)->data, &st) < 0) | 5432 | if (stat (SDATA (filename), &st) < 0) |
| 5433 | { | 5433 | { |
| 5434 | /* If the file doesn't exist now and didn't exist before, | 5434 | /* If the file doesn't exist now and didn't exist before, |
| 5435 | we say that it isn't modified, provided the error is a tame one. */ | 5435 | we say that it isn't modified, provided the error is a tame one. */ |
| @@ -5497,7 +5497,7 @@ An argument specifies the modification time value to use | |||
| 5497 | 5497 | ||
| 5498 | filename = ENCODE_FILE (filename); | 5498 | filename = ENCODE_FILE (filename); |
| 5499 | 5499 | ||
| 5500 | if (stat (XSTRING (filename)->data, &st) >= 0) | 5500 | if (stat (SDATA (filename), &st) >= 0) |
| 5501 | current_buffer->modtime = st.st_mtime; | 5501 | current_buffer->modtime = st.st_mtime; |
| 5502 | } | 5502 | } |
| 5503 | 5503 | ||
| @@ -5519,14 +5519,14 @@ auto_save_error (error) | |||
| 5519 | args[2] = Ferror_message_string (error); | 5519 | args[2] = Ferror_message_string (error); |
| 5520 | msg = Fformat (3, args); | 5520 | msg = Fformat (3, args); |
| 5521 | GCPRO1 (msg); | 5521 | GCPRO1 (msg); |
| 5522 | nbytes = STRING_BYTES (XSTRING (msg)); | 5522 | nbytes = SBYTES (msg); |
| 5523 | 5523 | ||
| 5524 | for (i = 0; i < 3; ++i) | 5524 | for (i = 0; i < 3; ++i) |
| 5525 | { | 5525 | { |
| 5526 | if (i == 0) | 5526 | if (i == 0) |
| 5527 | message2 (XSTRING (msg)->data, nbytes, STRING_MULTIBYTE (msg)); | 5527 | message2 (SDATA (msg), nbytes, STRING_MULTIBYTE (msg)); |
| 5528 | else | 5528 | else |
| 5529 | message2_nolog (XSTRING (msg)->data, nbytes, STRING_MULTIBYTE (msg)); | 5529 | message2_nolog (SDATA (msg), nbytes, STRING_MULTIBYTE (msg)); |
| 5530 | Fsleep_for (make_number (1), Qnil); | 5530 | Fsleep_for (make_number (1), Qnil); |
| 5531 | } | 5531 | } |
| 5532 | 5532 | ||
| @@ -5541,7 +5541,7 @@ auto_save_1 () | |||
| 5541 | 5541 | ||
| 5542 | /* Get visited file's mode to become the auto save file's mode. */ | 5542 | /* Get visited file's mode to become the auto save file's mode. */ |
| 5543 | if (! NILP (current_buffer->filename) | 5543 | if (! NILP (current_buffer->filename) |
| 5544 | && stat (XSTRING (current_buffer->filename)->data, &st) >= 0) | 5544 | && stat (SDATA (current_buffer->filename), &st) >= 0) |
| 5545 | /* But make sure we can overwrite it later! */ | 5545 | /* But make sure we can overwrite it later! */ |
| 5546 | auto_save_mode_bits = st.st_mode | 0600; | 5546 | auto_save_mode_bits = st.st_mode | 0600; |
| 5547 | else | 5547 | else |
| @@ -5635,7 +5635,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5635 | call2 (Qmake_directory, dir, Qt); | 5635 | call2 (Qmake_directory, dir, Qt); |
| 5636 | } | 5636 | } |
| 5637 | 5637 | ||
| 5638 | stream = fopen (XSTRING (listfile)->data, "w"); | 5638 | stream = fopen (SDATA (listfile), "w"); |
| 5639 | if (stream != NULL) | 5639 | if (stream != NULL) |
| 5640 | { | 5640 | { |
| 5641 | /* Arrange to close that file whether or not we get an error. | 5641 | /* Arrange to close that file whether or not we get an error. |
| @@ -5678,12 +5678,12 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */) | |||
| 5678 | { | 5678 | { |
| 5679 | if (!NILP (b->filename)) | 5679 | if (!NILP (b->filename)) |
| 5680 | { | 5680 | { |
| 5681 | fwrite (XSTRING (b->filename)->data, 1, | 5681 | fwrite (SDATA (b->filename), 1, |
| 5682 | STRING_BYTES (XSTRING (b->filename)), stream); | 5682 | SBYTES (b->filename), stream); |
| 5683 | } | 5683 | } |
| 5684 | putc ('\n', stream); | 5684 | putc ('\n', stream); |
| 5685 | fwrite (XSTRING (b->auto_save_file_name)->data, 1, | 5685 | fwrite (SDATA (b->auto_save_file_name), 1, |
| 5686 | STRING_BYTES (XSTRING (b->auto_save_file_name)), stream); | 5686 | SBYTES (b->auto_save_file_name), stream); |
| 5687 | putc ('\n', stream); | 5687 | putc ('\n', stream); |
| 5688 | } | 5688 | } |
| 5689 | 5689 | ||
| @@ -5817,17 +5817,17 @@ double_dollars (val) | |||
| 5817 | register int n; | 5817 | register int n; |
| 5818 | int osize, count; | 5818 | int osize, count; |
| 5819 | 5819 | ||
| 5820 | osize = STRING_BYTES (XSTRING (val)); | 5820 | osize = SBYTES (val); |
| 5821 | 5821 | ||
| 5822 | /* Count the number of $ characters. */ | 5822 | /* Count the number of $ characters. */ |
| 5823 | for (n = osize, count = 0, old = XSTRING (val)->data; n > 0; n--) | 5823 | for (n = osize, count = 0, old = SDATA (val); n > 0; n--) |
| 5824 | if (*old++ == '$') count++; | 5824 | if (*old++ == '$') count++; |
| 5825 | if (count > 0) | 5825 | if (count > 0) |
| 5826 | { | 5826 | { |
| 5827 | old = XSTRING (val)->data; | 5827 | old = SDATA (val); |
| 5828 | val = make_uninit_multibyte_string (XSTRING (val)->size + count, | 5828 | val = make_uninit_multibyte_string (SCHARS (val) + count, |
| 5829 | osize + count); | 5829 | osize + count); |
| 5830 | new = XSTRING (val)->data; | 5830 | new = SDATA (val); |
| 5831 | for (n = osize; n > 0; n--) | 5831 | for (n = osize; n > 0; n--) |
| 5832 | if (*old != '$') | 5832 | if (*old != '$') |
| 5833 | *new++ = *old++; | 5833 | *new++ = *old++; |
| @@ -5870,7 +5870,7 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte | |||
| 5870 | /* No need to protect ACTION--we only compare it with t and nil. */ | 5870 | /* No need to protect ACTION--we only compare it with t and nil. */ |
| 5871 | GCPRO5 (string, realdir, name, specdir, orig_string); | 5871 | GCPRO5 (string, realdir, name, specdir, orig_string); |
| 5872 | 5872 | ||
| 5873 | if (XSTRING (string)->size == 0) | 5873 | if (SCHARS (string) == 0) |
| 5874 | { | 5874 | { |
| 5875 | if (EQ (action, Qlambda)) | 5875 | if (EQ (action, Qlambda)) |
| 5876 | { | 5876 | { |
| @@ -5931,8 +5931,8 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte | |||
| 5931 | Lisp_Object tem = XCAR (all); | 5931 | Lisp_Object tem = XCAR (all); |
| 5932 | int len; | 5932 | int len; |
| 5933 | if (STRINGP (tem) && | 5933 | if (STRINGP (tem) && |
| 5934 | (len = XSTRING (tem)->size, len > 0) && | 5934 | (len = SCHARS (tem), len > 0) && |
| 5935 | IS_DIRECTORY_SEP (XSTRING (tem)->data[len-1])) | 5935 | IS_DIRECTORY_SEP (SREF (tem, len-1))) |
| 5936 | comp = Fcons (tem, comp); | 5936 | comp = Fcons (tem, comp); |
| 5937 | } | 5937 | } |
| 5938 | } | 5938 | } |
| @@ -5957,7 +5957,7 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte | |||
| 5957 | #ifdef VMS | 5957 | #ifdef VMS |
| 5958 | /* Supposedly this helps commands such as `cd' that read directory names, | 5958 | /* Supposedly this helps commands such as `cd' that read directory names, |
| 5959 | but can someone explain how it helps them? -- RMS */ | 5959 | but can someone explain how it helps them? -- RMS */ |
| 5960 | if (XSTRING (name)->size == 0) | 5960 | if (SCHARS (name) == 0) |
| 5961 | return Qt; | 5961 | return Qt; |
| 5962 | #endif /* VMS */ | 5962 | #endif /* VMS */ |
| 5963 | if (!NILP (Vread_file_name_predicate)) | 5963 | if (!NILP (Vread_file_name_predicate)) |
| @@ -6014,23 +6014,23 @@ provides a file dialog box. */) | |||
| 6014 | #endif | 6014 | #endif |
| 6015 | if (homedir != 0 | 6015 | if (homedir != 0 |
| 6016 | && STRINGP (dir) | 6016 | && STRINGP (dir) |
| 6017 | && !strncmp (homedir, XSTRING (dir)->data, strlen (homedir)) | 6017 | && !strncmp (homedir, SDATA (dir), strlen (homedir)) |
| 6018 | && IS_DIRECTORY_SEP (XSTRING (dir)->data[strlen (homedir)])) | 6018 | && IS_DIRECTORY_SEP (SDATA (dir)[strlen (homedir)])) |
| 6019 | { | 6019 | { |
| 6020 | dir = make_string (XSTRING (dir)->data + strlen (homedir) - 1, | 6020 | dir = make_string (SDATA (dir) + strlen (homedir) - 1, |
| 6021 | STRING_BYTES (XSTRING (dir)) - strlen (homedir) + 1); | 6021 | SBYTES (dir) - strlen (homedir) + 1); |
| 6022 | XSTRING (dir)->data[0] = '~'; | 6022 | SREF (dir, 0) = '~'; |
| 6023 | } | 6023 | } |
| 6024 | /* Likewise for default_filename. */ | 6024 | /* Likewise for default_filename. */ |
| 6025 | if (homedir != 0 | 6025 | if (homedir != 0 |
| 6026 | && STRINGP (default_filename) | 6026 | && STRINGP (default_filename) |
| 6027 | && !strncmp (homedir, XSTRING (default_filename)->data, strlen (homedir)) | 6027 | && !strncmp (homedir, SDATA (default_filename), strlen (homedir)) |
| 6028 | && IS_DIRECTORY_SEP (XSTRING (default_filename)->data[strlen (homedir)])) | 6028 | && IS_DIRECTORY_SEP (SDATA (default_filename)[strlen (homedir)])) |
| 6029 | { | 6029 | { |
| 6030 | default_filename | 6030 | default_filename |
| 6031 | = make_string (XSTRING (default_filename)->data + strlen (homedir) - 1, | 6031 | = make_string (SDATA (default_filename) + strlen (homedir) - 1, |
| 6032 | STRING_BYTES (XSTRING (default_filename)) - strlen (homedir) + 1); | 6032 | SBYTES (default_filename) - strlen (homedir) + 1); |
| 6033 | XSTRING (default_filename)->data[0] = '~'; | 6033 | SREF (default_filename, 0) = '~'; |
| 6034 | } | 6034 | } |
| 6035 | if (!NILP (default_filename)) | 6035 | if (!NILP (default_filename)) |
| 6036 | { | 6036 | { |
| @@ -6048,7 +6048,7 @@ provides a file dialog box. */) | |||
| 6048 | args[0] = insdef; | 6048 | args[0] = insdef; |
| 6049 | args[1] = initial; | 6049 | args[1] = initial; |
| 6050 | insdef = Fconcat (2, args); | 6050 | insdef = Fconcat (2, args); |
| 6051 | pos = make_number (XSTRING (double_dollars (dir))->size); | 6051 | pos = make_number (SCHARS (double_dollars (dir))); |
| 6052 | insdef = Fcons (double_dollars (insdef), pos); | 6052 | insdef = Fcons (double_dollars (insdef), pos); |
| 6053 | } | 6053 | } |
| 6054 | else | 6054 | else |
| @@ -6093,7 +6093,7 @@ provides a file dialog box. */) | |||
| 6093 | /* If DIR contains a file name, split it. */ | 6093 | /* If DIR contains a file name, split it. */ |
| 6094 | Lisp_Object file; | 6094 | Lisp_Object file; |
| 6095 | file = Ffile_name_nondirectory (dir); | 6095 | file = Ffile_name_nondirectory (dir); |
| 6096 | if (XSTRING (file)->size && NILP (default_filename)) | 6096 | if (SCHARS (file) && NILP (default_filename)) |
| 6097 | { | 6097 | { |
| 6098 | default_filename = file; | 6098 | default_filename = file; |
| 6099 | dir = Ffile_name_directory (dir); | 6099 | dir = Ffile_name_directory (dir); |
| @@ -6137,7 +6137,7 @@ provides a file dialog box. */) | |||
| 6137 | 6137 | ||
| 6138 | if (!NILP (tem) && !NILP (default_filename)) | 6138 | if (!NILP (tem) && !NILP (default_filename)) |
| 6139 | val = default_filename; | 6139 | val = default_filename; |
| 6140 | else if (XSTRING (val)->size == 0 && NILP (insdef)) | 6140 | else if (SCHARS (val) == 0 && NILP (insdef)) |
| 6141 | { | 6141 | { |
| 6142 | if (!NILP (default_filename)) | 6142 | if (!NILP (default_filename)) |
| 6143 | val = default_filename; | 6143 | val = default_filename; |
diff --git a/src/filelock.c b/src/filelock.c index b85f0a68a0e..33de9a4e7db 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -222,7 +222,7 @@ get_boot_time () | |||
| 222 | args[3] = Qnil; | 222 | args[3] = Qnil; |
| 223 | args[4] = build_string ("-c"); | 223 | args[4] = build_string ("-c"); |
| 224 | sprintf (cmd_string, "gunzip < %s.%d.gz > %s", | 224 | sprintf (cmd_string, "gunzip < %s.%d.gz > %s", |
| 225 | WTMP_FILE, counter, XSTRING (tempname)->data); | 225 | WTMP_FILE, counter, SDATA (tempname)); |
| 226 | args[5] = build_string (cmd_string); | 226 | args[5] = build_string (cmd_string); |
| 227 | Fcall_process (6, args); | 227 | Fcall_process (6, args); |
| 228 | filename = tempname; | 228 | filename = tempname; |
| @@ -232,9 +232,9 @@ get_boot_time () | |||
| 232 | 232 | ||
| 233 | if (! NILP (filename)) | 233 | if (! NILP (filename)) |
| 234 | { | 234 | { |
| 235 | get_boot_time_1 (XSTRING (filename)->data, 1); | 235 | get_boot_time_1 (SDATA (filename), 1); |
| 236 | if (delete_flag) | 236 | if (delete_flag) |
| 237 | unlink (XSTRING (filename)->data); | 237 | unlink (SDATA (filename)); |
| 238 | } | 238 | } |
| 239 | } | 239 | } |
| 240 | 240 | ||
| @@ -325,7 +325,7 @@ typedef struct | |||
| 325 | trailing period plus one for the digit after it plus one for the | 325 | trailing period plus one for the digit after it plus one for the |
| 326 | null. */ | 326 | null. */ |
| 327 | #define MAKE_LOCK_NAME(lock, file) \ | 327 | #define MAKE_LOCK_NAME(lock, file) \ |
| 328 | (lock = (char *) alloca (STRING_BYTES (XSTRING (file)) + 2 + 1 + 1 + 1), \ | 328 | (lock = (char *) alloca (SBYTES (file) + 2 + 1 + 1 + 1), \ |
| 329 | fill_in_lock_file_name (lock, (file))) | 329 | fill_in_lock_file_name (lock, (file))) |
| 330 | 330 | ||
| 331 | static void | 331 | static void |
| @@ -337,7 +337,7 @@ fill_in_lock_file_name (lockfile, fn) | |||
| 337 | struct stat st; | 337 | struct stat st; |
| 338 | int count = 0; | 338 | int count = 0; |
| 339 | 339 | ||
| 340 | strcpy (lockfile, XSTRING (fn)->data); | 340 | strcpy (lockfile, SDATA (fn)); |
| 341 | 341 | ||
| 342 | /* Shift the nondirectory part of the file name (including the null) | 342 | /* Shift the nondirectory part of the file name (including the null) |
| 343 | right two characters. Here is one of the places where we'd have to | 343 | right two characters. Here is one of the places where we'd have to |
| @@ -378,11 +378,11 @@ lock_file_1 (lfname, force) | |||
| 378 | char *lock_info_str; | 378 | char *lock_info_str; |
| 379 | 379 | ||
| 380 | if (STRINGP (Fuser_login_name (Qnil))) | 380 | if (STRINGP (Fuser_login_name (Qnil))) |
| 381 | user_name = (char *)XSTRING (Fuser_login_name (Qnil))->data; | 381 | user_name = (char *)SDATA (Fuser_login_name (Qnil)); |
| 382 | else | 382 | else |
| 383 | user_name = ""; | 383 | user_name = ""; |
| 384 | if (STRINGP (Fsystem_name ())) | 384 | if (STRINGP (Fsystem_name ())) |
| 385 | host_name = (char *)XSTRING (Fsystem_name ())->data; | 385 | host_name = (char *)SDATA (Fsystem_name ()); |
| 386 | else | 386 | else |
| 387 | host_name = ""; | 387 | host_name = ""; |
| 388 | lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) | 388 | lock_info_str = (char *)alloca (strlen (user_name) + strlen (host_name) |
| @@ -503,7 +503,7 @@ current_lock_owner (owner, lfname) | |||
| 503 | 503 | ||
| 504 | /* On current host? */ | 504 | /* On current host? */ |
| 505 | if (STRINGP (Fsystem_name ()) | 505 | if (STRINGP (Fsystem_name ()) |
| 506 | && strcmp (owner->host, XSTRING (Fsystem_name ())->data) == 0) | 506 | && strcmp (owner->host, SDATA (Fsystem_name ())) == 0) |
| 507 | { | 507 | { |
| 508 | if (owner->pid == getpid ()) | 508 | if (owner->pid == getpid ()) |
| 509 | ret = 2; /* We own it. */ | 509 | ret = 2; /* We own it. */ |
| @@ -132,7 +132,7 @@ To get the number of bytes, use `string-bytes'. */) | |||
| 132 | 132 | ||
| 133 | retry: | 133 | retry: |
| 134 | if (STRINGP (sequence)) | 134 | if (STRINGP (sequence)) |
| 135 | XSETFASTINT (val, XSTRING (sequence)->size); | 135 | XSETFASTINT (val, SCHARS (sequence)); |
| 136 | else if (VECTORP (sequence)) | 136 | else if (VECTORP (sequence)) |
| 137 | XSETFASTINT (val, XVECTOR (sequence)->size); | 137 | XSETFASTINT (val, XVECTOR (sequence)->size); |
| 138 | else if (CHAR_TABLE_P (sequence)) | 138 | else if (CHAR_TABLE_P (sequence)) |
| @@ -208,7 +208,7 @@ If STRING is a multibyte string, this is greater than the length of STRING. */) | |||
| 208 | Lisp_Object string; | 208 | Lisp_Object string; |
| 209 | { | 209 | { |
| 210 | CHECK_STRING (string); | 210 | CHECK_STRING (string); |
| 211 | return make_number (STRING_BYTES (XSTRING (string))); | 211 | return make_number (SBYTES (string)); |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0, | 214 | DEFUN ("string-equal", Fstring_equal, Sstring_equal, 2, 2, 0, |
| @@ -225,9 +225,9 @@ Symbols are also allowed; their print names are used instead. */) | |||
| 225 | CHECK_STRING (s1); | 225 | CHECK_STRING (s1); |
| 226 | CHECK_STRING (s2); | 226 | CHECK_STRING (s2); |
| 227 | 227 | ||
| 228 | if (XSTRING (s1)->size != XSTRING (s2)->size | 228 | if (SCHARS (s1) != SCHARS (s2) |
| 229 | || STRING_BYTES (XSTRING (s1)) != STRING_BYTES (XSTRING (s2)) | 229 | || SBYTES (s1) != SBYTES (s2) |
| 230 | || bcmp (XSTRING (s1)->data, XSTRING (s2)->data, STRING_BYTES (XSTRING (s1)))) | 230 | || bcmp (SDATA (s1), SDATA (s2), SBYTES (s1))) |
| 231 | return Qnil; | 231 | return Qnil; |
| 232 | return Qt; | 232 | return Qt; |
| 233 | } | 233 | } |
| @@ -272,11 +272,11 @@ If string STR1 is greater, the value is a positive number N; | |||
| 272 | i1_byte = string_char_to_byte (str1, i1); | 272 | i1_byte = string_char_to_byte (str1, i1); |
| 273 | i2_byte = string_char_to_byte (str2, i2); | 273 | i2_byte = string_char_to_byte (str2, i2); |
| 274 | 274 | ||
| 275 | end1_char = XSTRING (str1)->size; | 275 | end1_char = SCHARS (str1); |
| 276 | if (! NILP (end1) && end1_char > XINT (end1)) | 276 | if (! NILP (end1) && end1_char > XINT (end1)) |
| 277 | end1_char = XINT (end1); | 277 | end1_char = XINT (end1); |
| 278 | 278 | ||
| 279 | end2_char = XSTRING (str2)->size; | 279 | end2_char = SCHARS (str2); |
| 280 | if (! NILP (end2) && end2_char > XINT (end2)) | 280 | if (! NILP (end2) && end2_char > XINT (end2)) |
| 281 | end2_char = XINT (end2); | 281 | end2_char = XINT (end2); |
| 282 | 282 | ||
| @@ -290,7 +290,7 @@ If string STR1 is greater, the value is a positive number N; | |||
| 290 | FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c1, str1, i1, i1_byte); | 290 | FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c1, str1, i1, i1_byte); |
| 291 | else | 291 | else |
| 292 | { | 292 | { |
| 293 | c1 = XSTRING (str1)->data[i1++]; | 293 | c1 = SREF (str1, i1++); |
| 294 | c1 = unibyte_char_to_multibyte (c1); | 294 | c1 = unibyte_char_to_multibyte (c1); |
| 295 | } | 295 | } |
| 296 | 296 | ||
| @@ -298,7 +298,7 @@ If string STR1 is greater, the value is a positive number N; | |||
| 298 | FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c2, str2, i2, i2_byte); | 298 | FETCH_STRING_CHAR_ADVANCE_NO_CHECK (c2, str2, i2, i2_byte); |
| 299 | else | 299 | else |
| 300 | { | 300 | { |
| 301 | c2 = XSTRING (str2)->data[i2++]; | 301 | c2 = SREF (str2, i2++); |
| 302 | c2 = unibyte_char_to_multibyte (c2); | 302 | c2 = unibyte_char_to_multibyte (c2); |
| 303 | } | 303 | } |
| 304 | 304 | ||
| @@ -354,9 +354,9 @@ Symbols are also allowed; their print names are used instead. */) | |||
| 354 | 354 | ||
| 355 | i1 = i1_byte = i2 = i2_byte = 0; | 355 | i1 = i1_byte = i2 = i2_byte = 0; |
| 356 | 356 | ||
| 357 | end = XSTRING (s1)->size; | 357 | end = SCHARS (s1); |
| 358 | if (end > XSTRING (s2)->size) | 358 | if (end > SCHARS (s2)) |
| 359 | end = XSTRING (s2)->size; | 359 | end = SCHARS (s2); |
| 360 | 360 | ||
| 361 | while (i1 < end) | 361 | while (i1 < end) |
| 362 | { | 362 | { |
| @@ -370,7 +370,7 @@ Symbols are also allowed; their print names are used instead. */) | |||
| 370 | if (c1 != c2) | 370 | if (c1 != c2) |
| 371 | return c1 < c2 ? Qt : Qnil; | 371 | return c1 < c2 ? Qt : Qnil; |
| 372 | } | 372 | } |
| 373 | return i1 < XSTRING (s2)->size ? Qt : Qnil; | 373 | return i1 < SCHARS (s2) ? Qt : Qnil; |
| 374 | } | 374 | } |
| 375 | 375 | ||
| 376 | static Lisp_Object concat (); | 376 | static Lisp_Object concat (); |
| @@ -641,11 +641,11 @@ concat (nargs, args, target_type, last_special) | |||
| 641 | if (STRING_MULTIBYTE (this)) | 641 | if (STRING_MULTIBYTE (this)) |
| 642 | { | 642 | { |
| 643 | some_multibyte = 1; | 643 | some_multibyte = 1; |
| 644 | result_len_byte += STRING_BYTES (XSTRING (this)); | 644 | result_len_byte += SBYTES (this); |
| 645 | } | 645 | } |
| 646 | else | 646 | else |
| 647 | result_len_byte += count_size_as_multibyte (XSTRING (this)->data, | 647 | result_len_byte += count_size_as_multibyte (SDATA (this), |
| 648 | XSTRING (this)->size); | 648 | SCHARS (this)); |
| 649 | } | 649 | } |
| 650 | } | 650 | } |
| 651 | 651 | ||
| @@ -695,17 +695,17 @@ concat (nargs, args, target_type, last_special) | |||
| 695 | if (STRINGP (this) && STRINGP (val) | 695 | if (STRINGP (this) && STRINGP (val) |
| 696 | && STRING_MULTIBYTE (this) == some_multibyte) | 696 | && STRING_MULTIBYTE (this) == some_multibyte) |
| 697 | { | 697 | { |
| 698 | int thislen_byte = STRING_BYTES (XSTRING (this)); | 698 | int thislen_byte = SBYTES (this); |
| 699 | int combined; | 699 | int combined; |
| 700 | 700 | ||
| 701 | bcopy (XSTRING (this)->data, XSTRING (val)->data + toindex_byte, | 701 | bcopy (SDATA (this), SDATA (val) + toindex_byte, |
| 702 | STRING_BYTES (XSTRING (this))); | 702 | SBYTES (this)); |
| 703 | combined = (some_multibyte && toindex_byte > 0 | 703 | combined = (some_multibyte && toindex_byte > 0 |
| 704 | ? count_combining (XSTRING (val)->data, | 704 | ? count_combining (SDATA (val), |
| 705 | toindex_byte + thislen_byte, | 705 | toindex_byte + thislen_byte, |
| 706 | toindex_byte) | 706 | toindex_byte) |
| 707 | : 0); | 707 | : 0); |
| 708 | if (! NULL_INTERVAL_P (XSTRING (this)->intervals)) | 708 | if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) |
| 709 | { | 709 | { |
| 710 | textprops[num_textprops].argnum = argnum; | 710 | textprops[num_textprops].argnum = argnum; |
| 711 | /* We ignore text properties on characters being combined. */ | 711 | /* We ignore text properties on characters being combined. */ |
| @@ -714,20 +714,20 @@ concat (nargs, args, target_type, last_special) | |||
| 714 | } | 714 | } |
| 715 | toindex_byte += thislen_byte; | 715 | toindex_byte += thislen_byte; |
| 716 | toindex += thisleni - combined; | 716 | toindex += thisleni - combined; |
| 717 | XSTRING (val)->size -= combined; | 717 | SCHARS (val) -= combined; |
| 718 | } | 718 | } |
| 719 | /* Copy a single-byte string to a multibyte string. */ | 719 | /* Copy a single-byte string to a multibyte string. */ |
| 720 | else if (STRINGP (this) && STRINGP (val)) | 720 | else if (STRINGP (this) && STRINGP (val)) |
| 721 | { | 721 | { |
| 722 | if (! NULL_INTERVAL_P (XSTRING (this)->intervals)) | 722 | if (! NULL_INTERVAL_P (STRING_INTERVALS (this))) |
| 723 | { | 723 | { |
| 724 | textprops[num_textprops].argnum = argnum; | 724 | textprops[num_textprops].argnum = argnum; |
| 725 | textprops[num_textprops].from = 0; | 725 | textprops[num_textprops].from = 0; |
| 726 | textprops[num_textprops++].to = toindex; | 726 | textprops[num_textprops++].to = toindex; |
| 727 | } | 727 | } |
| 728 | toindex_byte += copy_text (XSTRING (this)->data, | 728 | toindex_byte += copy_text (SDATA (this), |
| 729 | XSTRING (val)->data + toindex_byte, | 729 | SDATA (val) + toindex_byte, |
| 730 | XSTRING (this)->size, 0, 1); | 730 | SCHARS (this), 0, 1); |
| 731 | toindex += thisleni; | 731 | toindex += thisleni; |
| 732 | } | 732 | } |
| 733 | else | 733 | else |
| @@ -755,7 +755,7 @@ concat (nargs, args, target_type, last_special) | |||
| 755 | } | 755 | } |
| 756 | else | 756 | else |
| 757 | { | 757 | { |
| 758 | XSETFASTINT (elt, XSTRING (this)->data[thisindex++]); | 758 | XSETFASTINT (elt, SREF (this, thisindex++)); |
| 759 | if (some_multibyte | 759 | if (some_multibyte |
| 760 | && (XINT (elt) >= 0240 | 760 | && (XINT (elt) >= 0240 |
| 761 | || (XINT (elt) >= 0200 | 761 | || (XINT (elt) >= 0200 |
| @@ -797,14 +797,14 @@ concat (nargs, args, target_type, last_special) | |||
| 797 | if (some_multibyte) | 797 | if (some_multibyte) |
| 798 | toindex_byte | 798 | toindex_byte |
| 799 | += CHAR_STRING (XINT (elt), | 799 | += CHAR_STRING (XINT (elt), |
| 800 | XSTRING (val)->data + toindex_byte); | 800 | SDATA (val) + toindex_byte); |
| 801 | else | 801 | else |
| 802 | XSTRING (val)->data[toindex_byte++] = XINT (elt); | 802 | SREF (val, toindex_byte++) = XINT (elt); |
| 803 | if (some_multibyte | 803 | if (some_multibyte |
| 804 | && toindex_byte > 0 | 804 | && toindex_byte > 0 |
| 805 | && count_combining (XSTRING (val)->data, | 805 | && count_combining (SDATA (val), |
| 806 | toindex_byte, toindex_byte - 1)) | 806 | toindex_byte, toindex_byte - 1)) |
| 807 | XSTRING (val)->size--; | 807 | SCHARS (val)--; |
| 808 | else | 808 | else |
| 809 | toindex++; | 809 | toindex++; |
| 810 | } | 810 | } |
| @@ -815,7 +815,7 @@ concat (nargs, args, target_type, last_special) | |||
| 815 | int c = XINT (elt); | 815 | int c = XINT (elt); |
| 816 | /* P exists as a variable | 816 | /* P exists as a variable |
| 817 | to avoid a bug on the Masscomp C compiler. */ | 817 | to avoid a bug on the Masscomp C compiler. */ |
| 818 | unsigned char *p = & XSTRING (val)->data[toindex_byte]; | 818 | unsigned char *p = & SREF (val, toindex_byte); |
| 819 | 819 | ||
| 820 | toindex_byte += CHAR_STRING (c, p); | 820 | toindex_byte += CHAR_STRING (c, p); |
| 821 | toindex++; | 821 | toindex++; |
| @@ -836,7 +836,7 @@ concat (nargs, args, target_type, last_special) | |||
| 836 | this = args[textprops[argnum].argnum]; | 836 | this = args[textprops[argnum].argnum]; |
| 837 | props = text_property_list (this, | 837 | props = text_property_list (this, |
| 838 | make_number (0), | 838 | make_number (0), |
| 839 | make_number (XSTRING (this)->size), | 839 | make_number (SCHARS (this)), |
| 840 | Qnil); | 840 | Qnil); |
| 841 | /* If successive arguments have properites, be sure that the | 841 | /* If successive arguments have properites, be sure that the |
| 842 | value of `composition' property be the copy. */ | 842 | value of `composition' property be the copy. */ |
| @@ -844,7 +844,7 @@ concat (nargs, args, target_type, last_special) | |||
| 844 | make_composition_value_copy (props); | 844 | make_composition_value_copy (props); |
| 845 | add_text_properties_from_list (val, props, | 845 | add_text_properties_from_list (val, props, |
| 846 | make_number (textprops[argnum].to)); | 846 | make_number (textprops[argnum].to)); |
| 847 | last_to_end = textprops[argnum].to + XSTRING (this)->size; | 847 | last_to_end = textprops[argnum].to + SCHARS (this); |
| 848 | } | 848 | } |
| 849 | } | 849 | } |
| 850 | return val; | 850 | return val; |
| @@ -875,8 +875,8 @@ string_char_to_byte (string, char_index) | |||
| 875 | return char_index; | 875 | return char_index; |
| 876 | 876 | ||
| 877 | best_below = best_below_byte = 0; | 877 | best_below = best_below_byte = 0; |
| 878 | best_above = XSTRING (string)->size; | 878 | best_above = SCHARS (string); |
| 879 | best_above_byte = STRING_BYTES (XSTRING (string)); | 879 | best_above_byte = SBYTES (string); |
| 880 | 880 | ||
| 881 | if (EQ (string, string_char_byte_cache_string)) | 881 | if (EQ (string, string_char_byte_cache_string)) |
| 882 | { | 882 | { |
| @@ -907,7 +907,7 @@ string_char_to_byte (string, char_index) | |||
| 907 | { | 907 | { |
| 908 | while (best_above > char_index) | 908 | while (best_above > char_index) |
| 909 | { | 909 | { |
| 910 | unsigned char *pend = XSTRING (string)->data + best_above_byte; | 910 | unsigned char *pend = SDATA (string) + best_above_byte; |
| 911 | unsigned char *pbeg = pend - best_above_byte; | 911 | unsigned char *pbeg = pend - best_above_byte; |
| 912 | unsigned char *p = pend - 1; | 912 | unsigned char *p = pend - 1; |
| 913 | int bytes; | 913 | int bytes; |
| @@ -948,8 +948,8 @@ string_byte_to_char (string, byte_index) | |||
| 948 | return byte_index; | 948 | return byte_index; |
| 949 | 949 | ||
| 950 | best_below = best_below_byte = 0; | 950 | best_below = best_below_byte = 0; |
| 951 | best_above = XSTRING (string)->size; | 951 | best_above = SCHARS (string); |
| 952 | best_above_byte = STRING_BYTES (XSTRING (string)); | 952 | best_above_byte = SBYTES (string); |
| 953 | 953 | ||
| 954 | if (EQ (string, string_char_byte_cache_string)) | 954 | if (EQ (string, string_char_byte_cache_string)) |
| 955 | { | 955 | { |
| @@ -980,7 +980,7 @@ string_byte_to_char (string, byte_index) | |||
| 980 | { | 980 | { |
| 981 | while (best_above_byte > byte_index) | 981 | while (best_above_byte > byte_index) |
| 982 | { | 982 | { |
| 983 | unsigned char *pend = XSTRING (string)->data + best_above_byte; | 983 | unsigned char *pend = SDATA (string) + best_above_byte; |
| 984 | unsigned char *pbeg = pend - best_above_byte; | 984 | unsigned char *pbeg = pend - best_above_byte; |
| 985 | unsigned char *p = pend - 1; | 985 | unsigned char *p = pend - 1; |
| 986 | int bytes; | 986 | int bytes; |
| @@ -1020,18 +1020,18 @@ string_make_multibyte (string) | |||
| 1020 | if (STRING_MULTIBYTE (string)) | 1020 | if (STRING_MULTIBYTE (string)) |
| 1021 | return string; | 1021 | return string; |
| 1022 | 1022 | ||
| 1023 | nbytes = count_size_as_multibyte (XSTRING (string)->data, | 1023 | nbytes = count_size_as_multibyte (SDATA (string), |
| 1024 | XSTRING (string)->size); | 1024 | SCHARS (string)); |
| 1025 | /* If all the chars are ASCII, they won't need any more bytes | 1025 | /* If all the chars are ASCII, they won't need any more bytes |
| 1026 | once converted. In that case, we can return STRING itself. */ | 1026 | once converted. In that case, we can return STRING itself. */ |
| 1027 | if (nbytes == STRING_BYTES (XSTRING (string))) | 1027 | if (nbytes == SBYTES (string)) |
| 1028 | return string; | 1028 | return string; |
| 1029 | 1029 | ||
| 1030 | buf = (unsigned char *) alloca (nbytes); | 1030 | buf = (unsigned char *) alloca (nbytes); |
| 1031 | copy_text (XSTRING (string)->data, buf, STRING_BYTES (XSTRING (string)), | 1031 | copy_text (SDATA (string), buf, SBYTES (string), |
| 1032 | 0, 1); | 1032 | 0, 1); |
| 1033 | 1033 | ||
| 1034 | return make_multibyte_string (buf, XSTRING (string)->size, nbytes); | 1034 | return make_multibyte_string (buf, SCHARS (string), nbytes); |
| 1035 | } | 1035 | } |
| 1036 | 1036 | ||
| 1037 | /* Convert STRING to a single-byte string. */ | 1037 | /* Convert STRING to a single-byte string. */ |
| @@ -1045,12 +1045,12 @@ string_make_unibyte (string) | |||
| 1045 | if (! STRING_MULTIBYTE (string)) | 1045 | if (! STRING_MULTIBYTE (string)) |
| 1046 | return string; | 1046 | return string; |
| 1047 | 1047 | ||
| 1048 | buf = (unsigned char *) alloca (XSTRING (string)->size); | 1048 | buf = (unsigned char *) alloca (SCHARS (string)); |
| 1049 | 1049 | ||
| 1050 | copy_text (XSTRING (string)->data, buf, STRING_BYTES (XSTRING (string)), | 1050 | copy_text (SDATA (string), buf, SBYTES (string), |
| 1051 | 1, 0); | 1051 | 1, 0); |
| 1052 | 1052 | ||
| 1053 | return make_unibyte_string (buf, XSTRING (string)->size); | 1053 | return make_unibyte_string (buf, SCHARS (string)); |
| 1054 | } | 1054 | } |
| 1055 | 1055 | ||
| 1056 | DEFUN ("string-make-multibyte", Fstring_make_multibyte, Sstring_make_multibyte, | 1056 | DEFUN ("string-make-multibyte", Fstring_make_multibyte, Sstring_make_multibyte, |
| @@ -1096,10 +1096,10 @@ corresponding single byte. */) | |||
| 1096 | 1096 | ||
| 1097 | if (STRING_MULTIBYTE (string)) | 1097 | if (STRING_MULTIBYTE (string)) |
| 1098 | { | 1098 | { |
| 1099 | int bytes = STRING_BYTES (XSTRING (string)); | 1099 | int bytes = SBYTES (string); |
| 1100 | unsigned char *str = (unsigned char *) xmalloc (bytes); | 1100 | unsigned char *str = (unsigned char *) xmalloc (bytes); |
| 1101 | 1101 | ||
| 1102 | bcopy (XSTRING (string)->data, str, bytes); | 1102 | bcopy (SDATA (string), str, bytes); |
| 1103 | bytes = str_as_unibyte (str, bytes); | 1103 | bytes = str_as_unibyte (str, bytes); |
| 1104 | string = make_unibyte_string (str, bytes); | 1104 | string = make_unibyte_string (str, bytes); |
| 1105 | xfree (str); | 1105 | xfree (str); |
| @@ -1125,17 +1125,17 @@ multibyte character of charset `eight-bit-control' or `eight-bit-graphic'. */) | |||
| 1125 | Lisp_Object new_string; | 1125 | Lisp_Object new_string; |
| 1126 | int nchars, nbytes; | 1126 | int nchars, nbytes; |
| 1127 | 1127 | ||
| 1128 | parse_str_as_multibyte (XSTRING (string)->data, | 1128 | parse_str_as_multibyte (SDATA (string), |
| 1129 | STRING_BYTES (XSTRING (string)), | 1129 | SBYTES (string), |
| 1130 | &nchars, &nbytes); | 1130 | &nchars, &nbytes); |
| 1131 | new_string = make_uninit_multibyte_string (nchars, nbytes); | 1131 | new_string = make_uninit_multibyte_string (nchars, nbytes); |
| 1132 | bcopy (XSTRING (string)->data, XSTRING (new_string)->data, | 1132 | bcopy (SDATA (string), SDATA (new_string), |
| 1133 | STRING_BYTES (XSTRING (string))); | 1133 | SBYTES (string)); |
| 1134 | if (nbytes != STRING_BYTES (XSTRING (string))) | 1134 | if (nbytes != SBYTES (string)) |
| 1135 | str_as_multibyte (XSTRING (new_string)->data, nbytes, | 1135 | str_as_multibyte (SDATA (new_string), nbytes, |
| 1136 | STRING_BYTES (XSTRING (string)), NULL); | 1136 | SBYTES (string), NULL); |
| 1137 | string = new_string; | 1137 | string = new_string; |
| 1138 | XSTRING (string)->intervals = NULL_INTERVAL; | 1138 | STRING_INTERVALS (string) = NULL_INTERVAL; |
| 1139 | } | 1139 | } |
| 1140 | return string; | 1140 | return string; |
| 1141 | } | 1141 | } |
| @@ -1190,8 +1190,8 @@ This function allows vectors as well as strings. */) | |||
| 1190 | 1190 | ||
| 1191 | if (STRINGP (string)) | 1191 | if (STRINGP (string)) |
| 1192 | { | 1192 | { |
| 1193 | size = XSTRING (string)->size; | 1193 | size = SCHARS (string); |
| 1194 | size_byte = STRING_BYTES (XSTRING (string)); | 1194 | size_byte = SBYTES (string); |
| 1195 | } | 1195 | } |
| 1196 | else | 1196 | else |
| 1197 | size = XVECTOR (string)->size; | 1197 | size = XVECTOR (string)->size; |
| @@ -1225,7 +1225,7 @@ This function allows vectors as well as strings. */) | |||
| 1225 | 1225 | ||
| 1226 | if (STRINGP (string)) | 1226 | if (STRINGP (string)) |
| 1227 | { | 1227 | { |
| 1228 | res = make_specified_string (XSTRING (string)->data + from_byte, | 1228 | res = make_specified_string (SDATA (string) + from_byte, |
| 1229 | to_char - from_char, to_byte - from_byte, | 1229 | to_char - from_char, to_byte - from_byte, |
| 1230 | STRING_MULTIBYTE (string)); | 1230 | STRING_MULTIBYTE (string)); |
| 1231 | copy_text_properties (make_number (from_char), make_number (to_char), | 1231 | copy_text_properties (make_number (from_char), make_number (to_char), |
| @@ -1257,8 +1257,8 @@ With one argument, just copy STRING without its properties. */) | |||
| 1257 | 1257 | ||
| 1258 | CHECK_STRING (string); | 1258 | CHECK_STRING (string); |
| 1259 | 1259 | ||
| 1260 | size = XSTRING (string)->size; | 1260 | size = SCHARS (string); |
| 1261 | size_byte = STRING_BYTES (XSTRING (string)); | 1261 | size_byte = SBYTES (string); |
| 1262 | 1262 | ||
| 1263 | if (NILP (from)) | 1263 | if (NILP (from)) |
| 1264 | from_char = from_byte = 0; | 1264 | from_char = from_byte = 0; |
| @@ -1292,7 +1292,7 @@ With one argument, just copy STRING without its properties. */) | |||
| 1292 | args_out_of_range_3 (string, make_number (from_char), | 1292 | args_out_of_range_3 (string, make_number (from_char), |
| 1293 | make_number (to_char)); | 1293 | make_number (to_char)); |
| 1294 | 1294 | ||
| 1295 | return make_specified_string (XSTRING (string)->data + from_byte, | 1295 | return make_specified_string (SDATA (string) + from_byte, |
| 1296 | to_char - from_char, to_byte - from_byte, | 1296 | to_char - from_char, to_byte - from_byte, |
| 1297 | STRING_MULTIBYTE (string)); | 1297 | STRING_MULTIBYTE (string)); |
| 1298 | } | 1298 | } |
| @@ -1314,8 +1314,8 @@ substring_both (string, from, from_byte, to, to_byte) | |||
| 1314 | 1314 | ||
| 1315 | if (STRINGP (string)) | 1315 | if (STRINGP (string)) |
| 1316 | { | 1316 | { |
| 1317 | size = XSTRING (string)->size; | 1317 | size = SCHARS (string); |
| 1318 | size_byte = STRING_BYTES (XSTRING (string)); | 1318 | size_byte = SBYTES (string); |
| 1319 | } | 1319 | } |
| 1320 | else | 1320 | else |
| 1321 | size = XVECTOR (string)->size; | 1321 | size = XVECTOR (string)->size; |
| @@ -1325,7 +1325,7 @@ substring_both (string, from, from_byte, to, to_byte) | |||
| 1325 | 1325 | ||
| 1326 | if (STRINGP (string)) | 1326 | if (STRINGP (string)) |
| 1327 | { | 1327 | { |
| 1328 | res = make_specified_string (XSTRING (string)->data + from_byte, | 1328 | res = make_specified_string (SDATA (string) + from_byte, |
| 1329 | to - from, to_byte - from_byte, | 1329 | to - from, to_byte - from_byte, |
| 1330 | STRING_MULTIBYTE (string)); | 1330 | STRING_MULTIBYTE (string)); |
| 1331 | copy_text_properties (make_number (from), make_number (to), | 1331 | copy_text_properties (make_number (from), make_number (to), |
| @@ -1693,18 +1693,18 @@ to be sure of changing the value of `foo'. */) | |||
| 1693 | int c; | 1693 | int c; |
| 1694 | 1694 | ||
| 1695 | for (i = nchars = nbytes = ibyte = 0; | 1695 | for (i = nchars = nbytes = ibyte = 0; |
| 1696 | i < XSTRING (seq)->size; | 1696 | i < SCHARS (seq); |
| 1697 | ++i, ibyte += cbytes) | 1697 | ++i, ibyte += cbytes) |
| 1698 | { | 1698 | { |
| 1699 | if (STRING_MULTIBYTE (seq)) | 1699 | if (STRING_MULTIBYTE (seq)) |
| 1700 | { | 1700 | { |
| 1701 | c = STRING_CHAR (&XSTRING (seq)->data[ibyte], | 1701 | c = STRING_CHAR (&SREF (seq, ibyte), |
| 1702 | STRING_BYTES (XSTRING (seq)) - ibyte); | 1702 | SBYTES (seq) - ibyte); |
| 1703 | cbytes = CHAR_BYTES (c); | 1703 | cbytes = CHAR_BYTES (c); |
| 1704 | } | 1704 | } |
| 1705 | else | 1705 | else |
| 1706 | { | 1706 | { |
| 1707 | c = XSTRING (seq)->data[i]; | 1707 | c = SREF (seq, i); |
| 1708 | cbytes = 1; | 1708 | cbytes = 1; |
| 1709 | } | 1709 | } |
| 1710 | 1710 | ||
| @@ -1715,34 +1715,34 @@ to be sure of changing the value of `foo'. */) | |||
| 1715 | } | 1715 | } |
| 1716 | } | 1716 | } |
| 1717 | 1717 | ||
| 1718 | if (nchars != XSTRING (seq)->size) | 1718 | if (nchars != SCHARS (seq)) |
| 1719 | { | 1719 | { |
| 1720 | Lisp_Object tem; | 1720 | Lisp_Object tem; |
| 1721 | 1721 | ||
| 1722 | tem = make_uninit_multibyte_string (nchars, nbytes); | 1722 | tem = make_uninit_multibyte_string (nchars, nbytes); |
| 1723 | if (!STRING_MULTIBYTE (seq)) | 1723 | if (!STRING_MULTIBYTE (seq)) |
| 1724 | SET_STRING_BYTES (XSTRING (tem), -1); | 1724 | STRING_SET_UNIBYTE (tem); |
| 1725 | 1725 | ||
| 1726 | for (i = nchars = nbytes = ibyte = 0; | 1726 | for (i = nchars = nbytes = ibyte = 0; |
| 1727 | i < XSTRING (seq)->size; | 1727 | i < SCHARS (seq); |
| 1728 | ++i, ibyte += cbytes) | 1728 | ++i, ibyte += cbytes) |
| 1729 | { | 1729 | { |
| 1730 | if (STRING_MULTIBYTE (seq)) | 1730 | if (STRING_MULTIBYTE (seq)) |
| 1731 | { | 1731 | { |
| 1732 | c = STRING_CHAR (&XSTRING (seq)->data[ibyte], | 1732 | c = STRING_CHAR (&SREF (seq, ibyte), |
| 1733 | STRING_BYTES (XSTRING (seq)) - ibyte); | 1733 | SBYTES (seq) - ibyte); |
| 1734 | cbytes = CHAR_BYTES (c); | 1734 | cbytes = CHAR_BYTES (c); |
| 1735 | } | 1735 | } |
| 1736 | else | 1736 | else |
| 1737 | { | 1737 | { |
| 1738 | c = XSTRING (seq)->data[i]; | 1738 | c = SREF (seq, i); |
| 1739 | cbytes = 1; | 1739 | cbytes = 1; |
| 1740 | } | 1740 | } |
| 1741 | 1741 | ||
| 1742 | if (!INTEGERP (elt) || c != XINT (elt)) | 1742 | if (!INTEGERP (elt) || c != XINT (elt)) |
| 1743 | { | 1743 | { |
| 1744 | unsigned char *from = &XSTRING (seq)->data[ibyte]; | 1744 | unsigned char *from = &SREF (seq, ibyte); |
| 1745 | unsigned char *to = &XSTRING (tem)->data[nbytes]; | 1745 | unsigned char *to = &SREF (tem, nbytes); |
| 1746 | EMACS_INT n; | 1746 | EMACS_INT n; |
| 1747 | 1747 | ||
| 1748 | ++nchars; | 1748 | ++nchars; |
| @@ -2176,12 +2176,12 @@ internal_equal (o1, o2, depth) | |||
| 2176 | break; | 2176 | break; |
| 2177 | 2177 | ||
| 2178 | case Lisp_String: | 2178 | case Lisp_String: |
| 2179 | if (XSTRING (o1)->size != XSTRING (o2)->size) | 2179 | if (SCHARS (o1) != SCHARS (o2)) |
| 2180 | return 0; | 2180 | return 0; |
| 2181 | if (STRING_BYTES (XSTRING (o1)) != STRING_BYTES (XSTRING (o2))) | 2181 | if (SBYTES (o1) != SBYTES (o2)) |
| 2182 | return 0; | 2182 | return 0; |
| 2183 | if (bcmp (XSTRING (o1)->data, XSTRING (o2)->data, | 2183 | if (bcmp (SDATA (o1), SDATA (o2), |
| 2184 | STRING_BYTES (XSTRING (o1)))) | 2184 | SBYTES (o1))) |
| 2185 | return 0; | 2185 | return 0; |
| 2186 | return 1; | 2186 | return 1; |
| 2187 | 2187 | ||
| @@ -2221,15 +2221,15 @@ ARRAY is a vector, string, char-table, or bool-vector. */) | |||
| 2221 | } | 2221 | } |
| 2222 | else if (STRINGP (array)) | 2222 | else if (STRINGP (array)) |
| 2223 | { | 2223 | { |
| 2224 | register unsigned char *p = XSTRING (array)->data; | 2224 | register unsigned char *p = SDATA (array); |
| 2225 | CHECK_NUMBER (item); | 2225 | CHECK_NUMBER (item); |
| 2226 | charval = XINT (item); | 2226 | charval = XINT (item); |
| 2227 | size = XSTRING (array)->size; | 2227 | size = SCHARS (array); |
| 2228 | if (STRING_MULTIBYTE (array)) | 2228 | if (STRING_MULTIBYTE (array)) |
| 2229 | { | 2229 | { |
| 2230 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 2230 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 2231 | int len = CHAR_STRING (charval, str); | 2231 | int len = CHAR_STRING (charval, str); |
| 2232 | int size_byte = STRING_BYTES (XSTRING (array)); | 2232 | int size_byte = SBYTES (array); |
| 2233 | unsigned char *p1 = p, *endp = p + size_byte; | 2233 | unsigned char *p1 = p, *endp = p + size_byte; |
| 2234 | int i; | 2234 | int i; |
| 2235 | 2235 | ||
| @@ -3113,12 +3113,12 @@ is nil, and `use-dialog-box' is non-nil. */) | |||
| 3113 | ans = Fdowncase (Fread_from_minibuffer (prompt, Qnil, Qnil, Qnil, | 3113 | ans = Fdowncase (Fread_from_minibuffer (prompt, Qnil, Qnil, Qnil, |
| 3114 | Qyes_or_no_p_history, Qnil, | 3114 | Qyes_or_no_p_history, Qnil, |
| 3115 | Qnil)); | 3115 | Qnil)); |
| 3116 | if (XSTRING (ans)->size == 3 && !strcmp (XSTRING (ans)->data, "yes")) | 3116 | if (SCHARS (ans) == 3 && !strcmp (SDATA (ans), "yes")) |
| 3117 | { | 3117 | { |
| 3118 | UNGCPRO; | 3118 | UNGCPRO; |
| 3119 | return Qt; | 3119 | return Qt; |
| 3120 | } | 3120 | } |
| 3121 | if (XSTRING (ans)->size == 2 && !strcmp (XSTRING (ans)->data, "no")) | 3121 | if (SCHARS (ans) == 2 && !strcmp (SDATA (ans), "no")) |
| 3122 | { | 3122 | { |
| 3123 | UNGCPRO; | 3123 | UNGCPRO; |
| 3124 | return Qnil; | 3124 | return Qnil; |
| @@ -3257,7 +3257,7 @@ The normal messages at start and end of loading FILENAME are suppressed. */) | |||
| 3257 | of what files are preloaded and when. */ | 3257 | of what files are preloaded and when. */ |
| 3258 | if (! NILP (Vpurify_flag)) | 3258 | if (! NILP (Vpurify_flag)) |
| 3259 | error ("(require %s) while preparing to dump", | 3259 | error ("(require %s) while preparing to dump", |
| 3260 | XSTRING (SYMBOL_NAME (feature))->data); | 3260 | SDATA (SYMBOL_NAME (feature))); |
| 3261 | 3261 | ||
| 3262 | /* A certain amount of recursive `require' is legitimate, | 3262 | /* A certain amount of recursive `require' is legitimate, |
| 3263 | but if we require the same feature recursively 3 times, | 3263 | but if we require the same feature recursively 3 times, |
| @@ -3271,7 +3271,7 @@ The normal messages at start and end of loading FILENAME are suppressed. */) | |||
| 3271 | } | 3271 | } |
| 3272 | if (nesting > 2) | 3272 | if (nesting > 2) |
| 3273 | error ("Recursive `require' for feature `%s'", | 3273 | error ("Recursive `require' for feature `%s'", |
| 3274 | XSTRING (SYMBOL_NAME (feature))->data); | 3274 | SDATA (SYMBOL_NAME (feature))); |
| 3275 | 3275 | ||
| 3276 | /* Update the list for any nested `require's that occur. */ | 3276 | /* Update the list for any nested `require's that occur. */ |
| 3277 | record_unwind_protect (require_unwind, require_nesting_list); | 3277 | record_unwind_protect (require_unwind, require_nesting_list); |
| @@ -3294,7 +3294,7 @@ The normal messages at start and end of loading FILENAME are suppressed. */) | |||
| 3294 | tem = Fmemq (feature, Vfeatures); | 3294 | tem = Fmemq (feature, Vfeatures); |
| 3295 | if (NILP (tem)) | 3295 | if (NILP (tem)) |
| 3296 | error ("Required feature `%s' was not provided", | 3296 | error ("Required feature `%s' was not provided", |
| 3297 | XSTRING (SYMBOL_NAME (feature))->data); | 3297 | SDATA (SYMBOL_NAME (feature))); |
| 3298 | 3298 | ||
| 3299 | /* Once loading finishes, don't undo it. */ | 3299 | /* Once loading finishes, don't undo it. */ |
| 3300 | Vautoload_queue = Qt; | 3300 | Vautoload_queue = Qt; |
| @@ -3557,7 +3557,7 @@ into shorter lines. */) | |||
| 3557 | /* We need to allocate enough room for encoding the text. | 3557 | /* We need to allocate enough room for encoding the text. |
| 3558 | We need 33 1/3% more space, plus a newline every 76 | 3558 | We need 33 1/3% more space, plus a newline every 76 |
| 3559 | characters, and then we round up. */ | 3559 | characters, and then we round up. */ |
| 3560 | length = STRING_BYTES (XSTRING (string)); | 3560 | length = SBYTES (string); |
| 3561 | allength = length + length/3 + 1; | 3561 | allength = length + length/3 + 1; |
| 3562 | allength += allength / MIME_LINE_LENGTH + 1 + 6; | 3562 | allength += allength / MIME_LINE_LENGTH + 1 + 6; |
| 3563 | 3563 | ||
| @@ -3567,7 +3567,7 @@ into shorter lines. */) | |||
| 3567 | else | 3567 | else |
| 3568 | encoded = (char *) xmalloc (allength); | 3568 | encoded = (char *) xmalloc (allength); |
| 3569 | 3569 | ||
| 3570 | encoded_length = base64_encode_1 (XSTRING (string)->data, | 3570 | encoded_length = base64_encode_1 (SDATA (string), |
| 3571 | encoded, length, NILP (no_line_break), | 3571 | encoded, length, NILP (no_line_break), |
| 3572 | STRING_MULTIBYTE (string)); | 3572 | STRING_MULTIBYTE (string)); |
| 3573 | if (encoded_length > allength) | 3573 | if (encoded_length > allength) |
| @@ -3760,7 +3760,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string, | |||
| 3760 | 3760 | ||
| 3761 | CHECK_STRING (string); | 3761 | CHECK_STRING (string); |
| 3762 | 3762 | ||
| 3763 | length = STRING_BYTES (XSTRING (string)); | 3763 | length = SBYTES (string); |
| 3764 | /* We need to allocate enough room for decoding the text. */ | 3764 | /* We need to allocate enough room for decoding the text. */ |
| 3765 | if (length <= MAX_ALLOCA) | 3765 | if (length <= MAX_ALLOCA) |
| 3766 | decoded = (char *) alloca (length); | 3766 | decoded = (char *) alloca (length); |
| @@ -3768,7 +3768,7 @@ DEFUN ("base64-decode-string", Fbase64_decode_string, Sbase64_decode_string, | |||
| 3768 | decoded = (char *) xmalloc (length); | 3768 | decoded = (char *) xmalloc (length); |
| 3769 | 3769 | ||
| 3770 | /* The decoded result should be unibyte. */ | 3770 | /* The decoded result should be unibyte. */ |
| 3771 | decoded_length = base64_decode_1 (XSTRING (string)->data, decoded, length, | 3771 | decoded_length = base64_decode_1 (SDATA (string), decoded, length, |
| 3772 | 0, NULL); | 3772 | 0, NULL); |
| 3773 | if (decoded_length > length) | 3773 | if (decoded_length > length) |
| 3774 | abort (); | 3774 | abort (); |
| @@ -4772,8 +4772,8 @@ sxhash (obj, depth) | |||
| 4772 | break; | 4772 | break; |
| 4773 | 4773 | ||
| 4774 | case Lisp_Symbol: | 4774 | case Lisp_Symbol: |
| 4775 | hash = sxhash_string (XSTRING (SYMBOL_NAME (obj))->data, | 4775 | hash = sxhash_string (SDATA (SYMBOL_NAME (obj)), |
| 4776 | XSTRING (SYMBOL_NAME (obj))->size); | 4776 | SCHARS (SYMBOL_NAME (obj))); |
| 4777 | break; | 4777 | break; |
| 4778 | 4778 | ||
| 4779 | case Lisp_Misc: | 4779 | case Lisp_Misc: |
| @@ -4781,7 +4781,7 @@ sxhash (obj, depth) | |||
| 4781 | break; | 4781 | break; |
| 4782 | 4782 | ||
| 4783 | case Lisp_String: | 4783 | case Lisp_String: |
| 4784 | hash = sxhash_string (XSTRING (obj)->data, XSTRING (obj)->size); | 4784 | hash = sxhash_string (SDATA (obj), SCHARS (obj)); |
| 4785 | break; | 4785 | break; |
| 4786 | 4786 | ||
| 4787 | /* This can be everything from a vector to an overlay. */ | 4787 | /* This can be everything from a vector to an overlay. */ |
| @@ -5206,8 +5206,8 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 5206 | if (STRING_MULTIBYTE (object)) | 5206 | if (STRING_MULTIBYTE (object)) |
| 5207 | object = code_convert_string1 (object, coding_system, Qnil, 1); | 5207 | object = code_convert_string1 (object, coding_system, Qnil, 1); |
| 5208 | 5208 | ||
| 5209 | size = XSTRING (object)->size; | 5209 | size = SCHARS (object); |
| 5210 | size_byte = STRING_BYTES (XSTRING (object)); | 5210 | size_byte = SBYTES (object); |
| 5211 | 5211 | ||
| 5212 | if (!NILP (start)) | 5212 | if (!NILP (start)) |
| 5213 | { | 5213 | { |
| @@ -5339,8 +5339,8 @@ guesswork fails. Normally, an error is signaled in such case. */) | |||
| 5339 | object = code_convert_string1 (object, coding_system, Qnil, 1); | 5339 | object = code_convert_string1 (object, coding_system, Qnil, 1); |
| 5340 | } | 5340 | } |
| 5341 | 5341 | ||
| 5342 | md5_buffer (XSTRING (object)->data + start_byte, | 5342 | md5_buffer (SDATA (object) + start_byte, |
| 5343 | STRING_BYTES(XSTRING (object)) - (size_byte - end_byte), | 5343 | SBYTES (object) - (size_byte - end_byte), |
| 5344 | digest); | 5344 | digest); |
| 5345 | 5345 | ||
| 5346 | for (i = 0; i < 16; i++) | 5346 | for (i = 0; i < 16; i++) |
diff --git a/src/fontset.c b/src/fontset.c index f2df1c63774..a69ae807af6 100644 --- a/src/fontset.c +++ b/src/fontset.c | |||
| @@ -370,7 +370,7 @@ font_family_registry (fontname, force) | |||
| 370 | int force; | 370 | int force; |
| 371 | { | 371 | { |
| 372 | Lisp_Object family, registry; | 372 | Lisp_Object family, registry; |
| 373 | char *p = XSTRING (fontname)->data; | 373 | char *p = SDATA (fontname); |
| 374 | char *sep[15]; | 374 | char *sep[15]; |
| 375 | int i = 0; | 375 | int i = 0; |
| 376 | 376 | ||
| @@ -557,7 +557,7 @@ fontset_font_pattern (f, id, c) | |||
| 557 | font name. */ | 557 | font name. */ |
| 558 | elt = XCDR (elt); | 558 | elt = XCDR (elt); |
| 559 | xassert (STRINGP (elt)); | 559 | xassert (STRINGP (elt)); |
| 560 | fontp = FS_LOAD_FONT (f, c, XSTRING (elt)->data, -1); | 560 | fontp = FS_LOAD_FONT (f, c, SDATA (elt), -1); |
| 561 | if (!fontp) | 561 | if (!fontp) |
| 562 | return Qnil; | 562 | return Qnil; |
| 563 | 563 | ||
| @@ -616,7 +616,7 @@ fs_load_font (f, c, fontname, id, face) | |||
| 616 | if (!fontname && charset == CHARSET_ASCII) | 616 | if (!fontname && charset == CHARSET_ASCII) |
| 617 | { | 617 | { |
| 618 | elt = FONTSET_ASCII (fontset); | 618 | elt = FONTSET_ASCII (fontset); |
| 619 | fontname = XSTRING (XCDR (elt))->data; | 619 | fontname = SDATA (XCDR (elt)); |
| 620 | } | 620 | } |
| 621 | } | 621 | } |
| 622 | 622 | ||
| @@ -705,7 +705,7 @@ fs_load_font (f, c, fontname, id, face) | |||
| 705 | the corresponding regular expression. */ | 705 | the corresponding regular expression. */ |
| 706 | static Lisp_Object Vcached_fontset_data; | 706 | static Lisp_Object Vcached_fontset_data; |
| 707 | 707 | ||
| 708 | #define CACHED_FONTSET_NAME (XSTRING (XCAR (Vcached_fontset_data))->data) | 708 | #define CACHED_FONTSET_NAME (SDATA (XCAR (Vcached_fontset_data))) |
| 709 | #define CACHED_FONTSET_REGEX (XCDR (Vcached_fontset_data)) | 709 | #define CACHED_FONTSET_REGEX (XCDR (Vcached_fontset_data)) |
| 710 | 710 | ||
| 711 | /* If fontset name PATTERN contains any wild card, return regular | 711 | /* If fontset name PATTERN contains any wild card, return regular |
| @@ -715,21 +715,21 @@ static Lisp_Object | |||
| 715 | fontset_pattern_regexp (pattern) | 715 | fontset_pattern_regexp (pattern) |
| 716 | Lisp_Object pattern; | 716 | Lisp_Object pattern; |
| 717 | { | 717 | { |
| 718 | if (!index (XSTRING (pattern)->data, '*') | 718 | if (!index (SDATA (pattern), '*') |
| 719 | && !index (XSTRING (pattern)->data, '?')) | 719 | && !index (SDATA (pattern), '?')) |
| 720 | /* PATTERN does not contain any wild cards. */ | 720 | /* PATTERN does not contain any wild cards. */ |
| 721 | return Qnil; | 721 | return Qnil; |
| 722 | 722 | ||
| 723 | if (!CONSP (Vcached_fontset_data) | 723 | if (!CONSP (Vcached_fontset_data) |
| 724 | || strcmp (XSTRING (pattern)->data, CACHED_FONTSET_NAME)) | 724 | || strcmp (SDATA (pattern), CACHED_FONTSET_NAME)) |
| 725 | { | 725 | { |
| 726 | /* We must at first update the cached data. */ | 726 | /* We must at first update the cached data. */ |
| 727 | char *regex = (char *) alloca (XSTRING (pattern)->size * 2 + 3); | 727 | char *regex = (char *) alloca (SCHARS (pattern) * 2 + 3); |
| 728 | char *p0, *p1 = regex; | 728 | char *p0, *p1 = regex; |
| 729 | 729 | ||
| 730 | /* Convert "*" to ".*", "?" to ".". */ | 730 | /* Convert "*" to ".*", "?" to ".". */ |
| 731 | *p1++ = '^'; | 731 | *p1++ = '^'; |
| 732 | for (p0 = (char *) XSTRING (pattern)->data; *p0; p0++) | 732 | for (p0 = (char *) SDATA (pattern); *p0; p0++) |
| 733 | { | 733 | { |
| 734 | if (*p0 == '*') | 734 | if (*p0 == '*') |
| 735 | { | 735 | { |
| @@ -744,7 +744,7 @@ fontset_pattern_regexp (pattern) | |||
| 744 | *p1++ = '$'; | 744 | *p1++ = '$'; |
| 745 | *p1++ = 0; | 745 | *p1++ = 0; |
| 746 | 746 | ||
| 747 | Vcached_fontset_data = Fcons (build_string (XSTRING (pattern)->data), | 747 | Vcached_fontset_data = Fcons (build_string (SDATA (pattern)), |
| 748 | build_string (regex)); | 748 | build_string (regex)); |
| 749 | } | 749 | } |
| 750 | 750 | ||
| @@ -789,10 +789,10 @@ fs_query_fontset (name, regexpp) | |||
| 789 | || !BASE_FONTSET_P (fontset)) | 789 | || !BASE_FONTSET_P (fontset)) |
| 790 | continue; | 790 | continue; |
| 791 | 791 | ||
| 792 | this_name = XSTRING (FONTSET_NAME (fontset))->data; | 792 | this_name = SDATA (FONTSET_NAME (fontset)); |
| 793 | if (regexpp | 793 | if (regexpp |
| 794 | ? fast_c_string_match_ignore_case (name, this_name) >= 0 | 794 | ? fast_c_string_match_ignore_case (name, this_name) >= 0 |
| 795 | : !strcmp (XSTRING (name)->data, this_name)) | 795 | : !strcmp (SDATA (name), this_name)) |
| 796 | return i; | 796 | return i; |
| 797 | } | 797 | } |
| 798 | return -1; | 798 | return -1; |
| @@ -815,7 +815,7 @@ If REGEXPP is non-nil, PATTERN is a regular expression. */) | |||
| 815 | 815 | ||
| 816 | CHECK_STRING (pattern); | 816 | CHECK_STRING (pattern); |
| 817 | 817 | ||
| 818 | if (XSTRING (pattern)->size == 0) | 818 | if (SCHARS (pattern) == 0) |
| 819 | return Qnil; | 819 | return Qnil; |
| 820 | 820 | ||
| 821 | id = fs_query_fontset (pattern, !NILP (regexpp)); | 821 | id = fs_query_fontset (pattern, !NILP (regexpp)); |
| @@ -854,11 +854,11 @@ list_fontsets (f, pattern, size) | |||
| 854 | || !BASE_FONTSET_P (fontset) | 854 | || !BASE_FONTSET_P (fontset) |
| 855 | || !EQ (frame, FONTSET_FRAME (fontset))) | 855 | || !EQ (frame, FONTSET_FRAME (fontset))) |
| 856 | continue; | 856 | continue; |
| 857 | name = XSTRING (FONTSET_NAME (fontset))->data; | 857 | name = SDATA (FONTSET_NAME (fontset)); |
| 858 | 858 | ||
| 859 | if (!NILP (regexp) | 859 | if (!NILP (regexp) |
| 860 | ? (fast_c_string_match_ignore_case (regexp, name) < 0) | 860 | ? (fast_c_string_match_ignore_case (regexp, name) < 0) |
| 861 | : strcmp (XSTRING (pattern)->data, name)) | 861 | : strcmp (SDATA (pattern), name)) |
| 862 | continue; | 862 | continue; |
| 863 | 863 | ||
| 864 | if (size) | 864 | if (size) |
| @@ -892,7 +892,7 @@ FONTLIST is an alist of charsets vs corresponding font name patterns. */) | |||
| 892 | tem = Fquery_fontset (name, Qnil); | 892 | tem = Fquery_fontset (name, Qnil); |
| 893 | if (!NILP (tem)) | 893 | if (!NILP (tem)) |
| 894 | error ("Fontset `%s' matches the existing fontset `%s'", | 894 | error ("Fontset `%s' matches the existing fontset `%s'", |
| 895 | XSTRING (name)->data, XSTRING (tem)->data); | 895 | SDATA (name), SDATA (tem)); |
| 896 | 896 | ||
| 897 | /* Check the validity of FONTLIST while creating a template for | 897 | /* Check the validity of FONTLIST while creating a template for |
| 898 | fontset elements. */ | 898 | fontset elements. */ |
| @@ -969,7 +969,7 @@ check_fontset_name (name) | |||
| 969 | CHECK_STRING (name); | 969 | CHECK_STRING (name); |
| 970 | id = fs_query_fontset (name, 0); | 970 | id = fs_query_fontset (name, 0); |
| 971 | if (id < 0) | 971 | if (id < 0) |
| 972 | error ("Fontset `%s' does not exist", XSTRING (name)->data); | 972 | error ("Fontset `%s' does not exist", SDATA (name)); |
| 973 | return FONTSET_FROM_ID (id); | 973 | return FONTSET_FROM_ID (id); |
| 974 | } | 974 | } |
| 975 | 975 | ||
| @@ -1120,7 +1120,7 @@ If the named font is not yet loaded, return nil. */) | |||
| 1120 | if (!query_font_func) | 1120 | if (!query_font_func) |
| 1121 | error ("Font query function is not supported"); | 1121 | error ("Font query function is not supported"); |
| 1122 | 1122 | ||
| 1123 | fontp = (*query_font_func) (f, XSTRING (name)->data); | 1123 | fontp = (*query_font_func) (f, SDATA (name)); |
| 1124 | if (!fontp) | 1124 | if (!fontp) |
| 1125 | return Qnil; | 1125 | return Qnil; |
| 1126 | 1126 | ||
| @@ -1338,7 +1338,7 @@ If FRAME is omitted, it defaults to the currently selected frame. */) | |||
| 1338 | if (CONSP (elt)) | 1338 | if (CONSP (elt)) |
| 1339 | { | 1339 | { |
| 1340 | elt = XCAR (elt); | 1340 | elt = XCAR (elt); |
| 1341 | fontp = (*query_font_func) (f, XSTRING (elt)->data); | 1341 | fontp = (*query_font_func) (f, SDATA (elt)); |
| 1342 | } | 1342 | } |
| 1343 | val = Fmake_vector (make_number (3), val); | 1343 | val = Fmake_vector (make_number (3), val); |
| 1344 | AREF (val, 0) = fontp ? make_number (fontp->size) : make_number (0); | 1344 | AREF (val, 0) = fontp ? make_number (fontp->size) : make_number (0); |
diff --git a/src/frame.c b/src/frame.c index 9c3ac13e3b9..d659740e2f4 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -293,7 +293,7 @@ make_frame (mini_p) | |||
| 293 | buf = Fcurrent_buffer (); | 293 | buf = Fcurrent_buffer (); |
| 294 | /* If buf is a 'hidden' buffer (i.e. one whose name starts with | 294 | /* If buf is a 'hidden' buffer (i.e. one whose name starts with |
| 295 | a space), try to find another one. */ | 295 | a space), try to find another one. */ |
| 296 | if (XSTRING (Fbuffer_name (buf))->data[0] == ' ') | 296 | if (SREF (Fbuffer_name (buf), 0) == ' ') |
| 297 | buf = Fother_buffer (buf, Qnil, Qnil); | 297 | buf = Fother_buffer (buf, Qnil, Qnil); |
| 298 | 298 | ||
| 299 | /* Use set_window_buffer, not Fset_window_buffer, and don't let | 299 | /* Use set_window_buffer, not Fset_window_buffer, and don't let |
| @@ -1115,7 +1115,7 @@ frame. The hook is called with one argument FRAME. */) | |||
| 1115 | #ifdef MAC_OS8 | 1115 | #ifdef MAC_OS8 |
| 1116 | /* Terminal frame deleted before any other visible frames are | 1116 | /* Terminal frame deleted before any other visible frames are |
| 1117 | created. */ | 1117 | created. */ |
| 1118 | && strcmp (XSTRING (f->name)->data, "F1") != 0 | 1118 | && strcmp (SDATA (f->name), "F1") != 0 |
| 1119 | #endif | 1119 | #endif |
| 1120 | ) | 1120 | ) |
| 1121 | error ("Attempt to delete the sole visible or iconified frame"); | 1121 | error ("Attempt to delete the sole visible or iconified frame"); |
| @@ -1869,8 +1869,8 @@ set_term_frame_name (f, name) | |||
| 1869 | 1869 | ||
| 1870 | /* Check for no change needed in this very common case | 1870 | /* Check for no change needed in this very common case |
| 1871 | before we do any consing. */ | 1871 | before we do any consing. */ |
| 1872 | if (frame_name_fnn_p (XSTRING (f->name)->data, | 1872 | if (frame_name_fnn_p (SDATA (f->name), |
| 1873 | STRING_BYTES (XSTRING (f->name)))) | 1873 | SBYTES (f->name))) |
| 1874 | return; | 1874 | return; |
| 1875 | 1875 | ||
| 1876 | terminal_frame_count++; | 1876 | terminal_frame_count++; |
| @@ -1887,7 +1887,7 @@ set_term_frame_name (f, name) | |||
| 1887 | 1887 | ||
| 1888 | /* Don't allow the user to set the frame name to F<num>, so it | 1888 | /* Don't allow the user to set the frame name to F<num>, so it |
| 1889 | doesn't clash with the names we generate for terminal frames. */ | 1889 | doesn't clash with the names we generate for terminal frames. */ |
| 1890 | if (frame_name_fnn_p (XSTRING (name)->data, STRING_BYTES (XSTRING (name)))) | 1890 | if (frame_name_fnn_p (SDATA (name), SBYTES (name))) |
| 1891 | error ("Frame names of the form F<num> are usurped by Emacs"); | 1891 | error ("Frame names of the form F<num> are usurped by Emacs"); |
| 1892 | } | 1892 | } |
| 1893 | 1893 | ||
| @@ -2005,13 +2005,13 @@ If FRAME is omitted, return information on the currently selected frame. */) | |||
| 2005 | elt = Fassq (Qforeground_color, alist); | 2005 | elt = Fassq (Qforeground_color, alist); |
| 2006 | if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) | 2006 | if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) |
| 2007 | { | 2007 | { |
| 2008 | if (strncmp (XSTRING (XCDR (elt))->data, | 2008 | if (strncmp (SDATA (XCDR (elt)), |
| 2009 | unspecified_bg, | 2009 | unspecified_bg, |
| 2010 | XSTRING (XCDR (elt))->size) == 0) | 2010 | SCHARS (XCDR (elt))) == 0) |
| 2011 | store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg)); | 2011 | store_in_alist (&alist, Qforeground_color, tty_color_name (f, bg)); |
| 2012 | else if (strncmp (XSTRING (XCDR (elt))->data, | 2012 | else if (strncmp (SDATA (XCDR (elt)), |
| 2013 | unspecified_fg, | 2013 | unspecified_fg, |
| 2014 | XSTRING (XCDR (elt))->size) == 0) | 2014 | SCHARS (XCDR (elt))) == 0) |
| 2015 | store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg)); | 2015 | store_in_alist (&alist, Qforeground_color, tty_color_name (f, fg)); |
| 2016 | } | 2016 | } |
| 2017 | else | 2017 | else |
| @@ -2019,13 +2019,13 @@ If FRAME is omitted, return information on the currently selected frame. */) | |||
| 2019 | elt = Fassq (Qbackground_color, alist); | 2019 | elt = Fassq (Qbackground_color, alist); |
| 2020 | if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) | 2020 | if (!NILP (elt) && CONSP (elt) && STRINGP (XCDR (elt))) |
| 2021 | { | 2021 | { |
| 2022 | if (strncmp (XSTRING (XCDR (elt))->data, | 2022 | if (strncmp (SDATA (XCDR (elt)), |
| 2023 | unspecified_fg, | 2023 | unspecified_fg, |
| 2024 | XSTRING (XCDR (elt))->size) == 0) | 2024 | SCHARS (XCDR (elt))) == 0) |
| 2025 | store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg)); | 2025 | store_in_alist (&alist, Qbackground_color, tty_color_name (f, fg)); |
| 2026 | else if (strncmp (XSTRING (XCDR (elt))->data, | 2026 | else if (strncmp (SDATA (XCDR (elt)), |
| 2027 | unspecified_bg, | 2027 | unspecified_bg, |
| 2028 | XSTRING (XCDR (elt))->size) == 0) | 2028 | SCHARS (XCDR (elt))) == 0) |
| 2029 | store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg)); | 2029 | store_in_alist (&alist, Qbackground_color, tty_color_name (f, bg)); |
| 2030 | } | 2030 | } |
| 2031 | else | 2031 | else |
| @@ -2112,8 +2112,8 @@ If FRAME is nil, describe the currently selected frame. */) | |||
| 2112 | 2112 | ||
| 2113 | if (EQ (parameter, Qbackground_color)) | 2113 | if (EQ (parameter, Qbackground_color)) |
| 2114 | { | 2114 | { |
| 2115 | color_name = XSTRING (value)->data; | 2115 | color_name = SDATA (value); |
| 2116 | csz = XSTRING (value)->size; | 2116 | csz = SCHARS (value); |
| 2117 | if (strncmp (color_name, unspecified_bg, csz) == 0) | 2117 | if (strncmp (color_name, unspecified_bg, csz) == 0) |
| 2118 | value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f)); | 2118 | value = tty_color_name (f, FRAME_BACKGROUND_PIXEL (f)); |
| 2119 | else if (strncmp (color_name, unspecified_fg, csz) == 0) | 2119 | else if (strncmp (color_name, unspecified_fg, csz) == 0) |
| @@ -2121,8 +2121,8 @@ If FRAME is nil, describe the currently selected frame. */) | |||
| 2121 | } | 2121 | } |
| 2122 | else if (EQ (parameter, Qforeground_color)) | 2122 | else if (EQ (parameter, Qforeground_color)) |
| 2123 | { | 2123 | { |
| 2124 | color_name = XSTRING (value)->data; | 2124 | color_name = SDATA (value); |
| 2125 | csz = XSTRING (value)->size; | 2125 | csz = SCHARS (value); |
| 2126 | if (strncmp (color_name, unspecified_fg, csz) == 0) | 2126 | if (strncmp (color_name, unspecified_fg, csz) == 0) |
| 2127 | value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f)); | 2127 | value = tty_color_name (f, FRAME_FOREGROUND_PIXEL (f)); |
| 2128 | else if (strncmp (color_name, unspecified_bg, csz) == 0) | 2128 | else if (strncmp (color_name, unspecified_bg, csz) == 0) |
diff --git a/src/indent.c b/src/indent.c index ae1f68806d3..b6cf76234e3 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -667,7 +667,7 @@ string_display_width (string, beg, end) | |||
| 667 | int b, e; | 667 | int b, e; |
| 668 | 668 | ||
| 669 | if (NILP (end)) | 669 | if (NILP (end)) |
| 670 | e = XSTRING (string)->size; | 670 | e = SCHARS (string); |
| 671 | else | 671 | else |
| 672 | { | 672 | { |
| 673 | CHECK_NUMBER (end); | 673 | CHECK_NUMBER (end); |
| @@ -683,10 +683,10 @@ string_display_width (string, beg, end) | |||
| 683 | } | 683 | } |
| 684 | 684 | ||
| 685 | /* Make a pointer for decrementing through the chars before point. */ | 685 | /* Make a pointer for decrementing through the chars before point. */ |
| 686 | ptr = XSTRING (string)->data + e; | 686 | ptr = SDATA (string) + e; |
| 687 | /* Make a pointer to where consecutive chars leave off, | 687 | /* Make a pointer to where consecutive chars leave off, |
| 688 | going backwards from point. */ | 688 | going backwards from point. */ |
| 689 | stop = XSTRING (string)->data + b; | 689 | stop = SDATA (string) + b; |
| 690 | 690 | ||
| 691 | if (tab_width <= 0 || tab_width > 1000) tab_width = 8; | 691 | if (tab_width <= 0 || tab_width > 1000) tab_width = 8; |
| 692 | 692 | ||
diff --git a/src/insdel.c b/src/insdel.c index 1028bc40c4a..9639adbf0fd 100644 --- a/src/insdel.c +++ b/src/insdel.c | |||
| @@ -1111,7 +1111,7 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes, | |||
| 1111 | outgoing_nbytes = nchars; | 1111 | outgoing_nbytes = nchars; |
| 1112 | else if (! STRING_MULTIBYTE (string)) | 1112 | else if (! STRING_MULTIBYTE (string)) |
| 1113 | outgoing_nbytes | 1113 | outgoing_nbytes |
| 1114 | = count_size_as_multibyte (&XSTRING (string)->data[pos_byte], | 1114 | = count_size_as_multibyte (&SREF (string, pos_byte), |
| 1115 | nbytes); | 1115 | nbytes); |
| 1116 | 1116 | ||
| 1117 | GCPRO1 (string); | 1117 | GCPRO1 (string); |
| @@ -1128,7 +1128,7 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes, | |||
| 1128 | 1128 | ||
| 1129 | /* Copy the string text into the buffer, perhaps converting | 1129 | /* Copy the string text into the buffer, perhaps converting |
| 1130 | between single-byte and multibyte. */ | 1130 | between single-byte and multibyte. */ |
| 1131 | copy_text (XSTRING (string)->data + pos_byte, GPT_ADDR, nbytes, | 1131 | copy_text (SDATA (string) + pos_byte, GPT_ADDR, nbytes, |
| 1132 | STRING_MULTIBYTE (string), | 1132 | STRING_MULTIBYTE (string), |
| 1133 | ! NILP (current_buffer->enable_multibyte_characters)); | 1133 | ! NILP (current_buffer->enable_multibyte_characters)); |
| 1134 | 1134 | ||
| @@ -1169,9 +1169,9 @@ insert_from_string_1 (string, pos, pos_byte, nchars, nbytes, | |||
| 1169 | 1169 | ||
| 1170 | offset_intervals (current_buffer, PT, nchars); | 1170 | offset_intervals (current_buffer, PT, nchars); |
| 1171 | 1171 | ||
| 1172 | intervals = XSTRING (string)->intervals; | 1172 | intervals = STRING_INTERVALS (string); |
| 1173 | /* Get the intervals for the part of the string we are inserting. */ | 1173 | /* Get the intervals for the part of the string we are inserting. */ |
| 1174 | if (nbytes < STRING_BYTES (XSTRING (string))) | 1174 | if (nbytes < SBYTES (string)) |
| 1175 | intervals = copy_intervals (intervals, pos, nchars); | 1175 | intervals = copy_intervals (intervals, pos, nchars); |
| 1176 | 1176 | ||
| 1177 | /* Insert those intervals. */ | 1177 | /* Insert those intervals. */ |
| @@ -1358,8 +1358,8 @@ adjust_after_replace (from, from_byte, prev_text, len, len_byte) | |||
| 1358 | 1358 | ||
| 1359 | if (STRINGP (prev_text)) | 1359 | if (STRINGP (prev_text)) |
| 1360 | { | 1360 | { |
| 1361 | nchars_del = XSTRING (prev_text)->size; | 1361 | nchars_del = SCHARS (prev_text); |
| 1362 | nbytes_del = STRING_BYTES (XSTRING (prev_text)); | 1362 | nbytes_del = SBYTES (prev_text); |
| 1363 | } | 1363 | } |
| 1364 | 1364 | ||
| 1365 | /* Update various buffer positions for the new text. */ | 1365 | /* Update various buffer positions for the new text. */ |
| @@ -1493,8 +1493,8 @@ replace_range (from, to, new, prepare, inherit, markers) | |||
| 1493 | Lisp_Object new; | 1493 | Lisp_Object new; |
| 1494 | int from, to, prepare, inherit, markers; | 1494 | int from, to, prepare, inherit, markers; |
| 1495 | { | 1495 | { |
| 1496 | int inschars = XSTRING (new)->size; | 1496 | int inschars = SCHARS (new); |
| 1497 | int insbytes = STRING_BYTES (XSTRING (new)); | 1497 | int insbytes = SBYTES (new); |
| 1498 | int from_byte, to_byte; | 1498 | int from_byte, to_byte; |
| 1499 | int nbytes_del, nchars_del; | 1499 | int nbytes_del, nchars_del; |
| 1500 | register Lisp_Object temp; | 1500 | register Lisp_Object temp; |
| @@ -1539,7 +1539,7 @@ replace_range (from, to, new, prepare, inherit, markers) | |||
| 1539 | outgoing_insbytes = inschars; | 1539 | outgoing_insbytes = inschars; |
| 1540 | else if (! STRING_MULTIBYTE (new)) | 1540 | else if (! STRING_MULTIBYTE (new)) |
| 1541 | outgoing_insbytes | 1541 | outgoing_insbytes |
| 1542 | = count_size_as_multibyte (XSTRING (new)->data, insbytes); | 1542 | = count_size_as_multibyte (SDATA (new), insbytes); |
| 1543 | 1543 | ||
| 1544 | /* Make sure point-max won't overflow after this insertion. */ | 1544 | /* Make sure point-max won't overflow after this insertion. */ |
| 1545 | XSETINT (temp, Z_BYTE - nbytes_del + insbytes); | 1545 | XSETINT (temp, Z_BYTE - nbytes_del + insbytes); |
| @@ -1582,7 +1582,7 @@ replace_range (from, to, new, prepare, inherit, markers) | |||
| 1582 | 1582 | ||
| 1583 | /* Copy the string text into the buffer, perhaps converting | 1583 | /* Copy the string text into the buffer, perhaps converting |
| 1584 | between single-byte and multibyte. */ | 1584 | between single-byte and multibyte. */ |
| 1585 | copy_text (XSTRING (new)->data, GPT_ADDR, insbytes, | 1585 | copy_text (SDATA (new), GPT_ADDR, insbytes, |
| 1586 | STRING_MULTIBYTE (new), | 1586 | STRING_MULTIBYTE (new), |
| 1587 | ! NILP (current_buffer->enable_multibyte_characters)); | 1587 | ! NILP (current_buffer->enable_multibyte_characters)); |
| 1588 | 1588 | ||
| @@ -1629,7 +1629,7 @@ replace_range (from, to, new, prepare, inherit, markers) | |||
| 1629 | 1629 | ||
| 1630 | /* Get the intervals for the part of the string we are inserting-- | 1630 | /* Get the intervals for the part of the string we are inserting-- |
| 1631 | not including the combined-before bytes. */ | 1631 | not including the combined-before bytes. */ |
| 1632 | intervals = XSTRING (new)->intervals; | 1632 | intervals = STRING_INTERVALS (new); |
| 1633 | /* Insert those intervals. */ | 1633 | /* Insert those intervals. */ |
| 1634 | graft_intervals_into_buffer (intervals, from, inschars, | 1634 | graft_intervals_into_buffer (intervals, from, inschars, |
| 1635 | current_buffer, inherit); | 1635 | current_buffer, inherit); |
diff --git a/src/intervals.c b/src/intervals.c index bec97d0b3e6..0129faa7877 100644 --- a/src/intervals.c +++ b/src/intervals.c | |||
| @@ -80,8 +80,8 @@ create_root_interval (parent) | |||
| 80 | } | 80 | } |
| 81 | else if (STRINGP (parent)) | 81 | else if (STRINGP (parent)) |
| 82 | { | 82 | { |
| 83 | new->total_length = XSTRING (parent)->size; | 83 | new->total_length = SCHARS (parent); |
| 84 | XSTRING (parent)->intervals = new; | 84 | STRING_INTERVALS (parent) = new; |
| 85 | new->position = 0; | 85 | new->position = 0; |
| 86 | } | 86 | } |
| 87 | 87 | ||
| @@ -452,7 +452,7 @@ balance_possible_root_interval (interval) | |||
| 452 | if (BUFFERP (parent)) | 452 | if (BUFFERP (parent)) |
| 453 | BUF_INTERVALS (XBUFFER (parent)) = interval; | 453 | BUF_INTERVALS (XBUFFER (parent)) = interval; |
| 454 | else if (STRINGP (parent)) | 454 | else if (STRINGP (parent)) |
| 455 | XSTRING (parent)->intervals = interval; | 455 | STRING_INTERVALS (parent) = interval; |
| 456 | } | 456 | } |
| 457 | 457 | ||
| 458 | return interval; | 458 | return interval; |
| @@ -1280,7 +1280,7 @@ delete_interval (i) | |||
| 1280 | if (BUFFERP (owner)) | 1280 | if (BUFFERP (owner)) |
| 1281 | BUF_INTERVALS (XBUFFER (owner)) = parent; | 1281 | BUF_INTERVALS (XBUFFER (owner)) = parent; |
| 1282 | else if (STRINGP (owner)) | 1282 | else if (STRINGP (owner)) |
| 1283 | XSTRING (owner)->intervals = parent; | 1283 | STRING_INTERVALS (owner) = parent; |
| 1284 | else | 1284 | else |
| 1285 | abort (); | 1285 | abort (); |
| 1286 | 1286 | ||
| @@ -2247,7 +2247,7 @@ get_property_and_range (pos, prop, val, start, end, object) | |||
| 2247 | else if (BUFFERP (object)) | 2247 | else if (BUFFERP (object)) |
| 2248 | i = find_interval (BUF_INTERVALS (XBUFFER (object)), pos); | 2248 | i = find_interval (BUF_INTERVALS (XBUFFER (object)), pos); |
| 2249 | else if (STRINGP (object)) | 2249 | else if (STRINGP (object)) |
| 2250 | i = find_interval (XSTRING (object)->intervals, pos); | 2250 | i = find_interval (STRING_INTERVALS (object), pos); |
| 2251 | else | 2251 | else |
| 2252 | abort (); | 2252 | abort (); |
| 2253 | 2253 | ||
| @@ -2384,7 +2384,7 @@ copy_intervals_to_string (string, buffer, position, length) | |||
| 2384 | return; | 2384 | return; |
| 2385 | 2385 | ||
| 2386 | SET_INTERVAL_OBJECT (interval_copy, string); | 2386 | SET_INTERVAL_OBJECT (interval_copy, string); |
| 2387 | XSTRING (string)->intervals = interval_copy; | 2387 | STRING_INTERVALS (string) = interval_copy; |
| 2388 | } | 2388 | } |
| 2389 | 2389 | ||
| 2390 | /* Return 1 if strings S1 and S2 have identical properties; 0 otherwise. | 2390 | /* Return 1 if strings S1 and S2 have identical properties; 0 otherwise. |
| @@ -2396,10 +2396,10 @@ compare_string_intervals (s1, s2) | |||
| 2396 | { | 2396 | { |
| 2397 | INTERVAL i1, i2; | 2397 | INTERVAL i1, i2; |
| 2398 | int pos = 0; | 2398 | int pos = 0; |
| 2399 | int end = XSTRING (s1)->size; | 2399 | int end = SCHARS (s1); |
| 2400 | 2400 | ||
| 2401 | i1 = find_interval (XSTRING (s1)->intervals, 0); | 2401 | i1 = find_interval (STRING_INTERVALS (s1), 0); |
| 2402 | i2 = find_interval (XSTRING (s2)->intervals, 0); | 2402 | i2 = find_interval (STRING_INTERVALS (s2), 0); |
| 2403 | 2403 | ||
| 2404 | while (pos < end) | 2404 | while (pos < end) |
| 2405 | { | 2405 | { |
diff --git a/src/keyboard.c b/src/keyboard.c index 6006d9276ac..26c1e8ffddb 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -855,7 +855,7 @@ echo_now () | |||
| 855 | echoing = 1; | 855 | echoing = 1; |
| 856 | message3_nolog (current_kboard->echo_string, | 856 | message3_nolog (current_kboard->echo_string, |
| 857 | SBYTES (current_kboard->echo_string), | 857 | SBYTES (current_kboard->echo_string), |
| 858 | SMBP (current_kboard->echo_string)); | 858 | STRING_MULTIBYTE (current_kboard->echo_string)); |
| 859 | echoing = 0; | 859 | echoing = 0; |
| 860 | 860 | ||
| 861 | /* Record in what buffer we echoed, and from which kboard. */ | 861 | /* Record in what buffer we echoed, and from which kboard. */ |
| @@ -1204,7 +1204,7 @@ cmd_error_internal (data, context) | |||
| 1204 | *Messages*. */ | 1204 | *Messages*. */ |
| 1205 | if (!NILP (Vsignaling_function) && SYMBOLP (Vsignaling_function)) | 1205 | if (!NILP (Vsignaling_function) && SYMBOLP (Vsignaling_function)) |
| 1206 | { | 1206 | { |
| 1207 | char *name = XSTRING (SYMBOL_NAME (Vsignaling_function))->data; | 1207 | char *name = SDATA (SYMBOL_NAME (Vsignaling_function)); |
| 1208 | message_dolog (name, strlen (name), 0, 0); | 1208 | message_dolog (name, strlen (name), 0, 0); |
| 1209 | message_dolog (": ", 2, 0, 0); | 1209 | message_dolog (": ", 2, 0, 0); |
| 1210 | Vsignaling_function = Qnil; | 1210 | Vsignaling_function = Qnil; |
| @@ -2111,14 +2111,14 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo) | |||
| 2111 | Vpre_help_message = current_message (); | 2111 | Vpre_help_message = current_message (); |
| 2112 | 2112 | ||
| 2113 | specbind (Qmessage_truncate_lines, Qt); | 2113 | specbind (Qmessage_truncate_lines, Qt); |
| 2114 | message3_nolog (help, STRING_BYTES (XSTRING (help)), | 2114 | message3_nolog (help, SBYTES (help), |
| 2115 | STRING_MULTIBYTE (help)); | 2115 | STRING_MULTIBYTE (help)); |
| 2116 | unbind_to (count, Qnil); | 2116 | unbind_to (count, Qnil); |
| 2117 | } | 2117 | } |
| 2118 | else if (STRINGP (Vpre_help_message)) | 2118 | else if (STRINGP (Vpre_help_message)) |
| 2119 | { | 2119 | { |
| 2120 | message3_nolog (Vpre_help_message, | 2120 | message3_nolog (Vpre_help_message, |
| 2121 | STRING_BYTES (XSTRING (Vpre_help_message)), | 2121 | SBYTES (Vpre_help_message), |
| 2122 | STRING_MULTIBYTE (Vpre_help_message)); | 2122 | STRING_MULTIBYTE (Vpre_help_message)); |
| 2123 | Vpre_help_message = Qnil; | 2123 | Vpre_help_message = Qnil; |
| 2124 | } | 2124 | } |
| @@ -2745,7 +2745,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2745 | RETURN_UNGCPRO (c); | 2745 | RETURN_UNGCPRO (c); |
| 2746 | 2746 | ||
| 2747 | if ((STRINGP (Vkeyboard_translate_table) | 2747 | if ((STRINGP (Vkeyboard_translate_table) |
| 2748 | && XSTRING (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c)) | 2748 | && SCHARS (Vkeyboard_translate_table) > (unsigned) XFASTINT (c)) |
| 2749 | || (VECTORP (Vkeyboard_translate_table) | 2749 | || (VECTORP (Vkeyboard_translate_table) |
| 2750 | && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c)) | 2750 | && XVECTOR (Vkeyboard_translate_table)->size > (unsigned) XFASTINT (c)) |
| 2751 | || (CHAR_TABLE_P (Vkeyboard_translate_table) | 2751 | || (CHAR_TABLE_P (Vkeyboard_translate_table) |
| @@ -3161,8 +3161,8 @@ record_char (c) | |||
| 3161 | if (SYMBOLP (dribblee)) | 3161 | if (SYMBOLP (dribblee)) |
| 3162 | { | 3162 | { |
| 3163 | putc ('<', dribble); | 3163 | putc ('<', dribble); |
| 3164 | fwrite (XSTRING (SYMBOL_NAME (dribblee))->data, sizeof (char), | 3164 | fwrite (SDATA (SYMBOL_NAME (dribblee)), sizeof (char), |
| 3165 | STRING_BYTES (XSTRING (SYMBOL_NAME (dribblee))), | 3165 | SBYTES (SYMBOL_NAME (dribblee)), |
| 3166 | dribble); | 3166 | dribble); |
| 3167 | putc ('>', dribble); | 3167 | putc ('>', dribble); |
| 3168 | } | 3168 | } |
| @@ -4929,7 +4929,7 @@ make_lispy_event (event) | |||
| 4929 | if (NILP (string)) | 4929 | if (NILP (string)) |
| 4930 | break; | 4930 | break; |
| 4931 | if (column >= XINT (pos) | 4931 | if (column >= XINT (pos) |
| 4932 | && column < XINT (pos) + XSTRING (string)->size) | 4932 | && column < XINT (pos) + SCHARS (string)) |
| 4933 | { | 4933 | { |
| 4934 | item = AREF (items, i); | 4934 | item = AREF (items, i); |
| 4935 | break; | 4935 | break; |
| @@ -5703,8 +5703,8 @@ apply_modifiers_uncached (modifiers, base, base_len, base_len_byte) | |||
| 5703 | 5703 | ||
| 5704 | new_name = make_uninit_multibyte_string (mod_len + base_len, | 5704 | new_name = make_uninit_multibyte_string (mod_len + base_len, |
| 5705 | mod_len + base_len_byte); | 5705 | mod_len + base_len_byte); |
| 5706 | bcopy (new_mods, XSTRING (new_name)->data, mod_len); | 5706 | bcopy (new_mods, SDATA (new_name), mod_len); |
| 5707 | bcopy (base, XSTRING (new_name)->data + mod_len, base_len_byte); | 5707 | bcopy (base, SDATA (new_name) + mod_len, base_len_byte); |
| 5708 | 5708 | ||
| 5709 | return Fintern (new_name, Qnil); | 5709 | return Fintern (new_name, Qnil); |
| 5710 | } | 5710 | } |
| @@ -5762,8 +5762,8 @@ parse_modifiers (symbol) | |||
| 5762 | Lisp_Object unmodified; | 5762 | Lisp_Object unmodified; |
| 5763 | Lisp_Object mask; | 5763 | Lisp_Object mask; |
| 5764 | 5764 | ||
| 5765 | unmodified = Fintern (make_string (XSTRING (SYMBOL_NAME (symbol))->data + end, | 5765 | unmodified = Fintern (make_string (SDATA (SYMBOL_NAME (symbol)) + end, |
| 5766 | STRING_BYTES (XSTRING (SYMBOL_NAME (symbol))) - end), | 5766 | SBYTES (SYMBOL_NAME (symbol)) - end), |
| 5767 | Qnil); | 5767 | Qnil); |
| 5768 | 5768 | ||
| 5769 | if (modifiers & ~VALMASK) | 5769 | if (modifiers & ~VALMASK) |
| @@ -5816,9 +5816,9 @@ apply_modifiers (modifiers, base) | |||
| 5816 | { | 5816 | { |
| 5817 | /* We have to create the symbol ourselves. */ | 5817 | /* We have to create the symbol ourselves. */ |
| 5818 | new_symbol = apply_modifiers_uncached (modifiers, | 5818 | new_symbol = apply_modifiers_uncached (modifiers, |
| 5819 | XSTRING (SYMBOL_NAME (base))->data, | 5819 | SDATA (SYMBOL_NAME (base)), |
| 5820 | XSTRING (SYMBOL_NAME (base))->size, | 5820 | SCHARS (SYMBOL_NAME (base)), |
| 5821 | STRING_BYTES (XSTRING (SYMBOL_NAME (base)))); | 5821 | SBYTES (SYMBOL_NAME (base))); |
| 5822 | 5822 | ||
| 5823 | /* Add the new symbol to the base's cache. */ | 5823 | /* Add the new symbol to the base's cache. */ |
| 5824 | entry = Fcons (index, new_symbol); | 5824 | entry = Fcons (index, new_symbol); |
| @@ -5956,9 +5956,9 @@ modify_event_symbol (symbol_num, modifiers, symbol_kind, name_alist_or_stem, | |||
| 5956 | value = Fcdr_safe (Fassq (symbol_int, name_alist_or_stem)); | 5956 | value = Fcdr_safe (Fassq (symbol_int, name_alist_or_stem)); |
| 5957 | else if (STRINGP (name_alist_or_stem)) | 5957 | else if (STRINGP (name_alist_or_stem)) |
| 5958 | { | 5958 | { |
| 5959 | int len = STRING_BYTES (XSTRING (name_alist_or_stem)); | 5959 | int len = SBYTES (name_alist_or_stem); |
| 5960 | char *buf = (char *) alloca (len + 50); | 5960 | char *buf = (char *) alloca (len + 50); |
| 5961 | sprintf (buf, "%s-%d", XSTRING (name_alist_or_stem)->data, | 5961 | sprintf (buf, "%s-%d", SDATA (name_alist_or_stem), |
| 5962 | XINT (symbol_int) + 1); | 5962 | XINT (symbol_int) + 1); |
| 5963 | value = intern (buf); | 5963 | value = intern (buf); |
| 5964 | } | 5964 | } |
| @@ -6039,8 +6039,8 @@ has the same base event type and all the specified modifiers. */) | |||
| 6039 | } | 6039 | } |
| 6040 | 6040 | ||
| 6041 | /* Let the symbol A refer to the character A. */ | 6041 | /* Let the symbol A refer to the character A. */ |
| 6042 | if (SYMBOLP (base) && XSTRING (SYMBOL_NAME (base))->size == 1) | 6042 | if (SYMBOLP (base) && SCHARS (SYMBOL_NAME (base)) == 1) |
| 6043 | XSETINT (base, XSTRING (SYMBOL_NAME (base))->data[0]); | 6043 | XSETINT (base, SDATA (SYMBOL_NAME (base))[0]); |
| 6044 | 6044 | ||
| 6045 | if (INTEGERP (base)) | 6045 | if (INTEGERP (base)) |
| 6046 | { | 6046 | { |
| @@ -7720,8 +7720,8 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps) | |||
| 7720 | return Qnil; | 7720 | return Qnil; |
| 7721 | 7721 | ||
| 7722 | /* Prompt string always starts with map's prompt, and a space. */ | 7722 | /* Prompt string always starts with map's prompt, and a space. */ |
| 7723 | strcpy (menu, XSTRING (name)->data); | 7723 | strcpy (menu, SDATA (name)); |
| 7724 | nlength = STRING_BYTES (XSTRING (name)); | 7724 | nlength = SBYTES (name); |
| 7725 | menu[nlength++] = ':'; | 7725 | menu[nlength++] = ':'; |
| 7726 | menu[nlength++] = ' '; | 7726 | menu[nlength++] = ' '; |
| 7727 | menu[nlength] = 0; | 7727 | menu[nlength] = 0; |
| @@ -7799,8 +7799,8 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps) | |||
| 7799 | 7799 | ||
| 7800 | upcased_event = Fupcase (event); | 7800 | upcased_event = Fupcase (event); |
| 7801 | downcased_event = Fdowncase (event); | 7801 | downcased_event = Fdowncase (event); |
| 7802 | char_matches = (XINT (upcased_event) == XSTRING (s)->data[0] | 7802 | char_matches = (XINT (upcased_event) == SREF (s, 0) |
| 7803 | || XINT (downcased_event) == XSTRING (s)->data[0]); | 7803 | || XINT (downcased_event) == SREF (s, 0)); |
| 7804 | if (! char_matches) | 7804 | if (! char_matches) |
| 7805 | desc = Fsingle_key_description (event, Qnil); | 7805 | desc = Fsingle_key_description (event, Qnil); |
| 7806 | 7806 | ||
| @@ -7829,8 +7829,8 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps) | |||
| 7829 | 7829 | ||
| 7830 | /* If we have room for the prompt string, add it to this line. | 7830 | /* If we have room for the prompt string, add it to this line. |
| 7831 | If this is the first on the line, always add it. */ | 7831 | If this is the first on the line, always add it. */ |
| 7832 | if ((XSTRING (s)->size + i + 2 | 7832 | if ((SCHARS (s) + i + 2 |
| 7833 | + (char_matches ? 0 : XSTRING (desc)->size + 3)) | 7833 | + (char_matches ? 0 : SCHARS (desc) + 3)) |
| 7834 | < width | 7834 | < width |
| 7835 | || !notfirst) | 7835 | || !notfirst) |
| 7836 | { | 7836 | { |
| @@ -7850,20 +7850,20 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps) | |||
| 7850 | if (! char_matches) | 7850 | if (! char_matches) |
| 7851 | { | 7851 | { |
| 7852 | /* Add as much of string as fits. */ | 7852 | /* Add as much of string as fits. */ |
| 7853 | thiswidth = XSTRING (desc)->size; | 7853 | thiswidth = SCHARS (desc); |
| 7854 | if (thiswidth + i > width) | 7854 | if (thiswidth + i > width) |
| 7855 | thiswidth = width - i; | 7855 | thiswidth = width - i; |
| 7856 | bcopy (XSTRING (desc)->data, menu + i, thiswidth); | 7856 | bcopy (SDATA (desc), menu + i, thiswidth); |
| 7857 | i += thiswidth; | 7857 | i += thiswidth; |
| 7858 | strcpy (menu + i, " = "); | 7858 | strcpy (menu + i, " = "); |
| 7859 | i += 3; | 7859 | i += 3; |
| 7860 | } | 7860 | } |
| 7861 | 7861 | ||
| 7862 | /* Add as much of string as fits. */ | 7862 | /* Add as much of string as fits. */ |
| 7863 | thiswidth = XSTRING (s)->size; | 7863 | thiswidth = SCHARS (s); |
| 7864 | if (thiswidth + i > width) | 7864 | if (thiswidth + i > width) |
| 7865 | thiswidth = width - i; | 7865 | thiswidth = width - i; |
| 7866 | bcopy (XSTRING (s)->data, menu + i, thiswidth); | 7866 | bcopy (SDATA (s), menu + i, thiswidth); |
| 7867 | i += thiswidth; | 7867 | i += thiswidth; |
| 7868 | menu[i] = 0; | 7868 | menu[i] = 0; |
| 7869 | } | 7869 | } |
| @@ -8594,7 +8594,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 8594 | pos = XCDR (string); | 8594 | pos = XCDR (string); |
| 8595 | string = XCAR (string); | 8595 | string = XCAR (string); |
| 8596 | if (XINT (pos) >= 0 | 8596 | if (XINT (pos) >= 0 |
| 8597 | && XINT (pos) < XSTRING (string)->size) | 8597 | && XINT (pos) < SCHARS (string)) |
| 8598 | { | 8598 | { |
| 8599 | map = Fget_text_property (pos, Qlocal_map, string); | 8599 | map = Fget_text_property (pos, Qlocal_map, string); |
| 8600 | if (!NILP (map)) | 8600 | if (!NILP (map)) |
| @@ -8622,7 +8622,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 8622 | pos = XCDR (string); | 8622 | pos = XCDR (string); |
| 8623 | string = XCAR (string); | 8623 | string = XCAR (string); |
| 8624 | if (XINT (pos) >= 0 | 8624 | if (XINT (pos) >= 0 |
| 8625 | && XINT (pos) < XSTRING (string)->size) | 8625 | && XINT (pos) < SCHARS (string)) |
| 8626 | { | 8626 | { |
| 8627 | map = Fget_text_property (pos, Qlocal_map, string); | 8627 | map = Fget_text_property (pos, Qlocal_map, string); |
| 8628 | if (!NILP (map)) | 8628 | if (!NILP (map)) |
| @@ -8923,7 +8923,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, | |||
| 8923 | 8923 | ||
| 8924 | for (i = 0; i < len; i++) | 8924 | for (i = 0; i < len; i++) |
| 8925 | XSETFASTINT (keybuf[fkey_start + i], | 8925 | XSETFASTINT (keybuf[fkey_start + i], |
| 8926 | XSTRING (fkey_next)->data[i]); | 8926 | SREF (fkey_next, i)); |
| 8927 | } | 8927 | } |
| 8928 | 8928 | ||
| 8929 | mock_input = t; | 8929 | mock_input = t; |
| @@ -9462,7 +9462,7 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 9462 | Qt, Qnil, Qextended_command_history, Qnil, | 9462 | Qt, Qnil, Qextended_command_history, Qnil, |
| 9463 | Qnil); | 9463 | Qnil); |
| 9464 | 9464 | ||
| 9465 | if (STRINGP (function) && XSTRING (function)->size == 0) | 9465 | if (STRINGP (function) && SCHARS (function) == 0) |
| 9466 | error ("No command name given"); | 9466 | error ("No command name given"); |
| 9467 | 9467 | ||
| 9468 | /* Set this_command_keys to the concatenation of saved_keys and | 9468 | /* Set this_command_keys to the concatenation of saved_keys and |
| @@ -9538,12 +9538,12 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 9538 | binding = Fkey_description (bindings); | 9538 | binding = Fkey_description (bindings); |
| 9539 | 9539 | ||
| 9540 | newmessage | 9540 | newmessage |
| 9541 | = (char *) alloca (XSTRING (SYMBOL_NAME (function))->size | 9541 | = (char *) alloca (SCHARS (SYMBOL_NAME (function)) |
| 9542 | + STRING_BYTES (XSTRING (binding)) | 9542 | + SBYTES (binding) |
| 9543 | + 100); | 9543 | + 100); |
| 9544 | sprintf (newmessage, "You can run the command `%s' with %s", | 9544 | sprintf (newmessage, "You can run the command `%s' with %s", |
| 9545 | XSTRING (SYMBOL_NAME (function))->data, | 9545 | SDATA (SYMBOL_NAME (function)), |
| 9546 | XSTRING (binding)->data); | 9546 | SDATA (binding)); |
| 9547 | message2_nolog (newmessage, | 9547 | message2_nolog (newmessage, |
| 9548 | strlen (newmessage), | 9548 | strlen (newmessage), |
| 9549 | STRING_MULTIBYTE (binding)); | 9549 | STRING_MULTIBYTE (binding)); |
| @@ -9769,7 +9769,7 @@ If FILE is nil, close any open dribble file. */) | |||
| 9769 | if (!NILP (file)) | 9769 | if (!NILP (file)) |
| 9770 | { | 9770 | { |
| 9771 | file = Fexpand_file_name (file, Qnil); | 9771 | file = Fexpand_file_name (file, Qnil); |
| 9772 | dribble = fopen (XSTRING (file)->data, "w"); | 9772 | dribble = fopen (SDATA (file), "w"); |
| 9773 | if (dribble == 0) | 9773 | if (dribble == 0) |
| 9774 | report_file_error ("Opening dribble", Fcons (file, Qnil)); | 9774 | report_file_error ("Opening dribble", Fcons (file, Qnil)); |
| 9775 | } | 9775 | } |
| @@ -9869,8 +9869,8 @@ stuff_buffered_input (stuffstring) | |||
| 9869 | { | 9869 | { |
| 9870 | register int count; | 9870 | register int count; |
| 9871 | 9871 | ||
| 9872 | p = XSTRING (stuffstring)->data; | 9872 | p = SDATA (stuffstring); |
| 9873 | count = STRING_BYTES (XSTRING (stuffstring)); | 9873 | count = SBYTES (stuffstring); |
| 9874 | while (count-- > 0) | 9874 | while (count-- > 0) |
| 9875 | stuff_char (*p++); | 9875 | stuff_char (*p++); |
| 9876 | stuff_char ('\n'); | 9876 | stuff_char ('\n'); |
diff --git a/src/keymap.c b/src/keymap.c index 467b5119b98..21c3bbdc232 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -1062,7 +1062,7 @@ the front of KEYMAP. */) | |||
| 1062 | /* We must use Fkey_description rather than just passing key to | 1062 | /* We must use Fkey_description rather than just passing key to |
| 1063 | error; key might be a vector, not a string. */ | 1063 | error; key might be a vector, not a string. */ |
| 1064 | error ("Key sequence %s uses invalid prefix characters", | 1064 | error ("Key sequence %s uses invalid prefix characters", |
| 1065 | XSTRING (Fkey_description (key))->data); | 1065 | SDATA (Fkey_description (key))); |
| 1066 | } | 1066 | } |
| 1067 | } | 1067 | } |
| 1068 | 1068 | ||
| @@ -1223,8 +1223,8 @@ silly_event_symbol_error (c) | |||
| 1223 | error ((modifiers & ~meta_modifier | 1223 | error ((modifiers & ~meta_modifier |
| 1224 | ? "To bind the key %s, use [?%s], not [%s]" | 1224 | ? "To bind the key %s, use [?%s], not [%s]" |
| 1225 | : "To bind the key %s, use \"%s\", not [%s]"), | 1225 | : "To bind the key %s, use \"%s\", not [%s]"), |
| 1226 | XSTRING (SYMBOL_NAME (c))->data, XSTRING (keystring)->data, | 1226 | SDATA (SYMBOL_NAME (c)), SDATA (keystring), |
| 1227 | XSTRING (SYMBOL_NAME (c))->data); | 1227 | SDATA (SYMBOL_NAME (c))); |
| 1228 | } | 1228 | } |
| 1229 | } | 1229 | } |
| 1230 | 1230 | ||
| @@ -1746,8 +1746,8 @@ then the value includes only maps for prefixes that start with PREFIX. */) | |||
| 1746 | int i, i_byte, c; | 1746 | int i, i_byte, c; |
| 1747 | Lisp_Object copy; | 1747 | Lisp_Object copy; |
| 1748 | 1748 | ||
| 1749 | copy = Fmake_vector (make_number (XSTRING (prefix)->size), Qnil); | 1749 | copy = Fmake_vector (make_number (SCHARS (prefix)), Qnil); |
| 1750 | for (i = 0, i_byte = 0; i < XSTRING (prefix)->size;) | 1750 | for (i = 0, i_byte = 0; i < SCHARS (prefix);) |
| 1751 | { | 1751 | { |
| 1752 | int i_before = i; | 1752 | int i_before = i; |
| 1753 | 1753 | ||
| @@ -1876,7 +1876,7 @@ spaces are put between sequence elements, etc. */) | |||
| 1876 | { | 1876 | { |
| 1877 | Lisp_Object vector; | 1877 | Lisp_Object vector; |
| 1878 | vector = Fmake_vector (Flength (keys), Qnil); | 1878 | vector = Fmake_vector (Flength (keys), Qnil); |
| 1879 | for (i = 0, i_byte = 0; i < XSTRING (keys)->size; ) | 1879 | for (i = 0, i_byte = 0; i < SCHARS (keys); ) |
| 1880 | { | 1880 | { |
| 1881 | int c; | 1881 | int c; |
| 1882 | int i_before = i; | 1882 | int i_before = i; |
| @@ -2120,8 +2120,8 @@ around function keys and event symbols. */) | |||
| 2120 | if (NILP (no_angles)) | 2120 | if (NILP (no_angles)) |
| 2121 | { | 2121 | { |
| 2122 | char *buffer | 2122 | char *buffer |
| 2123 | = (char *) alloca (STRING_BYTES (XSTRING (SYMBOL_NAME (key))) + 5); | 2123 | = (char *) alloca (SBYTES (SYMBOL_NAME (key)) + 5); |
| 2124 | sprintf (buffer, "<%s>", XSTRING (SYMBOL_NAME (key))->data); | 2124 | sprintf (buffer, "<%s>", SDATA (SYMBOL_NAME (key))); |
| 2125 | return build_string (buffer); | 2125 | return build_string (buffer); |
| 2126 | } | 2126 | } |
| 2127 | else | 2127 | else |
| @@ -2659,8 +2659,8 @@ You type Translation\n\ | |||
| 2659 | if (STRINGP (Vkeyboard_translate_table) && !NILP (prefix)) | 2659 | if (STRINGP (Vkeyboard_translate_table) && !NILP (prefix)) |
| 2660 | { | 2660 | { |
| 2661 | int c; | 2661 | int c; |
| 2662 | unsigned char *translate = XSTRING (Vkeyboard_translate_table)->data; | 2662 | unsigned char *translate = SDATA (Vkeyboard_translate_table); |
| 2663 | int translate_len = XSTRING (Vkeyboard_translate_table)->size; | 2663 | int translate_len = SCHARS (Vkeyboard_translate_table); |
| 2664 | 2664 | ||
| 2665 | for (c = 0; c < translate_len; c++) | 2665 | for (c = 0; c < translate_len; c++) |
| 2666 | if (translate[c] != c) | 2666 | if (translate[c] != c) |
| @@ -2738,13 +2738,13 @@ You type Translation\n\ | |||
| 2738 | if (!SYMBOLP (modes[i])) | 2738 | if (!SYMBOLP (modes[i])) |
| 2739 | abort(); | 2739 | abort(); |
| 2740 | 2740 | ||
| 2741 | p = title = (char *) alloca (42 + XSTRING (SYMBOL_NAME (modes[i]))->size); | 2741 | p = title = (char *) alloca (42 + SCHARS (SYMBOL_NAME (modes[i]))); |
| 2742 | *p++ = '\f'; | 2742 | *p++ = '\f'; |
| 2743 | *p++ = '\n'; | 2743 | *p++ = '\n'; |
| 2744 | *p++ = '`'; | 2744 | *p++ = '`'; |
| 2745 | bcopy (XSTRING (SYMBOL_NAME (modes[i]))->data, p, | 2745 | bcopy (SDATA (SYMBOL_NAME (modes[i])), p, |
| 2746 | XSTRING (SYMBOL_NAME (modes[i]))->size); | 2746 | SCHARS (SYMBOL_NAME (modes[i]))); |
| 2747 | p += XSTRING (SYMBOL_NAME (modes[i]))->size; | 2747 | p += SCHARS (SYMBOL_NAME (modes[i])); |
| 2748 | *p++ = '\''; | 2748 | *p++ = '\''; |
| 2749 | bcopy (" Minor Mode Bindings", p, sizeof (" Minor Mode Bindings") - 1); | 2749 | bcopy (" Minor Mode Bindings", p, sizeof (" Minor Mode Bindings") - 1); |
| 2750 | p += sizeof (" Minor Mode Bindings") - 1; | 2750 | p += sizeof (" Minor Mode Bindings") - 1; |
| @@ -2875,7 +2875,7 @@ key binding\n\ | |||
| 2875 | 2875 | ||
| 2876 | /* If the sequence by which we reach this keymap is zero-length, | 2876 | /* If the sequence by which we reach this keymap is zero-length, |
| 2877 | then the shadow map for this keymap is just SHADOW. */ | 2877 | then the shadow map for this keymap is just SHADOW. */ |
| 2878 | if ((STRINGP (prefix) && XSTRING (prefix)->size == 0) | 2878 | if ((STRINGP (prefix) && SCHARS (prefix) == 0) |
| 2879 | || (VECTORP (prefix) && XVECTOR (prefix)->size == 0)) | 2879 | || (VECTORP (prefix) && XVECTOR (prefix)->size == 0)) |
| 2880 | ; | 2880 | ; |
| 2881 | /* If the sequence by which we reach this keymap actually has | 2881 | /* If the sequence by which we reach this keymap actually has |
| @@ -3361,8 +3361,8 @@ describe_vector (vector, elt_prefix, args, elt_describer, | |||
| 3361 | insert_string ("<"); | 3361 | insert_string ("<"); |
| 3362 | tem2 = CHARSET_TABLE_INFO (i - 128, CHARSET_SHORT_NAME_IDX); | 3362 | tem2 = CHARSET_TABLE_INFO (i - 128, CHARSET_SHORT_NAME_IDX); |
| 3363 | if (STRINGP (tem2)) | 3363 | if (STRINGP (tem2)) |
| 3364 | insert_from_string (tem2, 0, 0, XSTRING (tem2)->size, | 3364 | insert_from_string (tem2, 0, 0, SCHARS (tem2), |
| 3365 | STRING_BYTES (XSTRING (tem2)), 0); | 3365 | SBYTES (tem2), 0); |
| 3366 | else | 3366 | else |
| 3367 | insert ("?", 1); | 3367 | insert ("?", 1); |
| 3368 | insert (">", 1); | 3368 | insert (">", 1); |
diff --git a/src/lread.c b/src/lread.c index aaab4fd8f64..6900e337c7c 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -695,9 +695,9 @@ Return t if file exists. */) | |||
| 695 | 695 | ||
| 696 | /* Avoid weird lossage with null string as arg, | 696 | /* Avoid weird lossage with null string as arg, |
| 697 | since it would try to load a directory as a Lisp file */ | 697 | since it would try to load a directory as a Lisp file */ |
| 698 | if (XSTRING (file)->size > 0) | 698 | if (SCHARS (file) > 0) |
| 699 | { | 699 | { |
| 700 | int size = STRING_BYTES (XSTRING (file)); | 700 | int size = SBYTES (file); |
| 701 | Lisp_Object tmp[2]; | 701 | Lisp_Object tmp[2]; |
| 702 | 702 | ||
| 703 | GCPRO1 (file); | 703 | GCPRO1 (file); |
| @@ -706,10 +706,10 @@ Return t if file exists. */) | |||
| 706 | { | 706 | { |
| 707 | /* Don't insist on adding a suffix if FILE already ends with one. */ | 707 | /* Don't insist on adding a suffix if FILE already ends with one. */ |
| 708 | if (size > 3 | 708 | if (size > 3 |
| 709 | && !strcmp (XSTRING (file)->data + size - 3, ".el")) | 709 | && !strcmp (SDATA (file) + size - 3, ".el")) |
| 710 | must_suffix = Qnil; | 710 | must_suffix = Qnil; |
| 711 | else if (size > 4 | 711 | else if (size > 4 |
| 712 | && !strcmp (XSTRING (file)->data + size - 4, ".elc")) | 712 | && !strcmp (SDATA (file) + size - 4, ".elc")) |
| 713 | must_suffix = Qnil; | 713 | must_suffix = Qnil; |
| 714 | /* Don't insist on adding a suffix | 714 | /* Don't insist on adding a suffix |
| 715 | if the argument includes a directory name. */ | 715 | if the argument includes a directory name. */ |
| @@ -778,7 +778,7 @@ Return t if file exists. */) | |||
| 778 | Vloads_in_progress = Fcons (found, Vloads_in_progress); | 778 | Vloads_in_progress = Fcons (found, Vloads_in_progress); |
| 779 | } | 779 | } |
| 780 | 780 | ||
| 781 | if (!bcmp (&(XSTRING (found)->data[STRING_BYTES (XSTRING (found)) - 4]), | 781 | if (!bcmp (&(SREF (found, SBYTES (found) - 4)), |
| 782 | ".elc", 4)) | 782 | ".elc", 4)) |
| 783 | /* Load .elc files directly, but not when they are | 783 | /* Load .elc files directly, but not when they are |
| 784 | remote and have no handler! */ | 784 | remote and have no handler! */ |
| @@ -793,7 +793,7 @@ Return t if file exists. */) | |||
| 793 | safe_p = 0; | 793 | safe_p = 0; |
| 794 | if (!load_dangerous_libraries) | 794 | if (!load_dangerous_libraries) |
| 795 | error ("File `%s' was not compiled in Emacs", | 795 | error ("File `%s' was not compiled in Emacs", |
| 796 | XSTRING (found)->data); | 796 | SDATA (found)); |
| 797 | else if (!NILP (nomessage)) | 797 | else if (!NILP (nomessage)) |
| 798 | message_with_string ("File `%s' not compiled in Emacs", found, 1); | 798 | message_with_string ("File `%s' not compiled in Emacs", found, 1); |
| 799 | } | 799 | } |
| @@ -806,10 +806,10 @@ Return t if file exists. */) | |||
| 806 | #ifdef DOS_NT | 806 | #ifdef DOS_NT |
| 807 | fmode = "rb"; | 807 | fmode = "rb"; |
| 808 | #endif /* DOS_NT */ | 808 | #endif /* DOS_NT */ |
| 809 | stat ((char *)XSTRING (efound)->data, &s1); | 809 | stat ((char *)SDATA (efound), &s1); |
| 810 | XSTRING (efound)->data[STRING_BYTES (XSTRING (efound)) - 1] = 0; | 810 | SREF (efound, SBYTES (efound) - 1) = 0; |
| 811 | result = stat ((char *)XSTRING (efound)->data, &s2); | 811 | result = stat ((char *)SDATA (efound), &s2); |
| 812 | XSTRING (efound)->data[STRING_BYTES (XSTRING (efound)) - 1] = 'c'; | 812 | SREF (efound, SBYTES (efound) - 1) = 'c'; |
| 813 | UNGCPRO; | 813 | UNGCPRO; |
| 814 | 814 | ||
| 815 | if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) | 815 | if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) |
| @@ -823,7 +823,7 @@ Return t if file exists. */) | |||
| 823 | Lisp_Object file; | 823 | Lisp_Object file; |
| 824 | file = Fsubstring (found, make_number (0), make_number (-1)); | 824 | file = Fsubstring (found, make_number (0), make_number (-1)); |
| 825 | message_with_string ("Source file `%s' newer than byte-compiled file", | 825 | message_with_string ("Source file `%s' newer than byte-compiled file", |
| 826 | file, SMBP (file)); | 826 | file, STRING_MULTIBYTE (file)); |
| 827 | } | 827 | } |
| 828 | } | 828 | } |
| 829 | } | 829 | } |
| @@ -848,7 +848,7 @@ Return t if file exists. */) | |||
| 848 | emacs_close (fd); | 848 | emacs_close (fd); |
| 849 | GCPRO1 (efound); | 849 | GCPRO1 (efound); |
| 850 | efound = ENCODE_FILE (found); | 850 | efound = ENCODE_FILE (found); |
| 851 | stream = fopen ((char *) XSTRING (efound)->data, fmode); | 851 | stream = fopen ((char *) SDATA (efound), fmode); |
| 852 | UNGCPRO; | 852 | UNGCPRO; |
| 853 | #else /* not WINDOWSNT */ | 853 | #else /* not WINDOWSNT */ |
| 854 | stream = fdopen (fd, fmode); | 854 | stream = fdopen (fd, fmode); |
| @@ -856,7 +856,7 @@ Return t if file exists. */) | |||
| 856 | if (stream == 0) | 856 | if (stream == 0) |
| 857 | { | 857 | { |
| 858 | emacs_close (fd); | 858 | emacs_close (fd); |
| 859 | error ("Failure to create stdio stream for %s", XSTRING (file)->data); | 859 | error ("Failure to create stdio stream for %s", SDATA (file)); |
| 860 | } | 860 | } |
| 861 | 861 | ||
| 862 | if (! NILP (Vpurify_flag)) | 862 | if (! NILP (Vpurify_flag)) |
| @@ -958,9 +958,9 @@ static int | |||
| 958 | complete_filename_p (pathname) | 958 | complete_filename_p (pathname) |
| 959 | Lisp_Object pathname; | 959 | Lisp_Object pathname; |
| 960 | { | 960 | { |
| 961 | register unsigned char *s = XSTRING (pathname)->data; | 961 | register unsigned char *s = SDATA (pathname); |
| 962 | return (IS_DIRECTORY_SEP (s[0]) | 962 | return (IS_DIRECTORY_SEP (s[0]) |
| 963 | || (XSTRING (pathname)->size > 2 | 963 | || (SCHARS (pathname) > 2 |
| 964 | && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2])) | 964 | && IS_DEVICE_SEP (s[1]) && IS_DIRECTORY_SEP (s[2])) |
| 965 | #ifdef ALTOS | 965 | #ifdef ALTOS |
| 966 | || *s == '@' | 966 | || *s == '@' |
| @@ -1032,7 +1032,7 @@ openp (path, str, suffixes, storeptr, predicate) | |||
| 1032 | { | 1032 | { |
| 1033 | CHECK_STRING_CAR (tail); | 1033 | CHECK_STRING_CAR (tail); |
| 1034 | max_suffix_len = max (max_suffix_len, | 1034 | max_suffix_len = max (max_suffix_len, |
| 1035 | STRING_BYTES (XSTRING (XCAR (tail)))); | 1035 | SBYTES (XCAR (tail))); |
| 1036 | } | 1036 | } |
| 1037 | 1037 | ||
| 1038 | string = filename = Qnil; | 1038 | string = filename = Qnil; |
| @@ -1060,7 +1060,7 @@ openp (path, str, suffixes, storeptr, predicate) | |||
| 1060 | 1060 | ||
| 1061 | /* Calculate maximum size of any filename made from | 1061 | /* Calculate maximum size of any filename made from |
| 1062 | this path element/specified file name and any possible suffix. */ | 1062 | this path element/specified file name and any possible suffix. */ |
| 1063 | want_size = max_suffix_len + STRING_BYTES (XSTRING (filename)) + 1; | 1063 | want_size = max_suffix_len + SBYTES (filename) + 1; |
| 1064 | if (fn_size < want_size) | 1064 | if (fn_size < want_size) |
| 1065 | fn = (char *) alloca (fn_size = 100 + want_size); | 1065 | fn = (char *) alloca (fn_size = 100 + want_size); |
| 1066 | 1066 | ||
| @@ -1068,29 +1068,29 @@ openp (path, str, suffixes, storeptr, predicate) | |||
| 1068 | for (tail = NILP (suffixes) ? default_suffixes : suffixes; | 1068 | for (tail = NILP (suffixes) ? default_suffixes : suffixes; |
| 1069 | CONSP (tail); tail = XCDR (tail)) | 1069 | CONSP (tail); tail = XCDR (tail)) |
| 1070 | { | 1070 | { |
| 1071 | int lsuffix = STRING_BYTES (XSTRING (XCAR (tail))); | 1071 | int lsuffix = SBYTES (XCAR (tail)); |
| 1072 | Lisp_Object handler; | 1072 | Lisp_Object handler; |
| 1073 | int exists; | 1073 | int exists; |
| 1074 | 1074 | ||
| 1075 | /* Concatenate path element/specified name with the suffix. | 1075 | /* Concatenate path element/specified name with the suffix. |
| 1076 | If the directory starts with /:, remove that. */ | 1076 | If the directory starts with /:, remove that. */ |
| 1077 | if (XSTRING (filename)->size > 2 | 1077 | if (SCHARS (filename) > 2 |
| 1078 | && XSTRING (filename)->data[0] == '/' | 1078 | && SREF (filename, 0) == '/' |
| 1079 | && XSTRING (filename)->data[1] == ':') | 1079 | && SREF (filename, 1) == ':') |
| 1080 | { | 1080 | { |
| 1081 | strncpy (fn, XSTRING (filename)->data + 2, | 1081 | strncpy (fn, SDATA (filename) + 2, |
| 1082 | STRING_BYTES (XSTRING (filename)) - 2); | 1082 | SBYTES (filename) - 2); |
| 1083 | fn[STRING_BYTES (XSTRING (filename)) - 2] = 0; | 1083 | fn[SBYTES (filename) - 2] = 0; |
| 1084 | } | 1084 | } |
| 1085 | else | 1085 | else |
| 1086 | { | 1086 | { |
| 1087 | strncpy (fn, XSTRING (filename)->data, | 1087 | strncpy (fn, SDATA (filename), |
| 1088 | STRING_BYTES (XSTRING (filename))); | 1088 | SBYTES (filename)); |
| 1089 | fn[STRING_BYTES (XSTRING (filename))] = 0; | 1089 | fn[SBYTES (filename)] = 0; |
| 1090 | } | 1090 | } |
| 1091 | 1091 | ||
| 1092 | if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ | 1092 | if (lsuffix != 0) /* Bug happens on CCI if lsuffix is 0. */ |
| 1093 | strncat (fn, XSTRING (XCAR (tail))->data, lsuffix); | 1093 | strncat (fn, SDATA (XCAR (tail)), lsuffix); |
| 1094 | 1094 | ||
| 1095 | /* Check that the file exists and is not a directory. */ | 1095 | /* Check that the file exists and is not a directory. */ |
| 1096 | /* We used to only check for handlers on non-absolute file names: | 1096 | /* We used to only check for handlers on non-absolute file names: |
| @@ -1125,7 +1125,7 @@ openp (path, str, suffixes, storeptr, predicate) | |||
| 1125 | char *pfn; | 1125 | char *pfn; |
| 1126 | 1126 | ||
| 1127 | encoded_fn = ENCODE_FILE (string); | 1127 | encoded_fn = ENCODE_FILE (string); |
| 1128 | pfn = XSTRING (encoded_fn)->data; | 1128 | pfn = SDATA (encoded_fn); |
| 1129 | exists = (stat (pfn, &st) >= 0 | 1129 | exists = (stat (pfn, &st) >= 0 |
| 1130 | && (st.st_mode & S_IFMT) != S_IFDIR); | 1130 | && (st.st_mode & S_IFMT) != S_IFDIR); |
| 1131 | if (exists) | 1131 | if (exists) |
| @@ -1507,12 +1507,12 @@ read_internal_start (stream, start, end) | |||
| 1507 | { | 1507 | { |
| 1508 | int startval, endval; | 1508 | int startval, endval; |
| 1509 | if (NILP (end)) | 1509 | if (NILP (end)) |
| 1510 | endval = XSTRING (stream)->size; | 1510 | endval = SCHARS (stream); |
| 1511 | else | 1511 | else |
| 1512 | { | 1512 | { |
| 1513 | CHECK_NUMBER (end); | 1513 | CHECK_NUMBER (end); |
| 1514 | endval = XINT (end); | 1514 | endval = XINT (end); |
| 1515 | if (endval < 0 || endval > XSTRING (stream)->size) | 1515 | if (endval < 0 || endval > SCHARS (stream)) |
| 1516 | args_out_of_range (stream, end); | 1516 | args_out_of_range (stream, end); |
| 1517 | } | 1517 | } |
| 1518 | 1518 | ||
| @@ -1963,17 +1963,17 @@ read1 (readcharfun, pch, first_in_list) | |||
| 1963 | 1963 | ||
| 1964 | UNREAD (c); | 1964 | UNREAD (c); |
| 1965 | tmp = read1 (readcharfun, pch, first_in_list); | 1965 | tmp = read1 (readcharfun, pch, first_in_list); |
| 1966 | if (size_in_chars != XSTRING (tmp)->size | 1966 | if (size_in_chars != SCHARS (tmp) |
| 1967 | /* We used to print 1 char too many | 1967 | /* We used to print 1 char too many |
| 1968 | when the number of bits was a multiple of 8. | 1968 | when the number of bits was a multiple of 8. |
| 1969 | Accept such input in case it came from an old version. */ | 1969 | Accept such input in case it came from an old version. */ |
| 1970 | && ! (XFASTINT (length) | 1970 | && ! (XFASTINT (length) |
| 1971 | == (XSTRING (tmp)->size - 1) * BITS_PER_CHAR)) | 1971 | == (SCHARS (tmp) - 1) * BITS_PER_CHAR)) |
| 1972 | Fsignal (Qinvalid_read_syntax, | 1972 | Fsignal (Qinvalid_read_syntax, |
| 1973 | Fcons (make_string ("#&...", 5), Qnil)); | 1973 | Fcons (make_string ("#&...", 5), Qnil)); |
| 1974 | 1974 | ||
| 1975 | val = Fmake_bool_vector (length, Qnil); | 1975 | val = Fmake_bool_vector (length, Qnil); |
| 1976 | bcopy (XSTRING (tmp)->data, XBOOL_VECTOR (val)->data, | 1976 | bcopy (SDATA (tmp), XBOOL_VECTOR (val)->data, |
| 1977 | size_in_chars); | 1977 | size_in_chars); |
| 1978 | /* Clear the extraneous bits in the last byte. */ | 1978 | /* Clear the extraneous bits in the last byte. */ |
| 1979 | if (XINT (length) != size_in_chars * BITS_PER_CHAR) | 1979 | if (XINT (length) != size_in_chars * BITS_PER_CHAR) |
| @@ -2614,7 +2614,7 @@ substitute_object_recurse (object, placeholder, subtree) | |||
| 2614 | /* Check for text properties in each interval. | 2614 | /* Check for text properties in each interval. |
| 2615 | substitute_in_interval contains part of the logic. */ | 2615 | substitute_in_interval contains part of the logic. */ |
| 2616 | 2616 | ||
| 2617 | INTERVAL root_interval = XSTRING (subtree)->intervals; | 2617 | INTERVAL root_interval = STRING_INTERVALS (subtree); |
| 2618 | Lisp_Object arg = Fcons (object, placeholder); | 2618 | Lisp_Object arg = Fcons (object, placeholder); |
| 2619 | 2619 | ||
| 2620 | traverse_intervals_noorder (root_interval, | 2620 | traverse_intervals_noorder (root_interval, |
| @@ -2760,8 +2760,8 @@ read_vector (readcharfun, bytecodeflag) | |||
| 2760 | /* Coerce string to unibyte (like string-as-unibyte, | 2760 | /* Coerce string to unibyte (like string-as-unibyte, |
| 2761 | but without generating extra garbage and | 2761 | but without generating extra garbage and |
| 2762 | guaranteeing no change in the contents). */ | 2762 | guaranteeing no change in the contents). */ |
| 2763 | XSTRING (bytestr)->size = STRING_BYTES (XSTRING (bytestr)); | 2763 | SCHARS (bytestr) = SBYTES (bytestr); |
| 2764 | SET_STRING_BYTES (XSTRING (bytestr), -1); | 2764 | STRING_SET_UNIBYTE (bytestr); |
| 2765 | 2765 | ||
| 2766 | item = Fread (bytestr); | 2766 | item = Fread (bytestr); |
| 2767 | if (!CONSP (item)) | 2767 | if (!CONSP (item)) |
| @@ -3040,9 +3040,9 @@ it defaults to the value of `obarray'. */) | |||
| 3040 | 3040 | ||
| 3041 | CHECK_STRING (string); | 3041 | CHECK_STRING (string); |
| 3042 | 3042 | ||
| 3043 | tem = oblookup (obarray, XSTRING (string)->data, | 3043 | tem = oblookup (obarray, SDATA (string), |
| 3044 | XSTRING (string)->size, | 3044 | SCHARS (string), |
| 3045 | STRING_BYTES (XSTRING (string))); | 3045 | SBYTES (string)); |
| 3046 | if (!INTEGERP (tem)) | 3046 | if (!INTEGERP (tem)) |
| 3047 | return tem; | 3047 | return tem; |
| 3048 | 3048 | ||
| @@ -3055,7 +3055,7 @@ it defaults to the value of `obarray'. */) | |||
| 3055 | else | 3055 | else |
| 3056 | XSYMBOL (sym)->interned = SYMBOL_INTERNED; | 3056 | XSYMBOL (sym)->interned = SYMBOL_INTERNED; |
| 3057 | 3057 | ||
| 3058 | if ((XSTRING (string)->data[0] == ':') | 3058 | if ((SREF (string, 0) == ':') |
| 3059 | && EQ (obarray, initial_obarray)) | 3059 | && EQ (obarray, initial_obarray)) |
| 3060 | { | 3060 | { |
| 3061 | XSYMBOL (sym)->constant = 1; | 3061 | XSYMBOL (sym)->constant = 1; |
| @@ -3124,9 +3124,9 @@ OBARRAY defaults to the value of the variable `obarray'. */) | |||
| 3124 | string = name; | 3124 | string = name; |
| 3125 | } | 3125 | } |
| 3126 | 3126 | ||
| 3127 | tem = oblookup (obarray, XSTRING (string)->data, | 3127 | tem = oblookup (obarray, SDATA (string), |
| 3128 | XSTRING (string)->size, | 3128 | SCHARS (string), |
| 3129 | STRING_BYTES (XSTRING (string))); | 3129 | SBYTES (string)); |
| 3130 | if (INTEGERP (tem)) | 3130 | if (INTEGERP (tem)) |
| 3131 | return Qnil; | 3131 | return Qnil; |
| 3132 | /* If arg was a symbol, don't delete anything but that symbol itself. */ | 3132 | /* If arg was a symbol, don't delete anything but that symbol itself. */ |
| @@ -3203,9 +3203,9 @@ oblookup (obarray, ptr, size, size_byte) | |||
| 3203 | else | 3203 | else |
| 3204 | for (tail = bucket; ; XSETSYMBOL (tail, XSYMBOL (tail)->next)) | 3204 | for (tail = bucket; ; XSETSYMBOL (tail, XSYMBOL (tail)->next)) |
| 3205 | { | 3205 | { |
| 3206 | if (STRING_BYTES (XSTRING (SYMBOL_NAME (tail))) == size_byte | 3206 | if (SBYTES (SYMBOL_NAME (tail)) == size_byte |
| 3207 | && XSTRING (SYMBOL_NAME (tail))->size == size | 3207 | && SCHARS (SYMBOL_NAME (tail)) == size |
| 3208 | && !bcmp (XSTRING (SYMBOL_NAME (tail))->data, ptr, size_byte)) | 3208 | && !bcmp (SDATA (SYMBOL_NAME (tail)), ptr, size_byte)) |
| 3209 | return tail; | 3209 | return tail; |
| 3210 | else if (XSYMBOL (tail)->next == 0) | 3210 | else if (XSYMBOL (tail)->next == 0) |
| 3211 | break; | 3211 | break; |
| @@ -3618,7 +3618,7 @@ init_lread () | |||
| 3618 | if (STRINGP (dirfile)) | 3618 | if (STRINGP (dirfile)) |
| 3619 | { | 3619 | { |
| 3620 | dirfile = Fdirectory_file_name (dirfile); | 3620 | dirfile = Fdirectory_file_name (dirfile); |
| 3621 | if (access (XSTRING (dirfile)->data, 0) < 0) | 3621 | if (access (SDATA (dirfile), 0) < 0) |
| 3622 | dir_warning ("Warning: Lisp directory `%s' does not exist.\n", | 3622 | dir_warning ("Warning: Lisp directory `%s' does not exist.\n", |
| 3623 | XCAR (path_tail)); | 3623 | XCAR (path_tail)); |
| 3624 | } | 3624 | } |
| @@ -3654,10 +3654,10 @@ dir_warning (format, dirname) | |||
| 3654 | Lisp_Object dirname; | 3654 | Lisp_Object dirname; |
| 3655 | { | 3655 | { |
| 3656 | char *buffer | 3656 | char *buffer |
| 3657 | = (char *) alloca (XSTRING (dirname)->size + strlen (format) + 5); | 3657 | = (char *) alloca (SCHARS (dirname) + strlen (format) + 5); |
| 3658 | 3658 | ||
| 3659 | fprintf (stderr, format, XSTRING (dirname)->data); | 3659 | fprintf (stderr, format, SDATA (dirname)); |
| 3660 | sprintf (buffer, format, XSTRING (dirname)->data); | 3660 | sprintf (buffer, format, SDATA (dirname)); |
| 3661 | /* Don't log the warning before we've initialized!! */ | 3661 | /* Don't log the warning before we've initialized!! */ |
| 3662 | if (initialized) | 3662 | if (initialized) |
| 3663 | message_dolog (buffer, strlen (buffer), 0, STRING_MULTIBYTE (dirname)); | 3663 | message_dolog (buffer, strlen (buffer), 0, STRING_MULTIBYTE (dirname)); |
| @@ -2048,7 +2048,7 @@ run_mac_command (argv, workdir, infn, outfn, errfn) | |||
| 2048 | 2048 | ||
| 2049 | if (NILP (path)) | 2049 | if (NILP (path)) |
| 2050 | return -1; | 2050 | return -1; |
| 2051 | if (posix_to_mac_pathname (XSTRING (path)->data, tempmacpathname, | 2051 | if (posix_to_mac_pathname (SDATA (path), tempmacpathname, |
| 2052 | MAXPATHLEN+1) == 0) | 2052 | MAXPATHLEN+1) == 0) |
| 2053 | return -1; | 2053 | return -1; |
| 2054 | } | 2054 | } |
| @@ -2529,7 +2529,7 @@ component. */) | |||
| 2529 | 2529 | ||
| 2530 | CHECK_STRING (script); | 2530 | CHECK_STRING (script); |
| 2531 | 2531 | ||
| 2532 | status = do_applescript (XSTRING (script)->data, &result); | 2532 | status = do_applescript (SDATA (script), &result); |
| 2533 | if (status) | 2533 | if (status) |
| 2534 | { | 2534 | { |
| 2535 | if (!result) | 2535 | if (!result) |
| @@ -2566,7 +2566,7 @@ DEFUN ("mac-file-name-to-posix", Fmac_file_name_to_posix, | |||
| 2566 | 2566 | ||
| 2567 | CHECK_STRING (mac_filename); | 2567 | CHECK_STRING (mac_filename); |
| 2568 | 2568 | ||
| 2569 | if (mac_to_posix_pathname (XSTRING (mac_filename)->data, posix_filename, | 2569 | if (mac_to_posix_pathname (SDATA (mac_filename), posix_filename, |
| 2570 | MAXPATHLEN)) | 2570 | MAXPATHLEN)) |
| 2571 | return build_string (posix_filename); | 2571 | return build_string (posix_filename); |
| 2572 | else | 2572 | else |
| @@ -2584,7 +2584,7 @@ DEFUN ("posix-file-name-to-mac", Fposix_file_name_to_mac, | |||
| 2584 | 2584 | ||
| 2585 | CHECK_STRING (posix_filename); | 2585 | CHECK_STRING (posix_filename); |
| 2586 | 2586 | ||
| 2587 | if (posix_to_mac_pathname (XSTRING (posix_filename)->data, mac_filename, | 2587 | if (posix_to_mac_pathname (SDATA (posix_filename), mac_filename, |
| 2588 | MAXPATHLEN)) | 2588 | MAXPATHLEN)) |
| 2589 | return build_string (mac_filename); | 2589 | return build_string (mac_filename); |
| 2590 | else | 2590 | else |
| @@ -2670,9 +2670,9 @@ DEFUN ("mac-cut-function", Fmac_cut_function, Smac_cut_function, 1, 2, 0, | |||
| 2670 | 2670 | ||
| 2671 | CHECK_STRING (value); | 2671 | CHECK_STRING (value); |
| 2672 | 2672 | ||
| 2673 | len = XSTRING (value)->size; | 2673 | len = SCHARS (value); |
| 2674 | buf = (char *) alloca (len+1); | 2674 | buf = (char *) alloca (len+1); |
| 2675 | bcopy (XSTRING (value)->data, buf, len); | 2675 | bcopy (SDATA (value), buf, len); |
| 2676 | buf[len] = '\0'; | 2676 | buf[len] = '\0'; |
| 2677 | 2677 | ||
| 2678 | /* convert to Mac-style eol's before sending to clipboard */ | 2678 | /* convert to Mac-style eol's before sending to clipboard */ |
diff --git a/src/macfns.c b/src/macfns.c index 9a9baed37a5..04cedba11dc 100644 --- a/src/macfns.c +++ b/src/macfns.c | |||
| @@ -534,7 +534,7 @@ x_create_bitmap_from_file (f, file) | |||
| 534 | { | 534 | { |
| 535 | if (dpyinfo->bitmaps[id].refcount | 535 | if (dpyinfo->bitmaps[id].refcount |
| 536 | && dpyinfo->bitmaps[id].file | 536 | && dpyinfo->bitmaps[id].file |
| 537 | && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data)) | 537 | && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file))) |
| 538 | { | 538 | { |
| 539 | ++dpyinfo->bitmaps[id].refcount; | 539 | ++dpyinfo->bitmaps[id].refcount; |
| 540 | return id + 1; | 540 | return id + 1; |
| @@ -550,7 +550,7 @@ x_create_bitmap_from_file (f, file) | |||
| 550 | return -1; | 550 | return -1; |
| 551 | emacs_close (fd); | 551 | emacs_close (fd); |
| 552 | 552 | ||
| 553 | filename = (char *) XSTRING (found)->data; | 553 | filename = (char *) SDATA (found); |
| 554 | 554 | ||
| 555 | hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE); | 555 | hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE); |
| 556 | 556 | ||
| @@ -566,11 +566,11 @@ x_create_bitmap_from_file (f, file) | |||
| 566 | id = x_allocate_bitmap_record (f); | 566 | id = x_allocate_bitmap_record (f); |
| 567 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; | 567 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
| 568 | dpyinfo->bitmaps[id - 1].refcount = 1; | 568 | dpyinfo->bitmaps[id - 1].refcount = 1; |
| 569 | dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (XSTRING (file)->size + 1); | 569 | dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (SCHARS (file) + 1); |
| 570 | dpyinfo->bitmaps[id - 1].depth = 1; | 570 | dpyinfo->bitmaps[id - 1].depth = 1; |
| 571 | dpyinfo->bitmaps[id - 1].height = height; | 571 | dpyinfo->bitmaps[id - 1].height = height; |
| 572 | dpyinfo->bitmaps[id - 1].width = width; | 572 | dpyinfo->bitmaps[id - 1].width = width; |
| 573 | strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); | 573 | strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file)); |
| 574 | 574 | ||
| 575 | return id; | 575 | return id; |
| 576 | #endif /* MAC_TODO */ | 576 | #endif /* MAC_TODO */ |
| @@ -2067,9 +2067,9 @@ x_decode_color (f, arg, def) | |||
| 2067 | 2067 | ||
| 2068 | CHECK_STRING (arg); | 2068 | CHECK_STRING (arg); |
| 2069 | 2069 | ||
| 2070 | if (strcmp (XSTRING (arg)->data, "black") == 0) | 2070 | if (strcmp (SDATA (arg), "black") == 0) |
| 2071 | return BLACK_PIX_DEFAULT (f); | 2071 | return BLACK_PIX_DEFAULT (f); |
| 2072 | else if (strcmp (XSTRING (arg)->data, "white") == 0) | 2072 | else if (strcmp (SDATA (arg), "white") == 0) |
| 2073 | return WHITE_PIX_DEFAULT (f); | 2073 | return WHITE_PIX_DEFAULT (f); |
| 2074 | 2074 | ||
| 2075 | #if 0 | 2075 | #if 0 |
| @@ -2078,7 +2078,7 @@ x_decode_color (f, arg, def) | |||
| 2078 | return def; | 2078 | return def; |
| 2079 | #endif | 2079 | #endif |
| 2080 | 2080 | ||
| 2081 | if (mac_defined_color (f, XSTRING (arg)->data, &cdef, 1)) | 2081 | if (mac_defined_color (f, SDATA (arg), &cdef, 1)) |
| 2082 | return cdef.pixel; | 2082 | return cdef.pixel; |
| 2083 | 2083 | ||
| 2084 | /* defined_color failed; return an ultimate default. */ | 2084 | /* defined_color failed; return an ultimate default. */ |
| @@ -2509,11 +2509,11 @@ x_set_icon_name (f, arg, oldval) | |||
| 2509 | BLOCK_INPUT; | 2509 | BLOCK_INPUT; |
| 2510 | 2510 | ||
| 2511 | result = x_text_icon (f, | 2511 | result = x_text_icon (f, |
| 2512 | (char *) XSTRING ((!NILP (f->icon_name) | 2512 | (char *) SDATA ((!NILP (f->icon_name) |
| 2513 | ? f->icon_name | 2513 | ? f->icon_name |
| 2514 | : !NILP (f->title) | 2514 | : !NILP (f->title) |
| 2515 | ? f->title | 2515 | ? f->title |
| 2516 | : f->name))->data); | 2516 | : f->name))); |
| 2517 | 2517 | ||
| 2518 | if (result) | 2518 | if (result) |
| 2519 | { | 2519 | { |
| @@ -2555,12 +2555,12 @@ x_set_font (f, arg, oldval) | |||
| 2555 | 2555 | ||
| 2556 | BLOCK_INPUT; | 2556 | BLOCK_INPUT; |
| 2557 | result = (STRINGP (fontset_name) | 2557 | result = (STRINGP (fontset_name) |
| 2558 | ? x_new_fontset (f, XSTRING (fontset_name)->data) | 2558 | ? x_new_fontset (f, SDATA (fontset_name)) |
| 2559 | : x_new_font (f, XSTRING (arg)->data)); | 2559 | : x_new_font (f, SDATA (arg))); |
| 2560 | UNBLOCK_INPUT; | 2560 | UNBLOCK_INPUT; |
| 2561 | 2561 | ||
| 2562 | if (EQ (result, Qnil)) | 2562 | if (EQ (result, Qnil)) |
| 2563 | error ("Font `%s' is not defined", XSTRING (arg)->data); | 2563 | error ("Font `%s' is not defined", SDATA (arg)); |
| 2564 | else if (EQ (result, Qt)) | 2564 | else if (EQ (result, Qt)) |
| 2565 | error ("The characters of the given font have varying widths"); | 2565 | error ("The characters of the given font have varying widths"); |
| 2566 | else if (STRINGP (result)) | 2566 | else if (STRINGP (result)) |
| @@ -2836,7 +2836,7 @@ x_set_name (f, name, explicit) | |||
| 2836 | /* Check for no change needed in this very common case | 2836 | /* Check for no change needed in this very common case |
| 2837 | before we do any consing. */ | 2837 | before we do any consing. */ |
| 2838 | if (!strcmp (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name, | 2838 | if (!strcmp (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name, |
| 2839 | XSTRING (f->name)->data)) | 2839 | SDATA (f->name))) |
| 2840 | return; | 2840 | return; |
| 2841 | name = build_string (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name); | 2841 | name = build_string (FRAME_MAC_DISPLAY_INFO (f)->mac_id_name); |
| 2842 | } | 2842 | } |
| @@ -2867,9 +2867,9 @@ x_set_name (f, name, explicit) | |||
| 2867 | 2867 | ||
| 2868 | { | 2868 | { |
| 2869 | Str255 windowTitle; | 2869 | Str255 windowTitle; |
| 2870 | if (strlen (XSTRING (name)->data) < 255) | 2870 | if (strlen (SDATA (name)) < 255) |
| 2871 | { | 2871 | { |
| 2872 | strcpy (windowTitle, XSTRING (name)->data); | 2872 | strcpy (windowTitle, SDATA (name)); |
| 2873 | c2pstr (windowTitle); | 2873 | c2pstr (windowTitle); |
| 2874 | SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); | 2874 | SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); |
| 2875 | } | 2875 | } |
| @@ -2941,9 +2941,9 @@ x_set_title (f, name, old_name) | |||
| 2941 | 2941 | ||
| 2942 | { | 2942 | { |
| 2943 | Str255 windowTitle; | 2943 | Str255 windowTitle; |
| 2944 | if (strlen (XSTRING (name)->data) < 255) | 2944 | if (strlen (SDATA (name)) < 255) |
| 2945 | { | 2945 | { |
| 2946 | strcpy (windowTitle, XSTRING (name)->data); | 2946 | strcpy (windowTitle, SDATA (name)); |
| 2947 | c2pstr (windowTitle); | 2947 | c2pstr (windowTitle); |
| 2948 | SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); | 2948 | SetWTitle (FRAME_MAC_WINDOW (f), windowTitle); |
| 2949 | } | 2949 | } |
| @@ -3067,10 +3067,10 @@ validate_x_resource_name () | |||
| 3067 | 3067 | ||
| 3068 | if (STRINGP (Vx_resource_name)) | 3068 | if (STRINGP (Vx_resource_name)) |
| 3069 | { | 3069 | { |
| 3070 | unsigned char *p = XSTRING (Vx_resource_name)->data; | 3070 | unsigned char *p = SDATA (Vx_resource_name); |
| 3071 | int i; | 3071 | int i; |
| 3072 | 3072 | ||
| 3073 | len = STRING_BYTES (XSTRING (Vx_resource_name)); | 3073 | len = SBYTES (Vx_resource_name); |
| 3074 | 3074 | ||
| 3075 | /* Only letters, digits, - and _ are valid in resource names. | 3075 | /* Only letters, digits, - and _ are valid in resource names. |
| 3076 | Count the valid characters and count the invalid ones. */ | 3076 | Count the valid characters and count the invalid ones. */ |
| @@ -3109,12 +3109,12 @@ validate_x_resource_name () | |||
| 3109 | 3109 | ||
| 3110 | for (i = 0; i < len; i++) | 3110 | for (i = 0; i < len; i++) |
| 3111 | { | 3111 | { |
| 3112 | int c = XSTRING (new)->data[i]; | 3112 | int c = SREF (new, i); |
| 3113 | if (! ((c >= 'a' && c <= 'z') | 3113 | if (! ((c >= 'a' && c <= 'z') |
| 3114 | || (c >= 'A' && c <= 'Z') | 3114 | || (c >= 'A' && c <= 'Z') |
| 3115 | || (c >= '0' && c <= '9') | 3115 | || (c >= '0' && c <= '9') |
| 3116 | || c == '-' || c == '_')) | 3116 | || c == '-' || c == '_')) |
| 3117 | XSTRING (new)->data[i] = '_'; | 3117 | SREF (new, i) = '_'; |
| 3118 | } | 3118 | } |
| 3119 | } | 3119 | } |
| 3120 | 3120 | ||
| @@ -3153,37 +3153,37 @@ and the class is `Emacs.CLASS.SUBCLASS'. */) | |||
| 3153 | 3153 | ||
| 3154 | /* Allocate space for the components, the dots which separate them, | 3154 | /* Allocate space for the components, the dots which separate them, |
| 3155 | and the final '\0'. Make them big enough for the worst case. */ | 3155 | and the final '\0'. Make them big enough for the worst case. */ |
| 3156 | name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) | 3156 | name_key = (char *) alloca (SBYTES (Vx_resource_name) |
| 3157 | + (STRINGP (component) | 3157 | + (STRINGP (component) |
| 3158 | ? STRING_BYTES (XSTRING (component)) : 0) | 3158 | ? SBYTES (component) : 0) |
| 3159 | + STRING_BYTES (XSTRING (attribute)) | 3159 | + SBYTES (attribute) |
| 3160 | + 3); | 3160 | + 3); |
| 3161 | 3161 | ||
| 3162 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | 3162 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
| 3163 | + STRING_BYTES (XSTRING (class)) | 3163 | + SBYTES (class) |
| 3164 | + (STRINGP (subclass) | 3164 | + (STRINGP (subclass) |
| 3165 | ? STRING_BYTES (XSTRING (subclass)) : 0) | 3165 | ? SBYTES (subclass) : 0) |
| 3166 | + 3); | 3166 | + 3); |
| 3167 | 3167 | ||
| 3168 | /* Start with emacs.FRAMENAME for the name (the specific one) | 3168 | /* Start with emacs.FRAMENAME for the name (the specific one) |
| 3169 | and with `Emacs' for the class key (the general one). */ | 3169 | and with `Emacs' for the class key (the general one). */ |
| 3170 | strcpy (name_key, XSTRING (Vx_resource_name)->data); | 3170 | strcpy (name_key, SDATA (Vx_resource_name)); |
| 3171 | strcpy (class_key, EMACS_CLASS); | 3171 | strcpy (class_key, EMACS_CLASS); |
| 3172 | 3172 | ||
| 3173 | strcat (class_key, "."); | 3173 | strcat (class_key, "."); |
| 3174 | strcat (class_key, XSTRING (class)->data); | 3174 | strcat (class_key, SDATA (class)); |
| 3175 | 3175 | ||
| 3176 | if (!NILP (component)) | 3176 | if (!NILP (component)) |
| 3177 | { | 3177 | { |
| 3178 | strcat (class_key, "."); | 3178 | strcat (class_key, "."); |
| 3179 | strcat (class_key, XSTRING (subclass)->data); | 3179 | strcat (class_key, SDATA (subclass)); |
| 3180 | 3180 | ||
| 3181 | strcat (name_key, "."); | 3181 | strcat (name_key, "."); |
| 3182 | strcat (name_key, XSTRING (component)->data); | 3182 | strcat (name_key, SDATA (component)); |
| 3183 | } | 3183 | } |
| 3184 | 3184 | ||
| 3185 | strcat (name_key, "."); | 3185 | strcat (name_key, "."); |
| 3186 | strcat (name_key, XSTRING (attribute)->data); | 3186 | strcat (name_key, SDATA (attribute)); |
| 3187 | 3187 | ||
| 3188 | value = x_get_string_resource (Qnil, | 3188 | value = x_get_string_resource (Qnil, |
| 3189 | name_key, class_key); | 3189 | name_key, class_key); |
| @@ -3206,13 +3206,13 @@ x_get_resource_string (attribute, class) | |||
| 3206 | 3206 | ||
| 3207 | /* Allocate space for the components, the dots which separate them, | 3207 | /* Allocate space for the components, the dots which separate them, |
| 3208 | and the final '\0'. */ | 3208 | and the final '\0'. */ |
| 3209 | name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name)) | 3209 | name_key = (char *) alloca (SBYTES (Vinvocation_name) |
| 3210 | + strlen (attribute) + 2); | 3210 | + strlen (attribute) + 2); |
| 3211 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | 3211 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
| 3212 | + strlen (class) + 2); | 3212 | + strlen (class) + 2); |
| 3213 | 3213 | ||
| 3214 | sprintf (name_key, "%s.%s", | 3214 | sprintf (name_key, "%s.%s", |
| 3215 | XSTRING (Vinvocation_name)->data, | 3215 | SDATA (Vinvocation_name), |
| 3216 | attribute); | 3216 | attribute); |
| 3217 | sprintf (class_key, "%s.%s", EMACS_CLASS, class); | 3217 | sprintf (class_key, "%s.%s", EMACS_CLASS, class); |
| 3218 | 3218 | ||
| @@ -3269,15 +3269,15 @@ mac_get_arg (alist, param, attribute, class, type) | |||
| 3269 | switch (type) | 3269 | switch (type) |
| 3270 | { | 3270 | { |
| 3271 | case RES_TYPE_NUMBER: | 3271 | case RES_TYPE_NUMBER: |
| 3272 | return make_number (atoi (XSTRING (tem)->data)); | 3272 | return make_number (atoi (SDATA (tem))); |
| 3273 | 3273 | ||
| 3274 | case RES_TYPE_FLOAT: | 3274 | case RES_TYPE_FLOAT: |
| 3275 | return make_float (atof (XSTRING (tem)->data)); | 3275 | return make_float (atof (SDATA (tem))); |
| 3276 | 3276 | ||
| 3277 | case RES_TYPE_BOOLEAN: | 3277 | case RES_TYPE_BOOLEAN: |
| 3278 | tem = Fdowncase (tem); | 3278 | tem = Fdowncase (tem); |
| 3279 | if (!strcmp (XSTRING (tem)->data, "on") | 3279 | if (!strcmp (SDATA (tem), "on") |
| 3280 | || !strcmp (XSTRING (tem)->data, "true")) | 3280 | || !strcmp (SDATA (tem), "true")) |
| 3281 | return Qt; | 3281 | return Qt; |
| 3282 | else | 3282 | else |
| 3283 | return Qnil; | 3283 | return Qnil; |
| @@ -3291,11 +3291,11 @@ mac_get_arg (alist, param, attribute, class, type) | |||
| 3291 | { | 3291 | { |
| 3292 | Lisp_Object lower; | 3292 | Lisp_Object lower; |
| 3293 | lower = Fdowncase (tem); | 3293 | lower = Fdowncase (tem); |
| 3294 | if (!strcmp (XSTRING (lower)->data, "on") | 3294 | if (!strcmp (SDATA (lower), "on") |
| 3295 | || !strcmp (XSTRING (lower)->data, "true")) | 3295 | || !strcmp (SDATA (lower), "true")) |
| 3296 | return Qt; | 3296 | return Qt; |
| 3297 | else if (!strcmp (XSTRING (lower)->data, "off") | 3297 | else if (!strcmp (SDATA (lower), "off") |
| 3298 | || !strcmp (XSTRING (lower)->data, "false")) | 3298 | || !strcmp (SDATA (lower), "false")) |
| 3299 | return Qnil; | 3299 | return Qnil; |
| 3300 | else | 3300 | else |
| 3301 | return Fintern (tem, Qnil); | 3301 | return Fintern (tem, Qnil); |
| @@ -3490,7 +3490,7 @@ or a list (- N) meaning -N pixels relative to bottom/right corner. */) | |||
| 3490 | 3490 | ||
| 3491 | CHECK_STRING (string); | 3491 | CHECK_STRING (string); |
| 3492 | 3492 | ||
| 3493 | geometry = XParseGeometry ((char *) XSTRING (string)->data, | 3493 | geometry = XParseGeometry ((char *) SDATA (string), |
| 3494 | &x, &y, &width, &height); | 3494 | &x, &y, &width, &height); |
| 3495 | 3495 | ||
| 3496 | result = Qnil; | 3496 | result = Qnil; |
| @@ -3678,7 +3678,7 @@ mac_window (f, window_prompting, minibuffer_only) | |||
| 3678 | Elsewhere we specify the window name for the window manager. */ | 3678 | Elsewhere we specify the window name for the window manager. */ |
| 3679 | 3679 | ||
| 3680 | { | 3680 | { |
| 3681 | char *str = (char *) XSTRING (Vx_resource_name)->data; | 3681 | char *str = (char *) SDATA (Vx_resource_name); |
| 3682 | f->namebuf = (char *) xmalloc (strlen (str) + 1); | 3682 | f->namebuf = (char *) xmalloc (strlen (str) + 1); |
| 3683 | strcpy (f->namebuf, str); | 3683 | strcpy (f->namebuf, str); |
| 3684 | } | 3684 | } |
| @@ -3752,9 +3752,9 @@ x_icon (f, parms) | |||
| 3752 | ? IconicState | 3752 | ? IconicState |
| 3753 | : NormalState)); | 3753 | : NormalState)); |
| 3754 | 3754 | ||
| 3755 | x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name) | 3755 | x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) |
| 3756 | ? f->icon_name | 3756 | ? f->icon_name |
| 3757 | : f->name))->data); | 3757 | : f->name))); |
| 3758 | #endif | 3758 | #endif |
| 3759 | 3759 | ||
| 3760 | UNBLOCK_INPUT; | 3760 | UNBLOCK_INPUT; |
| @@ -3964,9 +3964,9 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 3964 | { | 3964 | { |
| 3965 | tem = Fquery_fontset (font, Qnil); | 3965 | tem = Fquery_fontset (font, Qnil); |
| 3966 | if (STRINGP (tem)) | 3966 | if (STRINGP (tem)) |
| 3967 | font = x_new_fontset (f, XSTRING (tem)->data); | 3967 | font = x_new_fontset (f, SDATA (tem)); |
| 3968 | else | 3968 | else |
| 3969 | font = x_new_font (f, XSTRING (font)->data); | 3969 | font = x_new_font (f, SDATA (font)); |
| 3970 | } | 3970 | } |
| 3971 | /* Try out a font which we hope has bold and italic variations. */ | 3971 | /* Try out a font which we hope has bold and italic variations. */ |
| 3972 | if (! STRINGP (font)) | 3972 | if (! STRINGP (font)) |
| @@ -4178,7 +4178,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, | |||
| 4178 | 4178 | ||
| 4179 | CHECK_STRING (color); | 4179 | CHECK_STRING (color); |
| 4180 | 4180 | ||
| 4181 | if (mac_defined_color (f, XSTRING (color)->data, &foo, 0)) | 4181 | if (mac_defined_color (f, SDATA (color), &foo, 0)) |
| 4182 | return Qt; | 4182 | return Qt; |
| 4183 | else | 4183 | else |
| 4184 | return Qnil; | 4184 | return Qnil; |
| @@ -4194,7 +4194,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, | |||
| 4194 | 4194 | ||
| 4195 | CHECK_STRING (color); | 4195 | CHECK_STRING (color); |
| 4196 | 4196 | ||
| 4197 | if (mac_defined_color (f, XSTRING (color)->data, &foo, 0)) | 4197 | if (mac_defined_color (f, SDATA (color), &foo, 0)) |
| 4198 | { | 4198 | { |
| 4199 | Lisp_Object rgb[3]; | 4199 | Lisp_Object rgb[3]; |
| 4200 | 4200 | ||
| @@ -4515,10 +4515,10 @@ x_display_info_for_name (name) | |||
| 4515 | validate_x_resource_name (); | 4515 | validate_x_resource_name (); |
| 4516 | 4516 | ||
| 4517 | dpyinfo = mac_term_init (name, (unsigned char *) 0, | 4517 | dpyinfo = mac_term_init (name, (unsigned char *) 0, |
| 4518 | (char *) XSTRING (Vx_resource_name)->data); | 4518 | (char *) SDATA (Vx_resource_name)); |
| 4519 | 4519 | ||
| 4520 | if (dpyinfo == 0) | 4520 | if (dpyinfo == 0) |
| 4521 | error ("Cannot connect to server %s", XSTRING (name)->data); | 4521 | error ("Cannot connect to server %s", SDATA (name)); |
| 4522 | 4522 | ||
| 4523 | mac_in_use = 1; | 4523 | mac_in_use = 1; |
| 4524 | XSETFASTINT (Vwindow_system_version, 3); | 4524 | XSETFASTINT (Vwindow_system_version, 3); |
| @@ -4548,7 +4548,7 @@ terminate Emacs if we can't open the connection. */) | |||
| 4548 | error ("Not using Mac OS"); | 4548 | error ("Not using Mac OS"); |
| 4549 | 4549 | ||
| 4550 | if (! NILP (xrm_string)) | 4550 | if (! NILP (xrm_string)) |
| 4551 | xrm_option = (unsigned char *) XSTRING (xrm_string)->data; | 4551 | xrm_option = (unsigned char *) SDATA (xrm_string); |
| 4552 | else | 4552 | else |
| 4553 | xrm_option = (unsigned char *) 0; | 4553 | xrm_option = (unsigned char *) 0; |
| 4554 | 4554 | ||
| @@ -4557,15 +4557,15 @@ terminate Emacs if we can't open the connection. */) | |||
| 4557 | /* This is what opens the connection and sets x_current_display. | 4557 | /* This is what opens the connection and sets x_current_display. |
| 4558 | This also initializes many symbols, such as those used for input. */ | 4558 | This also initializes many symbols, such as those used for input. */ |
| 4559 | dpyinfo = mac_term_init (display, xrm_option, | 4559 | dpyinfo = mac_term_init (display, xrm_option, |
| 4560 | (char *) XSTRING (Vx_resource_name)->data); | 4560 | (char *) SDATA (Vx_resource_name)); |
| 4561 | 4561 | ||
| 4562 | if (dpyinfo == 0) | 4562 | if (dpyinfo == 0) |
| 4563 | { | 4563 | { |
| 4564 | if (!NILP (must_succeed)) | 4564 | if (!NILP (must_succeed)) |
| 4565 | fatal ("Cannot connect to server %s.\n", | 4565 | fatal ("Cannot connect to server %s.\n", |
| 4566 | XSTRING (display)->data); | 4566 | SDATA (display)); |
| 4567 | else | 4567 | else |
| 4568 | error ("Cannot connect to server %s", XSTRING (display)->data); | 4568 | error ("Cannot connect to server %s", SDATA (display)); |
| 4569 | } | 4569 | } |
| 4570 | 4570 | ||
| 4571 | mac_in_use = 1; | 4571 | mac_in_use = 1; |
| @@ -4842,7 +4842,7 @@ parse_image_spec (spec, keywords, nkeywords, type) | |||
| 4842 | 4842 | ||
| 4843 | /* Find key in KEYWORDS. Error if not found. */ | 4843 | /* Find key in KEYWORDS. Error if not found. */ |
| 4844 | for (i = 0; i < nkeywords; ++i) | 4844 | for (i = 0; i < nkeywords; ++i) |
| 4845 | if (strcmp (keywords[i].name, XSTRING (SYMBOL_NAME (key))->data) == 0) | 4845 | if (strcmp (keywords[i].name, SDATA (SYMBOL_NAME (key))) == 0) |
| 4846 | break; | 4846 | break; |
| 4847 | 4847 | ||
| 4848 | if (i == nkeywords) | 4848 | if (i == nkeywords) |
| @@ -5152,7 +5152,7 @@ x_alloc_image_color (f, img, color_name, dflt) | |||
| 5152 | 5152 | ||
| 5153 | xassert (STRINGP (color_name)); | 5153 | xassert (STRINGP (color_name)); |
| 5154 | 5154 | ||
| 5155 | if (w32_defined_color (f, XSTRING (color_name)->data, &color, 1)) | 5155 | if (w32_defined_color (f, SDATA (color_name), &color, 1)) |
| 5156 | { | 5156 | { |
| 5157 | /* This isn't called frequently so we get away with simply | 5157 | /* This isn't called frequently so we get away with simply |
| 5158 | reallocating the color vector to the needed size, here. */ | 5158 | reallocating the color vector to the needed size, here. */ |
| @@ -5730,7 +5730,7 @@ xbm_image_p (object) | |||
| 5730 | 5730 | ||
| 5731 | if (STRINGP (elt)) | 5731 | if (STRINGP (elt)) |
| 5732 | { | 5732 | { |
| 5733 | if (XSTRING (elt)->size | 5733 | if (SCHARS (elt) |
| 5734 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) | 5734 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) |
| 5735 | return 0; | 5735 | return 0; |
| 5736 | } | 5736 | } |
| @@ -5745,7 +5745,7 @@ xbm_image_p (object) | |||
| 5745 | } | 5745 | } |
| 5746 | else if (STRINGP (data)) | 5746 | else if (STRINGP (data)) |
| 5747 | { | 5747 | { |
| 5748 | if (XSTRING (data)->size | 5748 | if (SCHARS (data) |
| 5749 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) | 5749 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) |
| 5750 | return 0; | 5750 | return 0; |
| 5751 | } | 5751 | } |
| @@ -6026,7 +6026,7 @@ xbm_load_image_from_file (f, img, specified_file) | |||
| 6026 | return 0; | 6026 | return 0; |
| 6027 | } | 6027 | } |
| 6028 | 6028 | ||
| 6029 | rc = xbm_read_bitmap_file_data (XSTRING (file)->data, &img->width, | 6029 | rc = xbm_read_bitmap_file_data (SDATA (file), &img->width, |
| 6030 | &img->height, &data); | 6030 | &img->height, &data); |
| 6031 | if (rc) | 6031 | if (rc) |
| 6032 | { | 6032 | { |
| @@ -6139,13 +6139,13 @@ xbm_load (f, img) | |||
| 6139 | { | 6139 | { |
| 6140 | Lisp_Object line = XVECTOR (data)->contents[i]; | 6140 | Lisp_Object line = XVECTOR (data)->contents[i]; |
| 6141 | if (STRINGP (line)) | 6141 | if (STRINGP (line)) |
| 6142 | bcopy (XSTRING (line)->data, p, nbytes); | 6142 | bcopy (SDATA (line), p, nbytes); |
| 6143 | else | 6143 | else |
| 6144 | bcopy (XBOOL_VECTOR (line)->data, p, nbytes); | 6144 | bcopy (XBOOL_VECTOR (line)->data, p, nbytes); |
| 6145 | } | 6145 | } |
| 6146 | } | 6146 | } |
| 6147 | else if (STRINGP (data)) | 6147 | else if (STRINGP (data)) |
| 6148 | bits = XSTRING (data)->data; | 6148 | bits = SDATA (data); |
| 6149 | else | 6149 | else |
| 6150 | bits = XBOOL_VECTOR (data)->data; | 6150 | bits = XBOOL_VECTOR (data)->data; |
| 6151 | 6151 | ||
| @@ -6337,10 +6337,10 @@ xpm_load (f, img) | |||
| 6337 | { | 6337 | { |
| 6338 | Lisp_Object name = XCAR (XCAR (tail)); | 6338 | Lisp_Object name = XCAR (XCAR (tail)); |
| 6339 | Lisp_Object color = XCDR (XCAR (tail)); | 6339 | Lisp_Object color = XCDR (XCAR (tail)); |
| 6340 | xpm_syms[i].name = (char *) alloca (XSTRING (name)->size + 1); | 6340 | xpm_syms[i].name = (char *) alloca (SCHARS (name) + 1); |
| 6341 | strcpy (xpm_syms[i].name, XSTRING (name)->data); | 6341 | strcpy (xpm_syms[i].name, SDATA (name)); |
| 6342 | xpm_syms[i].value = (char *) alloca (XSTRING (color)->size + 1); | 6342 | xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1); |
| 6343 | strcpy (xpm_syms[i].value, XSTRING (color)->data); | 6343 | strcpy (xpm_syms[i].value, SDATA (color)); |
| 6344 | } | 6344 | } |
| 6345 | } | 6345 | } |
| 6346 | 6346 | ||
| @@ -6359,14 +6359,14 @@ xpm_load (f, img) | |||
| 6359 | } | 6359 | } |
| 6360 | 6360 | ||
| 6361 | rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), | 6361 | rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), |
| 6362 | XSTRING (file)->data, &img->pixmap, &img->mask, | 6362 | SDATA (file), &img->pixmap, &img->mask, |
| 6363 | &attrs); | 6363 | &attrs); |
| 6364 | } | 6364 | } |
| 6365 | else | 6365 | else |
| 6366 | { | 6366 | { |
| 6367 | Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); | 6367 | Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); |
| 6368 | rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f), | 6368 | rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f), |
| 6369 | XSTRING (buffer)->data, | 6369 | SDATA (buffer), |
| 6370 | &img->pixmap, &img->mask, | 6370 | &img->pixmap, &img->mask, |
| 6371 | &attrs); | 6371 | &attrs); |
| 6372 | } | 6372 | } |
| @@ -6998,8 +6998,8 @@ pbm_read_file (file, size) | |||
| 6998 | char *buf = NULL; | 6998 | char *buf = NULL; |
| 6999 | struct stat st; | 6999 | struct stat st; |
| 7000 | 7000 | ||
| 7001 | if (stat (XSTRING (file)->data, &st) == 0 | 7001 | if (stat (SDATA (file), &st) == 0 |
| 7002 | && (fp = fopen (XSTRING (file)->data, "r")) != NULL | 7002 | && (fp = fopen (SDATA (file), "r")) != NULL |
| 7003 | && (buf = (char *) xmalloc (st.st_size), | 7003 | && (buf = (char *) xmalloc (st.st_size), |
| 7004 | fread (buf, 1, st.st_size, fp) == st.st_size)) | 7004 | fread (buf, 1, st.st_size, fp) == st.st_size)) |
| 7005 | { | 7005 | { |
| @@ -7067,8 +7067,8 @@ pbm_load (f, img) | |||
| 7067 | { | 7067 | { |
| 7068 | Lisp_Object data; | 7068 | Lisp_Object data; |
| 7069 | data = image_spec_value (img->spec, QCdata, NULL); | 7069 | data = image_spec_value (img->spec, QCdata, NULL); |
| 7070 | p = XSTRING (data)->data; | 7070 | p = SDATA (data); |
| 7071 | end = p + STRING_BYTES (XSTRING (data)); | 7071 | end = p + SBYTES (data); |
| 7072 | } | 7072 | } |
| 7073 | 7073 | ||
| 7074 | /* Check magic number. */ | 7074 | /* Check magic number. */ |
| @@ -7401,7 +7401,7 @@ png_load (f, img) | |||
| 7401 | } | 7401 | } |
| 7402 | 7402 | ||
| 7403 | /* Open the image file. */ | 7403 | /* Open the image file. */ |
| 7404 | fp = fopen (XSTRING (file)->data, "rb"); | 7404 | fp = fopen (SDATA (file), "rb"); |
| 7405 | if (!fp) | 7405 | if (!fp) |
| 7406 | { | 7406 | { |
| 7407 | image_error ("Cannot open image file `%s'", file, Qnil); | 7407 | image_error ("Cannot open image file `%s'", file, Qnil); |
| @@ -7423,8 +7423,8 @@ png_load (f, img) | |||
| 7423 | else | 7423 | else |
| 7424 | { | 7424 | { |
| 7425 | /* Read from memory. */ | 7425 | /* Read from memory. */ |
| 7426 | tbr.bytes = XSTRING (specified_data)->data; | 7426 | tbr.bytes = SDATA (specified_data); |
| 7427 | tbr.len = STRING_BYTES (XSTRING (specified_data)); | 7427 | tbr.len = SBYTES (specified_data); |
| 7428 | tbr.index = 0; | 7428 | tbr.index = 0; |
| 7429 | 7429 | ||
| 7430 | /* Check PNG signature. */ | 7430 | /* Check PNG signature. */ |
| @@ -7936,7 +7936,7 @@ jpeg_load (f, img) | |||
| 7936 | return 0; | 7936 | return 0; |
| 7937 | } | 7937 | } |
| 7938 | 7938 | ||
| 7939 | fp = fopen (XSTRING (file)->data, "r"); | 7939 | fp = fopen (SDATA (file), "r"); |
| 7940 | if (fp == NULL) | 7940 | if (fp == NULL) |
| 7941 | { | 7941 | { |
| 7942 | image_error ("Cannot open `%s'", file, Qnil); | 7942 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -7986,8 +7986,8 @@ jpeg_load (f, img) | |||
| 7986 | if (NILP (specified_data)) | 7986 | if (NILP (specified_data)) |
| 7987 | jpeg_stdio_src (&cinfo, fp); | 7987 | jpeg_stdio_src (&cinfo, fp); |
| 7988 | else | 7988 | else |
| 7989 | jpeg_memory_src (&cinfo, XSTRING (specified_data)->data, | 7989 | jpeg_memory_src (&cinfo, SDATA (specified_data), |
| 7990 | STRING_BYTES (XSTRING (specified_data))); | 7990 | SBYTES (specified_data)); |
| 7991 | 7991 | ||
| 7992 | jpeg_read_header (&cinfo, TRUE); | 7992 | jpeg_read_header (&cinfo, TRUE); |
| 7993 | 7993 | ||
| @@ -8295,7 +8295,7 @@ tiff_load (f, img) | |||
| 8295 | } | 8295 | } |
| 8296 | 8296 | ||
| 8297 | /* Try to open the image file. */ | 8297 | /* Try to open the image file. */ |
| 8298 | tiff = TIFFOpen (XSTRING (file)->data, "r"); | 8298 | tiff = TIFFOpen (SDATA (file), "r"); |
| 8299 | if (tiff == NULL) | 8299 | if (tiff == NULL) |
| 8300 | { | 8300 | { |
| 8301 | image_error ("Cannot open `%s'", file, Qnil); | 8301 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -8306,8 +8306,8 @@ tiff_load (f, img) | |||
| 8306 | else | 8306 | else |
| 8307 | { | 8307 | { |
| 8308 | /* Memory source! */ | 8308 | /* Memory source! */ |
| 8309 | memsrc.bytes = XSTRING (specified_data)->data; | 8309 | memsrc.bytes = SDATA (specified_data); |
| 8310 | memsrc.len = STRING_BYTES (XSTRING (specified_data)); | 8310 | memsrc.len = SBYTES (specified_data); |
| 8311 | memsrc.index = 0; | 8311 | memsrc.index = 0; |
| 8312 | 8312 | ||
| 8313 | tiff = TIFFClientOpen ("memory_source", "r", &memsrc, | 8313 | tiff = TIFFClientOpen ("memory_source", "r", &memsrc, |
| @@ -8539,7 +8539,7 @@ gif_load (f, img) | |||
| 8539 | } | 8539 | } |
| 8540 | 8540 | ||
| 8541 | /* Open the GIF file. */ | 8541 | /* Open the GIF file. */ |
| 8542 | gif = DGifOpenFileName (XSTRING (file)->data); | 8542 | gif = DGifOpenFileName (SDATA (file)); |
| 8543 | if (gif == NULL) | 8543 | if (gif == NULL) |
| 8544 | { | 8544 | { |
| 8545 | image_error ("Cannot open `%s'", file, Qnil); | 8545 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -8551,8 +8551,8 @@ gif_load (f, img) | |||
| 8551 | { | 8551 | { |
| 8552 | /* Read from memory! */ | 8552 | /* Read from memory! */ |
| 8553 | current_gif_memory_src = &memsrc; | 8553 | current_gif_memory_src = &memsrc; |
| 8554 | memsrc.bytes = XSTRING (specified_data)->data; | 8554 | memsrc.bytes = SDATA (specified_data); |
| 8555 | memsrc.len = STRING_BYTES (XSTRING (specified_data)); | 8555 | memsrc.len = SBYTES (specified_data); |
| 8556 | memsrc.index = 0; | 8556 | memsrc.index = 0; |
| 8557 | 8557 | ||
| 8558 | gif = DGifOpen(&memsrc, gif_read_from_memory); | 8558 | gif = DGifOpen(&memsrc, gif_read_from_memory); |
| @@ -8999,10 +8999,10 @@ selected frame. Value is VALUE. */) | |||
| 8999 | CHECK_STRING (value); | 8999 | CHECK_STRING (value); |
| 9000 | 9000 | ||
| 9001 | BLOCK_INPUT; | 9001 | BLOCK_INPUT; |
| 9002 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); | 9002 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); |
| 9003 | XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), | 9003 | XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), |
| 9004 | prop_atom, XA_STRING, 8, PropModeReplace, | 9004 | prop_atom, XA_STRING, 8, PropModeReplace, |
| 9005 | XSTRING (value)->data, XSTRING (value)->size); | 9005 | SDATA (value), SCHARS (value)); |
| 9006 | 9006 | ||
| 9007 | /* Make sure the property is set when we return. */ | 9007 | /* Make sure the property is set when we return. */ |
| 9008 | XFlush (FRAME_W32_DISPLAY (f)); | 9008 | XFlush (FRAME_W32_DISPLAY (f)); |
| @@ -9028,7 +9028,7 @@ FRAME nil or omitted means use the selected frame. Value is PROP. */) | |||
| 9028 | 9028 | ||
| 9029 | CHECK_STRING (prop); | 9029 | CHECK_STRING (prop); |
| 9030 | BLOCK_INPUT; | 9030 | BLOCK_INPUT; |
| 9031 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); | 9031 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); |
| 9032 | XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom); | 9032 | XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom); |
| 9033 | 9033 | ||
| 9034 | /* Make sure the property is removed when we return. */ | 9034 | /* Make sure the property is removed when we return. */ |
| @@ -9062,7 +9062,7 @@ value. */) | |||
| 9062 | 9062 | ||
| 9063 | CHECK_STRING (prop); | 9063 | CHECK_STRING (prop); |
| 9064 | BLOCK_INPUT; | 9064 | BLOCK_INPUT; |
| 9065 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); | 9065 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); |
| 9066 | rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), | 9066 | rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), |
| 9067 | prop_atom, 0, 0, False, XA_STRING, | 9067 | prop_atom, 0, 0, False, XA_STRING, |
| 9068 | &actual_type, &actual_format, &actual_size, | 9068 | &actual_type, &actual_format, &actual_size, |
| @@ -9378,9 +9378,9 @@ x_create_tip_frame (dpyinfo, parms) | |||
| 9378 | { | 9378 | { |
| 9379 | tem = Fquery_fontset (font, Qnil); | 9379 | tem = Fquery_fontset (font, Qnil); |
| 9380 | if (STRINGP (tem)) | 9380 | if (STRINGP (tem)) |
| 9381 | font = x_new_fontset (f, XSTRING (tem)->data); | 9381 | font = x_new_fontset (f, SDATA (tem)); |
| 9382 | else | 9382 | else |
| 9383 | font = x_new_font (f, XSTRING (font)->data); | 9383 | font = x_new_font (f, SDATA (font)); |
| 9384 | } | 9384 | } |
| 9385 | 9385 | ||
| 9386 | /* Try out a font which we hope has bold and italic variations. */ | 9386 | /* Try out a font which we hope has bold and italic variations. */ |
| @@ -9800,14 +9800,14 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */) | |||
| 9800 | /* Create the dialog with PROMPT as title, using DIR as initial | 9800 | /* Create the dialog with PROMPT as title, using DIR as initial |
| 9801 | directory and using "*" as pattern. */ | 9801 | directory and using "*" as pattern. */ |
| 9802 | dir = Fexpand_file_name (dir, Qnil); | 9802 | dir = Fexpand_file_name (dir, Qnil); |
| 9803 | strncpy (init_dir, XSTRING (dir)->data, MAX_PATH); | 9803 | strncpy (init_dir, SDATA (dir), MAX_PATH); |
| 9804 | init_dir[MAX_PATH] = '\0'; | 9804 | init_dir[MAX_PATH] = '\0'; |
| 9805 | unixtodos_filename (init_dir); | 9805 | unixtodos_filename (init_dir); |
| 9806 | 9806 | ||
| 9807 | if (STRINGP (default_filename)) | 9807 | if (STRINGP (default_filename)) |
| 9808 | { | 9808 | { |
| 9809 | char *file_name_only; | 9809 | char *file_name_only; |
| 9810 | char *full_path_name = XSTRING (default_filename)->data; | 9810 | char *full_path_name = SDATA (default_filename); |
| 9811 | 9811 | ||
| 9812 | unixtodos_filename (full_path_name); | 9812 | unixtodos_filename (full_path_name); |
| 9813 | 9813 | ||
| @@ -9846,7 +9846,7 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */) | |||
| 9846 | file_details.lpstrFile = filename; | 9846 | file_details.lpstrFile = filename; |
| 9847 | file_details.nMaxFile = sizeof (filename); | 9847 | file_details.nMaxFile = sizeof (filename); |
| 9848 | file_details.lpstrInitialDir = init_dir; | 9848 | file_details.lpstrInitialDir = init_dir; |
| 9849 | file_details.lpstrTitle = XSTRING (prompt)->data; | 9849 | file_details.lpstrTitle = SDATA (prompt); |
| 9850 | file_details.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR; | 9850 | file_details.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR; |
| 9851 | 9851 | ||
| 9852 | if (!NILP (mustmatch)) | 9852 | if (!NILP (mustmatch)) |
diff --git a/src/macmenu.c b/src/macmenu.c index 15190a7813b..cb51018ce00 100644 --- a/src/macmenu.c +++ b/src/macmenu.c | |||
| @@ -541,7 +541,7 @@ single_menu_item (key, item, pending_maps_ptr, notreal, maxdepth) | |||
| 541 | enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; | 541 | enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; |
| 542 | item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; | 542 | item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; |
| 543 | 543 | ||
| 544 | if (!NILP (map) && XSTRING (item_string)->data[0] == '@') | 544 | if (!NILP (map) && SREF (item_string, 0) == '@') |
| 545 | { | 545 | { |
| 546 | if (!NILP (enabled)) | 546 | if (!NILP (enabled)) |
| 547 | /* An enabled separate pane. Remember this to handle it later. */ | 547 | /* An enabled separate pane. Remember this to handle it later. */ |
| @@ -1223,7 +1223,7 @@ single_submenu (item_key, item_name, maps) | |||
| 1223 | } | 1223 | } |
| 1224 | #endif | 1224 | #endif |
| 1225 | pane_string = (NILP (pane_name) | 1225 | pane_string = (NILP (pane_name) |
| 1226 | ? "" : (char *) XSTRING (pane_name)->data); | 1226 | ? "" : (char *) SDATA (pane_name)); |
| 1227 | /* If there is just one top-level pane, put all its items directly | 1227 | /* If there is just one top-level pane, put all its items directly |
| 1228 | under the top-level menu. */ | 1228 | under the top-level menu. */ |
| 1229 | if (menu_items_n_panes == 1) | 1229 | if (menu_items_n_panes == 1) |
| @@ -1287,9 +1287,9 @@ single_submenu (item_key, item_name, maps) | |||
| 1287 | else | 1287 | else |
| 1288 | save_wv->contents = wv; | 1288 | save_wv->contents = wv; |
| 1289 | 1289 | ||
| 1290 | wv->name = (char *) XSTRING (item_name)->data; | 1290 | wv->name = (char *) SDATA (item_name); |
| 1291 | if (!NILP (descrip)) | 1291 | if (!NILP (descrip)) |
| 1292 | wv->key = (char *) XSTRING (descrip)->data; | 1292 | wv->key = (char *) SDATA (descrip); |
| 1293 | wv->value = 0; | 1293 | wv->value = 0; |
| 1294 | /* The EMACS_INT cast avoids a warning. There's no problem | 1294 | /* The EMACS_INT cast avoids a warning. There's no problem |
| 1295 | as long as pointers have enough bits to hold small integers. */ | 1295 | as long as pointers have enough bits to hold small integers. */ |
| @@ -1470,7 +1470,7 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1470 | string = XVECTOR (items)->contents[i + 1]; | 1470 | string = XVECTOR (items)->contents[i + 1]; |
| 1471 | if (NILP (string)) | 1471 | if (NILP (string)) |
| 1472 | break; | 1472 | break; |
| 1473 | wv->name = (char *) XSTRING (string)->data; | 1473 | wv->name = (char *) SDATA (string); |
| 1474 | wv = wv->next; | 1474 | wv = wv->next; |
| 1475 | } | 1475 | } |
| 1476 | 1476 | ||
| @@ -1493,7 +1493,7 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1493 | break; | 1493 | break; |
| 1494 | 1494 | ||
| 1495 | wv = xmalloc_widget_value (); | 1495 | wv = xmalloc_widget_value (); |
| 1496 | wv->name = (char *) XSTRING (string)->data; | 1496 | wv->name = (char *) SDATA (string); |
| 1497 | wv->value = 0; | 1497 | wv->value = 0; |
| 1498 | wv->enabled = 1; | 1498 | wv->enabled = 1; |
| 1499 | wv->button_type = BUTTON_TYPE_NONE; | 1499 | wv->button_type = BUTTON_TYPE_NONE; |
| @@ -1676,7 +1676,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1676 | } | 1676 | } |
| 1677 | #endif | 1677 | #endif |
| 1678 | pane_string = (NILP (pane_name) | 1678 | pane_string = (NILP (pane_name) |
| 1679 | ? "" : (char *) XSTRING (pane_name)->data); | 1679 | ? "" : (char *) SDATA (pane_name)); |
| 1680 | /* If there is just one top-level pane, put all its items directly | 1680 | /* If there is just one top-level pane, put all its items directly |
| 1681 | under the top-level menu. */ | 1681 | under the top-level menu. */ |
| 1682 | if (menu_items_n_panes == 1) | 1682 | if (menu_items_n_panes == 1) |
| @@ -1741,9 +1741,9 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1741 | prev_wv->next = wv; | 1741 | prev_wv->next = wv; |
| 1742 | else | 1742 | else |
| 1743 | save_wv->contents = wv; | 1743 | save_wv->contents = wv; |
| 1744 | wv->name = (char *) XSTRING (item_name)->data; | 1744 | wv->name = (char *) SDATA (item_name); |
| 1745 | if (!NILP (descrip)) | 1745 | if (!NILP (descrip)) |
| 1746 | wv->key = (char *) XSTRING (descrip)->data; | 1746 | wv->key = (char *) SDATA (descrip); |
| 1747 | wv->value = 0; | 1747 | wv->value = 0; |
| 1748 | /* Use the contents index as call_data, since we are | 1748 | /* Use the contents index as call_data, since we are |
| 1749 | restricted to 16-bits. */ | 1749 | restricted to 16-bits. */ |
| @@ -1787,7 +1787,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1787 | if (STRING_MULTIBYTE (title)) | 1787 | if (STRING_MULTIBYTE (title)) |
| 1788 | title = ENCODE_SYSTEM (title); | 1788 | title = ENCODE_SYSTEM (title); |
| 1789 | #endif | 1789 | #endif |
| 1790 | wv_title->name = (char *) XSTRING (title)->data; | 1790 | wv_title->name = (char *) SDATA (title); |
| 1791 | wv_title->enabled = TRUE; | 1791 | wv_title->enabled = TRUE; |
| 1792 | wv_title->title = TRUE; | 1792 | wv_title->title = TRUE; |
| 1793 | wv_title->button_type = BUTTON_TYPE_NONE; | 1793 | wv_title->button_type = BUTTON_TYPE_NONE; |
| @@ -2047,7 +2047,7 @@ mac_dialog_show (f, keymaps, title, error) | |||
| 2047 | pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; | 2047 | pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; |
| 2048 | prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; | 2048 | prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; |
| 2049 | pane_string = (NILP (pane_name) | 2049 | pane_string = (NILP (pane_name) |
| 2050 | ? "" : (char *) XSTRING (pane_name)->data); | 2050 | ? "" : (char *) SDATA (pane_name)); |
| 2051 | prev_wv = xmalloc_widget_value (); | 2051 | prev_wv = xmalloc_widget_value (); |
| 2052 | prev_wv->value = pane_string; | 2052 | prev_wv->value = pane_string; |
| 2053 | if (keymaps && !NILP (prefix)) | 2053 | if (keymaps && !NILP (prefix)) |
| @@ -2096,8 +2096,8 @@ mac_dialog_show (f, keymaps, title, error) | |||
| 2096 | prev_wv->next = wv; | 2096 | prev_wv->next = wv; |
| 2097 | wv->name = (char *) button_names[nb_buttons]; | 2097 | wv->name = (char *) button_names[nb_buttons]; |
| 2098 | if (!NILP (descrip)) | 2098 | if (!NILP (descrip)) |
| 2099 | wv->key = (char *) XSTRING (descrip)->data; | 2099 | wv->key = (char *) SDATA (descrip); |
| 2100 | wv->value = (char *) XSTRING (item_name)->data; | 2100 | wv->value = (char *) SDATA (item_name); |
| 2101 | wv->call_data = (void *) i; | 2101 | wv->call_data = (void *) i; |
| 2102 | /* menu item is identified by its index in menu_items table */ | 2102 | /* menu item is identified by its index in menu_items table */ |
| 2103 | wv->enabled = !NILP (enable); | 2103 | wv->enabled = !NILP (enable); |
diff --git a/src/macterm.c b/src/macterm.c index 7885f6c4a30..c471ba4bf35 100644 --- a/src/macterm.c +++ b/src/macterm.c | |||
| @@ -7005,9 +7005,9 @@ note_mode_line_highlight (w, x, mode_line_p) | |||
| 7005 | 7005 | ||
| 7006 | if (glyph < end | 7006 | if (glyph < end |
| 7007 | && STRINGP (glyph->object) | 7007 | && STRINGP (glyph->object) |
| 7008 | && XSTRING (glyph->object)->intervals | 7008 | && STRING_INTERVALS (glyph->object) |
| 7009 | && glyph->charpos >= 0 | 7009 | && glyph->charpos >= 0 |
| 7010 | && glyph->charpos < XSTRING (glyph->object)->size) | 7010 | && glyph->charpos < SCHARS (glyph->object)) |
| 7011 | { | 7011 | { |
| 7012 | /* If we're on a string with `help-echo' text property, | 7012 | /* If we're on a string with `help-echo' text property, |
| 7013 | arrange for the help to be displayed. This is done by | 7013 | arrange for the help to be displayed. This is done by |
| @@ -7328,7 +7328,7 @@ note_mouse_highlight (f, x, y) | |||
| 7328 | if (NILP (b)) | 7328 | if (NILP (b)) |
| 7329 | b = make_number (0); | 7329 | b = make_number (0); |
| 7330 | if (NILP (e)) | 7330 | if (NILP (e)) |
| 7331 | e = make_number (XSTRING (object)->size - 1); | 7331 | e = make_number (SCHARS (object) - 1); |
| 7332 | fast_find_string_pos (w, XINT (b), object, | 7332 | fast_find_string_pos (w, XINT (b), object, |
| 7333 | &dpyinfo->mouse_face_beg_col, | 7333 | &dpyinfo->mouse_face_beg_col, |
| 7334 | &dpyinfo->mouse_face_beg_row, | 7334 | &dpyinfo->mouse_face_beg_row, |
| @@ -7426,7 +7426,7 @@ note_mouse_highlight (f, x, y) | |||
| 7426 | /* Try text properties. */ | 7426 | /* Try text properties. */ |
| 7427 | if (STRINGP (object) | 7427 | if (STRINGP (object) |
| 7428 | && charpos >= 0 | 7428 | && charpos >= 0 |
| 7429 | && charpos < XSTRING (object)->size) | 7429 | && charpos < SCHARS (object)) |
| 7430 | { | 7430 | { |
| 7431 | help = Fget_text_property (make_number (charpos), | 7431 | help = Fget_text_property (make_number (charpos), |
| 7432 | Qhelp_echo, object); | 7432 | Qhelp_echo, object); |
| @@ -9469,7 +9469,7 @@ x_bitmap_icon (f, icon) | |||
| 9469 | if (NILP (icon)) | 9469 | if (NILP (icon)) |
| 9470 | hicon = LoadIcon (hinst, EMACS_CLASS); | 9470 | hicon = LoadIcon (hinst, EMACS_CLASS); |
| 9471 | else if (STRINGP (icon)) | 9471 | else if (STRINGP (icon)) |
| 9472 | hicon = LoadImage (NULL, (LPCTSTR) XSTRING (icon)->data, IMAGE_ICON, 0, 0, | 9472 | hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0, |
| 9473 | LR_DEFAULTSIZE | LR_LOADFROMFILE); | 9473 | LR_DEFAULTSIZE | LR_LOADFROMFILE); |
| 9474 | else if (SYMBOLP (icon)) | 9474 | else if (SYMBOLP (icon)) |
| 9475 | { | 9475 | { |
| @@ -9606,7 +9606,7 @@ x_new_fontset (f, fontsetname) | |||
| 9606 | to do. */ | 9606 | to do. */ |
| 9607 | return fontset_name (fontset); | 9607 | return fontset_name (fontset); |
| 9608 | 9608 | ||
| 9609 | result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data)); | 9609 | result = x_new_font (f, (SDATA (fontset_ascii (fontset)))); |
| 9610 | 9610 | ||
| 9611 | if (!STRINGP (result)) | 9611 | if (!STRINGP (result)) |
| 9612 | /* Can't load ASCII font. */ | 9612 | /* Can't load ASCII font. */ |
| @@ -10893,7 +10893,7 @@ x_list_fonts (struct frame *f, | |||
| 10893 | } | 10893 | } |
| 10894 | } | 10894 | } |
| 10895 | 10895 | ||
| 10896 | ptnstr = XSTRING (pattern)->data; | 10896 | ptnstr = SDATA (pattern); |
| 10897 | 10897 | ||
| 10898 | GCPRO2 (pattern, newlist); | 10898 | GCPRO2 (pattern, newlist); |
| 10899 | 10899 | ||
| @@ -11243,9 +11243,9 @@ x_load_font (f, fontname, size) | |||
| 11243 | for (tail = font_names; CONSP (tail); tail = XCDR (tail)) | 11243 | for (tail = font_names; CONSP (tail); tail = XCDR (tail)) |
| 11244 | if (dpyinfo->font_table[i].name | 11244 | if (dpyinfo->font_table[i].name |
| 11245 | && (!strcmp (dpyinfo->font_table[i].name, | 11245 | && (!strcmp (dpyinfo->font_table[i].name, |
| 11246 | XSTRING (XCAR (tail))->data) | 11246 | SDATA (XCAR (tail))) |
| 11247 | || !strcmp (dpyinfo->font_table[i].full_name, | 11247 | || !strcmp (dpyinfo->font_table[i].full_name, |
| 11248 | XSTRING (XCAR (tail))->data))) | 11248 | SDATA (XCAR (tail))))) |
| 11249 | return (dpyinfo->font_table + i); | 11249 | return (dpyinfo->font_table + i); |
| 11250 | } | 11250 | } |
| 11251 | 11251 | ||
| @@ -11263,7 +11263,7 @@ x_load_font (f, fontname, size) | |||
| 11263 | a bug of not finding a font even if the font surely exists and | 11263 | a bug of not finding a font even if the font surely exists and |
| 11264 | is loadable by XLoadQueryFont. */ | 11264 | is loadable by XLoadQueryFont. */ |
| 11265 | if (size > 0 && !NILP (font_names)) | 11265 | if (size > 0 && !NILP (font_names)) |
| 11266 | fontname = (char *) XSTRING (XCAR (font_names))->data; | 11266 | fontname = (char *) SDATA (XCAR (font_names)); |
| 11267 | 11267 | ||
| 11268 | font = (MacFontStruct *) XLoadQueryFont (FRAME_MAC_DISPLAY (f), fontname); | 11268 | font = (MacFontStruct *) XLoadQueryFont (FRAME_MAC_DISPLAY (f), fontname); |
| 11269 | if (!font) | 11269 | if (!font) |
| @@ -11457,7 +11457,7 @@ same_x_server (name1, name2) | |||
| 11457 | char *name1, *name2; | 11457 | char *name1, *name2; |
| 11458 | { | 11458 | { |
| 11459 | int seen_colon = 0; | 11459 | int seen_colon = 0; |
| 11460 | unsigned char *system_name = XSTRING (Vsystem_name)->data; | 11460 | unsigned char *system_name = SDATA (Vsystem_name); |
| 11461 | int system_name_length = strlen (system_name); | 11461 | int system_name_length = strlen (system_name); |
| 11462 | int length_until_period = 0; | 11462 | int length_until_period = 0; |
| 11463 | 11463 | ||
| @@ -12968,7 +12968,7 @@ same_x_server (name1, name2) | |||
| 12968 | char *name1, *name2; | 12968 | char *name1, *name2; |
| 12969 | { | 12969 | { |
| 12970 | int seen_colon = 0; | 12970 | int seen_colon = 0; |
| 12971 | unsigned char *system_name = XSTRING (Vsystem_name)->data; | 12971 | unsigned char *system_name = SDATA (Vsystem_name); |
| 12972 | int system_name_length = strlen (system_name); | 12972 | int system_name_length = strlen (system_name); |
| 12973 | int length_until_period = 0; | 12973 | int length_until_period = 0; |
| 12974 | 12974 | ||
| @@ -13026,11 +13026,11 @@ mac_initialize_display_info () | |||
| 13026 | 13026 | ||
| 13027 | #if 0 | 13027 | #if 0 |
| 13028 | dpyinfo->mac_id_name | 13028 | dpyinfo->mac_id_name |
| 13029 | = (char *) xmalloc (XSTRING (Vinvocation_name)->size | 13029 | = (char *) xmalloc (SCHARS (Vinvocation_name) |
| 13030 | + XSTRING (Vsystem_name)->size | 13030 | + SCHARS (Vsystem_name) |
| 13031 | + 2); | 13031 | + 2); |
| 13032 | sprintf (dpyinfo->mac_id_name, "%s@%s", | 13032 | sprintf (dpyinfo->mac_id_name, "%s@%s", |
| 13033 | XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data); | 13033 | SDATA (Vinvocation_name), SDATA (Vsystem_name)); |
| 13034 | #else | 13034 | #else |
| 13035 | dpyinfo->mac_id_name = (char *) xmalloc (strlen ("Mac Display") + 1); | 13035 | dpyinfo->mac_id_name = (char *) xmalloc (strlen ("Mac Display") + 1); |
| 13036 | strcpy (dpyinfo->mac_id_name, "Mac Display"); | 13036 | strcpy (dpyinfo->mac_id_name, "Mac Display"); |
diff --git a/src/minibuf.c b/src/minibuf.c index 00380392efe..87cdcea4522 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -233,21 +233,21 @@ string_to_object (val, defalt) | |||
| 233 | 233 | ||
| 234 | GCPRO2 (val, defalt); | 234 | GCPRO2 (val, defalt); |
| 235 | 235 | ||
| 236 | if (STRINGP (val) && XSTRING (val)->size == 0 | 236 | if (STRINGP (val) && SCHARS (val) == 0 |
| 237 | && STRINGP (defalt)) | 237 | && STRINGP (defalt)) |
| 238 | val = defalt; | 238 | val = defalt; |
| 239 | 239 | ||
| 240 | expr_and_pos = Fread_from_string (val, Qnil, Qnil); | 240 | expr_and_pos = Fread_from_string (val, Qnil, Qnil); |
| 241 | pos = XINT (Fcdr (expr_and_pos)); | 241 | pos = XINT (Fcdr (expr_and_pos)); |
| 242 | if (pos != XSTRING (val)->size) | 242 | if (pos != SCHARS (val)) |
| 243 | { | 243 | { |
| 244 | /* Ignore trailing whitespace; any other trailing junk | 244 | /* Ignore trailing whitespace; any other trailing junk |
| 245 | is an error. */ | 245 | is an error. */ |
| 246 | int i; | 246 | int i; |
| 247 | pos = string_char_to_byte (val, pos); | 247 | pos = string_char_to_byte (val, pos); |
| 248 | for (i = pos; i < STRING_BYTES (XSTRING (val)); i++) | 248 | for (i = pos; i < SBYTES (val); i++) |
| 249 | { | 249 | { |
| 250 | int c = XSTRING (val)->data[i]; | 250 | int c = SREF (val, i); |
| 251 | if (c != ' ' && c != '\t' && c != '\n') | 251 | if (c != ' ' && c != '\t' && c != '\n') |
| 252 | error ("Trailing garbage following expression"); | 252 | error ("Trailing garbage following expression"); |
| 253 | } | 253 | } |
| @@ -280,7 +280,7 @@ read_minibuf_noninteractive (map, initial, prompt, backup_n, expflag, | |||
| 280 | char *line, *s; | 280 | char *line, *s; |
| 281 | Lisp_Object val; | 281 | Lisp_Object val; |
| 282 | 282 | ||
| 283 | fprintf (stdout, "%s", XSTRING (prompt)->data); | 283 | fprintf (stdout, "%s", SDATA (prompt)); |
| 284 | fflush (stdout); | 284 | fflush (stdout); |
| 285 | 285 | ||
| 286 | val = Qnil; | 286 | val = Qnil; |
| @@ -648,7 +648,7 @@ read_minibuf (map, initial, prompt, backup_n, expflag, | |||
| 648 | last_minibuf_string = val; | 648 | last_minibuf_string = val; |
| 649 | 649 | ||
| 650 | /* Add the value to the appropriate history list unless it is empty. */ | 650 | /* Add the value to the appropriate history list unless it is empty. */ |
| 651 | if (XSTRING (val)->size != 0 | 651 | if (SCHARS (val) != 0 |
| 652 | && SYMBOLP (Vminibuffer_history_variable)) | 652 | && SYMBOLP (Vminibuffer_history_variable)) |
| 653 | { | 653 | { |
| 654 | /* If the caller wanted to save the value read on a history list, | 654 | /* If the caller wanted to save the value read on a history list, |
| @@ -868,9 +868,9 @@ If the variable `minibuffer-allow-text-properties' is non-nil, | |||
| 868 | /* Convert to distance from end of input. */ | 868 | /* Convert to distance from end of input. */ |
| 869 | if (XINT (position) < 1) | 869 | if (XINT (position) < 1) |
| 870 | /* A number too small means the beginning of the string. */ | 870 | /* A number too small means the beginning of the string. */ |
| 871 | pos = - XSTRING (initial_contents)->size; | 871 | pos = - SCHARS (initial_contents); |
| 872 | else | 872 | else |
| 873 | pos = XINT (position) - 1 - XSTRING (initial_contents)->size; | 873 | pos = XINT (position) - 1 - SCHARS (initial_contents); |
| 874 | } | 874 | } |
| 875 | } | 875 | } |
| 876 | 876 | ||
| @@ -950,7 +950,7 @@ Fifth arg INHERIT-INPUT-METHOD, if non-nil, means the minibuffer inherits | |||
| 950 | val = Fread_from_minibuffer (prompt, initial_input, Qnil, | 950 | val = Fread_from_minibuffer (prompt, initial_input, Qnil, |
| 951 | Qnil, history, default_value, | 951 | Qnil, history, default_value, |
| 952 | inherit_input_method); | 952 | inherit_input_method); |
| 953 | if (STRINGP (val) && XSTRING (val)->size == 0 && ! NILP (default_value)) | 953 | if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (default_value)) |
| 954 | val = default_value; | 954 | val = default_value; |
| 955 | return val; | 955 | return val; |
| 956 | } | 956 | } |
| @@ -1185,9 +1185,9 @@ is used to further constrain the set of candidates. */) | |||
| 1185 | /* Is this element a possible completion? */ | 1185 | /* Is this element a possible completion? */ |
| 1186 | 1186 | ||
| 1187 | if (STRINGP (eltstring) | 1187 | if (STRINGP (eltstring) |
| 1188 | && XSTRING (string)->size <= XSTRING (eltstring)->size | 1188 | && SCHARS (string) <= SCHARS (eltstring) |
| 1189 | && (tem = Fcompare_strings (eltstring, make_number (0), | 1189 | && (tem = Fcompare_strings (eltstring, make_number (0), |
| 1190 | make_number (XSTRING (string)->size), | 1190 | make_number (SCHARS (string)), |
| 1191 | string, make_number (0), Qnil, | 1191 | string, make_number (0), Qnil, |
| 1192 | completion_ignore_case ?Qt : Qnil), | 1192 | completion_ignore_case ?Qt : Qnil), |
| 1193 | EQ (Qt, tem))) | 1193 | EQ (Qt, tem))) |
| @@ -1233,11 +1233,11 @@ is used to further constrain the set of candidates. */) | |||
| 1233 | { | 1233 | { |
| 1234 | matchcount = 1; | 1234 | matchcount = 1; |
| 1235 | bestmatch = eltstring; | 1235 | bestmatch = eltstring; |
| 1236 | bestmatchsize = XSTRING (eltstring)->size; | 1236 | bestmatchsize = SCHARS (eltstring); |
| 1237 | } | 1237 | } |
| 1238 | else | 1238 | else |
| 1239 | { | 1239 | { |
| 1240 | compare = min (bestmatchsize, XSTRING (eltstring)->size); | 1240 | compare = min (bestmatchsize, SCHARS (eltstring)); |
| 1241 | tem = Fcompare_strings (bestmatch, make_number (0), | 1241 | tem = Fcompare_strings (bestmatch, make_number (0), |
| 1242 | make_number (compare), | 1242 | make_number (compare), |
| 1243 | eltstring, make_number (0), | 1243 | eltstring, make_number (0), |
| @@ -1259,8 +1259,8 @@ is used to further constrain the set of candidates. */) | |||
| 1259 | use it as the best match rather than one that is not an | 1259 | use it as the best match rather than one that is not an |
| 1260 | exact match. This way, we get the case pattern | 1260 | exact match. This way, we get the case pattern |
| 1261 | of the actual match. */ | 1261 | of the actual match. */ |
| 1262 | if ((matchsize == XSTRING (eltstring)->size | 1262 | if ((matchsize == SCHARS (eltstring) |
| 1263 | && matchsize < XSTRING (bestmatch)->size) | 1263 | && matchsize < SCHARS (bestmatch)) |
| 1264 | || | 1264 | || |
| 1265 | /* If there is more than one exact match ignoring case, | 1265 | /* If there is more than one exact match ignoring case, |
| 1266 | and one of them is exact including case, | 1266 | and one of them is exact including case, |
| @@ -1268,29 +1268,29 @@ is used to further constrain the set of candidates. */) | |||
| 1268 | /* If there is no exact match ignoring case, | 1268 | /* If there is no exact match ignoring case, |
| 1269 | prefer a match that does not change the case | 1269 | prefer a match that does not change the case |
| 1270 | of the input. */ | 1270 | of the input. */ |
| 1271 | ((matchsize == XSTRING (eltstring)->size) | 1271 | ((matchsize == SCHARS (eltstring)) |
| 1272 | == | 1272 | == |
| 1273 | (matchsize == XSTRING (bestmatch)->size) | 1273 | (matchsize == SCHARS (bestmatch)) |
| 1274 | && (tem = Fcompare_strings (eltstring, make_number (0), | 1274 | && (tem = Fcompare_strings (eltstring, make_number (0), |
| 1275 | make_number (XSTRING (string)->size), | 1275 | make_number (SCHARS (string)), |
| 1276 | string, make_number (0), | 1276 | string, make_number (0), |
| 1277 | Qnil, | 1277 | Qnil, |
| 1278 | Qnil), | 1278 | Qnil), |
| 1279 | EQ (Qt, tem)) | 1279 | EQ (Qt, tem)) |
| 1280 | && (tem = Fcompare_strings (bestmatch, make_number (0), | 1280 | && (tem = Fcompare_strings (bestmatch, make_number (0), |
| 1281 | make_number (XSTRING (string)->size), | 1281 | make_number (SCHARS (string)), |
| 1282 | string, make_number (0), | 1282 | string, make_number (0), |
| 1283 | Qnil, | 1283 | Qnil, |
| 1284 | Qnil), | 1284 | Qnil), |
| 1285 | ! EQ (Qt, tem)))) | 1285 | ! EQ (Qt, tem)))) |
| 1286 | bestmatch = eltstring; | 1286 | bestmatch = eltstring; |
| 1287 | } | 1287 | } |
| 1288 | if (bestmatchsize != XSTRING (eltstring)->size | 1288 | if (bestmatchsize != SCHARS (eltstring) |
| 1289 | || bestmatchsize != matchsize) | 1289 | || bestmatchsize != matchsize) |
| 1290 | /* Don't count the same string multiple times. */ | 1290 | /* Don't count the same string multiple times. */ |
| 1291 | matchcount++; | 1291 | matchcount++; |
| 1292 | bestmatchsize = matchsize; | 1292 | bestmatchsize = matchsize; |
| 1293 | if (matchsize <= XSTRING (string)->size | 1293 | if (matchsize <= SCHARS (string) |
| 1294 | && matchcount > 1) | 1294 | && matchcount > 1) |
| 1295 | /* No need to look any further. */ | 1295 | /* No need to look any further. */ |
| 1296 | break; | 1296 | break; |
| @@ -1303,13 +1303,13 @@ is used to further constrain the set of candidates. */) | |||
| 1303 | /* If we are ignoring case, and there is no exact match, | 1303 | /* If we are ignoring case, and there is no exact match, |
| 1304 | and no additional text was supplied, | 1304 | and no additional text was supplied, |
| 1305 | don't change the case of what the user typed. */ | 1305 | don't change the case of what the user typed. */ |
| 1306 | if (completion_ignore_case && bestmatchsize == XSTRING (string)->size | 1306 | if (completion_ignore_case && bestmatchsize == SCHARS (string) |
| 1307 | && XSTRING (bestmatch)->size > bestmatchsize) | 1307 | && SCHARS (bestmatch) > bestmatchsize) |
| 1308 | return minibuf_conform_representation (string, bestmatch); | 1308 | return minibuf_conform_representation (string, bestmatch); |
| 1309 | 1309 | ||
| 1310 | /* Return t if the supplied string is an exact match (counting case); | 1310 | /* Return t if the supplied string is an exact match (counting case); |
| 1311 | it does not require any change to be made. */ | 1311 | it does not require any change to be made. */ |
| 1312 | if (matchcount == 1 && bestmatchsize == XSTRING (string)->size | 1312 | if (matchcount == 1 && bestmatchsize == SCHARS (string) |
| 1313 | && (tem = Fcompare_strings (bestmatch, make_number (0), | 1313 | && (tem = Fcompare_strings (bestmatch, make_number (0), |
| 1314 | make_number (bestmatchsize), | 1314 | make_number (bestmatchsize), |
| 1315 | string, make_number (0), | 1315 | string, make_number (0), |
| @@ -1423,17 +1423,17 @@ are ignored unless STRING itself starts with a space. */) | |||
| 1423 | /* Is this element a possible completion? */ | 1423 | /* Is this element a possible completion? */ |
| 1424 | 1424 | ||
| 1425 | if (STRINGP (eltstring) | 1425 | if (STRINGP (eltstring) |
| 1426 | && XSTRING (string)->size <= XSTRING (eltstring)->size | 1426 | && SCHARS (string) <= SCHARS (eltstring) |
| 1427 | /* If HIDE_SPACES, reject alternatives that start with space | 1427 | /* If HIDE_SPACES, reject alternatives that start with space |
| 1428 | unless the input starts with space. */ | 1428 | unless the input starts with space. */ |
| 1429 | && ((STRING_BYTES (XSTRING (string)) > 0 | 1429 | && ((SBYTES (string) > 0 |
| 1430 | && XSTRING (string)->data[0] == ' ') | 1430 | && SREF (string, 0) == ' ') |
| 1431 | || XSTRING (eltstring)->data[0] != ' ' | 1431 | || SREF (eltstring, 0) != ' ' |
| 1432 | || NILP (hide_spaces)) | 1432 | || NILP (hide_spaces)) |
| 1433 | && (tem = Fcompare_strings (eltstring, make_number (0), | 1433 | && (tem = Fcompare_strings (eltstring, make_number (0), |
| 1434 | make_number (XSTRING (string)->size), | 1434 | make_number (SCHARS (string)), |
| 1435 | string, make_number (0), | 1435 | string, make_number (0), |
| 1436 | make_number (XSTRING (string)->size), | 1436 | make_number (SCHARS (string)), |
| 1437 | completion_ignore_case ? Qt : Qnil), | 1437 | completion_ignore_case ? Qt : Qnil), |
| 1438 | EQ (Qt, tem))) | 1438 | EQ (Qt, tem))) |
| 1439 | { | 1439 | { |
| @@ -1553,7 +1553,7 @@ Completion ignores case if the ambient value of | |||
| 1553 | { | 1553 | { |
| 1554 | CHECK_NUMBER (position); | 1554 | CHECK_NUMBER (position); |
| 1555 | /* Convert to distance from end of input. */ | 1555 | /* Convert to distance from end of input. */ |
| 1556 | pos = XINT (position) - XSTRING (init)->size; | 1556 | pos = XINT (position) - SCHARS (init); |
| 1557 | } | 1557 | } |
| 1558 | } | 1558 | } |
| 1559 | 1559 | ||
| @@ -1579,7 +1579,7 @@ Completion ignores case if the ambient value of | |||
| 1579 | histvar, histpos, def, 0, | 1579 | histvar, histpos, def, 0, |
| 1580 | !NILP (inherit_input_method)); | 1580 | !NILP (inherit_input_method)); |
| 1581 | 1581 | ||
| 1582 | if (STRINGP (val) && XSTRING (val)->size == 0 && ! NILP (def)) | 1582 | if (STRINGP (val) && SCHARS (val) == 0 && ! NILP (def)) |
| 1583 | val = def; | 1583 | val = def; |
| 1584 | 1584 | ||
| 1585 | RETURN_UNGCPRO (unbind_to (count, val)); | 1585 | RETURN_UNGCPRO (unbind_to (count, val)); |
| @@ -1613,9 +1613,9 @@ the values STRING, PREDICATE and `lambda'. */) | |||
| 1613 | { | 1613 | { |
| 1614 | /* Bypass intern-soft as that loses for nil. */ | 1614 | /* Bypass intern-soft as that loses for nil. */ |
| 1615 | tem = oblookup (alist, | 1615 | tem = oblookup (alist, |
| 1616 | XSTRING (string)->data, | 1616 | SDATA (string), |
| 1617 | XSTRING (string)->size, | 1617 | SCHARS (string), |
| 1618 | STRING_BYTES (XSTRING (string))); | 1618 | SBYTES (string)); |
| 1619 | if (!SYMBOLP (tem)) | 1619 | if (!SYMBOLP (tem)) |
| 1620 | { | 1620 | { |
| 1621 | if (STRING_MULTIBYTE (string)) | 1621 | if (STRING_MULTIBYTE (string)) |
| @@ -1624,9 +1624,9 @@ the values STRING, PREDICATE and `lambda'. */) | |||
| 1624 | string = Fstring_make_multibyte (string); | 1624 | string = Fstring_make_multibyte (string); |
| 1625 | 1625 | ||
| 1626 | tem = oblookup (Vminibuffer_completion_table, | 1626 | tem = oblookup (Vminibuffer_completion_table, |
| 1627 | XSTRING (string)->data, | 1627 | SDATA (string), |
| 1628 | XSTRING (string)->size, | 1628 | SCHARS (string), |
| 1629 | STRING_BYTES (XSTRING (string))); | 1629 | SBYTES (string)); |
| 1630 | if (!SYMBOLP (tem)) | 1630 | if (!SYMBOLP (tem)) |
| 1631 | return Qnil; | 1631 | return Qnil; |
| 1632 | } | 1632 | } |
| @@ -1716,7 +1716,7 @@ do_completion () | |||
| 1716 | /* Some completion happened */ | 1716 | /* Some completion happened */ |
| 1717 | 1717 | ||
| 1718 | if (! NILP (Vminibuffer_completing_file_name) | 1718 | if (! NILP (Vminibuffer_completing_file_name) |
| 1719 | && XSTRING (completion)->data[STRING_BYTES (XSTRING (completion)) - 1] == '/' | 1719 | && SREF (completion, SBYTES (completion) - 1) == '/' |
| 1720 | && PT < ZV | 1720 | && PT < ZV |
| 1721 | && FETCH_CHAR (PT_BYTE) == '/') | 1721 | && FETCH_CHAR (PT_BYTE) == '/') |
| 1722 | { | 1722 | { |
| @@ -1963,9 +1963,9 @@ Return nil if there is no valid completion, else t. */) | |||
| 1963 | 1963 | ||
| 1964 | #if 0 /* How the below code used to look, for reference. */ | 1964 | #if 0 /* How the below code used to look, for reference. */ |
| 1965 | tem = Fminibuffer_contents (); | 1965 | tem = Fminibuffer_contents (); |
| 1966 | b = XSTRING (tem)->data; | 1966 | b = SDATA (tem); |
| 1967 | i = ZV - 1 - XSTRING (completion)->size; | 1967 | i = ZV - 1 - SCHARS (completion); |
| 1968 | p = XSTRING (completion)->data; | 1968 | p = SDATA (completion); |
| 1969 | if (i > 0 || | 1969 | if (i > 0 || |
| 1970 | 0 <= scmp (b, p, ZV - 1)) | 1970 | 0 <= scmp (b, p, ZV - 1)) |
| 1971 | { | 1971 | { |
| @@ -1996,8 +1996,8 @@ Return nil if there is no valid completion, else t. */) | |||
| 1996 | Finsert (1, &tem); | 1996 | Finsert (1, &tem); |
| 1997 | } | 1997 | } |
| 1998 | } | 1998 | } |
| 1999 | buffer_nchars = XSTRING (tem)->size; /* # chars in what we completed. */ | 1999 | buffer_nchars = SCHARS (tem); /* # chars in what we completed. */ |
| 2000 | completion_nchars = XSTRING (completion)->size; | 2000 | completion_nchars = SCHARS (completion); |
| 2001 | i = buffer_nchars - completion_nchars; | 2001 | i = buffer_nchars - completion_nchars; |
| 2002 | if (i > 0 | 2002 | if (i > 0 |
| 2003 | || | 2003 | || |
| @@ -2042,7 +2042,7 @@ Return nil if there is no valid completion, else t. */) | |||
| 2042 | 2042 | ||
| 2043 | /* If completion finds next char not unique, | 2043 | /* If completion finds next char not unique, |
| 2044 | consider adding a space or a hyphen. */ | 2044 | consider adding a space or a hyphen. */ |
| 2045 | if (i == XSTRING (completion)->size) | 2045 | if (i == SCHARS (completion)) |
| 2046 | { | 2046 | { |
| 2047 | GCPRO1 (completion); | 2047 | GCPRO1 (completion); |
| 2048 | tem = Ftry_completion (concat2 (minibuffer_completion_contents (), | 2048 | tem = Ftry_completion (concat2 (minibuffer_completion_contents (), |
| @@ -2072,9 +2072,9 @@ Return nil if there is no valid completion, else t. */) | |||
| 2072 | i gets index in string of where to stop completing. */ | 2072 | i gets index in string of where to stop completing. */ |
| 2073 | { | 2073 | { |
| 2074 | int len, c; | 2074 | int len, c; |
| 2075 | int bytes = STRING_BYTES (XSTRING (completion)); | 2075 | int bytes = SBYTES (completion); |
| 2076 | completion_string = XSTRING (completion)->data; | 2076 | completion_string = SDATA (completion); |
| 2077 | for (; i_byte < STRING_BYTES (XSTRING (completion)); i_byte += len, i++) | 2077 | for (; i_byte < SBYTES (completion); i_byte += len, i++) |
| 2078 | { | 2078 | { |
| 2079 | c = STRING_CHAR_AND_LENGTH (completion_string + i_byte, | 2079 | c = STRING_CHAR_AND_LENGTH (completion_string + i_byte, |
| 2080 | bytes - i_byte, | 2080 | bytes - i_byte, |
| @@ -2100,7 +2100,7 @@ Return nil if there is no valid completion, else t. */) | |||
| 2100 | /* Otherwise insert in minibuffer the chars we got */ | 2100 | /* Otherwise insert in minibuffer the chars we got */ |
| 2101 | 2101 | ||
| 2102 | if (! NILP (Vminibuffer_completing_file_name) | 2102 | if (! NILP (Vminibuffer_completing_file_name) |
| 2103 | && XSTRING (completion)->data[STRING_BYTES (XSTRING (completion)) - 1] == '/' | 2103 | && SREF (completion, SBYTES (completion) - 1) == '/' |
| 2104 | && PT < ZV | 2104 | && PT < ZV |
| 2105 | && FETCH_CHAR (PT_BYTE) == '/') | 2105 | && FETCH_CHAR (PT_BYTE) == '/') |
| 2106 | { | 2106 | { |
| @@ -2163,16 +2163,16 @@ It can find the completion buffer in `standard-output'. */) | |||
| 2163 | { | 2163 | { |
| 2164 | tem = XCAR (elt); | 2164 | tem = XCAR (elt); |
| 2165 | CHECK_STRING (tem); | 2165 | CHECK_STRING (tem); |
| 2166 | length = XSTRING (tem)->size; | 2166 | length = SCHARS (tem); |
| 2167 | 2167 | ||
| 2168 | tem = Fcar (XCDR (elt)); | 2168 | tem = Fcar (XCDR (elt)); |
| 2169 | CHECK_STRING (tem); | 2169 | CHECK_STRING (tem); |
| 2170 | length += XSTRING (tem)->size; | 2170 | length += SCHARS (tem); |
| 2171 | } | 2171 | } |
| 2172 | else | 2172 | else |
| 2173 | { | 2173 | { |
| 2174 | CHECK_STRING (elt); | 2174 | CHECK_STRING (elt); |
| 2175 | length = XSTRING (elt)->size; | 2175 | length = SCHARS (elt); |
| 2176 | } | 2176 | } |
| 2177 | 2177 | ||
| 2178 | /* This does a bad job for narrower than usual windows. | 2178 | /* This does a bad job for narrower than usual windows. |
| @@ -2400,7 +2400,7 @@ or until the next input event arrives, whichever comes first. */) | |||
| 2400 | (string) | 2400 | (string) |
| 2401 | Lisp_Object string; | 2401 | Lisp_Object string; |
| 2402 | { | 2402 | { |
| 2403 | temp_echo_area_glyphs (XSTRING (string)->data); | 2403 | temp_echo_area_glyphs (SDATA (string)); |
| 2404 | return Qnil; | 2404 | return Qnil; |
| 2405 | } | 2405 | } |
| 2406 | 2406 | ||
diff --git a/src/msdos.c b/src/msdos.c index 5f261937008..b3cf0e9f345 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -1454,9 +1454,9 @@ IT_note_mode_line_highlight (struct window *w, int x, int mode_line_p) | |||
| 1454 | end = glyph + row->used[TEXT_AREA]; | 1454 | end = glyph + row->used[TEXT_AREA]; |
| 1455 | if (glyph < end | 1455 | if (glyph < end |
| 1456 | && STRINGP (glyph->object) | 1456 | && STRINGP (glyph->object) |
| 1457 | && XSTRING (glyph->object)->intervals | 1457 | && STRING_INTERVALS (glyph->object) |
| 1458 | && glyph->charpos >= 0 | 1458 | && glyph->charpos >= 0 |
| 1459 | && glyph->charpos < XSTRING (glyph->object)->size) | 1459 | && glyph->charpos < SCHARS (glyph->object)) |
| 1460 | { | 1460 | { |
| 1461 | /* If we're on a string with `help-echo' text property, | 1461 | /* If we're on a string with `help-echo' text property, |
| 1462 | arrange for the help to be displayed. This is done by | 1462 | arrange for the help to be displayed. This is done by |
| @@ -1738,7 +1738,7 @@ IT_note_mouse_highlight (struct frame *f, int x, int y) | |||
| 1738 | else if (NILP (help) | 1738 | else if (NILP (help) |
| 1739 | && ((STRINGP (glyph->object) | 1739 | && ((STRINGP (glyph->object) |
| 1740 | && glyph->charpos >= 0 | 1740 | && glyph->charpos >= 0 |
| 1741 | && glyph->charpos < XSTRING (glyph->object)->size) | 1741 | && glyph->charpos < SCHARS (glyph->object)) |
| 1742 | || (BUFFERP (glyph->object) | 1742 | || (BUFFERP (glyph->object) |
| 1743 | && glyph->charpos >= BEGV | 1743 | && glyph->charpos >= BEGV |
| 1744 | && glyph->charpos < ZV))) | 1744 | && glyph->charpos < ZV))) |
| @@ -2454,7 +2454,7 @@ IT_set_frame_parameters (f, alist) | |||
| 2454 | { | 2454 | { |
| 2455 | x_set_title (f, val); | 2455 | x_set_title (f, val); |
| 2456 | if (termscript) | 2456 | if (termscript) |
| 2457 | fprintf (termscript, "<TITLE: %s>\n", XSTRING (val)->data); | 2457 | fprintf (termscript, "<TITLE: %s>\n", SDATA (val)); |
| 2458 | } | 2458 | } |
| 2459 | else if (EQ (prop, Qcursor_type)) | 2459 | else if (EQ (prop, Qcursor_type)) |
| 2460 | { | 2460 | { |
| @@ -4405,7 +4405,7 @@ The argument object is never altered--the value is a copy. */) | |||
| 4405 | return Qnil; | 4405 | return Qnil; |
| 4406 | 4406 | ||
| 4407 | tem = Fcopy_sequence (filename); | 4407 | tem = Fcopy_sequence (filename); |
| 4408 | msdos_downcase_filename (XSTRING (tem)->data); | 4408 | msdos_downcase_filename (SDATA (tem)); |
| 4409 | return tem; | 4409 | return tem; |
| 4410 | } | 4410 | } |
| 4411 | 4411 | ||
diff --git a/src/print.c b/src/print.c index 1a68eaa9942..dbbeec97b4e 100644 --- a/src/print.c +++ b/src/print.c | |||
| @@ -290,7 +290,7 @@ static Lisp_Object | |||
| 290 | print_unwind (saved_text) | 290 | print_unwind (saved_text) |
| 291 | Lisp_Object saved_text; | 291 | Lisp_Object saved_text; |
| 292 | { | 292 | { |
| 293 | bcopy (XSTRING (saved_text)->data, print_buffer, XSTRING (saved_text)->size); | 293 | bcopy (SDATA (saved_text), print_buffer, SCHARS (saved_text)); |
| 294 | return Qnil; | 294 | return Qnil; |
| 295 | } | 295 | } |
| 296 | 296 | ||
| @@ -461,7 +461,7 @@ print_string (string, printcharfun) | |||
| 461 | int chars; | 461 | int chars; |
| 462 | 462 | ||
| 463 | if (STRING_MULTIBYTE (string)) | 463 | if (STRING_MULTIBYTE (string)) |
| 464 | chars = XSTRING (string)->size; | 464 | chars = SCHARS (string); |
| 465 | else if (EQ (printcharfun, Qt) | 465 | else if (EQ (printcharfun, Qt) |
| 466 | ? ! NILP (buffer_defaults.enable_multibyte_characters) | 466 | ? ! NILP (buffer_defaults.enable_multibyte_characters) |
| 467 | : ! NILP (current_buffer->enable_multibyte_characters)) | 467 | : ! NILP (current_buffer->enable_multibyte_characters)) |
| @@ -472,22 +472,22 @@ print_string (string, printcharfun) | |||
| 472 | Lisp_Object newstr; | 472 | Lisp_Object newstr; |
| 473 | int bytes; | 473 | int bytes; |
| 474 | 474 | ||
| 475 | chars = STRING_BYTES (XSTRING (string)); | 475 | chars = SBYTES (string); |
| 476 | bytes = parse_str_to_multibyte (XSTRING (string)->data, chars); | 476 | bytes = parse_str_to_multibyte (SDATA (string), chars); |
| 477 | if (chars < bytes) | 477 | if (chars < bytes) |
| 478 | { | 478 | { |
| 479 | newstr = make_uninit_multibyte_string (chars, bytes); | 479 | newstr = make_uninit_multibyte_string (chars, bytes); |
| 480 | bcopy (XSTRING (string)->data, XSTRING (newstr)->data, chars); | 480 | bcopy (SDATA (string), SDATA (newstr), chars); |
| 481 | str_to_multibyte (XSTRING (newstr)->data, bytes, chars); | 481 | str_to_multibyte (SDATA (newstr), bytes, chars); |
| 482 | string = newstr; | 482 | string = newstr; |
| 483 | } | 483 | } |
| 484 | } | 484 | } |
| 485 | else | 485 | else |
| 486 | chars = STRING_BYTES (XSTRING (string)); | 486 | chars = SBYTES (string); |
| 487 | 487 | ||
| 488 | /* strout is safe for output to a frame (echo area) or to print_buffer. */ | 488 | /* strout is safe for output to a frame (echo area) or to print_buffer. */ |
| 489 | strout (XSTRING (string)->data, | 489 | strout (SDATA (string), |
| 490 | chars, STRING_BYTES (XSTRING (string)), | 490 | chars, SBYTES (string), |
| 491 | printcharfun, STRING_MULTIBYTE (string)); | 491 | printcharfun, STRING_MULTIBYTE (string)); |
| 492 | } | 492 | } |
| 493 | else | 493 | else |
| @@ -495,24 +495,24 @@ print_string (string, printcharfun) | |||
| 495 | /* Otherwise, string may be relocated by printing one char. | 495 | /* Otherwise, string may be relocated by printing one char. |
| 496 | So re-fetch the string address for each character. */ | 496 | So re-fetch the string address for each character. */ |
| 497 | int i; | 497 | int i; |
| 498 | int size = XSTRING (string)->size; | 498 | int size = SCHARS (string); |
| 499 | int size_byte = STRING_BYTES (XSTRING (string)); | 499 | int size_byte = SBYTES (string); |
| 500 | struct gcpro gcpro1; | 500 | struct gcpro gcpro1; |
| 501 | GCPRO1 (string); | 501 | GCPRO1 (string); |
| 502 | if (size == size_byte) | 502 | if (size == size_byte) |
| 503 | for (i = 0; i < size; i++) | 503 | for (i = 0; i < size; i++) |
| 504 | PRINTCHAR (XSTRING (string)->data[i]); | 504 | PRINTCHAR (SREF (string, i)); |
| 505 | else | 505 | else |
| 506 | for (i = 0; i < size_byte; i++) | 506 | for (i = 0; i < size_byte; i++) |
| 507 | { | 507 | { |
| 508 | /* Here, we must convert each multi-byte form to the | 508 | /* Here, we must convert each multi-byte form to the |
| 509 | corresponding character code before handing it to PRINTCHAR. */ | 509 | corresponding character code before handing it to PRINTCHAR. */ |
| 510 | int len; | 510 | int len; |
| 511 | int ch = STRING_CHAR_AND_LENGTH (XSTRING (string)->data + i, | 511 | int ch = STRING_CHAR_AND_LENGTH (SDATA (string) + i, |
| 512 | size_byte - i, len); | 512 | size_byte - i, len); |
| 513 | if (!CHAR_VALID_P (ch, 0)) | 513 | if (!CHAR_VALID_P (ch, 0)) |
| 514 | { | 514 | { |
| 515 | ch = XSTRING (string)->data[i]; | 515 | ch = SREF (string, i); |
| 516 | len = 1; | 516 | len = 1; |
| 517 | } | 517 | } |
| 518 | PRINTCHAR (ch); | 518 | PRINTCHAR (ch); |
| @@ -664,7 +664,7 @@ usage: (with-output-to-temp-buffer BUFFNAME BODY ...) */) | |||
| 664 | GCPRO1(args); | 664 | GCPRO1(args); |
| 665 | name = Feval (Fcar (args)); | 665 | name = Feval (Fcar (args)); |
| 666 | CHECK_STRING (name); | 666 | CHECK_STRING (name); |
| 667 | temp_output_buffer_setup (XSTRING (name)->data); | 667 | temp_output_buffer_setup (SDATA (name)); |
| 668 | buf = Vstandard_output; | 668 | buf = Vstandard_output; |
| 669 | UNGCPRO; | 669 | UNGCPRO; |
| 670 | 670 | ||
| @@ -1074,7 +1074,7 @@ float_to_string (buf, data) | |||
| 1074 | /* Check that the spec we have is fully valid. | 1074 | /* Check that the spec we have is fully valid. |
| 1075 | This means not only valid for printf, | 1075 | This means not only valid for printf, |
| 1076 | but meant for floats, and reasonable. */ | 1076 | but meant for floats, and reasonable. */ |
| 1077 | cp = XSTRING (Vfloat_output_format)->data; | 1077 | cp = SDATA (Vfloat_output_format); |
| 1078 | 1078 | ||
| 1079 | if (cp[0] != '%') | 1079 | if (cp[0] != '%') |
| 1080 | goto lose; | 1080 | goto lose; |
| @@ -1104,7 +1104,7 @@ float_to_string (buf, data) | |||
| 1104 | if (cp[1] != 0) | 1104 | if (cp[1] != 0) |
| 1105 | goto lose; | 1105 | goto lose; |
| 1106 | 1106 | ||
| 1107 | sprintf (buf, XSTRING (Vfloat_output_format)->data, data); | 1107 | sprintf (buf, SDATA (Vfloat_output_format), data); |
| 1108 | } | 1108 | } |
| 1109 | 1109 | ||
| 1110 | /* Make sure there is a decimal point with digit after, or an | 1110 | /* Make sure there is a decimal point with digit after, or an |
| @@ -1243,7 +1243,7 @@ print_preprocess (obj) | |||
| 1243 | { | 1243 | { |
| 1244 | case Lisp_String: | 1244 | case Lisp_String: |
| 1245 | /* A string may have text properties, which can be circular. */ | 1245 | /* A string may have text properties, which can be circular. */ |
| 1246 | traverse_intervals_noorder (XSTRING (obj)->intervals, | 1246 | traverse_intervals_noorder (STRING_INTERVALS (obj), |
| 1247 | print_preprocess_string, Qnil); | 1247 | print_preprocess_string, Qnil); |
| 1248 | break; | 1248 | break; |
| 1249 | 1249 | ||
| @@ -1379,15 +1379,15 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1379 | 1379 | ||
| 1380 | GCPRO1 (obj); | 1380 | GCPRO1 (obj); |
| 1381 | 1381 | ||
| 1382 | if (!NULL_INTERVAL_P (XSTRING (obj)->intervals)) | 1382 | if (!NULL_INTERVAL_P (STRING_INTERVALS (obj))) |
| 1383 | { | 1383 | { |
| 1384 | PRINTCHAR ('#'); | 1384 | PRINTCHAR ('#'); |
| 1385 | PRINTCHAR ('('); | 1385 | PRINTCHAR ('('); |
| 1386 | } | 1386 | } |
| 1387 | 1387 | ||
| 1388 | PRINTCHAR ('\"'); | 1388 | PRINTCHAR ('\"'); |
| 1389 | str = XSTRING (obj)->data; | 1389 | str = SDATA (obj); |
| 1390 | size_byte = STRING_BYTES (XSTRING (obj)); | 1390 | size_byte = SBYTES (obj); |
| 1391 | 1391 | ||
| 1392 | for (i = 0, i_byte = 0; i_byte < size_byte;) | 1392 | for (i = 0, i_byte = 0; i_byte < size_byte;) |
| 1393 | { | 1393 | { |
| @@ -1467,9 +1467,9 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1467 | } | 1467 | } |
| 1468 | PRINTCHAR ('\"'); | 1468 | PRINTCHAR ('\"'); |
| 1469 | 1469 | ||
| 1470 | if (!NULL_INTERVAL_P (XSTRING (obj)->intervals)) | 1470 | if (!NULL_INTERVAL_P (STRING_INTERVALS (obj))) |
| 1471 | { | 1471 | { |
| 1472 | traverse_intervals (XSTRING (obj)->intervals, | 1472 | traverse_intervals (STRING_INTERVALS (obj), |
| 1473 | 0, print_interval, printcharfun); | 1473 | 0, print_interval, printcharfun); |
| 1474 | PRINTCHAR (')'); | 1474 | PRINTCHAR (')'); |
| 1475 | } | 1475 | } |
| @@ -1481,8 +1481,8 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1481 | case Lisp_Symbol: | 1481 | case Lisp_Symbol: |
| 1482 | { | 1482 | { |
| 1483 | register int confusing; | 1483 | register int confusing; |
| 1484 | register unsigned char *p = XSTRING (SYMBOL_NAME (obj))->data; | 1484 | register unsigned char *p = SDATA (SYMBOL_NAME (obj)); |
| 1485 | register unsigned char *end = p + STRING_BYTES (XSTRING (SYMBOL_NAME (obj))); | 1485 | register unsigned char *end = p + SBYTES (SYMBOL_NAME (obj)); |
| 1486 | register int c; | 1486 | register int c; |
| 1487 | int i, i_byte, size_byte; | 1487 | int i, i_byte, size_byte; |
| 1488 | Lisp_Object name; | 1488 | Lisp_Object name; |
| @@ -1517,7 +1517,7 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1517 | PRINTCHAR (':'); | 1517 | PRINTCHAR (':'); |
| 1518 | } | 1518 | } |
| 1519 | 1519 | ||
| 1520 | size_byte = STRING_BYTES (XSTRING (name)); | 1520 | size_byte = SBYTES (name); |
| 1521 | 1521 | ||
| 1522 | for (i = 0, i_byte = 0; i_byte < size_byte;) | 1522 | for (i = 0, i_byte = 0; i_byte < size_byte;) |
| 1523 | { | 1523 | { |
| @@ -1735,9 +1735,9 @@ print_object (obj, printcharfun, escapeflag) | |||
| 1735 | { | 1735 | { |
| 1736 | PRINTCHAR (' '); | 1736 | PRINTCHAR (' '); |
| 1737 | PRINTCHAR ('\''); | 1737 | PRINTCHAR ('\''); |
| 1738 | strout (XSTRING (SYMBOL_NAME (h->test))->data, -1, -1, printcharfun, 0); | 1738 | strout (SDATA (SYMBOL_NAME (h->test)), -1, -1, printcharfun, 0); |
| 1739 | PRINTCHAR (' '); | 1739 | PRINTCHAR (' '); |
| 1740 | strout (XSTRING (SYMBOL_NAME (h->weak))->data, -1, -1, printcharfun, 0); | 1740 | strout (SDATA (SYMBOL_NAME (h->weak)), -1, -1, printcharfun, 0); |
| 1741 | PRINTCHAR (' '); | 1741 | PRINTCHAR (' '); |
| 1742 | sprintf (buf, "%d/%d", XFASTINT (h->count), | 1742 | sprintf (buf, "%d/%d", XFASTINT (h->count), |
| 1743 | XVECTOR (h->next)->size); | 1743 | XVECTOR (h->next)->size); |
diff --git a/src/process.c b/src/process.c index 771a4e1fe62..df6646e0b62 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -419,7 +419,7 @@ status_message (status) | |||
| 419 | signame = "unknown"; | 419 | signame = "unknown"; |
| 420 | string = build_string (signame); | 420 | string = build_string (signame); |
| 421 | string2 = build_string (coredump ? " (core dumped)\n" : "\n"); | 421 | string2 = build_string (coredump ? " (core dumped)\n" : "\n"); |
| 422 | XSTRING (string)->data[0] = DOWNCASE (XSTRING (string)->data[0]); | 422 | SREF (string, 0) = DOWNCASE (SREF (string, 0)); |
| 423 | return concat2 (string, string2); | 423 | return concat2 (string, string2); |
| 424 | } | 424 | } |
| 425 | else if (EQ (symbol, Qexit)) | 425 | else if (EQ (symbol, Qexit)) |
| @@ -637,7 +637,7 @@ get_process (name) | |||
| 637 | if (NILP (obj)) | 637 | if (NILP (obj)) |
| 638 | obj = Fget_buffer (name); | 638 | obj = Fget_buffer (name); |
| 639 | if (NILP (obj)) | 639 | if (NILP (obj)) |
| 640 | error ("Process %s does not exist", XSTRING (name)->data); | 640 | error ("Process %s does not exist", SDATA (name)); |
| 641 | } | 641 | } |
| 642 | else if (NILP (name)) | 642 | else if (NILP (name)) |
| 643 | obj = Fcurrent_buffer (); | 643 | obj = Fcurrent_buffer (); |
| @@ -650,7 +650,7 @@ get_process (name) | |||
| 650 | { | 650 | { |
| 651 | proc = Fget_buffer_process (obj); | 651 | proc = Fget_buffer_process (obj); |
| 652 | if (NILP (proc)) | 652 | if (NILP (proc)) |
| 653 | error ("Buffer %s has no process", XSTRING (XBUFFER (obj)->name)->data); | 653 | error ("Buffer %s has no process", SDATA (XBUFFER (obj)->name)); |
| 654 | } | 654 | } |
| 655 | else | 655 | else |
| 656 | { | 656 | { |
| @@ -1070,17 +1070,17 @@ list_processes_1 (query_only) | |||
| 1070 | if (!NILP (query_only) && !NILP (p->kill_without_query)) | 1070 | if (!NILP (query_only) && !NILP (p->kill_without_query)) |
| 1071 | continue; | 1071 | continue; |
| 1072 | if (STRINGP (p->name) | 1072 | if (STRINGP (p->name) |
| 1073 | && ( i = XSTRING (p->name)->size, (i > w_proc))) | 1073 | && ( i = SCHARS (p->name), (i > w_proc))) |
| 1074 | w_proc = i; | 1074 | w_proc = i; |
| 1075 | if (!NILP (p->buffer)) | 1075 | if (!NILP (p->buffer)) |
| 1076 | { | 1076 | { |
| 1077 | if (NILP (XBUFFER (p->buffer)->name) && w_buffer < 8) | 1077 | if (NILP (XBUFFER (p->buffer)->name) && w_buffer < 8) |
| 1078 | w_buffer = 8; /* (Killed) */ | 1078 | w_buffer = 8; /* (Killed) */ |
| 1079 | else if ((i = XSTRING (XBUFFER (p->buffer)->name)->size, (i > w_buffer))) | 1079 | else if ((i = SCHARS (XBUFFER (p->buffer)->name), (i > w_buffer))) |
| 1080 | w_buffer = i; | 1080 | w_buffer = i; |
| 1081 | } | 1081 | } |
| 1082 | if (STRINGP (p->tty_name) | 1082 | if (STRINGP (p->tty_name) |
| 1083 | && (i = XSTRING (p->tty_name)->size, (i > w_tty))) | 1083 | && (i = SCHARS (p->tty_name), (i > w_tty))) |
| 1084 | w_tty = i; | 1084 | w_tty = i; |
| 1085 | } | 1085 | } |
| 1086 | 1086 | ||
| @@ -1206,7 +1206,7 @@ list_processes_1 (query_only) | |||
| 1206 | port = Fnumber_to_string (port); | 1206 | port = Fnumber_to_string (port); |
| 1207 | sprintf (tembuf, "(network %s server on %s)\n", | 1207 | sprintf (tembuf, "(network %s server on %s)\n", |
| 1208 | (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"), | 1208 | (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"), |
| 1209 | XSTRING (port)->data); | 1209 | SDATA (port)); |
| 1210 | insert_string (tembuf); | 1210 | insert_string (tembuf); |
| 1211 | } | 1211 | } |
| 1212 | else if (NETCONN1_P (p)) | 1212 | else if (NETCONN1_P (p)) |
| @@ -1222,7 +1222,7 @@ list_processes_1 (query_only) | |||
| 1222 | } | 1222 | } |
| 1223 | sprintf (tembuf, "(network %s connection to %s)\n", | 1223 | sprintf (tembuf, "(network %s connection to %s)\n", |
| 1224 | (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"), | 1224 | (DATAGRAM_CHAN_P (XINT (p->infd)) ? "datagram" : "stream"), |
| 1225 | XSTRING (host)->data); | 1225 | SDATA (host)); |
| 1226 | insert_string (tembuf); | 1226 | insert_string (tembuf); |
| 1227 | } | 1227 | } |
| 1228 | else | 1228 | else |
| @@ -1400,21 +1400,21 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) | |||
| 1400 | #ifdef VMS | 1400 | #ifdef VMS |
| 1401 | /* Make a one member argv with all args concatenated | 1401 | /* Make a one member argv with all args concatenated |
| 1402 | together separated by a blank. */ | 1402 | together separated by a blank. */ |
| 1403 | len = STRING_BYTES (XSTRING (program)) + 2; | 1403 | len = SBYTES (program) + 2; |
| 1404 | for (i = 3; i < nargs; i++) | 1404 | for (i = 3; i < nargs; i++) |
| 1405 | { | 1405 | { |
| 1406 | tem = args[i]; | 1406 | tem = args[i]; |
| 1407 | CHECK_STRING (tem); | 1407 | CHECK_STRING (tem); |
| 1408 | len += STRING_BYTES (XSTRING (tem)) + 1; /* count the blank */ | 1408 | len += SBYTES (tem) + 1; /* count the blank */ |
| 1409 | } | 1409 | } |
| 1410 | new_argv = (unsigned char *) alloca (len); | 1410 | new_argv = (unsigned char *) alloca (len); |
| 1411 | strcpy (new_argv, XSTRING (program)->data); | 1411 | strcpy (new_argv, SDATA (program)); |
| 1412 | for (i = 3; i < nargs; i++) | 1412 | for (i = 3; i < nargs; i++) |
| 1413 | { | 1413 | { |
| 1414 | tem = args[i]; | 1414 | tem = args[i]; |
| 1415 | CHECK_STRING (tem); | 1415 | CHECK_STRING (tem); |
| 1416 | strcat (new_argv, " "); | 1416 | strcat (new_argv, " "); |
| 1417 | strcat (new_argv, XSTRING (tem)->data); | 1417 | strcat (new_argv, SDATA (tem)); |
| 1418 | } | 1418 | } |
| 1419 | /* Need to add code here to check for program existence on VMS */ | 1419 | /* Need to add code here to check for program existence on VMS */ |
| 1420 | 1420 | ||
| @@ -1422,9 +1422,9 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) | |||
| 1422 | new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *)); | 1422 | new_argv = (unsigned char **) alloca ((nargs - 1) * sizeof (char *)); |
| 1423 | 1423 | ||
| 1424 | /* If program file name is not absolute, search our path for it */ | 1424 | /* If program file name is not absolute, search our path for it */ |
| 1425 | if (!IS_DIRECTORY_SEP (XSTRING (program)->data[0]) | 1425 | if (!IS_DIRECTORY_SEP (SREF (program, 0)) |
| 1426 | && !(XSTRING (program)->size > 1 | 1426 | && !(SCHARS (program) > 1 |
| 1427 | && IS_DEVICE_SEP (XSTRING (program)->data[1]))) | 1427 | && IS_DEVICE_SEP (SREF (program, 1)))) |
| 1428 | { | 1428 | { |
| 1429 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 1429 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 1430 | 1430 | ||
| @@ -1436,7 +1436,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) | |||
| 1436 | report_file_error ("Searching for program", Fcons (program, Qnil)); | 1436 | report_file_error ("Searching for program", Fcons (program, Qnil)); |
| 1437 | tem = Fexpand_file_name (tem, Qnil); | 1437 | tem = Fexpand_file_name (tem, Qnil); |
| 1438 | tem = ENCODE_FILE (tem); | 1438 | tem = ENCODE_FILE (tem); |
| 1439 | new_argv[0] = XSTRING (tem)->data; | 1439 | new_argv[0] = SDATA (tem); |
| 1440 | } | 1440 | } |
| 1441 | else | 1441 | else |
| 1442 | { | 1442 | { |
| @@ -1444,7 +1444,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) | |||
| 1444 | error ("Specified program for new process is a directory"); | 1444 | error ("Specified program for new process is a directory"); |
| 1445 | 1445 | ||
| 1446 | tem = ENCODE_FILE (program); | 1446 | tem = ENCODE_FILE (program); |
| 1447 | new_argv[0] = XSTRING (tem)->data; | 1447 | new_argv[0] = SDATA (tem); |
| 1448 | } | 1448 | } |
| 1449 | 1449 | ||
| 1450 | /* Here we encode arguments by the coding system used for sending | 1450 | /* Here we encode arguments by the coding system used for sending |
| @@ -1459,7 +1459,7 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */) | |||
| 1459 | if (STRING_MULTIBYTE (tem)) | 1459 | if (STRING_MULTIBYTE (tem)) |
| 1460 | tem = (code_convert_string_norecord | 1460 | tem = (code_convert_string_norecord |
| 1461 | (tem, XPROCESS (proc)->encode_coding_system, 1)); | 1461 | (tem, XPROCESS (proc)->encode_coding_system, 1)); |
| 1462 | new_argv[i - 2] = XSTRING (tem)->data; | 1462 | new_argv[i - 2] = SDATA (tem); |
| 1463 | } | 1463 | } |
| 1464 | new_argv[i - 2] = 0; | 1464 | new_argv[i - 2] = 0; |
| 1465 | #endif /* not VMS */ | 1465 | #endif /* not VMS */ |
| @@ -2092,7 +2092,7 @@ conv_lisp_to_sockaddr (family, address, sa, len) | |||
| 2092 | if (family == AF_LOCAL) | 2092 | if (family == AF_LOCAL) |
| 2093 | { | 2093 | { |
| 2094 | struct sockaddr_un *sockun = (struct sockaddr_un *) sa; | 2094 | struct sockaddr_un *sockun = (struct sockaddr_un *) sa; |
| 2095 | cp = XSTRING (address)->data; | 2095 | cp = SDATA (address); |
| 2096 | for (i = 0; i < sizeof (sockun->sun_path) && *cp; i++) | 2096 | for (i = 0; i < sizeof (sockun->sun_path) && *cp; i++) |
| 2097 | sockun->sun_path[i] = *cp++; | 2097 | sockun->sun_path[i] = *cp++; |
| 2098 | } | 2098 | } |
| @@ -2232,9 +2232,9 @@ set_socket_options (s, opts, no_error) | |||
| 2232 | opt = XCAR (opt); | 2232 | opt = XCAR (opt); |
| 2233 | } | 2233 | } |
| 2234 | if (STRINGP (opt)) | 2234 | if (STRINGP (opt)) |
| 2235 | name = (char *) XSTRING (opt)->data; | 2235 | name = (char *) SDATA (opt); |
| 2236 | else if (SYMBOLP (opt)) | 2236 | else if (SYMBOLP (opt)) |
| 2237 | name = (char *) XSTRING (SYMBOL_NAME (opt))->data; | 2237 | name = (char *) SDATA (SYMBOL_NAME (opt)); |
| 2238 | else { | 2238 | else { |
| 2239 | error ("Mal-formed option list"); | 2239 | error ("Mal-formed option list"); |
| 2240 | return 0; | 2240 | return 0; |
| @@ -2300,9 +2300,9 @@ set_socket_options (s, opts, no_error) | |||
| 2300 | if (NILP (val)) | 2300 | if (NILP (val)) |
| 2301 | arg = ""; | 2301 | arg = ""; |
| 2302 | else if (STRINGP (val)) | 2302 | else if (STRINGP (val)) |
| 2303 | arg = (char *) XSTRING (val)->data; | 2303 | arg = (char *) SDATA (val); |
| 2304 | else if (XSYMBOL (val)) | 2304 | else if (XSYMBOL (val)) |
| 2305 | arg = (char *) XSTRING (SYMBOL_NAME (val))->data; | 2305 | arg = (char *) SDATA (SYMBOL_NAME (val)); |
| 2306 | else | 2306 | else |
| 2307 | error ("Invalid argument to %s option", name); | 2307 | error ("Invalid argument to %s option", name); |
| 2308 | } | 2308 | } |
| @@ -2632,16 +2632,16 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2632 | { | 2632 | { |
| 2633 | struct servent *svc_info; | 2633 | struct servent *svc_info; |
| 2634 | CHECK_STRING (service); | 2634 | CHECK_STRING (service); |
| 2635 | svc_info = getservbyname (XSTRING (service)->data, "tcp"); | 2635 | svc_info = getservbyname (SDATA (service), "tcp"); |
| 2636 | if (svc_info == 0) | 2636 | if (svc_info == 0) |
| 2637 | error ("Unknown service: %s", XSTRING (service)->data); | 2637 | error ("Unknown service: %s", SDATA (service)); |
| 2638 | port = svc_info->s_port; | 2638 | port = svc_info->s_port; |
| 2639 | } | 2639 | } |
| 2640 | 2640 | ||
| 2641 | s = connect_server (0); | 2641 | s = connect_server (0); |
| 2642 | if (s < 0) | 2642 | if (s < 0) |
| 2643 | report_file_error ("error creating socket", Fcons (name, Qnil)); | 2643 | report_file_error ("error creating socket", Fcons (name, Qnil)); |
| 2644 | send_command (s, C_PORT, 0, "%s:%d", XSTRING (host)->data, ntohs (port)); | 2644 | send_command (s, C_PORT, 0, "%s:%d", SDATA (host), ntohs (port)); |
| 2645 | send_command (s, C_DUMB, 1, 0); | 2645 | send_command (s, C_DUMB, 1, 0); |
| 2646 | 2646 | ||
| 2647 | #else /* not TERM */ | 2647 | #else /* not TERM */ |
| @@ -2694,7 +2694,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2694 | CHECK_STRING (service); | 2694 | CHECK_STRING (service); |
| 2695 | bzero (&address_un, sizeof address_un); | 2695 | bzero (&address_un, sizeof address_un); |
| 2696 | address_un.sun_family = AF_LOCAL; | 2696 | address_un.sun_family = AF_LOCAL; |
| 2697 | strncpy (address_un.sun_path, XSTRING (service)->data, sizeof address_un.sun_path); | 2697 | strncpy (address_un.sun_path, SDATA (service), sizeof address_un.sun_path); |
| 2698 | ai.ai_addr = (struct sockaddr *) &address_un; | 2698 | ai.ai_addr = (struct sockaddr *) &address_un; |
| 2699 | ai.ai_addrlen = sizeof address_un; | 2699 | ai.ai_addrlen = sizeof address_un; |
| 2700 | goto open_socket; | 2700 | goto open_socket; |
| @@ -2739,7 +2739,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2739 | else | 2739 | else |
| 2740 | { | 2740 | { |
| 2741 | CHECK_STRING (service); | 2741 | CHECK_STRING (service); |
| 2742 | portstring = XSTRING (service)->data; | 2742 | portstring = SDATA (service); |
| 2743 | } | 2743 | } |
| 2744 | 2744 | ||
| 2745 | immediate_quit = 1; | 2745 | immediate_quit = 1; |
| @@ -2749,12 +2749,12 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2749 | hints.ai_family = NILP (Fplist_member (contact, QCfamily)) ? AF_UNSPEC : family; | 2749 | hints.ai_family = NILP (Fplist_member (contact, QCfamily)) ? AF_UNSPEC : family; |
| 2750 | hints.ai_socktype = socktype; | 2750 | hints.ai_socktype = socktype; |
| 2751 | hints.ai_protocol = 0; | 2751 | hints.ai_protocol = 0; |
| 2752 | ret = getaddrinfo (XSTRING (host)->data, portstring, &hints, &res); | 2752 | ret = getaddrinfo (SDATA (host), portstring, &hints, &res); |
| 2753 | if (ret) | 2753 | if (ret) |
| 2754 | #ifdef HAVE_GAI_STRERROR | 2754 | #ifdef HAVE_GAI_STRERROR |
| 2755 | error ("%s/%s %s", XSTRING (host)->data, portstring, gai_strerror(ret)); | 2755 | error ("%s/%s %s", SDATA (host), portstring, gai_strerror(ret)); |
| 2756 | #else | 2756 | #else |
| 2757 | error ("%s/%s getaddrinfo error %d", XSTRING (host)->data, portstring, ret); | 2757 | error ("%s/%s getaddrinfo error %d", SDATA (host), portstring, ret); |
| 2758 | #endif | 2758 | #endif |
| 2759 | immediate_quit = 0; | 2759 | immediate_quit = 0; |
| 2760 | 2760 | ||
| @@ -2773,10 +2773,10 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2773 | { | 2773 | { |
| 2774 | struct servent *svc_info; | 2774 | struct servent *svc_info; |
| 2775 | CHECK_STRING (service); | 2775 | CHECK_STRING (service); |
| 2776 | svc_info = getservbyname (XSTRING (service)->data, | 2776 | svc_info = getservbyname (SDATA (service), |
| 2777 | (socktype == SOCK_DGRAM ? "udp" : "tcp")); | 2777 | (socktype == SOCK_DGRAM ? "udp" : "tcp")); |
| 2778 | if (svc_info == 0) | 2778 | if (svc_info == 0) |
| 2779 | error ("Unknown service: %s", XSTRING (service)->data); | 2779 | error ("Unknown service: %s", SDATA (service)); |
| 2780 | port = svc_info->s_port; | 2780 | port = svc_info->s_port; |
| 2781 | } | 2781 | } |
| 2782 | 2782 | ||
| @@ -2794,7 +2794,7 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2794 | as it may `hang' emacs for a very long time. */ | 2794 | as it may `hang' emacs for a very long time. */ |
| 2795 | immediate_quit = 1; | 2795 | immediate_quit = 1; |
| 2796 | QUIT; | 2796 | QUIT; |
| 2797 | host_info_ptr = gethostbyname (XSTRING (host)->data); | 2797 | host_info_ptr = gethostbyname (SDATA (host)); |
| 2798 | immediate_quit = 0; | 2798 | immediate_quit = 0; |
| 2799 | 2799 | ||
| 2800 | if (host_info_ptr) | 2800 | if (host_info_ptr) |
| @@ -2808,9 +2808,9 @@ usage: (make-network-process &rest ARGS) */) | |||
| 2808 | /* Attempt to interpret host as numeric inet address */ | 2808 | /* Attempt to interpret host as numeric inet address */ |
| 2809 | { | 2809 | { |
| 2810 | IN_ADDR numeric_addr; | 2810 | IN_ADDR numeric_addr; |
| 2811 | numeric_addr = inet_addr ((char *) XSTRING (host)->data); | 2811 | numeric_addr = inet_addr ((char *) SDATA (host)); |
| 2812 | if (NUMERIC_ADDR_ERROR) | 2812 | if (NUMERIC_ADDR_ERROR) |
| 2813 | error ("Unknown host \"%s\"", XSTRING (host)->data); | 2813 | error ("Unknown host \"%s\"", SDATA (host)); |
| 2814 | 2814 | ||
| 2815 | bcopy ((char *)&numeric_addr, (char *) &address_in.sin_addr, | 2815 | bcopy ((char *)&numeric_addr, (char *) &address_in.sin_addr, |
| 2816 | sizeof (address_in.sin_addr)); | 2816 | sizeof (address_in.sin_addr)); |
| @@ -4283,7 +4283,7 @@ read_process_output (proc, channel) | |||
| 4283 | the tail of decoding buffer) should be prepended to the new | 4283 | the tail of decoding buffer) should be prepended to the new |
| 4284 | data read to decode all together. */ | 4284 | data read to decode all together. */ |
| 4285 | chars = (char *) alloca (nbytes + carryover); | 4285 | chars = (char *) alloca (nbytes + carryover); |
| 4286 | bcopy (XSTRING (p->decoding_buf)->data, buf, carryover); | 4286 | bcopy (SDATA (p->decoding_buf), buf, carryover); |
| 4287 | bcopy (vs->inputBuffer, chars + carryover, nbytes); | 4287 | bcopy (vs->inputBuffer, chars + carryover, nbytes); |
| 4288 | } | 4288 | } |
| 4289 | #else /* not VMS */ | 4289 | #else /* not VMS */ |
| @@ -4301,7 +4301,7 @@ read_process_output (proc, channel) | |||
| 4301 | chars = (char *) alloca (carryover + readmax); | 4301 | chars = (char *) alloca (carryover + readmax); |
| 4302 | if (carryover) | 4302 | if (carryover) |
| 4303 | /* See the comment above. */ | 4303 | /* See the comment above. */ |
| 4304 | bcopy (XSTRING (p->decoding_buf)->data, chars, carryover); | 4304 | bcopy (SDATA (p->decoding_buf), chars, carryover); |
| 4305 | 4305 | ||
| 4306 | #ifdef DATAGRAM_SOCKETS | 4306 | #ifdef DATAGRAM_SOCKETS |
| 4307 | /* We have a working select, so proc_buffered_char is always -1. */ | 4307 | /* We have a working select, so proc_buffered_char is always -1. */ |
| @@ -4414,11 +4414,11 @@ read_process_output (proc, channel) | |||
| 4414 | } | 4414 | } |
| 4415 | 4415 | ||
| 4416 | carryover = nbytes - coding->consumed; | 4416 | carryover = nbytes - coding->consumed; |
| 4417 | bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data, | 4417 | bcopy (chars + coding->consumed, SDATA (p->decoding_buf), |
| 4418 | carryover); | 4418 | carryover); |
| 4419 | XSETINT (p->decoding_carryover, carryover); | 4419 | XSETINT (p->decoding_carryover, carryover); |
| 4420 | nbytes = STRING_BYTES (XSTRING (text)); | 4420 | nbytes = SBYTES (text); |
| 4421 | nchars = XSTRING (text)->size; | 4421 | nchars = SCHARS (text); |
| 4422 | if (nbytes > 0) | 4422 | if (nbytes > 0) |
| 4423 | internal_condition_case_1 (read_process_output_call, | 4423 | internal_condition_case_1 (read_process_output_call, |
| 4424 | Fcons (outstream, | 4424 | Fcons (outstream, |
| @@ -4515,7 +4515,7 @@ read_process_output (proc, channel) | |||
| 4515 | } | 4515 | } |
| 4516 | } | 4516 | } |
| 4517 | carryover = nbytes - coding->consumed; | 4517 | carryover = nbytes - coding->consumed; |
| 4518 | bcopy (chars + coding->consumed, XSTRING (p->decoding_buf)->data, | 4518 | bcopy (chars + coding->consumed, SDATA (p->decoding_buf), |
| 4519 | carryover); | 4519 | carryover); |
| 4520 | XSETINT (p->decoding_carryover, carryover); | 4520 | XSETINT (p->decoding_carryover, carryover); |
| 4521 | /* Adjust the multibyteness of TEXT to that of the buffer. */ | 4521 | /* Adjust the multibyteness of TEXT to that of the buffer. */ |
| @@ -4524,8 +4524,8 @@ read_process_output (proc, channel) | |||
| 4524 | text = (STRING_MULTIBYTE (text) | 4524 | text = (STRING_MULTIBYTE (text) |
| 4525 | ? Fstring_as_unibyte (text) | 4525 | ? Fstring_as_unibyte (text) |
| 4526 | : Fstring_as_multibyte (text)); | 4526 | : Fstring_as_multibyte (text)); |
| 4527 | nbytes = STRING_BYTES (XSTRING (text)); | 4527 | nbytes = SBYTES (text); |
| 4528 | nchars = XSTRING (text)->size; | 4528 | nchars = SCHARS (text); |
| 4529 | /* Insert before markers in case we are inserting where | 4529 | /* Insert before markers in case we are inserting where |
| 4530 | the buffer's mark is, and the user's next command is Meta-y. */ | 4530 | the buffer's mark is, and the user's next command is Meta-y. */ |
| 4531 | insert_from_string_before_markers (text, 0, 0, nchars, nbytes, 0); | 4531 | insert_from_string_before_markers (text, 0, 0, nchars, nbytes, 0); |
| @@ -4633,10 +4633,10 @@ send_process (proc, buf, len, object) | |||
| 4633 | update_status (XPROCESS (proc)); | 4633 | update_status (XPROCESS (proc)); |
| 4634 | if (! EQ (XPROCESS (proc)->status, Qrun)) | 4634 | if (! EQ (XPROCESS (proc)->status, Qrun)) |
| 4635 | error ("Process %s not running", | 4635 | error ("Process %s not running", |
| 4636 | XSTRING (XPROCESS (proc)->name)->data); | 4636 | SDATA (XPROCESS (proc)->name)); |
| 4637 | if (XINT (XPROCESS (proc)->outfd) < 0) | 4637 | if (XINT (XPROCESS (proc)->outfd) < 0) |
| 4638 | error ("Output file descriptor of %s is closed", | 4638 | error ("Output file descriptor of %s is closed", |
| 4639 | XSTRING (XPROCESS (proc)->name)->data); | 4639 | SDATA (XPROCESS (proc)->name)); |
| 4640 | 4640 | ||
| 4641 | coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)]; | 4641 | coding = proc_encode_coding_system[XINT (XPROCESS (proc)->outfd)]; |
| 4642 | Vlast_coding_system_used = coding->symbol; | 4642 | Vlast_coding_system_used = coding->symbol; |
| @@ -4691,7 +4691,7 @@ send_process (proc, buf, len, object) | |||
| 4691 | } | 4691 | } |
| 4692 | else if (STRINGP (object)) | 4692 | else if (STRINGP (object)) |
| 4693 | { | 4693 | { |
| 4694 | from_byte = buf - XSTRING (object)->data; | 4694 | from_byte = buf - SDATA (object); |
| 4695 | from = string_byte_to_char (object, from_byte); | 4695 | from = string_byte_to_char (object, from_byte); |
| 4696 | to = string_byte_to_char (object, from_byte + len); | 4696 | to = string_byte_to_char (object, from_byte + len); |
| 4697 | } | 4697 | } |
| @@ -4704,19 +4704,19 @@ send_process (proc, buf, len, object) | |||
| 4704 | coding->composing = COMPOSITION_DISABLED; | 4704 | coding->composing = COMPOSITION_DISABLED; |
| 4705 | } | 4705 | } |
| 4706 | 4706 | ||
| 4707 | if (STRING_BYTES (XSTRING (XPROCESS (proc)->encoding_buf)) < require) | 4707 | if (SBYTES (XPROCESS (proc)->encoding_buf) < require) |
| 4708 | XPROCESS (proc)->encoding_buf = make_uninit_string (require); | 4708 | XPROCESS (proc)->encoding_buf = make_uninit_string (require); |
| 4709 | 4709 | ||
| 4710 | if (from_byte >= 0) | 4710 | if (from_byte >= 0) |
| 4711 | buf = (BUFFERP (object) | 4711 | buf = (BUFFERP (object) |
| 4712 | ? BUF_BYTE_ADDRESS (XBUFFER (object), from_byte) | 4712 | ? BUF_BYTE_ADDRESS (XBUFFER (object), from_byte) |
| 4713 | : XSTRING (object)->data + from_byte); | 4713 | : SDATA (object) + from_byte); |
| 4714 | 4714 | ||
| 4715 | object = XPROCESS (proc)->encoding_buf; | 4715 | object = XPROCESS (proc)->encoding_buf; |
| 4716 | encode_coding (coding, (char *) buf, XSTRING (object)->data, | 4716 | encode_coding (coding, (char *) buf, SDATA (object), |
| 4717 | len, STRING_BYTES (XSTRING (object))); | 4717 | len, SBYTES (object)); |
| 4718 | len = coding->produced; | 4718 | len = coding->produced; |
| 4719 | buf = XSTRING (object)->data; | 4719 | buf = SDATA (object); |
| 4720 | if (temp_buf) | 4720 | if (temp_buf) |
| 4721 | xfree (temp_buf); | 4721 | xfree (temp_buf); |
| 4722 | } | 4722 | } |
| @@ -4849,7 +4849,7 @@ send_process (proc, buf, len, object) | |||
| 4849 | if (BUFFERP (object)) | 4849 | if (BUFFERP (object)) |
| 4850 | offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); | 4850 | offset = BUF_PTR_BYTE_POS (XBUFFER (object), buf); |
| 4851 | else if (STRINGP (object)) | 4851 | else if (STRINGP (object)) |
| 4852 | offset = buf - XSTRING (object)->data; | 4852 | offset = buf - SDATA (object); |
| 4853 | 4853 | ||
| 4854 | XSETFASTINT (zero, 0); | 4854 | XSETFASTINT (zero, 0); |
| 4855 | #ifdef EMACS_HAS_USECS | 4855 | #ifdef EMACS_HAS_USECS |
| @@ -4861,7 +4861,7 @@ send_process (proc, buf, len, object) | |||
| 4861 | if (BUFFERP (object)) | 4861 | if (BUFFERP (object)) |
| 4862 | buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); | 4862 | buf = BUF_BYTE_ADDRESS (XBUFFER (object), offset); |
| 4863 | else if (STRINGP (object)) | 4863 | else if (STRINGP (object)) |
| 4864 | buf = offset + XSTRING (object)->data; | 4864 | buf = offset + SDATA (object); |
| 4865 | 4865 | ||
| 4866 | rv = 0; | 4866 | rv = 0; |
| 4867 | } | 4867 | } |
| @@ -4893,10 +4893,10 @@ send_process (proc, buf, len, object) | |||
| 4893 | deactivate_process (proc); | 4893 | deactivate_process (proc); |
| 4894 | #ifdef VMS | 4894 | #ifdef VMS |
| 4895 | error ("Error writing to process %s; closed it", | 4895 | error ("Error writing to process %s; closed it", |
| 4896 | XSTRING (XPROCESS (proc)->name)->data); | 4896 | SDATA (XPROCESS (proc)->name)); |
| 4897 | #else | 4897 | #else |
| 4898 | error ("SIGPIPE raised on process %s; closed it", | 4898 | error ("SIGPIPE raised on process %s; closed it", |
| 4899 | XSTRING (XPROCESS (proc)->name)->data); | 4899 | SDATA (XPROCESS (proc)->name)); |
| 4900 | #endif | 4900 | #endif |
| 4901 | } | 4901 | } |
| 4902 | 4902 | ||
| @@ -4946,8 +4946,8 @@ Output from processes can arrive in between bunches. */) | |||
| 4946 | Lisp_Object proc; | 4946 | Lisp_Object proc; |
| 4947 | CHECK_STRING (string); | 4947 | CHECK_STRING (string); |
| 4948 | proc = get_process (process); | 4948 | proc = get_process (process); |
| 4949 | send_process (proc, XSTRING (string)->data, | 4949 | send_process (proc, SDATA (string), |
| 4950 | STRING_BYTES (XSTRING (string)), string); | 4950 | SBYTES (string), string); |
| 4951 | return Qnil; | 4951 | return Qnil; |
| 4952 | } | 4952 | } |
| 4953 | 4953 | ||
| @@ -4970,10 +4970,10 @@ return t unconditionally. */) | |||
| 4970 | 4970 | ||
| 4971 | if (!EQ (p->childp, Qt)) | 4971 | if (!EQ (p->childp, Qt)) |
| 4972 | error ("Process %s is not a subprocess", | 4972 | error ("Process %s is not a subprocess", |
| 4973 | XSTRING (p->name)->data); | 4973 | SDATA (p->name)); |
| 4974 | if (XINT (p->infd) < 0) | 4974 | if (XINT (p->infd) < 0) |
| 4975 | error ("Process %s is not active", | 4975 | error ("Process %s is not active", |
| 4976 | XSTRING (p->name)->data); | 4976 | SDATA (p->name)); |
| 4977 | 4977 | ||
| 4978 | #ifdef TIOCGPGRP | 4978 | #ifdef TIOCGPGRP |
| 4979 | if (!NILP (p->subtty)) | 4979 | if (!NILP (p->subtty)) |
| @@ -5018,10 +5018,10 @@ process_send_signal (process, signo, current_group, nomsg) | |||
| 5018 | 5018 | ||
| 5019 | if (!EQ (p->childp, Qt)) | 5019 | if (!EQ (p->childp, Qt)) |
| 5020 | error ("Process %s is not a subprocess", | 5020 | error ("Process %s is not a subprocess", |
| 5021 | XSTRING (p->name)->data); | 5021 | SDATA (p->name)); |
| 5022 | if (XINT (p->infd) < 0) | 5022 | if (XINT (p->infd) < 0) |
| 5023 | error ("Process %s is not active", | 5023 | error ("Process %s is not active", |
| 5024 | XSTRING (p->name)->data); | 5024 | SDATA (p->name)); |
| 5025 | 5025 | ||
| 5026 | if (NILP (p->pty_flag)) | 5026 | if (NILP (p->pty_flag)) |
| 5027 | current_group = Qnil; | 5027 | current_group = Qnil; |
| @@ -5337,7 +5337,7 @@ SIGCODE may be an integer, or a symbol whose name is a signal name. */) | |||
| 5337 | unsigned char *name; | 5337 | unsigned char *name; |
| 5338 | 5338 | ||
| 5339 | CHECK_SYMBOL (sigcode); | 5339 | CHECK_SYMBOL (sigcode); |
| 5340 | name = XSTRING (SYMBOL_NAME (sigcode))->data; | 5340 | name = SDATA (SYMBOL_NAME (sigcode)); |
| 5341 | 5341 | ||
| 5342 | if (0) | 5342 | if (0) |
| 5343 | ; | 5343 | ; |
| @@ -5464,7 +5464,7 @@ text to PROCESS after you call this function. */) | |||
| 5464 | if (! NILP (XPROCESS (proc)->raw_status_low)) | 5464 | if (! NILP (XPROCESS (proc)->raw_status_low)) |
| 5465 | update_status (XPROCESS (proc)); | 5465 | update_status (XPROCESS (proc)); |
| 5466 | if (! EQ (XPROCESS (proc)->status, Qrun)) | 5466 | if (! EQ (XPROCESS (proc)->status, Qrun)) |
| 5467 | error ("Process %s not running", XSTRING (XPROCESS (proc)->name)->data); | 5467 | error ("Process %s not running", SDATA (XPROCESS (proc)->name)); |
| 5468 | 5468 | ||
| 5469 | if (CODING_REQUIRE_FLUSHING (coding)) | 5469 | if (CODING_REQUIRE_FLUSHING (coding)) |
| 5470 | { | 5470 | { |
| @@ -5946,9 +5946,9 @@ encode subprocess input. */) | |||
| 5946 | CHECK_PROCESS (proc); | 5946 | CHECK_PROCESS (proc); |
| 5947 | p = XPROCESS (proc); | 5947 | p = XPROCESS (proc); |
| 5948 | if (XINT (p->infd) < 0) | 5948 | if (XINT (p->infd) < 0) |
| 5949 | error ("Input file descriptor of %s closed", XSTRING (p->name)->data); | 5949 | error ("Input file descriptor of %s closed", SDATA (p->name)); |
| 5950 | if (XINT (p->outfd) < 0) | 5950 | if (XINT (p->outfd) < 0) |
| 5951 | error ("Output file descriptor of %s closed", XSTRING (p->name)->data); | 5951 | error ("Output file descriptor of %s closed", SDATA (p->name)); |
| 5952 | 5952 | ||
| 5953 | p->decode_coding_system = Fcheck_coding_system (decoding); | 5953 | p->decode_coding_system = Fcheck_coding_system (decoding); |
| 5954 | p->encode_coding_system = Fcheck_coding_system (encoding); | 5954 | p->encode_coding_system = Fcheck_coding_system (encoding); |
diff --git a/src/search.c b/src/search.c index 643a57d59ca..7ccdab568e1 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -128,16 +128,16 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) | |||
| 128 | 128 | ||
| 129 | if (multibyte == STRING_MULTIBYTE (pattern)) | 129 | if (multibyte == STRING_MULTIBYTE (pattern)) |
| 130 | { | 130 | { |
| 131 | raw_pattern = (unsigned char *) XSTRING (pattern)->data; | 131 | raw_pattern = (unsigned char *) SDATA (pattern); |
| 132 | raw_pattern_size = STRING_BYTES (XSTRING (pattern)); | 132 | raw_pattern_size = SBYTES (pattern); |
| 133 | } | 133 | } |
| 134 | else if (multibyte) | 134 | else if (multibyte) |
| 135 | { | 135 | { |
| 136 | raw_pattern_size = count_size_as_multibyte (XSTRING (pattern)->data, | 136 | raw_pattern_size = count_size_as_multibyte (SDATA (pattern), |
| 137 | XSTRING (pattern)->size); | 137 | SCHARS (pattern)); |
| 138 | raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1); | 138 | raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1); |
| 139 | copy_text (XSTRING (pattern)->data, raw_pattern, | 139 | copy_text (SDATA (pattern), raw_pattern, |
| 140 | XSTRING (pattern)->size, 0, 1); | 140 | SCHARS (pattern), 0, 1); |
| 141 | } | 141 | } |
| 142 | else | 142 | else |
| 143 | { | 143 | { |
| @@ -147,10 +147,10 @@ compile_pattern_1 (cp, pattern, translate, regp, posix, multibyte) | |||
| 147 | by subtracting nonascii-insert-offset from each non-ASCII char, | 147 | by subtracting nonascii-insert-offset from each non-ASCII char, |
| 148 | so that only the multibyte chars which really correspond to | 148 | so that only the multibyte chars which really correspond to |
| 149 | the chosen single-byte character set can possibly match. */ | 149 | the chosen single-byte character set can possibly match. */ |
| 150 | raw_pattern_size = XSTRING (pattern)->size; | 150 | raw_pattern_size = SCHARS (pattern); |
| 151 | raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1); | 151 | raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1); |
| 152 | copy_text (XSTRING (pattern)->data, raw_pattern, | 152 | copy_text (SDATA (pattern), raw_pattern, |
| 153 | STRING_BYTES (XSTRING (pattern)), 1, 0); | 153 | SBYTES (pattern), 1, 0); |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | cp->regexp = Qnil; | 156 | cp->regexp = Qnil; |
| @@ -217,7 +217,7 @@ compile_pattern (pattern, regp, translate, posix, multibyte) | |||
| 217 | should never appear before a non-nil entry. */ | 217 | should never appear before a non-nil entry. */ |
| 218 | if (NILP (cp->regexp)) | 218 | if (NILP (cp->regexp)) |
| 219 | goto compile_it; | 219 | goto compile_it; |
| 220 | if (XSTRING (cp->regexp)->size == XSTRING (pattern)->size | 220 | if (SCHARS (cp->regexp) == SCHARS (pattern) |
| 221 | && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern) | 221 | && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern) |
| 222 | && !NILP (Fstring_equal (cp->regexp, pattern)) | 222 | && !NILP (Fstring_equal (cp->regexp, pattern)) |
| 223 | && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) | 223 | && EQ (cp->buf.translate, (! NILP (translate) ? translate : make_number (0))) |
| @@ -372,7 +372,7 @@ string_match_1 (regexp, string, start, posix) | |||
| 372 | pos = 0, pos_byte = 0; | 372 | pos = 0, pos_byte = 0; |
| 373 | else | 373 | else |
| 374 | { | 374 | { |
| 375 | int len = XSTRING (string)->size; | 375 | int len = SCHARS (string); |
| 376 | 376 | ||
| 377 | CHECK_NUMBER (start); | 377 | CHECK_NUMBER (start); |
| 378 | pos = XINT (start); | 378 | pos = XINT (start); |
| @@ -391,9 +391,9 @@ string_match_1 (regexp, string, start, posix) | |||
| 391 | immediate_quit = 1; | 391 | immediate_quit = 1; |
| 392 | re_match_object = string; | 392 | re_match_object = string; |
| 393 | 393 | ||
| 394 | val = re_search (bufp, (char *) XSTRING (string)->data, | 394 | val = re_search (bufp, (char *) SDATA (string), |
| 395 | STRING_BYTES (XSTRING (string)), pos_byte, | 395 | SBYTES (string), pos_byte, |
| 396 | STRING_BYTES (XSTRING (string)) - pos_byte, | 396 | SBYTES (string) - pos_byte, |
| 397 | &search_regs); | 397 | &search_regs); |
| 398 | immediate_quit = 0; | 398 | immediate_quit = 0; |
| 399 | last_thing_searched = Qt; | 399 | last_thing_searched = Qt; |
| @@ -456,9 +456,9 @@ fast_string_match (regexp, string) | |||
| 456 | immediate_quit = 1; | 456 | immediate_quit = 1; |
| 457 | re_match_object = string; | 457 | re_match_object = string; |
| 458 | 458 | ||
| 459 | val = re_search (bufp, (char *) XSTRING (string)->data, | 459 | val = re_search (bufp, (char *) SDATA (string), |
| 460 | STRING_BYTES (XSTRING (string)), 0, | 460 | SBYTES (string), 0, |
| 461 | STRING_BYTES (XSTRING (string)), 0); | 461 | SBYTES (string), 0); |
| 462 | immediate_quit = 0; | 462 | immediate_quit = 0; |
| 463 | return val; | 463 | return val; |
| 464 | } | 464 | } |
| @@ -939,8 +939,8 @@ static int | |||
| 939 | trivial_regexp_p (regexp) | 939 | trivial_regexp_p (regexp) |
| 940 | Lisp_Object regexp; | 940 | Lisp_Object regexp; |
| 941 | { | 941 | { |
| 942 | int len = STRING_BYTES (XSTRING (regexp)); | 942 | int len = SBYTES (regexp); |
| 943 | unsigned char *s = XSTRING (regexp)->data; | 943 | unsigned char *s = SDATA (regexp); |
| 944 | while (--len >= 0) | 944 | while (--len >= 0) |
| 945 | { | 945 | { |
| 946 | switch (*s++) | 946 | switch (*s++) |
| @@ -1011,8 +1011,8 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1011 | Lisp_Object inverse_trt; | 1011 | Lisp_Object inverse_trt; |
| 1012 | int posix; | 1012 | int posix; |
| 1013 | { | 1013 | { |
| 1014 | int len = XSTRING (string)->size; | 1014 | int len = SCHARS (string); |
| 1015 | int len_byte = STRING_BYTES (XSTRING (string)); | 1015 | int len_byte = SBYTES (string); |
| 1016 | register int i; | 1016 | register int i; |
| 1017 | 1017 | ||
| 1018 | if (running_asynch_code) | 1018 | if (running_asynch_code) |
| @@ -1136,7 +1136,7 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1136 | int raw_pattern_size_byte; | 1136 | int raw_pattern_size_byte; |
| 1137 | unsigned char *patbuf; | 1137 | unsigned char *patbuf; |
| 1138 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); | 1138 | int multibyte = !NILP (current_buffer->enable_multibyte_characters); |
| 1139 | unsigned char *base_pat = XSTRING (string)->data; | 1139 | unsigned char *base_pat = SDATA (string); |
| 1140 | int charset_base = -1; | 1140 | int charset_base = -1; |
| 1141 | int boyer_moore_ok = 1; | 1141 | int boyer_moore_ok = 1; |
| 1142 | 1142 | ||
| @@ -1146,19 +1146,19 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1146 | 1146 | ||
| 1147 | if (multibyte == STRING_MULTIBYTE (string)) | 1147 | if (multibyte == STRING_MULTIBYTE (string)) |
| 1148 | { | 1148 | { |
| 1149 | raw_pattern = (unsigned char *) XSTRING (string)->data; | 1149 | raw_pattern = (unsigned char *) SDATA (string); |
| 1150 | raw_pattern_size = XSTRING (string)->size; | 1150 | raw_pattern_size = SCHARS (string); |
| 1151 | raw_pattern_size_byte = STRING_BYTES (XSTRING (string)); | 1151 | raw_pattern_size_byte = SBYTES (string); |
| 1152 | } | 1152 | } |
| 1153 | else if (multibyte) | 1153 | else if (multibyte) |
| 1154 | { | 1154 | { |
| 1155 | raw_pattern_size = XSTRING (string)->size; | 1155 | raw_pattern_size = SCHARS (string); |
| 1156 | raw_pattern_size_byte | 1156 | raw_pattern_size_byte |
| 1157 | = count_size_as_multibyte (XSTRING (string)->data, | 1157 | = count_size_as_multibyte (SDATA (string), |
| 1158 | raw_pattern_size); | 1158 | raw_pattern_size); |
| 1159 | raw_pattern = (unsigned char *) alloca (raw_pattern_size_byte + 1); | 1159 | raw_pattern = (unsigned char *) alloca (raw_pattern_size_byte + 1); |
| 1160 | copy_text (XSTRING (string)->data, raw_pattern, | 1160 | copy_text (SDATA (string), raw_pattern, |
| 1161 | XSTRING (string)->size, 0, 1); | 1161 | SCHARS (string), 0, 1); |
| 1162 | } | 1162 | } |
| 1163 | else | 1163 | else |
| 1164 | { | 1164 | { |
| @@ -1168,11 +1168,11 @@ search_buffer (string, pos, pos_byte, lim, lim_byte, n, | |||
| 1168 | by subtracting nonascii-insert-offset from each non-ASCII char, | 1168 | by subtracting nonascii-insert-offset from each non-ASCII char, |
| 1169 | so that only the multibyte chars which really correspond to | 1169 | so that only the multibyte chars which really correspond to |
| 1170 | the chosen single-byte character set can possibly match. */ | 1170 | the chosen single-byte character set can possibly match. */ |
| 1171 | raw_pattern_size = XSTRING (string)->size; | 1171 | raw_pattern_size = SCHARS (string); |
| 1172 | raw_pattern_size_byte = XSTRING (string)->size; | 1172 | raw_pattern_size_byte = SCHARS (string); |
| 1173 | raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1); | 1173 | raw_pattern = (unsigned char *) alloca (raw_pattern_size + 1); |
| 1174 | copy_text (XSTRING (string)->data, raw_pattern, | 1174 | copy_text (SDATA (string), raw_pattern, |
| 1175 | STRING_BYTES (XSTRING (string)), 1, 0); | 1175 | SBYTES (string), 1, 0); |
| 1176 | } | 1176 | } |
| 1177 | 1177 | ||
| 1178 | /* Copy and optionally translate the pattern. */ | 1178 | /* Copy and optionally translate the pattern. */ |
| @@ -1948,8 +1948,8 @@ wordify (string) | |||
| 1948 | int adjust; | 1948 | int adjust; |
| 1949 | 1949 | ||
| 1950 | CHECK_STRING (string); | 1950 | CHECK_STRING (string); |
| 1951 | p = XSTRING (string)->data; | 1951 | p = SDATA (string); |
| 1952 | len = XSTRING (string)->size; | 1952 | len = SCHARS (string); |
| 1953 | 1953 | ||
| 1954 | for (i = 0, i_byte = 0; i < len; ) | 1954 | for (i = 0, i_byte = 0; i < len; ) |
| 1955 | { | 1955 | { |
| @@ -1975,12 +1975,12 @@ wordify (string) | |||
| 1975 | adjust = - punct_count + 5 * (word_count - 1) + 4; | 1975 | adjust = - punct_count + 5 * (word_count - 1) + 4; |
| 1976 | if (STRING_MULTIBYTE (string)) | 1976 | if (STRING_MULTIBYTE (string)) |
| 1977 | val = make_uninit_multibyte_string (len + adjust, | 1977 | val = make_uninit_multibyte_string (len + adjust, |
| 1978 | STRING_BYTES (XSTRING (string)) | 1978 | SBYTES (string) |
| 1979 | + adjust); | 1979 | + adjust); |
| 1980 | else | 1980 | else |
| 1981 | val = make_uninit_string (len + adjust); | 1981 | val = make_uninit_string (len + adjust); |
| 1982 | 1982 | ||
| 1983 | o = XSTRING (val)->data; | 1983 | o = SDATA (val); |
| 1984 | *o++ = '\\'; | 1984 | *o++ = '\\'; |
| 1985 | *o++ = 'b'; | 1985 | *o++ = 'b'; |
| 1986 | prev_c = 0; | 1986 | prev_c = 0; |
| @@ -1994,7 +1994,7 @@ wordify (string) | |||
| 1994 | 1994 | ||
| 1995 | if (SYNTAX (c) == Sword) | 1995 | if (SYNTAX (c) == Sword) |
| 1996 | { | 1996 | { |
| 1997 | bcopy (&XSTRING (string)->data[i_byte_orig], o, | 1997 | bcopy (&SREF (string, i_byte_orig), o, |
| 1998 | i_byte - i_byte_orig); | 1998 | i_byte - i_byte_orig); |
| 1999 | o += i_byte - i_byte_orig; | 1999 | o += i_byte - i_byte_orig; |
| 2000 | } | 2000 | } |
| @@ -2242,7 +2242,7 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2242 | { | 2242 | { |
| 2243 | if (search_regs.start[sub] < 0 | 2243 | if (search_regs.start[sub] < 0 |
| 2244 | || search_regs.start[sub] > search_regs.end[sub] | 2244 | || search_regs.start[sub] > search_regs.end[sub] |
| 2245 | || search_regs.end[sub] > XSTRING (string)->size) | 2245 | || search_regs.end[sub] > SCHARS (string)) |
| 2246 | args_out_of_range (make_number (search_regs.start[sub]), | 2246 | args_out_of_range (make_number (search_regs.start[sub]), |
| 2247 | make_number (search_regs.end[sub])); | 2247 | make_number (search_regs.end[sub])); |
| 2248 | } | 2248 | } |
| @@ -2342,7 +2342,7 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2342 | /* We build up the substituted string in ACCUM. */ | 2342 | /* We build up the substituted string in ACCUM. */ |
| 2343 | Lisp_Object accum; | 2343 | Lisp_Object accum; |
| 2344 | Lisp_Object middle; | 2344 | Lisp_Object middle; |
| 2345 | int length = STRING_BYTES (XSTRING (newtext)); | 2345 | int length = SBYTES (newtext); |
| 2346 | 2346 | ||
| 2347 | accum = Qnil; | 2347 | accum = Qnil; |
| 2348 | 2348 | ||
| @@ -2434,7 +2434,7 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2434 | perform substitution on the replacement string. */ | 2434 | perform substitution on the replacement string. */ |
| 2435 | if (NILP (literal)) | 2435 | if (NILP (literal)) |
| 2436 | { | 2436 | { |
| 2437 | int length = STRING_BYTES (XSTRING (newtext)); | 2437 | int length = SBYTES (newtext); |
| 2438 | unsigned char *substed; | 2438 | unsigned char *substed; |
| 2439 | int substed_alloc_size, substed_len; | 2439 | int substed_alloc_size, substed_len; |
| 2440 | int buf_multibyte = !NILP (current_buffer->enable_multibyte_characters); | 2440 | int buf_multibyte = !NILP (current_buffer->enable_multibyte_characters); |
| @@ -2471,7 +2471,7 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2471 | else | 2471 | else |
| 2472 | { | 2472 | { |
| 2473 | /* Note that we don't have to increment POS. */ | 2473 | /* Note that we don't have to increment POS. */ |
| 2474 | c = XSTRING (newtext)->data[pos_byte++]; | 2474 | c = SDATA (newtext)[pos_byte++]; |
| 2475 | if (buf_multibyte) | 2475 | if (buf_multibyte) |
| 2476 | c = unibyte_char_to_multibyte (c); | 2476 | c = unibyte_char_to_multibyte (c); |
| 2477 | } | 2477 | } |
| @@ -2493,7 +2493,7 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2493 | } | 2493 | } |
| 2494 | else | 2494 | else |
| 2495 | { | 2495 | { |
| 2496 | c = XSTRING (newtext)->data[pos_byte++]; | 2496 | c = SREF (newtext, pos_byte++); |
| 2497 | if (buf_multibyte) | 2497 | if (buf_multibyte) |
| 2498 | c = unibyte_char_to_multibyte (c); | 2498 | c = unibyte_char_to_multibyte (c); |
| 2499 | } | 2499 | } |
| @@ -2558,7 +2558,7 @@ since only regular expressions have distinguished subexpressions. */) | |||
| 2558 | /* Replace the old text with the new in the cleanest possible way. */ | 2558 | /* Replace the old text with the new in the cleanest possible way. */ |
| 2559 | replace_range (search_regs.start[sub], search_regs.end[sub], | 2559 | replace_range (search_regs.start[sub], search_regs.end[sub], |
| 2560 | newtext, 1, 0, 1); | 2560 | newtext, 1, 0, 1); |
| 2561 | newpoint = search_regs.start[sub] + XSTRING (newtext)->size; | 2561 | newpoint = search_regs.start[sub] + SCHARS (newtext); |
| 2562 | 2562 | ||
| 2563 | if (case_action == all_caps) | 2563 | if (case_action == all_caps) |
| 2564 | Fupcase_region (make_number (search_regs.start[sub]), | 2564 | Fupcase_region (make_number (search_regs.start[sub]), |
| @@ -2849,12 +2849,12 @@ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, | |||
| 2849 | 2849 | ||
| 2850 | CHECK_STRING (string); | 2850 | CHECK_STRING (string); |
| 2851 | 2851 | ||
| 2852 | temp = (unsigned char *) alloca (STRING_BYTES (XSTRING (string)) * 2); | 2852 | temp = (unsigned char *) alloca (SBYTES (string) * 2); |
| 2853 | 2853 | ||
| 2854 | /* Now copy the data into the new string, inserting escapes. */ | 2854 | /* Now copy the data into the new string, inserting escapes. */ |
| 2855 | 2855 | ||
| 2856 | in = XSTRING (string)->data; | 2856 | in = SDATA (string); |
| 2857 | end = in + STRING_BYTES (XSTRING (string)); | 2857 | end = in + SBYTES (string); |
| 2858 | out = temp; | 2858 | out = temp; |
| 2859 | 2859 | ||
| 2860 | for (; in != end; in++) | 2860 | for (; in != end; in++) |
| @@ -2868,7 +2868,7 @@ DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, | |||
| 2868 | } | 2868 | } |
| 2869 | 2869 | ||
| 2870 | return make_specified_string (temp, | 2870 | return make_specified_string (temp, |
| 2871 | XSTRING (string)->size + backslashes_added, | 2871 | SCHARS (string) + backslashes_added, |
| 2872 | out - temp, | 2872 | out - temp, |
| 2873 | STRING_MULTIBYTE (string)); | 2873 | STRING_MULTIBYTE (string)); |
| 2874 | } | 2874 | } |
diff --git a/src/sound.c b/src/sound.c index 90fe5f524c7..18d0403d49e 100644 --- a/src/sound.c +++ b/src/sound.c | |||
| @@ -433,8 +433,8 @@ Internal use only, use `play-sound' instead. */) | |||
| 433 | else | 433 | else |
| 434 | { | 434 | { |
| 435 | s.data = attrs[SOUND_DATA]; | 435 | s.data = attrs[SOUND_DATA]; |
| 436 | s.header_size = min (MAX_SOUND_HEADER_BYTES, STRING_BYTES (XSTRING (s.data))); | 436 | s.header_size = min (MAX_SOUND_HEADER_BYTES, SBYTES (s.data)); |
| 437 | bcopy (XSTRING (s.data)->data, s.header, s.header_size); | 437 | bcopy (SDATA (s.data), s.header, s.header_size); |
| 438 | } | 438 | } |
| 439 | 439 | ||
| 440 | /* Find out the type of sound. Give up if we can't tell. */ | 440 | /* Find out the type of sound. Give up if we can't tell. */ |
| @@ -443,9 +443,9 @@ Internal use only, use `play-sound' instead. */) | |||
| 443 | /* Set up a device. */ | 443 | /* Set up a device. */ |
| 444 | if (STRINGP (attrs[SOUND_DEVICE])) | 444 | if (STRINGP (attrs[SOUND_DEVICE])) |
| 445 | { | 445 | { |
| 446 | int len = XSTRING (attrs[SOUND_DEVICE])->size; | 446 | int len = SCHARS (attrs[SOUND_DEVICE]); |
| 447 | sd.file = (char *) alloca (len + 1); | 447 | sd.file = (char *) alloca (len + 1); |
| 448 | strcpy (sd.file, XSTRING (attrs[SOUND_DEVICE])->data); | 448 | strcpy (sd.file, SDATA (attrs[SOUND_DEVICE])); |
| 449 | } | 449 | } |
| 450 | 450 | ||
| 451 | if (INTEGERP (attrs[SOUND_VOLUME])) | 451 | if (INTEGERP (attrs[SOUND_VOLUME])) |
| @@ -624,8 +624,8 @@ wav_play (s, sd) | |||
| 624 | files I found so far. If someone feels inclined to implement the | 624 | files I found so far. If someone feels inclined to implement the |
| 625 | whole RIFF-WAVE spec, please do. */ | 625 | whole RIFF-WAVE spec, please do. */ |
| 626 | if (STRINGP (s->data)) | 626 | if (STRINGP (s->data)) |
| 627 | sd->write (sd, XSTRING (s->data)->data + sizeof *header, | 627 | sd->write (sd, SDATA (s->data) + sizeof *header, |
| 628 | STRING_BYTES (XSTRING (s->data)) - sizeof *header); | 628 | SBYTES (s->data) - sizeof *header); |
| 629 | else | 629 | else |
| 630 | { | 630 | { |
| 631 | char *buffer; | 631 | char *buffer; |
| @@ -712,8 +712,8 @@ au_play (s, sd) | |||
| 712 | sd->configure (sd); | 712 | sd->configure (sd); |
| 713 | 713 | ||
| 714 | if (STRINGP (s->data)) | 714 | if (STRINGP (s->data)) |
| 715 | sd->write (sd, XSTRING (s->data)->data + header->data_offset, | 715 | sd->write (sd, SDATA (s->data) + header->data_offset, |
| 716 | STRING_BYTES (XSTRING (s->data)) - header->data_offset); | 716 | SBYTES (s->data) - header->data_offset); |
| 717 | else | 717 | else |
| 718 | { | 718 | { |
| 719 | int blksize = 2048; | 719 | int blksize = 2048; |
diff --git a/src/sunfns.c b/src/sunfns.c index 51347aa42f5..e4e2e84da45 100644 --- a/src/sunfns.c +++ b/src/sunfns.c | |||
| @@ -240,13 +240,13 @@ expressed as a string. If ICON is nil then the original arrow cursor is used. | |||
| 240 | CHECK_NUMBER (X_Hot); | 240 | CHECK_NUMBER (X_Hot); |
| 241 | CHECK_NUMBER (Y_Hot); | 241 | CHECK_NUMBER (Y_Hot); |
| 242 | CHECK_STRING (Data); | 242 | CHECK_STRING (Data); |
| 243 | if (XSTRING(Data)->size != 32) return(Qnil); | 243 | if (SCHARS (Data) != 32) return(Qnil); |
| 244 | /* | 244 | /* |
| 245 | * Setup the new cursor | 245 | * Setup the new cursor |
| 246 | */ | 246 | */ |
| 247 | NewCursor.cur_xhot = X_Hot; | 247 | NewCursor.cur_xhot = X_Hot; |
| 248 | NewCursor.cur_yhot = Y_Hot; | 248 | NewCursor.cur_yhot = Y_Hot; |
| 249 | cp = XSTRING(Data)->data; | 249 | cp = SDATA (Data); |
| 250 | p = CursorData; | 250 | p = CursorData; |
| 251 | i = 16; | 251 | i = 16; |
| 252 | while(--i >= 0) | 252 | while(--i >= 0) |
| @@ -267,7 +267,7 @@ sel_write (sel, file) | |||
| 267 | struct selection *sel; | 267 | struct selection *sel; |
| 268 | FILE *file; | 268 | FILE *file; |
| 269 | { | 269 | { |
| 270 | fwrite (XSTRING (Current_Selection)->data, sizeof (char), | 270 | fwrite (SDATA (Current_Selection), sizeof (char), |
| 271 | sel->sel_items, file); | 271 | sel->sel_items, file); |
| 272 | } | 272 | } |
| 273 | 273 | ||
| @@ -330,7 +330,7 @@ DEFUN ("sun-set-selection", Fsun_set_selection, Ssun_set_selection, 1, 1, | |||
| 330 | 330 | ||
| 331 | CHECK_GFX (Qnil); | 331 | CHECK_GFX (Qnil); |
| 332 | selection.sel_type = SELTYPE_CHAR; | 332 | selection.sel_type = SELTYPE_CHAR; |
| 333 | selection.sel_items = XSTRING (str)->size; | 333 | selection.sel_items = SCHARS (str); |
| 334 | selection.sel_itembytes = 1; | 334 | selection.sel_itembytes = 1; |
| 335 | selection.sel_pubflags = 1; | 335 | selection.sel_pubflags = 1; |
| 336 | selection_set(&selection, sel_write, sel_clear, win_fd); | 336 | selection_set(&selection, sel_write, sel_clear, win_fd); |
| @@ -371,10 +371,10 @@ sun_item_create (Pair) | |||
| 371 | if (VECTORP (Value)) { | 371 | if (VECTORP (Value)) { |
| 372 | submenu = sun_menu_create (Value); | 372 | submenu = sun_menu_create (Value); |
| 373 | menu_item = menu_create_item | 373 | menu_item = menu_create_item |
| 374 | (MENU_RELEASE, MENU_PULLRIGHT_ITEM, XSTRING(String)->data, submenu, 0); | 374 | (MENU_RELEASE, MENU_PULLRIGHT_ITEM, SDATA (String), submenu, 0); |
| 375 | } else { | 375 | } else { |
| 376 | menu_item = menu_create_item | 376 | menu_item = menu_create_item |
| 377 | (MENU_RELEASE, MENU_STRING_ITEM, XSTRING(String)->data, Value, 0); | 377 | (MENU_RELEASE, MENU_STRING_ITEM, SDATA (String), Value, 0); |
| 378 | } | 378 | } |
| 379 | return menu_item; | 379 | return menu_item; |
| 380 | } | 380 | } |
diff --git a/src/syntax.c b/src/syntax.c index 30b9eb1f4c4..8d6b052f14b 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -908,7 +908,7 @@ text property. */) | |||
| 908 | 908 | ||
| 909 | CHECK_STRING (string); | 909 | CHECK_STRING (string); |
| 910 | 910 | ||
| 911 | p = XSTRING (string)->data; | 911 | p = SDATA (string); |
| 912 | code = (enum syntaxcode) syntax_spec_code[*p++]; | 912 | code = (enum syntaxcode) syntax_spec_code[*p++]; |
| 913 | if (((int) code & 0377) == 0377) | 913 | if (((int) code & 0377) == 0377) |
| 914 | error ("invalid syntax description letter: %c", p[-1]); | 914 | error ("invalid syntax description letter: %c", p[-1]); |
| @@ -920,7 +920,7 @@ text property. */) | |||
| 920 | { | 920 | { |
| 921 | int len; | 921 | int len; |
| 922 | int character = (STRING_CHAR_AND_LENGTH | 922 | int character = (STRING_CHAR_AND_LENGTH |
| 923 | (p, STRING_BYTES (XSTRING (string)) - 1, len)); | 923 | (p, SBYTES (string) - 1, len)); |
| 924 | XSETINT (match, character); | 924 | XSETINT (match, character); |
| 925 | if (XFASTINT (match) == ' ') | 925 | if (XFASTINT (match) == ' ') |
| 926 | match = Qnil; | 926 | match = Qnil; |
| @@ -1369,10 +1369,10 @@ skip_chars (forwardp, syntaxp, string, lim) | |||
| 1369 | int len; | 1369 | int len; |
| 1370 | 1370 | ||
| 1371 | CHECK_STRING (string); | 1371 | CHECK_STRING (string); |
| 1372 | char_ranges = (int *) alloca (XSTRING (string)->size * (sizeof (int)) * 2); | 1372 | char_ranges = (int *) alloca (SCHARS (string) * (sizeof (int)) * 2); |
| 1373 | string_multibyte = STRING_MULTIBYTE (string); | 1373 | string_multibyte = STRING_MULTIBYTE (string); |
| 1374 | str = XSTRING (string)->data; | 1374 | str = SDATA (string); |
| 1375 | size_byte = STRING_BYTES (XSTRING (string)); | 1375 | size_byte = SBYTES (string); |
| 1376 | 1376 | ||
| 1377 | /* Adjust the multibyteness of the string to that of the buffer. */ | 1377 | /* Adjust the multibyteness of the string to that of the buffer. */ |
| 1378 | if (multibyte != string_multibyte) | 1378 | if (multibyte != string_multibyte) |
| @@ -1380,14 +1380,14 @@ skip_chars (forwardp, syntaxp, string, lim) | |||
| 1380 | int nbytes; | 1380 | int nbytes; |
| 1381 | 1381 | ||
| 1382 | if (multibyte) | 1382 | if (multibyte) |
| 1383 | nbytes = count_size_as_multibyte (XSTRING (string)->data, | 1383 | nbytes = count_size_as_multibyte (SDATA (string), |
| 1384 | XSTRING (string)->size); | 1384 | SCHARS (string)); |
| 1385 | else | 1385 | else |
| 1386 | nbytes = XSTRING (string)->size; | 1386 | nbytes = SCHARS (string); |
| 1387 | if (nbytes != size_byte) | 1387 | if (nbytes != size_byte) |
| 1388 | { | 1388 | { |
| 1389 | str = (unsigned char *) alloca (nbytes); | 1389 | str = (unsigned char *) alloca (nbytes); |
| 1390 | copy_text (XSTRING (string)->data, str, size_byte, | 1390 | copy_text (SDATA (string), str, size_byte, |
| 1391 | string_multibyte, multibyte); | 1391 | string_multibyte, multibyte); |
| 1392 | size_byte = nbytes; | 1392 | size_byte = nbytes; |
| 1393 | } | 1393 | } |
| @@ -1409,7 +1409,7 @@ skip_chars (forwardp, syntaxp, string, lim) | |||
| 1409 | i_byte = 0; | 1409 | i_byte = 0; |
| 1410 | 1410 | ||
| 1411 | if (i_byte < size_byte | 1411 | if (i_byte < size_byte |
| 1412 | && XSTRING (string)->data[0] == '^') | 1412 | && SREF (string, 0) == '^') |
| 1413 | { | 1413 | { |
| 1414 | negate = 1; i_byte++; | 1414 | negate = 1; i_byte++; |
| 1415 | } | 1415 | } |
diff --git a/src/syntax.h b/src/syntax.h index 41f6662ddeb..4cbd2e2edf9 100644 --- a/src/syntax.h +++ b/src/syntax.h | |||
| @@ -330,7 +330,7 @@ if (1) \ | |||
| 330 | else \ | 330 | else \ |
| 331 | { \ | 331 | { \ |
| 332 | gl_state.b_property = 0; \ | 332 | gl_state.b_property = 0; \ |
| 333 | gl_state.e_property = 1 + XSTRING (gl_state.object)->size; \ | 333 | gl_state.e_property = 1 + SCHARS (gl_state.object); \ |
| 334 | gl_state.offset = 0; \ | 334 | gl_state.offset = 0; \ |
| 335 | } \ | 335 | } \ |
| 336 | gl_state.use_global = 0; \ | 336 | gl_state.use_global = 0; \ |
diff --git a/src/sysdep.c b/src/sysdep.c index f2ac20ae4a5..9b49f72b4eb 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -795,9 +795,9 @@ sys_subshell () | |||
| 795 | goto xyzzy; | 795 | goto xyzzy; |
| 796 | 796 | ||
| 797 | dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil); | 797 | dir = expand_and_dir_to_file (Funhandled_file_name_directory (dir), Qnil); |
| 798 | str = (unsigned char *) alloca (XSTRING (dir)->size + 2); | 798 | str = (unsigned char *) alloca (SCHARS (dir) + 2); |
| 799 | len = XSTRING (dir)->size; | 799 | len = SCHARS (dir); |
| 800 | bcopy (XSTRING (dir)->data, str, len); | 800 | bcopy (SDATA (dir), str, len); |
| 801 | if (str[len - 1] != '/') str[len++] = '/'; | 801 | if (str[len - 1] != '/') str[len++] = '/'; |
| 802 | str[len] = 0; | 802 | str[len] = 0; |
| 803 | xyzzy: | 803 | xyzzy: |
| @@ -2465,7 +2465,7 @@ init_system_name () | |||
| 2465 | #endif /* BSD4_1 */ | 2465 | #endif /* BSD4_1 */ |
| 2466 | { | 2466 | { |
| 2467 | unsigned char *p; | 2467 | unsigned char *p; |
| 2468 | for (p = XSTRING (Vsystem_name)->data; *p; p++) | 2468 | for (p = SDATA (Vsystem_name); *p; p++) |
| 2469 | if (*p == ' ' || *p == '\t') | 2469 | if (*p == ' ' || *p == '\t') |
| 2470 | *p = '-'; | 2470 | *p = '-'; |
| 2471 | } | 2471 | } |
diff --git a/src/textprop.c b/src/textprop.c index 3e742476a12..bf23f6a34aa 100644 --- a/src/textprop.c +++ b/src/textprop.c | |||
| @@ -776,7 +776,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 776 | if (NILP (position)) | 776 | if (NILP (position)) |
| 777 | { | 777 | { |
| 778 | if (NILP (limit)) | 778 | if (NILP (limit)) |
| 779 | position = make_number (XSTRING (object)->size); | 779 | position = make_number (SCHARS (object)); |
| 780 | else | 780 | else |
| 781 | position = limit; | 781 | position = limit; |
| 782 | } | 782 | } |
| @@ -842,7 +842,7 @@ back past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 842 | if (NILP (position)) | 842 | if (NILP (position)) |
| 843 | { | 843 | { |
| 844 | if (NILP (limit)) | 844 | if (NILP (limit)) |
| 845 | position = make_number (XSTRING (object)->size); | 845 | position = make_number (SCHARS (object)); |
| 846 | else | 846 | else |
| 847 | position = limit; | 847 | position = limit; |
| 848 | } | 848 | } |
| @@ -935,7 +935,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 935 | 935 | ||
| 936 | if (NULL_INTERVAL_P (next)) | 936 | if (NULL_INTERVAL_P (next)) |
| 937 | XSETFASTINT (position, (STRINGP (object) | 937 | XSETFASTINT (position, (STRINGP (object) |
| 938 | ? XSTRING (object)->size | 938 | ? SCHARS (object) |
| 939 | : BUF_ZV (XBUFFER (object)))); | 939 | : BUF_ZV (XBUFFER (object)))); |
| 940 | else | 940 | else |
| 941 | XSETFASTINT (position, next->position); | 941 | XSETFASTINT (position, next->position); |
| @@ -955,7 +955,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 955 | return limit; | 955 | return limit; |
| 956 | if (NILP (limit)) | 956 | if (NILP (limit)) |
| 957 | XSETFASTINT (limit, (STRINGP (object) | 957 | XSETFASTINT (limit, (STRINGP (object) |
| 958 | ? XSTRING (object)->size | 958 | ? SCHARS (object) |
| 959 | : BUF_ZV (XBUFFER (object)))); | 959 | : BUF_ZV (XBUFFER (object)))); |
| 960 | if (!(next->position < XFASTINT (limit))) | 960 | if (!(next->position < XFASTINT (limit))) |
| 961 | return limit; | 961 | return limit; |
| @@ -1035,7 +1035,7 @@ past position LIMIT; return LIMIT if nothing is found before LIMIT. */) | |||
| 1035 | return limit; | 1035 | return limit; |
| 1036 | if (NILP (limit)) | 1036 | if (NILP (limit)) |
| 1037 | XSETFASTINT (limit, (STRINGP (object) | 1037 | XSETFASTINT (limit, (STRINGP (object) |
| 1038 | ? XSTRING (object)->size | 1038 | ? SCHARS (object) |
| 1039 | : BUF_ZV (XBUFFER (object)))); | 1039 | : BUF_ZV (XBUFFER (object)))); |
| 1040 | if (!(next->position < XFASTINT (limit))) | 1040 | if (!(next->position < XFASTINT (limit))) |
| 1041 | return limit; | 1041 | return limit; |
| @@ -1306,12 +1306,12 @@ set_text_properties (start, end, properties, object, signal_after_change_p) | |||
| 1306 | get rid of its intervals. */ | 1306 | get rid of its intervals. */ |
| 1307 | if (NILP (properties) && STRINGP (object) | 1307 | if (NILP (properties) && STRINGP (object) |
| 1308 | && XFASTINT (start) == 0 | 1308 | && XFASTINT (start) == 0 |
| 1309 | && XFASTINT (end) == XSTRING (object)->size) | 1309 | && XFASTINT (end) == SCHARS (object)) |
| 1310 | { | 1310 | { |
| 1311 | if (! XSTRING (object)->intervals) | 1311 | if (! STRING_INTERVALS (object)) |
| 1312 | return Qt; | 1312 | return Qt; |
| 1313 | 1313 | ||
| 1314 | XSTRING (object)->intervals = 0; | 1314 | STRING_INTERVALS (object) = 0; |
| 1315 | return Qt; | 1315 | return Qt; |
| 1316 | } | 1316 | } |
| 1317 | 1317 | ||
diff --git a/src/undo.c b/src/undo.c index 714c3022d96..edb07147a0a 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -142,7 +142,7 @@ record_delete (beg, string) | |||
| 142 | if (EQ (current_buffer->undo_list, Qt)) | 142 | if (EQ (current_buffer->undo_list, Qt)) |
| 143 | return; | 143 | return; |
| 144 | 144 | ||
| 145 | if (PT == beg + XSTRING (string)->size) | 145 | if (PT == beg + SCHARS (string)) |
| 146 | { | 146 | { |
| 147 | XSETINT (sbeg, -beg); | 147 | XSETINT (sbeg, -beg); |
| 148 | record_point (PT); | 148 | record_point (PT); |
| @@ -334,7 +334,7 @@ truncate_undo_list (list, minsize, maxsize) | |||
| 334 | size_so_far += sizeof (struct Lisp_Cons); | 334 | size_so_far += sizeof (struct Lisp_Cons); |
| 335 | if (STRINGP (XCAR (elt))) | 335 | if (STRINGP (XCAR (elt))) |
| 336 | size_so_far += (sizeof (struct Lisp_String) - 1 | 336 | size_so_far += (sizeof (struct Lisp_String) - 1 |
| 337 | + XSTRING (XCAR (elt))->size); | 337 | + SCHARS (XCAR (elt))); |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | /* Advance to next element. */ | 340 | /* Advance to next element. */ |
| @@ -369,7 +369,7 @@ truncate_undo_list (list, minsize, maxsize) | |||
| 369 | size_so_far += sizeof (struct Lisp_Cons); | 369 | size_so_far += sizeof (struct Lisp_Cons); |
| 370 | if (STRINGP (XCAR (elt))) | 370 | if (STRINGP (XCAR (elt))) |
| 371 | size_so_far += (sizeof (struct Lisp_String) - 1 | 371 | size_so_far += (sizeof (struct Lisp_String) - 1 |
| 372 | + XSTRING (XCAR (elt))->size); | 372 | + SCHARS (XCAR (elt))); |
| 373 | } | 373 | } |
| 374 | 374 | ||
| 375 | /* Advance to next element. */ | 375 | /* Advance to next element. */ |
diff --git a/src/w16select.c b/src/w16select.c index 194efdf590d..bdbd38de575 100644 --- a/src/w16select.c +++ b/src/w16select.c | |||
| @@ -501,12 +501,12 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat | |||
| 501 | 501 | ||
| 502 | BLOCK_INPUT; | 502 | BLOCK_INPUT; |
| 503 | 503 | ||
| 504 | nbytes = STRING_BYTES (XSTRING (string)); | 504 | nbytes = SBYTES (string); |
| 505 | src = XSTRING (string)->data; | 505 | src = SDATA (string); |
| 506 | 506 | ||
| 507 | /* Since we are now handling multilingual text, we must consider | 507 | /* Since we are now handling multilingual text, we must consider |
| 508 | encoding text for the clipboard. */ | 508 | encoding text for the clipboard. */ |
| 509 | charset_info = find_charset_in_text (src, XSTRING (string)->size, nbytes, | 509 | charset_info = find_charset_in_text (src, SCHARS (string), nbytes, |
| 510 | NULL, Qnil); | 510 | NULL, Qnil); |
| 511 | 511 | ||
| 512 | if (charset_info == 0) | 512 | if (charset_info == 0) |
| @@ -531,8 +531,8 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat | |||
| 531 | && !NILP (Ffboundp (coding.pre_write_conversion))) | 531 | && !NILP (Ffboundp (coding.pre_write_conversion))) |
| 532 | { | 532 | { |
| 533 | string = run_pre_post_conversion_on_str (string, &coding, 1); | 533 | string = run_pre_post_conversion_on_str (string, &coding, 1); |
| 534 | src = XSTRING (string)->data; | 534 | src = SDATA (string); |
| 535 | nbytes = STRING_BYTES (XSTRING (string)); | 535 | nbytes = SBYTES (string); |
| 536 | } | 536 | } |
| 537 | coding.src_multibyte = 1; | 537 | coding.src_multibyte = 1; |
| 538 | coding.dst_multibyte = 0; | 538 | coding.dst_multibyte = 0; |
| @@ -3581,8 +3581,8 @@ check_windows_init_file () | |||
| 3581 | if (fd < 0) | 3581 | if (fd < 0) |
| 3582 | { | 3582 | { |
| 3583 | Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil); | 3583 | Lisp_Object load_path_print = Fprin1_to_string (full_load_path, Qnil); |
| 3584 | char *init_file_name = XSTRING (init_file)->data; | 3584 | char *init_file_name = SDATA (init_file); |
| 3585 | char *load_path = XSTRING (load_path_print)->data; | 3585 | char *load_path = SDATA (load_path_print); |
| 3586 | char *buffer = alloca (1024); | 3586 | char *buffer = alloca (1024); |
| 3587 | 3587 | ||
| 3588 | sprintf (buffer, | 3588 | sprintf (buffer, |
diff --git a/src/w32fns.c b/src/w32fns.c index 88d30931d51..ea865a7a0ae 100644 --- a/src/w32fns.c +++ b/src/w32fns.c | |||
| @@ -571,7 +571,7 @@ x_create_bitmap_from_file (f, file) | |||
| 571 | { | 571 | { |
| 572 | if (dpyinfo->bitmaps[id].refcount | 572 | if (dpyinfo->bitmaps[id].refcount |
| 573 | && dpyinfo->bitmaps[id].file | 573 | && dpyinfo->bitmaps[id].file |
| 574 | && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data)) | 574 | && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file))) |
| 575 | { | 575 | { |
| 576 | ++dpyinfo->bitmaps[id].refcount; | 576 | ++dpyinfo->bitmaps[id].refcount; |
| 577 | return id + 1; | 577 | return id + 1; |
| @@ -584,7 +584,7 @@ x_create_bitmap_from_file (f, file) | |||
| 584 | return -1; | 584 | return -1; |
| 585 | emacs_close (fd); | 585 | emacs_close (fd); |
| 586 | 586 | ||
| 587 | filename = (char *) XSTRING (found)->data; | 587 | filename = (char *) SDATA (found); |
| 588 | 588 | ||
| 589 | hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE); | 589 | hinst = LoadLibraryEx (filename, NULL, LOAD_LIBRARY_AS_DATAFILE); |
| 590 | 590 | ||
| @@ -600,11 +600,11 @@ x_create_bitmap_from_file (f, file) | |||
| 600 | id = x_allocate_bitmap_record (f); | 600 | id = x_allocate_bitmap_record (f); |
| 601 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; | 601 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
| 602 | dpyinfo->bitmaps[id - 1].refcount = 1; | 602 | dpyinfo->bitmaps[id - 1].refcount = 1; |
| 603 | dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (XSTRING (file)->size + 1); | 603 | dpyinfo->bitmaps[id - 1].file = (char *) xmalloc (SCHARS (file) + 1); |
| 604 | dpyinfo->bitmaps[id - 1].depth = 1; | 604 | dpyinfo->bitmaps[id - 1].depth = 1; |
| 605 | dpyinfo->bitmaps[id - 1].height = height; | 605 | dpyinfo->bitmaps[id - 1].height = height; |
| 606 | dpyinfo->bitmaps[id - 1].width = width; | 606 | dpyinfo->bitmaps[id - 1].width = width; |
| 607 | strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); | 607 | strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file)); |
| 608 | 608 | ||
| 609 | return id; | 609 | return id; |
| 610 | #endif /* TODO */ | 610 | #endif /* TODO */ |
| @@ -1216,7 +1216,7 @@ where R,G,B are numbers between 0 and 255 and name is an arbitrary string. */) | |||
| 1216 | CHECK_STRING (filename); | 1216 | CHECK_STRING (filename); |
| 1217 | abspath = Fexpand_file_name (filename, Qnil); | 1217 | abspath = Fexpand_file_name (filename, Qnil); |
| 1218 | 1218 | ||
| 1219 | fp = fopen (XSTRING (filename)->data, "rt"); | 1219 | fp = fopen (SDATA (filename), "rt"); |
| 1220 | if (fp) | 1220 | if (fp) |
| 1221 | { | 1221 | { |
| 1222 | char buf[512]; | 1222 | char buf[512]; |
| @@ -1556,7 +1556,7 @@ w32_color_map_lookup (colorname) | |||
| 1556 | 1556 | ||
| 1557 | tem = Fcar (elt); | 1557 | tem = Fcar (elt); |
| 1558 | 1558 | ||
| 1559 | if (lstrcmpi (XSTRING (tem)->data, colorname) == 0) | 1559 | if (lstrcmpi (SDATA (tem), colorname) == 0) |
| 1560 | { | 1560 | { |
| 1561 | ret = XUINT (Fcdr (elt)); | 1561 | ret = XUINT (Fcdr (elt)); |
| 1562 | break; | 1562 | break; |
| @@ -1986,9 +1986,9 @@ x_decode_color (f, arg, def) | |||
| 1986 | 1986 | ||
| 1987 | CHECK_STRING (arg); | 1987 | CHECK_STRING (arg); |
| 1988 | 1988 | ||
| 1989 | if (strcmp (XSTRING (arg)->data, "black") == 0) | 1989 | if (strcmp (SDATA (arg), "black") == 0) |
| 1990 | return BLACK_PIX_DEFAULT (f); | 1990 | return BLACK_PIX_DEFAULT (f); |
| 1991 | else if (strcmp (XSTRING (arg)->data, "white") == 0) | 1991 | else if (strcmp (SDATA (arg), "white") == 0) |
| 1992 | return WHITE_PIX_DEFAULT (f); | 1992 | return WHITE_PIX_DEFAULT (f); |
| 1993 | 1993 | ||
| 1994 | if ((FRAME_W32_DISPLAY_INFO (f)->n_planes * FRAME_W32_DISPLAY_INFO (f)->n_cbits) == 1) | 1994 | if ((FRAME_W32_DISPLAY_INFO (f)->n_planes * FRAME_W32_DISPLAY_INFO (f)->n_cbits) == 1) |
| @@ -1996,7 +1996,7 @@ x_decode_color (f, arg, def) | |||
| 1996 | 1996 | ||
| 1997 | /* w32_defined_color is responsible for coping with failures | 1997 | /* w32_defined_color is responsible for coping with failures |
| 1998 | by looking for a near-miss. */ | 1998 | by looking for a near-miss. */ |
| 1999 | if (w32_defined_color (f, XSTRING (arg)->data, &cdef, 1)) | 1999 | if (w32_defined_color (f, SDATA (arg), &cdef, 1)) |
| 2000 | return cdef.pixel; | 2000 | return cdef.pixel; |
| 2001 | 2001 | ||
| 2002 | /* defined_color failed; return an ultimate default. */ | 2002 | /* defined_color failed; return an ultimate default. */ |
| @@ -2476,11 +2476,11 @@ x_set_icon_name (f, arg, oldval) | |||
| 2476 | BLOCK_INPUT; | 2476 | BLOCK_INPUT; |
| 2477 | 2477 | ||
| 2478 | result = x_text_icon (f, | 2478 | result = x_text_icon (f, |
| 2479 | (char *) XSTRING ((!NILP (f->icon_name) | 2479 | (char *) SDATA ((!NILP (f->icon_name) |
| 2480 | ? f->icon_name | 2480 | ? f->icon_name |
| 2481 | : !NILP (f->title) | 2481 | : !NILP (f->title) |
| 2482 | ? f->title | 2482 | ? f->title |
| 2483 | : f->name))->data); | 2483 | : f->name))); |
| 2484 | 2484 | ||
| 2485 | if (result) | 2485 | if (result) |
| 2486 | { | 2486 | { |
| @@ -2522,12 +2522,12 @@ x_set_font (f, arg, oldval) | |||
| 2522 | 2522 | ||
| 2523 | BLOCK_INPUT; | 2523 | BLOCK_INPUT; |
| 2524 | result = (STRINGP (fontset_name) | 2524 | result = (STRINGP (fontset_name) |
| 2525 | ? x_new_fontset (f, XSTRING (fontset_name)->data) | 2525 | ? x_new_fontset (f, SDATA (fontset_name)) |
| 2526 | : x_new_font (f, XSTRING (arg)->data)); | 2526 | : x_new_font (f, SDATA (arg))); |
| 2527 | UNBLOCK_INPUT; | 2527 | UNBLOCK_INPUT; |
| 2528 | 2528 | ||
| 2529 | if (EQ (result, Qnil)) | 2529 | if (EQ (result, Qnil)) |
| 2530 | error ("Font `%s' is not defined", XSTRING (arg)->data); | 2530 | error ("Font `%s' is not defined", SDATA (arg)); |
| 2531 | else if (EQ (result, Qt)) | 2531 | else if (EQ (result, Qt)) |
| 2532 | error ("The characters of the given font have varying widths"); | 2532 | error ("The characters of the given font have varying widths"); |
| 2533 | else if (STRINGP (result)) | 2533 | else if (STRINGP (result)) |
| @@ -2812,7 +2812,7 @@ x_set_name (f, name, explicit) | |||
| 2812 | /* Check for no change needed in this very common case | 2812 | /* Check for no change needed in this very common case |
| 2813 | before we do any consing. */ | 2813 | before we do any consing. */ |
| 2814 | if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name, | 2814 | if (!strcmp (FRAME_W32_DISPLAY_INFO (f)->w32_id_name, |
| 2815 | XSTRING (f->name)->data)) | 2815 | SDATA (f->name))) |
| 2816 | return; | 2816 | return; |
| 2817 | name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name); | 2817 | name = build_string (FRAME_W32_DISPLAY_INFO (f)->w32_id_name); |
| 2818 | } | 2818 | } |
| @@ -2836,7 +2836,7 @@ x_set_name (f, name, explicit) | |||
| 2836 | name = ENCODE_SYSTEM (name); | 2836 | name = ENCODE_SYSTEM (name); |
| 2837 | 2837 | ||
| 2838 | BLOCK_INPUT; | 2838 | BLOCK_INPUT; |
| 2839 | SetWindowText(FRAME_W32_WINDOW (f), XSTRING (name)->data); | 2839 | SetWindowText(FRAME_W32_WINDOW (f), SDATA (name)); |
| 2840 | UNBLOCK_INPUT; | 2840 | UNBLOCK_INPUT; |
| 2841 | } | 2841 | } |
| 2842 | } | 2842 | } |
| @@ -2896,7 +2896,7 @@ x_set_title (f, name, old_name) | |||
| 2896 | name = ENCODE_SYSTEM (name); | 2896 | name = ENCODE_SYSTEM (name); |
| 2897 | 2897 | ||
| 2898 | BLOCK_INPUT; | 2898 | BLOCK_INPUT; |
| 2899 | SetWindowText(FRAME_W32_WINDOW (f), XSTRING (name)->data); | 2899 | SetWindowText(FRAME_W32_WINDOW (f), SDATA (name)); |
| 2900 | UNBLOCK_INPUT; | 2900 | UNBLOCK_INPUT; |
| 2901 | } | 2901 | } |
| 2902 | } | 2902 | } |
| @@ -3002,10 +3002,10 @@ validate_x_resource_name () | |||
| 3002 | 3002 | ||
| 3003 | if (STRINGP (Vx_resource_name)) | 3003 | if (STRINGP (Vx_resource_name)) |
| 3004 | { | 3004 | { |
| 3005 | unsigned char *p = XSTRING (Vx_resource_name)->data; | 3005 | unsigned char *p = SDATA (Vx_resource_name); |
| 3006 | int i; | 3006 | int i; |
| 3007 | 3007 | ||
| 3008 | len = STRING_BYTES (XSTRING (Vx_resource_name)); | 3008 | len = SBYTES (Vx_resource_name); |
| 3009 | 3009 | ||
| 3010 | /* Only letters, digits, - and _ are valid in resource names. | 3010 | /* Only letters, digits, - and _ are valid in resource names. |
| 3011 | Count the valid characters and count the invalid ones. */ | 3011 | Count the valid characters and count the invalid ones. */ |
| @@ -3044,12 +3044,12 @@ validate_x_resource_name () | |||
| 3044 | 3044 | ||
| 3045 | for (i = 0; i < len; i++) | 3045 | for (i = 0; i < len; i++) |
| 3046 | { | 3046 | { |
| 3047 | int c = XSTRING (new)->data[i]; | 3047 | int c = SREF (new, i); |
| 3048 | if (! ((c >= 'a' && c <= 'z') | 3048 | if (! ((c >= 'a' && c <= 'z') |
| 3049 | || (c >= 'A' && c <= 'Z') | 3049 | || (c >= 'A' && c <= 'Z') |
| 3050 | || (c >= '0' && c <= '9') | 3050 | || (c >= '0' && c <= '9') |
| 3051 | || c == '-' || c == '_')) | 3051 | || c == '-' || c == '_')) |
| 3052 | XSTRING (new)->data[i] = '_'; | 3052 | SREF (new, i) = '_'; |
| 3053 | } | 3053 | } |
| 3054 | } | 3054 | } |
| 3055 | 3055 | ||
| @@ -3087,37 +3087,37 @@ and the class is `Emacs.CLASS.SUBCLASS'. */) | |||
| 3087 | 3087 | ||
| 3088 | /* Allocate space for the components, the dots which separate them, | 3088 | /* Allocate space for the components, the dots which separate them, |
| 3089 | and the final '\0'. Make them big enough for the worst case. */ | 3089 | and the final '\0'. Make them big enough for the worst case. */ |
| 3090 | name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) | 3090 | name_key = (char *) alloca (SBYTES (Vx_resource_name) |
| 3091 | + (STRINGP (component) | 3091 | + (STRINGP (component) |
| 3092 | ? STRING_BYTES (XSTRING (component)) : 0) | 3092 | ? SBYTES (component) : 0) |
| 3093 | + STRING_BYTES (XSTRING (attribute)) | 3093 | + SBYTES (attribute) |
| 3094 | + 3); | 3094 | + 3); |
| 3095 | 3095 | ||
| 3096 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | 3096 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
| 3097 | + STRING_BYTES (XSTRING (class)) | 3097 | + SBYTES (class) |
| 3098 | + (STRINGP (subclass) | 3098 | + (STRINGP (subclass) |
| 3099 | ? STRING_BYTES (XSTRING (subclass)) : 0) | 3099 | ? SBYTES (subclass) : 0) |
| 3100 | + 3); | 3100 | + 3); |
| 3101 | 3101 | ||
| 3102 | /* Start with emacs.FRAMENAME for the name (the specific one) | 3102 | /* Start with emacs.FRAMENAME for the name (the specific one) |
| 3103 | and with `Emacs' for the class key (the general one). */ | 3103 | and with `Emacs' for the class key (the general one). */ |
| 3104 | strcpy (name_key, XSTRING (Vx_resource_name)->data); | 3104 | strcpy (name_key, SDATA (Vx_resource_name)); |
| 3105 | strcpy (class_key, EMACS_CLASS); | 3105 | strcpy (class_key, EMACS_CLASS); |
| 3106 | 3106 | ||
| 3107 | strcat (class_key, "."); | 3107 | strcat (class_key, "."); |
| 3108 | strcat (class_key, XSTRING (class)->data); | 3108 | strcat (class_key, SDATA (class)); |
| 3109 | 3109 | ||
| 3110 | if (!NILP (component)) | 3110 | if (!NILP (component)) |
| 3111 | { | 3111 | { |
| 3112 | strcat (class_key, "."); | 3112 | strcat (class_key, "."); |
| 3113 | strcat (class_key, XSTRING (subclass)->data); | 3113 | strcat (class_key, SDATA (subclass)); |
| 3114 | 3114 | ||
| 3115 | strcat (name_key, "."); | 3115 | strcat (name_key, "."); |
| 3116 | strcat (name_key, XSTRING (component)->data); | 3116 | strcat (name_key, SDATA (component)); |
| 3117 | } | 3117 | } |
| 3118 | 3118 | ||
| 3119 | strcat (name_key, "."); | 3119 | strcat (name_key, "."); |
| 3120 | strcat (name_key, XSTRING (attribute)->data); | 3120 | strcat (name_key, SDATA (attribute)); |
| 3121 | 3121 | ||
| 3122 | value = x_get_string_resource (Qnil, | 3122 | value = x_get_string_resource (Qnil, |
| 3123 | name_key, class_key); | 3123 | name_key, class_key); |
| @@ -3140,13 +3140,13 @@ x_get_resource_string (attribute, class) | |||
| 3140 | 3140 | ||
| 3141 | /* Allocate space for the components, the dots which separate them, | 3141 | /* Allocate space for the components, the dots which separate them, |
| 3142 | and the final '\0'. */ | 3142 | and the final '\0'. */ |
| 3143 | name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name)) | 3143 | name_key = (char *) alloca (SBYTES (Vinvocation_name) |
| 3144 | + strlen (attribute) + 2); | 3144 | + strlen (attribute) + 2); |
| 3145 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | 3145 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
| 3146 | + strlen (class) + 2); | 3146 | + strlen (class) + 2); |
| 3147 | 3147 | ||
| 3148 | sprintf (name_key, "%s.%s", | 3148 | sprintf (name_key, "%s.%s", |
| 3149 | XSTRING (Vinvocation_name)->data, | 3149 | SDATA (Vinvocation_name), |
| 3150 | attribute); | 3150 | attribute); |
| 3151 | sprintf (class_key, "%s.%s", EMACS_CLASS, class); | 3151 | sprintf (class_key, "%s.%s", EMACS_CLASS, class); |
| 3152 | 3152 | ||
| @@ -3201,15 +3201,15 @@ w32_get_arg (alist, param, attribute, class, type) | |||
| 3201 | switch (type) | 3201 | switch (type) |
| 3202 | { | 3202 | { |
| 3203 | case RES_TYPE_NUMBER: | 3203 | case RES_TYPE_NUMBER: |
| 3204 | return make_number (atoi (XSTRING (tem)->data)); | 3204 | return make_number (atoi (SDATA (tem))); |
| 3205 | 3205 | ||
| 3206 | case RES_TYPE_FLOAT: | 3206 | case RES_TYPE_FLOAT: |
| 3207 | return make_float (atof (XSTRING (tem)->data)); | 3207 | return make_float (atof (SDATA (tem))); |
| 3208 | 3208 | ||
| 3209 | case RES_TYPE_BOOLEAN: | 3209 | case RES_TYPE_BOOLEAN: |
| 3210 | tem = Fdowncase (tem); | 3210 | tem = Fdowncase (tem); |
| 3211 | if (!strcmp (XSTRING (tem)->data, "on") | 3211 | if (!strcmp (SDATA (tem), "on") |
| 3212 | || !strcmp (XSTRING (tem)->data, "true")) | 3212 | || !strcmp (SDATA (tem), "true")) |
| 3213 | return Qt; | 3213 | return Qt; |
| 3214 | else | 3214 | else |
| 3215 | return Qnil; | 3215 | return Qnil; |
| @@ -3223,11 +3223,11 @@ w32_get_arg (alist, param, attribute, class, type) | |||
| 3223 | { | 3223 | { |
| 3224 | Lisp_Object lower; | 3224 | Lisp_Object lower; |
| 3225 | lower = Fdowncase (tem); | 3225 | lower = Fdowncase (tem); |
| 3226 | if (!strcmp (XSTRING (lower)->data, "on") | 3226 | if (!strcmp (SDATA (lower), "on") |
| 3227 | || !strcmp (XSTRING (lower)->data, "true")) | 3227 | || !strcmp (SDATA (lower), "true")) |
| 3228 | return Qt; | 3228 | return Qt; |
| 3229 | else if (!strcmp (XSTRING (lower)->data, "off") | 3229 | else if (!strcmp (SDATA (lower), "off") |
| 3230 | || !strcmp (XSTRING (lower)->data, "false")) | 3230 | || !strcmp (SDATA (lower), "false")) |
| 3231 | return Qnil; | 3231 | return Qnil; |
| 3232 | else | 3232 | else |
| 3233 | return Fintern (tem, Qnil); | 3233 | return Fintern (tem, Qnil); |
| @@ -3284,7 +3284,7 @@ or a list (- N) meaning -N pixels relative to bottom/right corner. */) | |||
| 3284 | 3284 | ||
| 3285 | CHECK_STRING (string); | 3285 | CHECK_STRING (string); |
| 3286 | 3286 | ||
| 3287 | geometry = XParseGeometry ((char *) XSTRING (string)->data, | 3287 | geometry = XParseGeometry ((char *) SDATA (string), |
| 3288 | &x, &y, &width, &height); | 3288 | &x, &y, &width, &height); |
| 3289 | 3289 | ||
| 3290 | result = Qnil; | 3290 | result = Qnil; |
| @@ -5342,7 +5342,7 @@ w32_window (f, window_prompting, minibuffer_only) | |||
| 5342 | Elsewhere we specify the window name for the window manager. */ | 5342 | Elsewhere we specify the window name for the window manager. */ |
| 5343 | 5343 | ||
| 5344 | { | 5344 | { |
| 5345 | char *str = (char *) XSTRING (Vx_resource_name)->data; | 5345 | char *str = (char *) SDATA (Vx_resource_name); |
| 5346 | f->namebuf = (char *) xmalloc (strlen (str) + 1); | 5346 | f->namebuf = (char *) xmalloc (strlen (str) + 1); |
| 5347 | strcpy (f->namebuf, str); | 5347 | strcpy (f->namebuf, str); |
| 5348 | } | 5348 | } |
| @@ -5409,9 +5409,9 @@ x_icon (f, parms) | |||
| 5409 | ? IconicState | 5409 | ? IconicState |
| 5410 | : NormalState)); | 5410 | : NormalState)); |
| 5411 | 5411 | ||
| 5412 | x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name) | 5412 | x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) |
| 5413 | ? f->icon_name | 5413 | ? f->icon_name |
| 5414 | : f->name))->data); | 5414 | : f->name))); |
| 5415 | #endif | 5415 | #endif |
| 5416 | 5416 | ||
| 5417 | UNBLOCK_INPUT; | 5417 | UNBLOCK_INPUT; |
| @@ -5621,9 +5621,9 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 5621 | { | 5621 | { |
| 5622 | tem = Fquery_fontset (font, Qnil); | 5622 | tem = Fquery_fontset (font, Qnil); |
| 5623 | if (STRINGP (tem)) | 5623 | if (STRINGP (tem)) |
| 5624 | font = x_new_fontset (f, XSTRING (tem)->data); | 5624 | font = x_new_fontset (f, SDATA (tem)); |
| 5625 | else | 5625 | else |
| 5626 | font = x_new_font (f, XSTRING (font)->data); | 5626 | font = x_new_font (f, SDATA (font)); |
| 5627 | } | 5627 | } |
| 5628 | /* Try out a font which we hope has bold and italic variations. */ | 5628 | /* Try out a font which we hope has bold and italic variations. */ |
| 5629 | if (!STRINGP (font)) | 5629 | if (!STRINGP (font)) |
| @@ -5912,12 +5912,12 @@ w32_load_system_font (f,fontname,size) | |||
| 5912 | for (tail = font_names; CONSP (tail); tail = XCDR (tail)) | 5912 | for (tail = font_names; CONSP (tail); tail = XCDR (tail)) |
| 5913 | if (dpyinfo->font_table[i].name | 5913 | if (dpyinfo->font_table[i].name |
| 5914 | && (!strcmp (dpyinfo->font_table[i].name, | 5914 | && (!strcmp (dpyinfo->font_table[i].name, |
| 5915 | XSTRING (XCAR (tail))->data) | 5915 | SDATA (XCAR (tail))) |
| 5916 | || !strcmp (dpyinfo->font_table[i].full_name, | 5916 | || !strcmp (dpyinfo->font_table[i].full_name, |
| 5917 | XSTRING (XCAR (tail))->data))) | 5917 | SDATA (XCAR (tail))))) |
| 5918 | return (dpyinfo->font_table + i); | 5918 | return (dpyinfo->font_table + i); |
| 5919 | 5919 | ||
| 5920 | fontname = (char *) XSTRING (XCAR (font_names))->data; | 5920 | fontname = (char *) SDATA (XCAR (font_names)); |
| 5921 | } | 5921 | } |
| 5922 | else if (w32_strict_fontnames) | 5922 | else if (w32_strict_fontnames) |
| 5923 | { | 5923 | { |
| @@ -6125,9 +6125,9 @@ int size; | |||
| 6125 | char *bdf_name, *bdf_file; | 6125 | char *bdf_name, *bdf_file; |
| 6126 | Lisp_Object bdf_pair; | 6126 | Lisp_Object bdf_pair; |
| 6127 | 6127 | ||
| 6128 | bdf_name = XSTRING (XCAR (bdf_fonts))->data; | 6128 | bdf_name = SDATA (XCAR (bdf_fonts)); |
| 6129 | bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist); | 6129 | bdf_pair = Fassoc (XCAR (bdf_fonts), Vw32_bdf_filename_alist); |
| 6130 | bdf_file = XSTRING (XCDR (bdf_pair))->data; | 6130 | bdf_file = SDATA (XCDR (bdf_pair)); |
| 6131 | 6131 | ||
| 6132 | retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); | 6132 | retval = w32_load_bdf_font (f, bdf_name, size, bdf_file); |
| 6133 | 6133 | ||
| @@ -6413,7 +6413,7 @@ w32_to_x_charset (fncharset) | |||
| 6413 | || !SYMBOLP (XCAR (XCDR (this_entry)))) | 6413 | || !SYMBOLP (XCAR (XCDR (this_entry)))) |
| 6414 | continue; | 6414 | continue; |
| 6415 | 6415 | ||
| 6416 | x_charset = XSTRING (XCAR (this_entry))->data; | 6416 | x_charset = SDATA (XCAR (this_entry)); |
| 6417 | w32_charset = XCAR (XCDR (this_entry)); | 6417 | w32_charset = XCAR (XCDR (this_entry)); |
| 6418 | codepage = XCDR (XCDR (this_entry)); | 6418 | codepage = XCDR (XCDR (this_entry)); |
| 6419 | 6419 | ||
| @@ -7196,7 +7196,7 @@ enum_font_cb2 (lplf, lptm, FontType, lpef) | |||
| 7196 | 7196 | ||
| 7197 | if (!NILP (lpef->pattern)) | 7197 | if (!NILP (lpef->pattern)) |
| 7198 | { | 7198 | { |
| 7199 | charset = xlfd_charset_of_font (XSTRING(lpef->pattern)->data); | 7199 | charset = xlfd_charset_of_font (SDATA (lpef->pattern)); |
| 7200 | 7200 | ||
| 7201 | /* We already checked charsets above, but DEFAULT_CHARSET | 7201 | /* We already checked charsets above, but DEFAULT_CHARSET |
| 7202 | slipped through. So only allow exact matches for DEFAULT_CHARSET. */ | 7202 | slipped through. So only allow exact matches for DEFAULT_CHARSET. */ |
| @@ -7216,7 +7216,7 @@ enum_font_cb2 (lplf, lptm, FontType, lpef) | |||
| 7216 | for ( ; CONSP (charset_list); charset_list = Fcdr (charset_list)) | 7216 | for ( ; CONSP (charset_list); charset_list = Fcdr (charset_list)) |
| 7217 | { | 7217 | { |
| 7218 | Lisp_Object this_charset = Fcar (charset_list); | 7218 | Lisp_Object this_charset = Fcar (charset_list); |
| 7219 | charset = XSTRING (this_charset)->data; | 7219 | charset = SDATA (this_charset); |
| 7220 | 7220 | ||
| 7221 | /* List bold and italic variations if w32-enable-synthesized-fonts | 7221 | /* List bold and italic variations if w32-enable-synthesized-fonts |
| 7222 | is non-nil and this is a plain font. */ | 7222 | is non-nil and this is a plain font. */ |
| @@ -7261,7 +7261,7 @@ enum_font_maybe_add_to_list (lpef, logfont, match_charset, width) | |||
| 7261 | return; | 7261 | return; |
| 7262 | 7262 | ||
| 7263 | if (NILP (lpef->pattern) | 7263 | if (NILP (lpef->pattern) |
| 7264 | || w32_font_match (buf, XSTRING (lpef->pattern)->data)) | 7264 | || w32_font_match (buf, SDATA (lpef->pattern))) |
| 7265 | { | 7265 | { |
| 7266 | /* Check if we already listed this font. This may happen if | 7266 | /* Check if we already listed this font. This may happen if |
| 7267 | w32_enable_synthesized_fonts is non-nil, and there are real | 7267 | w32_enable_synthesized_fonts is non-nil, and there are real |
| @@ -7335,15 +7335,15 @@ static Lisp_Object w32_list_bdf_fonts (Lisp_Object pattern, int max_names) | |||
| 7335 | int n_fonts = 0; | 7335 | int n_fonts = 0; |
| 7336 | 7336 | ||
| 7337 | list = Vw32_bdf_filename_alist; | 7337 | list = Vw32_bdf_filename_alist; |
| 7338 | ptnstr = XSTRING (pattern)->data; | 7338 | ptnstr = SDATA (pattern); |
| 7339 | 7339 | ||
| 7340 | for ( ; CONSP (list); list = XCDR (list)) | 7340 | for ( ; CONSP (list); list = XCDR (list)) |
| 7341 | { | 7341 | { |
| 7342 | tem = XCAR (list); | 7342 | tem = XCAR (list); |
| 7343 | if (CONSP (tem)) | 7343 | if (CONSP (tem)) |
| 7344 | fontname = XSTRING (XCAR (tem))->data; | 7344 | fontname = SDATA (XCAR (tem)); |
| 7345 | else if (STRINGP (tem)) | 7345 | else if (STRINGP (tem)) |
| 7346 | fontname = XSTRING (tem)->data; | 7346 | fontname = SDATA (tem); |
| 7347 | else | 7347 | else |
| 7348 | continue; | 7348 | continue; |
| 7349 | 7349 | ||
| @@ -7395,7 +7395,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 7395 | 7395 | ||
| 7396 | /* Avoid expensive EnumFontFamilies functions if we are not | 7396 | /* Avoid expensive EnumFontFamilies functions if we are not |
| 7397 | going to be able to output one of these anyway. */ | 7397 | going to be able to output one of these anyway. */ |
| 7398 | codepage = w32_codepage_for_font (XSTRING (tpat)->data); | 7398 | codepage = w32_codepage_for_font (SDATA (tpat)); |
| 7399 | if (codepage != CP_8BIT && codepage != CP_UNICODE | 7399 | if (codepage != CP_8BIT && codepage != CP_UNICODE |
| 7400 | && codepage != CP_DEFAULT && codepage != CP_UNKNOWN | 7400 | && codepage != CP_DEFAULT && codepage != CP_UNKNOWN |
| 7401 | && !IsValidCodePage(codepage)) | 7401 | && !IsValidCodePage(codepage)) |
| @@ -7422,7 +7422,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 7422 | /* Use EnumFontFamiliesEx where it is available, as it knows | 7422 | /* Use EnumFontFamiliesEx where it is available, as it knows |
| 7423 | about character sets. Fall back to EnumFontFamilies for | 7423 | about character sets. Fall back to EnumFontFamilies for |
| 7424 | older versions of NT that don't support the 'Ex function. */ | 7424 | older versions of NT that don't support the 'Ex function. */ |
| 7425 | x_to_w32_font (XSTRING (tpat)->data, &ef.logfont); | 7425 | x_to_w32_font (SDATA (tpat), &ef.logfont); |
| 7426 | { | 7426 | { |
| 7427 | LOGFONT font_match_pattern; | 7427 | LOGFONT font_match_pattern; |
| 7428 | HMODULE gdi32 = GetModuleHandle ("gdi32.dll"); | 7428 | HMODULE gdi32 = GetModuleHandle ("gdi32.dll"); |
| @@ -7492,7 +7492,7 @@ w32_list_fonts (f, pattern, size, maxnames) | |||
| 7492 | HDC hdc; | 7492 | HDC hdc; |
| 7493 | HANDLE oldobj; | 7493 | HANDLE oldobj; |
| 7494 | 7494 | ||
| 7495 | if (!x_to_w32_font (XSTRING (XCAR (tem))->data, &lf)) | 7495 | if (!x_to_w32_font (SDATA (XCAR (tem)), &lf)) |
| 7496 | continue; | 7496 | continue; |
| 7497 | 7497 | ||
| 7498 | BLOCK_INPUT; | 7498 | BLOCK_INPUT; |
| @@ -7639,7 +7639,7 @@ w32_find_bdf_fonts_in_dir (Lisp_Object directory) | |||
| 7639 | for ( ; CONSP(filelist); filelist = XCDR (filelist)) | 7639 | for ( ; CONSP(filelist); filelist = XCDR (filelist)) |
| 7640 | { | 7640 | { |
| 7641 | Lisp_Object filename = XCAR (filelist); | 7641 | Lisp_Object filename = XCAR (filelist); |
| 7642 | if (w32_BDF_to_x_font (XSTRING (filename)->data, fontname, 100)) | 7642 | if (w32_BDF_to_x_font (SDATA (filename), fontname, 100)) |
| 7643 | store_in_alist (&list, build_string (fontname), filename); | 7643 | store_in_alist (&list, build_string (fontname), filename); |
| 7644 | } | 7644 | } |
| 7645 | return list; | 7645 | return list; |
| @@ -7684,7 +7684,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, | |||
| 7684 | 7684 | ||
| 7685 | CHECK_STRING (color); | 7685 | CHECK_STRING (color); |
| 7686 | 7686 | ||
| 7687 | if (w32_defined_color (f, XSTRING (color)->data, &foo, 0)) | 7687 | if (w32_defined_color (f, SDATA (color), &foo, 0)) |
| 7688 | return Qt; | 7688 | return Qt; |
| 7689 | else | 7689 | else |
| 7690 | return Qnil; | 7690 | return Qnil; |
| @@ -7700,7 +7700,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, | |||
| 7700 | 7700 | ||
| 7701 | CHECK_STRING (color); | 7701 | CHECK_STRING (color); |
| 7702 | 7702 | ||
| 7703 | if (w32_defined_color (f, XSTRING (color)->data, &foo, 0)) | 7703 | if (w32_defined_color (f, SDATA (color), &foo, 0)) |
| 7704 | { | 7704 | { |
| 7705 | Lisp_Object rgb[3]; | 7705 | Lisp_Object rgb[3]; |
| 7706 | 7706 | ||
| @@ -8031,10 +8031,10 @@ x_display_info_for_name (name) | |||
| 8031 | validate_x_resource_name (); | 8031 | validate_x_resource_name (); |
| 8032 | 8032 | ||
| 8033 | dpyinfo = w32_term_init (name, (unsigned char *)0, | 8033 | dpyinfo = w32_term_init (name, (unsigned char *)0, |
| 8034 | (char *) XSTRING (Vx_resource_name)->data); | 8034 | (char *) SDATA (Vx_resource_name)); |
| 8035 | 8035 | ||
| 8036 | if (dpyinfo == 0) | 8036 | if (dpyinfo == 0) |
| 8037 | error ("Cannot connect to server %s", XSTRING (name)->data); | 8037 | error ("Cannot connect to server %s", SDATA (name)); |
| 8038 | 8038 | ||
| 8039 | w32_in_use = 1; | 8039 | w32_in_use = 1; |
| 8040 | XSETFASTINT (Vwindow_system_version, 3); | 8040 | XSETFASTINT (Vwindow_system_version, 3); |
| @@ -8089,7 +8089,7 @@ terminate Emacs if we can't open the connection. */) | |||
| 8089 | Vw32_color_map = Fw32_default_color_map (); | 8089 | Vw32_color_map = Fw32_default_color_map (); |
| 8090 | 8090 | ||
| 8091 | if (! NILP (xrm_string)) | 8091 | if (! NILP (xrm_string)) |
| 8092 | xrm_option = (unsigned char *) XSTRING (xrm_string)->data; | 8092 | xrm_option = (unsigned char *) SDATA (xrm_string); |
| 8093 | else | 8093 | else |
| 8094 | xrm_option = (unsigned char *) 0; | 8094 | xrm_option = (unsigned char *) 0; |
| 8095 | 8095 | ||
| @@ -8098,7 +8098,7 @@ terminate Emacs if we can't open the connection. */) | |||
| 8098 | { | 8098 | { |
| 8099 | char basename[ MAX_PATH ], *str; | 8099 | char basename[ MAX_PATH ], *str; |
| 8100 | 8100 | ||
| 8101 | strcpy (basename, XSTRING (Vinvocation_name)->data); | 8101 | strcpy (basename, SDATA (Vinvocation_name)); |
| 8102 | str = strrchr (basename, '.'); | 8102 | str = strrchr (basename, '.'); |
| 8103 | if (str) *str = 0; | 8103 | if (str) *str = 0; |
| 8104 | Vinvocation_name = build_string (basename); | 8104 | Vinvocation_name = build_string (basename); |
| @@ -8110,15 +8110,15 @@ terminate Emacs if we can't open the connection. */) | |||
| 8110 | /* This is what opens the connection and sets x_current_display. | 8110 | /* This is what opens the connection and sets x_current_display. |
| 8111 | This also initializes many symbols, such as those used for input. */ | 8111 | This also initializes many symbols, such as those used for input. */ |
| 8112 | dpyinfo = w32_term_init (display, xrm_option, | 8112 | dpyinfo = w32_term_init (display, xrm_option, |
| 8113 | (char *) XSTRING (Vx_resource_name)->data); | 8113 | (char *) SDATA (Vx_resource_name)); |
| 8114 | 8114 | ||
| 8115 | if (dpyinfo == 0) | 8115 | if (dpyinfo == 0) |
| 8116 | { | 8116 | { |
| 8117 | if (!NILP (must_succeed)) | 8117 | if (!NILP (must_succeed)) |
| 8118 | fatal ("Cannot connect to server %s.\n", | 8118 | fatal ("Cannot connect to server %s.\n", |
| 8119 | XSTRING (display)->data); | 8119 | SDATA (display)); |
| 8120 | else | 8120 | else |
| 8121 | error ("Cannot connect to server %s", XSTRING (display)->data); | 8121 | error ("Cannot connect to server %s", SDATA (display)); |
| 8122 | } | 8122 | } |
| 8123 | 8123 | ||
| 8124 | w32_in_use = 1; | 8124 | w32_in_use = 1; |
| @@ -8402,7 +8402,7 @@ parse_image_spec (spec, keywords, nkeywords, type) | |||
| 8402 | 8402 | ||
| 8403 | /* Find key in KEYWORDS. Error if not found. */ | 8403 | /* Find key in KEYWORDS. Error if not found. */ |
| 8404 | for (i = 0; i < nkeywords; ++i) | 8404 | for (i = 0; i < nkeywords; ++i) |
| 8405 | if (strcmp (keywords[i].name, XSTRING (SYMBOL_NAME (key))->data) == 0) | 8405 | if (strcmp (keywords[i].name, SDATA (SYMBOL_NAME (key))) == 0) |
| 8406 | break; | 8406 | break; |
| 8407 | 8407 | ||
| 8408 | if (i == nkeywords) | 8408 | if (i == nkeywords) |
| @@ -8916,7 +8916,7 @@ x_alloc_image_color (f, img, color_name, dflt) | |||
| 8916 | 8916 | ||
| 8917 | xassert (STRINGP (color_name)); | 8917 | xassert (STRINGP (color_name)); |
| 8918 | 8918 | ||
| 8919 | if (w32_defined_color (f, XSTRING (color_name)->data, &color, 1)) | 8919 | if (w32_defined_color (f, SDATA (color_name), &color, 1)) |
| 8920 | { | 8920 | { |
| 8921 | /* This isn't called frequently so we get away with simply | 8921 | /* This isn't called frequently so we get away with simply |
| 8922 | reallocating the color vector to the needed size, here. */ | 8922 | reallocating the color vector to the needed size, here. */ |
| @@ -9694,7 +9694,7 @@ xbm_image_p (object) | |||
| 9694 | 9694 | ||
| 9695 | if (STRINGP (elt)) | 9695 | if (STRINGP (elt)) |
| 9696 | { | 9696 | { |
| 9697 | if (XSTRING (elt)->size | 9697 | if (SCHARS (elt) |
| 9698 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) | 9698 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) |
| 9699 | return 0; | 9699 | return 0; |
| 9700 | } | 9700 | } |
| @@ -9709,7 +9709,7 @@ xbm_image_p (object) | |||
| 9709 | } | 9709 | } |
| 9710 | else if (STRINGP (data)) | 9710 | else if (STRINGP (data)) |
| 9711 | { | 9711 | { |
| 9712 | if (XSTRING (data)->size | 9712 | if (SCHARS (data) |
| 9713 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) | 9713 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) |
| 9714 | return 0; | 9714 | return 0; |
| 9715 | } | 9715 | } |
| @@ -10073,9 +10073,9 @@ xbm_file_p (data) | |||
| 10073 | { | 10073 | { |
| 10074 | int w, h; | 10074 | int w, h; |
| 10075 | return (STRINGP (data) | 10075 | return (STRINGP (data) |
| 10076 | && xbm_read_bitmap_data (XSTRING (data)->data, | 10076 | && xbm_read_bitmap_data (SDATA (data), |
| 10077 | (XSTRING (data)->data | 10077 | (SDATA (data) |
| 10078 | + STRING_BYTES (XSTRING (data))), | 10078 | + SBYTES (data)), |
| 10079 | &w, &h, NULL)); | 10079 | &w, &h, NULL)); |
| 10080 | } | 10080 | } |
| 10081 | 10081 | ||
| @@ -10111,7 +10111,7 @@ xbm_load (f, img) | |||
| 10111 | return 0; | 10111 | return 0; |
| 10112 | } | 10112 | } |
| 10113 | 10113 | ||
| 10114 | contents = slurp_file (XSTRING (file)->data, &size); | 10114 | contents = slurp_file (SDATA (file), &size); |
| 10115 | if (contents == NULL) | 10115 | if (contents == NULL) |
| 10116 | { | 10116 | { |
| 10117 | image_error ("Error loading XBM image `%s'", img->spec, Qnil); | 10117 | image_error ("Error loading XBM image `%s'", img->spec, Qnil); |
| @@ -10161,9 +10161,9 @@ xbm_load (f, img) | |||
| 10161 | background); | 10161 | background); |
| 10162 | 10162 | ||
| 10163 | if (in_memory_file_p) | 10163 | if (in_memory_file_p) |
| 10164 | success_p = xbm_load_image (f, img, XSTRING (data)->data, | 10164 | success_p = xbm_load_image (f, img, SDATA (data), |
| 10165 | (XSTRING (data)->data | 10165 | (SDATA (data) |
| 10166 | + STRING_BYTES (XSTRING (data)))); | 10166 | + SBYTES (data))); |
| 10167 | else | 10167 | else |
| 10168 | { | 10168 | { |
| 10169 | if (VECTORP (data)) | 10169 | if (VECTORP (data)) |
| @@ -10177,13 +10177,13 @@ xbm_load (f, img) | |||
| 10177 | { | 10177 | { |
| 10178 | Lisp_Object line = XVECTOR (data)->contents[i]; | 10178 | Lisp_Object line = XVECTOR (data)->contents[i]; |
| 10179 | if (STRINGP (line)) | 10179 | if (STRINGP (line)) |
| 10180 | bcopy (XSTRING (line)->data, p, nbytes); | 10180 | bcopy (SDATA (line), p, nbytes); |
| 10181 | else | 10181 | else |
| 10182 | bcopy (XBOOL_VECTOR (line)->data, p, nbytes); | 10182 | bcopy (XBOOL_VECTOR (line)->data, p, nbytes); |
| 10183 | } | 10183 | } |
| 10184 | } | 10184 | } |
| 10185 | else if (STRINGP (data)) | 10185 | else if (STRINGP (data)) |
| 10186 | bits = XSTRING (data)->data; | 10186 | bits = SDATA (data); |
| 10187 | else | 10187 | else |
| 10188 | bits = XBOOL_VECTOR (data)->data; | 10188 | bits = XBOOL_VECTOR (data)->data; |
| 10189 | 10189 | ||
| @@ -10372,10 +10372,10 @@ xpm_load (f, img) | |||
| 10372 | { | 10372 | { |
| 10373 | Lisp_Object name = XCAR (XCAR (tail)); | 10373 | Lisp_Object name = XCAR (XCAR (tail)); |
| 10374 | Lisp_Object color = XCDR (XCAR (tail)); | 10374 | Lisp_Object color = XCDR (XCAR (tail)); |
| 10375 | xpm_syms[i].name = (char *) alloca (XSTRING (name)->size + 1); | 10375 | xpm_syms[i].name = (char *) alloca (SCHARS (name) + 1); |
| 10376 | strcpy (xpm_syms[i].name, XSTRING (name)->data); | 10376 | strcpy (xpm_syms[i].name, SDATA (name)); |
| 10377 | xpm_syms[i].value = (char *) alloca (XSTRING (color)->size + 1); | 10377 | xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1); |
| 10378 | strcpy (xpm_syms[i].value, XSTRING (color)->data); | 10378 | strcpy (xpm_syms[i].value, SDATA (color)); |
| 10379 | } | 10379 | } |
| 10380 | } | 10380 | } |
| 10381 | 10381 | ||
| @@ -10394,14 +10394,14 @@ xpm_load (f, img) | |||
| 10394 | } | 10394 | } |
| 10395 | 10395 | ||
| 10396 | rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), | 10396 | rc = XpmReadFileToPixmap (NULL, FRAME_W32_WINDOW (f), |
| 10397 | XSTRING (file)->data, &img->pixmap, &img->mask, | 10397 | SDATA (file), &img->pixmap, &img->mask, |
| 10398 | &attrs); | 10398 | &attrs); |
| 10399 | } | 10399 | } |
| 10400 | else | 10400 | else |
| 10401 | { | 10401 | { |
| 10402 | Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); | 10402 | Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); |
| 10403 | rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f), | 10403 | rc = XpmCreatePixmapFromBuffer (NULL, FRAME_W32_WINDOW (f), |
| 10404 | XSTRING (buffer)->data, | 10404 | SDATA (buffer), |
| 10405 | &img->pixmap, &img->mask, | 10405 | &img->pixmap, &img->mask, |
| 10406 | &attrs); | 10406 | &attrs); |
| 10407 | } | 10407 | } |
| @@ -11218,8 +11218,8 @@ pbm_read_file (file, size) | |||
| 11218 | char *buf = NULL; | 11218 | char *buf = NULL; |
| 11219 | struct stat st; | 11219 | struct stat st; |
| 11220 | 11220 | ||
| 11221 | if (stat (XSTRING (file)->data, &st) == 0 | 11221 | if (stat (SDATA (file), &st) == 0 |
| 11222 | && (fp = fopen (XSTRING (file)->data, "r")) != NULL | 11222 | && (fp = fopen (SDATA (file), "r")) != NULL |
| 11223 | && (buf = (char *) xmalloc (st.st_size), | 11223 | && (buf = (char *) xmalloc (st.st_size), |
| 11224 | fread (buf, 1, st.st_size, fp) == st.st_size)) | 11224 | fread (buf, 1, st.st_size, fp) == st.st_size)) |
| 11225 | { | 11225 | { |
| @@ -11272,7 +11272,7 @@ pbm_load (f, img) | |||
| 11272 | return 0; | 11272 | return 0; |
| 11273 | } | 11273 | } |
| 11274 | 11274 | ||
| 11275 | contents = slurp_file (XSTRING (file)->data, &size); | 11275 | contents = slurp_file (SDATA (file), &size); |
| 11276 | if (contents == NULL) | 11276 | if (contents == NULL) |
| 11277 | { | 11277 | { |
| 11278 | image_error ("Error reading `%s'", file, Qnil); | 11278 | image_error ("Error reading `%s'", file, Qnil); |
| @@ -11287,8 +11287,8 @@ pbm_load (f, img) | |||
| 11287 | { | 11287 | { |
| 11288 | Lisp_Object data; | 11288 | Lisp_Object data; |
| 11289 | data = image_spec_value (img->spec, QCdata, NULL); | 11289 | data = image_spec_value (img->spec, QCdata, NULL); |
| 11290 | p = XSTRING (data)->data; | 11290 | p = SDATA (data); |
| 11291 | end = p + STRING_BYTES (XSTRING (data)); | 11291 | end = p + SBYTES (data); |
| 11292 | } | 11292 | } |
| 11293 | 11293 | ||
| 11294 | /* Check magic number. */ | 11294 | /* Check magic number. */ |
| @@ -11644,7 +11644,7 @@ png_load (f, img) | |||
| 11644 | } | 11644 | } |
| 11645 | 11645 | ||
| 11646 | /* Open the image file. */ | 11646 | /* Open the image file. */ |
| 11647 | fp = fopen (XSTRING (file)->data, "rb"); | 11647 | fp = fopen (SDATA (file), "rb"); |
| 11648 | if (!fp) | 11648 | if (!fp) |
| 11649 | { | 11649 | { |
| 11650 | image_error ("Cannot open image file `%s'", file, Qnil); | 11650 | image_error ("Cannot open image file `%s'", file, Qnil); |
| @@ -11666,8 +11666,8 @@ png_load (f, img) | |||
| 11666 | else | 11666 | else |
| 11667 | { | 11667 | { |
| 11668 | /* Read from memory. */ | 11668 | /* Read from memory. */ |
| 11669 | tbr.bytes = XSTRING (specified_data)->data; | 11669 | tbr.bytes = SDATA (specified_data); |
| 11670 | tbr.len = STRING_BYTES (XSTRING (specified_data)); | 11670 | tbr.len = SBYTES (specified_data); |
| 11671 | tbr.index = 0; | 11671 | tbr.index = 0; |
| 11672 | 11672 | ||
| 11673 | /* Check PNG signature. */ | 11673 | /* Check PNG signature. */ |
| @@ -11793,7 +11793,7 @@ png_load (f, img) | |||
| 11793 | /* The user specified `:background', use that. */ | 11793 | /* The user specified `:background', use that. */ |
| 11794 | { | 11794 | { |
| 11795 | COLORREF color; | 11795 | COLORREF color; |
| 11796 | if (w32_defined_color (f, XSTRING (specified_bg)->data, &color, 0)) | 11796 | if (w32_defined_color (f, SDATA (specified_bg), &color, 0)) |
| 11797 | { | 11797 | { |
| 11798 | png_color_16 user_bg; | 11798 | png_color_16 user_bg; |
| 11799 | 11799 | ||
| @@ -12213,7 +12213,7 @@ jpeg_load (f, img) | |||
| 12213 | return 0; | 12213 | return 0; |
| 12214 | } | 12214 | } |
| 12215 | 12215 | ||
| 12216 | fp = fopen (XSTRING (file)->data, "r"); | 12216 | fp = fopen (SDATA (file), "r"); |
| 12217 | if (fp == NULL) | 12217 | if (fp == NULL) |
| 12218 | { | 12218 | { |
| 12219 | image_error ("Cannot open `%s'", file, Qnil); | 12219 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -12260,8 +12260,8 @@ jpeg_load (f, img) | |||
| 12260 | if (NILP (specified_data)) | 12260 | if (NILP (specified_data)) |
| 12261 | jpeg_stdio_src (&cinfo, fp); | 12261 | jpeg_stdio_src (&cinfo, fp); |
| 12262 | else | 12262 | else |
| 12263 | jpeg_memory_src (&cinfo, XSTRING (specified_data)->data, | 12263 | jpeg_memory_src (&cinfo, SDATA (specified_data), |
| 12264 | STRING_BYTES (XSTRING (specified_data))); | 12264 | SBYTES (specified_data)); |
| 12265 | 12265 | ||
| 12266 | jpeg_read_header (&cinfo, TRUE); | 12266 | jpeg_read_header (&cinfo, TRUE); |
| 12267 | 12267 | ||
| @@ -12604,7 +12604,7 @@ tiff_load (f, img) | |||
| 12604 | } | 12604 | } |
| 12605 | 12605 | ||
| 12606 | /* Try to open the image file. */ | 12606 | /* Try to open the image file. */ |
| 12607 | tiff = TIFFOpen (XSTRING (file)->data, "r"); | 12607 | tiff = TIFFOpen (SDATA (file), "r"); |
| 12608 | if (tiff == NULL) | 12608 | if (tiff == NULL) |
| 12609 | { | 12609 | { |
| 12610 | image_error ("Cannot open `%s'", file, Qnil); | 12610 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -12615,8 +12615,8 @@ tiff_load (f, img) | |||
| 12615 | else | 12615 | else |
| 12616 | { | 12616 | { |
| 12617 | /* Memory source! */ | 12617 | /* Memory source! */ |
| 12618 | memsrc.bytes = XSTRING (specified_data)->data; | 12618 | memsrc.bytes = SDATA (specified_data); |
| 12619 | memsrc.len = STRING_BYTES (XSTRING (specified_data)); | 12619 | memsrc.len = SBYTES (specified_data); |
| 12620 | memsrc.index = 0; | 12620 | memsrc.index = 0; |
| 12621 | 12621 | ||
| 12622 | tiff = TIFFClientOpen ("memory_source", "r", &memsrc, | 12622 | tiff = TIFFClientOpen ("memory_source", "r", &memsrc, |
| @@ -12852,7 +12852,7 @@ gif_load (f, img) | |||
| 12852 | } | 12852 | } |
| 12853 | 12853 | ||
| 12854 | /* Open the GIF file. */ | 12854 | /* Open the GIF file. */ |
| 12855 | gif = DGifOpenFileName (XSTRING (file)->data); | 12855 | gif = DGifOpenFileName (SDATA (file)); |
| 12856 | if (gif == NULL) | 12856 | if (gif == NULL) |
| 12857 | { | 12857 | { |
| 12858 | image_error ("Cannot open `%s'", file, Qnil); | 12858 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -12864,8 +12864,8 @@ gif_load (f, img) | |||
| 12864 | { | 12864 | { |
| 12865 | /* Read from memory! */ | 12865 | /* Read from memory! */ |
| 12866 | current_gif_memory_src = &memsrc; | 12866 | current_gif_memory_src = &memsrc; |
| 12867 | memsrc.bytes = XSTRING (specified_data)->data; | 12867 | memsrc.bytes = SDATA (specified_data); |
| 12868 | memsrc.len = STRING_BYTES (XSTRING (specified_data)); | 12868 | memsrc.len = SBYTES (specified_data); |
| 12869 | memsrc.index = 0; | 12869 | memsrc.index = 0; |
| 12870 | 12870 | ||
| 12871 | gif = DGifOpen(&memsrc, gif_read_from_memory); | 12871 | gif = DGifOpen(&memsrc, gif_read_from_memory); |
| @@ -13323,10 +13323,10 @@ selected frame. Value is VALUE. */) | |||
| 13323 | CHECK_STRING (value); | 13323 | CHECK_STRING (value); |
| 13324 | 13324 | ||
| 13325 | BLOCK_INPUT; | 13325 | BLOCK_INPUT; |
| 13326 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); | 13326 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); |
| 13327 | XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), | 13327 | XChangeProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), |
| 13328 | prop_atom, XA_STRING, 8, PropModeReplace, | 13328 | prop_atom, XA_STRING, 8, PropModeReplace, |
| 13329 | XSTRING (value)->data, XSTRING (value)->size); | 13329 | SDATA (value), SCHARS (value)); |
| 13330 | 13330 | ||
| 13331 | /* Make sure the property is set when we return. */ | 13331 | /* Make sure the property is set when we return. */ |
| 13332 | XFlush (FRAME_W32_DISPLAY (f)); | 13332 | XFlush (FRAME_W32_DISPLAY (f)); |
| @@ -13352,7 +13352,7 @@ FRAME nil or omitted means use the selected frame. Value is PROP. */) | |||
| 13352 | 13352 | ||
| 13353 | CHECK_STRING (prop); | 13353 | CHECK_STRING (prop); |
| 13354 | BLOCK_INPUT; | 13354 | BLOCK_INPUT; |
| 13355 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); | 13355 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); |
| 13356 | XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom); | 13356 | XDeleteProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), prop_atom); |
| 13357 | 13357 | ||
| 13358 | /* Make sure the property is removed when we return. */ | 13358 | /* Make sure the property is removed when we return. */ |
| @@ -13386,7 +13386,7 @@ value. */) | |||
| 13386 | 13386 | ||
| 13387 | CHECK_STRING (prop); | 13387 | CHECK_STRING (prop); |
| 13388 | BLOCK_INPUT; | 13388 | BLOCK_INPUT; |
| 13389 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), XSTRING (prop)->data, False); | 13389 | prop_atom = XInternAtom (FRAME_W32_DISPLAY (f), SDATA (prop), False); |
| 13390 | rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), | 13390 | rc = XGetWindowProperty (FRAME_W32_DISPLAY (f), FRAME_W32_WINDOW (f), |
| 13391 | prop_atom, 0, 0, False, XA_STRING, | 13391 | prop_atom, 0, 0, False, XA_STRING, |
| 13392 | &actual_type, &actual_format, &actual_size, | 13392 | &actual_type, &actual_format, &actual_size, |
| @@ -13753,9 +13753,9 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 13753 | { | 13753 | { |
| 13754 | tem = Fquery_fontset (font, Qnil); | 13754 | tem = Fquery_fontset (font, Qnil); |
| 13755 | if (STRINGP (tem)) | 13755 | if (STRINGP (tem)) |
| 13756 | font = x_new_fontset (f, XSTRING (tem)->data); | 13756 | font = x_new_fontset (f, SDATA (tem)); |
| 13757 | else | 13757 | else |
| 13758 | font = x_new_font (f, XSTRING (font)->data); | 13758 | font = x_new_font (f, SDATA (font)); |
| 13759 | } | 13759 | } |
| 13760 | 13760 | ||
| 13761 | /* Try out a font which we hope has bold and italic variations. */ | 13761 | /* Try out a font which we hope has bold and italic variations. */ |
| @@ -14313,14 +14313,14 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */) | |||
| 14313 | /* Create the dialog with PROMPT as title, using DIR as initial | 14313 | /* Create the dialog with PROMPT as title, using DIR as initial |
| 14314 | directory and using "*" as pattern. */ | 14314 | directory and using "*" as pattern. */ |
| 14315 | dir = Fexpand_file_name (dir, Qnil); | 14315 | dir = Fexpand_file_name (dir, Qnil); |
| 14316 | strncpy (init_dir, XSTRING (dir)->data, MAX_PATH); | 14316 | strncpy (init_dir, SDATA (dir), MAX_PATH); |
| 14317 | init_dir[MAX_PATH] = '\0'; | 14317 | init_dir[MAX_PATH] = '\0'; |
| 14318 | unixtodos_filename (init_dir); | 14318 | unixtodos_filename (init_dir); |
| 14319 | 14319 | ||
| 14320 | if (STRINGP (default_filename)) | 14320 | if (STRINGP (default_filename)) |
| 14321 | { | 14321 | { |
| 14322 | char *file_name_only; | 14322 | char *file_name_only; |
| 14323 | char *full_path_name = XSTRING (default_filename)->data; | 14323 | char *full_path_name = SDATA (default_filename); |
| 14324 | 14324 | ||
| 14325 | unixtodos_filename (full_path_name); | 14325 | unixtodos_filename (full_path_name); |
| 14326 | 14326 | ||
| @@ -14354,7 +14354,7 @@ specified. Ensure that file exists if MUSTMATCH is non-nil. */) | |||
| 14354 | file_details.lpstrFile = filename; | 14354 | file_details.lpstrFile = filename; |
| 14355 | file_details.nMaxFile = sizeof (filename); | 14355 | file_details.nMaxFile = sizeof (filename); |
| 14356 | file_details.lpstrInitialDir = init_dir; | 14356 | file_details.lpstrInitialDir = init_dir; |
| 14357 | file_details.lpstrTitle = XSTRING (prompt)->data; | 14357 | file_details.lpstrTitle = SDATA (prompt); |
| 14358 | file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR | 14358 | file_details.Flags = (OFN_HIDEREADONLY | OFN_NOCHANGEDIR |
| 14359 | | OFN_EXPLORER | OFN_ENABLEHOOK); | 14359 | | OFN_EXPLORER | OFN_ENABLEHOOK); |
| 14360 | if (!NILP (mustmatch)) | 14360 | if (!NILP (mustmatch)) |
| @@ -14507,11 +14507,11 @@ otherwise it is an integer representing a ShowWindow flag: | |||
| 14507 | document = ENCODE_FILE (document); | 14507 | document = ENCODE_FILE (document); |
| 14508 | if ((int) ShellExecute (NULL, | 14508 | if ((int) ShellExecute (NULL, |
| 14509 | (STRINGP (operation) ? | 14509 | (STRINGP (operation) ? |
| 14510 | XSTRING (operation)->data : NULL), | 14510 | SDATA (operation) : NULL), |
| 14511 | XSTRING (document)->data, | 14511 | SDATA (document), |
| 14512 | (STRINGP (parameters) ? | 14512 | (STRINGP (parameters) ? |
| 14513 | XSTRING (parameters)->data : NULL), | 14513 | SDATA (parameters) : NULL), |
| 14514 | XSTRING (current_dir)->data, | 14514 | SDATA (current_dir), |
| 14515 | (INTEGERP (show_flag) ? | 14515 | (INTEGERP (show_flag) ? |
| 14516 | XINT (show_flag) : SW_SHOWDEFAULT)) | 14516 | XINT (show_flag) : SW_SHOWDEFAULT)) |
| 14517 | > 32) | 14517 | > 32) |
| @@ -14573,7 +14573,7 @@ w32_parse_hot_key (key) | |||
| 14573 | c = Fcar (c); | 14573 | c = Fcar (c); |
| 14574 | if (!SYMBOLP (c)) | 14574 | if (!SYMBOLP (c)) |
| 14575 | abort (); | 14575 | abort (); |
| 14576 | vk_code = lookup_vk_code (XSTRING (SYMBOL_NAME (c))->data); | 14576 | vk_code = lookup_vk_code (SDATA (SYMBOL_NAME (c))); |
| 14577 | } | 14577 | } |
| 14578 | else if (INTEGERP (c)) | 14578 | else if (INTEGERP (c)) |
| 14579 | { | 14579 | { |
| @@ -14777,7 +14777,7 @@ If the underlying system call fails, value is nil. */) | |||
| 14777 | /* On Windows, we may need to specify the root directory of the | 14777 | /* On Windows, we may need to specify the root directory of the |
| 14778 | volume holding FILENAME. */ | 14778 | volume holding FILENAME. */ |
| 14779 | char rootname[MAX_PATH]; | 14779 | char rootname[MAX_PATH]; |
| 14780 | char *name = XSTRING (encoded)->data; | 14780 | char *name = SDATA (encoded); |
| 14781 | 14781 | ||
| 14782 | /* find the root name of the volume if given */ | 14782 | /* find the root name of the volume if given */ |
| 14783 | if (isalpha (name[0]) && name[1] == ':') | 14783 | if (isalpha (name[0]) && name[1] == ':') |
diff --git a/src/w32menu.c b/src/w32menu.c index c27ad031103..1816e33875b 100644 --- a/src/w32menu.c +++ b/src/w32menu.c | |||
| @@ -518,7 +518,7 @@ single_menu_item (key, item, pending_maps_ptr, notreal, maxdepth) | |||
| 518 | enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; | 518 | enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; |
| 519 | item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; | 519 | item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; |
| 520 | 520 | ||
| 521 | if (!NILP (map) && XSTRING (item_string)->data[0] == '@') | 521 | if (!NILP (map) && SREF (item_string, 0) == '@') |
| 522 | { | 522 | { |
| 523 | if (!NILP (enabled)) | 523 | if (!NILP (enabled)) |
| 524 | /* An enabled separate pane. Remember this to handle it later. */ | 524 | /* An enabled separate pane. Remember this to handle it later. */ |
| @@ -1201,7 +1201,7 @@ single_submenu (item_key, item_name, maps) | |||
| 1201 | } | 1201 | } |
| 1202 | #endif | 1202 | #endif |
| 1203 | pane_string = (NILP (pane_name) | 1203 | pane_string = (NILP (pane_name) |
| 1204 | ? "" : (char *) XSTRING (pane_name)->data); | 1204 | ? "" : (char *) SDATA (pane_name)); |
| 1205 | /* If there is just one top-level pane, put all its items directly | 1205 | /* If there is just one top-level pane, put all its items directly |
| 1206 | under the top-level menu. */ | 1206 | under the top-level menu. */ |
| 1207 | if (menu_items_n_panes == 1) | 1207 | if (menu_items_n_panes == 1) |
| @@ -1265,9 +1265,9 @@ single_submenu (item_key, item_name, maps) | |||
| 1265 | else | 1265 | else |
| 1266 | save_wv->contents = wv; | 1266 | save_wv->contents = wv; |
| 1267 | 1267 | ||
| 1268 | wv->name = (char *) XSTRING (item_name)->data; | 1268 | wv->name = (char *) SDATA (item_name); |
| 1269 | if (!NILP (descrip)) | 1269 | if (!NILP (descrip)) |
| 1270 | wv->key = (char *) XSTRING (descrip)->data; | 1270 | wv->key = (char *) SDATA (descrip); |
| 1271 | wv->value = 0; | 1271 | wv->value = 0; |
| 1272 | /* The EMACS_INT cast avoids a warning. There's no problem | 1272 | /* The EMACS_INT cast avoids a warning. There's no problem |
| 1273 | as long as pointers have enough bits to hold small integers. */ | 1273 | as long as pointers have enough bits to hold small integers. */ |
| @@ -1448,7 +1448,7 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1448 | string = XVECTOR (items)->contents[i + 1]; | 1448 | string = XVECTOR (items)->contents[i + 1]; |
| 1449 | if (NILP (string)) | 1449 | if (NILP (string)) |
| 1450 | break; | 1450 | break; |
| 1451 | wv->name = (char *) XSTRING (string)->data; | 1451 | wv->name = (char *) SDATA (string); |
| 1452 | wv = wv->next; | 1452 | wv = wv->next; |
| 1453 | } | 1453 | } |
| 1454 | 1454 | ||
| @@ -1471,7 +1471,7 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1471 | break; | 1471 | break; |
| 1472 | 1472 | ||
| 1473 | wv = xmalloc_widget_value (); | 1473 | wv = xmalloc_widget_value (); |
| 1474 | wv->name = (char *) XSTRING (string)->data; | 1474 | wv->name = (char *) SDATA (string); |
| 1475 | wv->value = 0; | 1475 | wv->value = 0; |
| 1476 | wv->enabled = 1; | 1476 | wv->enabled = 1; |
| 1477 | wv->button_type = BUTTON_TYPE_NONE; | 1477 | wv->button_type = BUTTON_TYPE_NONE; |
| @@ -1662,7 +1662,7 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1662 | } | 1662 | } |
| 1663 | #endif | 1663 | #endif |
| 1664 | pane_string = (NILP (pane_name) | 1664 | pane_string = (NILP (pane_name) |
| 1665 | ? "" : (char *) XSTRING (pane_name)->data); | 1665 | ? "" : (char *) SDATA (pane_name)); |
| 1666 | /* If there is just one top-level pane, put all its items directly | 1666 | /* If there is just one top-level pane, put all its items directly |
| 1667 | under the top-level menu. */ | 1667 | under the top-level menu. */ |
| 1668 | if (menu_items_n_panes == 1) | 1668 | if (menu_items_n_panes == 1) |
| @@ -1727,9 +1727,9 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1727 | prev_wv->next = wv; | 1727 | prev_wv->next = wv; |
| 1728 | else | 1728 | else |
| 1729 | save_wv->contents = wv; | 1729 | save_wv->contents = wv; |
| 1730 | wv->name = (char *) XSTRING (item_name)->data; | 1730 | wv->name = (char *) SDATA (item_name); |
| 1731 | if (!NILP (descrip)) | 1731 | if (!NILP (descrip)) |
| 1732 | wv->key = (char *) XSTRING (descrip)->data; | 1732 | wv->key = (char *) SDATA (descrip); |
| 1733 | wv->value = 0; | 1733 | wv->value = 0; |
| 1734 | /* Use the contents index as call_data, since we are | 1734 | /* Use the contents index as call_data, since we are |
| 1735 | restricted to 16-bits. */ | 1735 | restricted to 16-bits. */ |
| @@ -1773,7 +1773,7 @@ w32_menu_show (f, x, y, for_click, keymaps, title, error) | |||
| 1773 | if (STRING_MULTIBYTE (title)) | 1773 | if (STRING_MULTIBYTE (title)) |
| 1774 | title = ENCODE_SYSTEM (title); | 1774 | title = ENCODE_SYSTEM (title); |
| 1775 | #endif | 1775 | #endif |
| 1776 | wv_title->name = (char *) XSTRING (title)->data; | 1776 | wv_title->name = (char *) SDATA (title); |
| 1777 | wv_title->enabled = TRUE; | 1777 | wv_title->enabled = TRUE; |
| 1778 | wv_title->title = TRUE; | 1778 | wv_title->title = TRUE; |
| 1779 | wv_title->button_type = BUTTON_TYPE_NONE; | 1779 | wv_title->button_type = BUTTON_TYPE_NONE; |
| @@ -1906,7 +1906,7 @@ w32_dialog_show (f, keymaps, title, error) | |||
| 1906 | pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; | 1906 | pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; |
| 1907 | prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; | 1907 | prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; |
| 1908 | pane_string = (NILP (pane_name) | 1908 | pane_string = (NILP (pane_name) |
| 1909 | ? "" : (char *) XSTRING (pane_name)->data); | 1909 | ? "" : (char *) SDATA (pane_name)); |
| 1910 | prev_wv = xmalloc_widget_value (); | 1910 | prev_wv = xmalloc_widget_value (); |
| 1911 | prev_wv->value = pane_string; | 1911 | prev_wv->value = pane_string; |
| 1912 | if (keymaps && !NILP (prefix)) | 1912 | if (keymaps && !NILP (prefix)) |
| @@ -1955,8 +1955,8 @@ w32_dialog_show (f, keymaps, title, error) | |||
| 1955 | prev_wv->next = wv; | 1955 | prev_wv->next = wv; |
| 1956 | wv->name = (char *) button_names[nb_buttons]; | 1956 | wv->name = (char *) button_names[nb_buttons]; |
| 1957 | if (!NILP (descrip)) | 1957 | if (!NILP (descrip)) |
| 1958 | wv->key = (char *) XSTRING (descrip)->data; | 1958 | wv->key = (char *) SDATA (descrip); |
| 1959 | wv->value = (char *) XSTRING (item_name)->data; | 1959 | wv->value = (char *) SDATA (item_name); |
| 1960 | wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; | 1960 | wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; |
| 1961 | wv->enabled = !NILP (enable); | 1961 | wv->enabled = !NILP (enable); |
| 1962 | wv->help = Qnil; | 1962 | wv->help = Qnil; |
diff --git a/src/w32proc.c b/src/w32proc.c index b94e5cca53c..a44a326caf9 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -760,7 +760,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) | |||
| 760 | } | 760 | } |
| 761 | 761 | ||
| 762 | /* make sure argv[0] and cmdname are both in DOS format */ | 762 | /* make sure argv[0] and cmdname are both in DOS format */ |
| 763 | cmdname = XSTRING (program)->data; | 763 | cmdname = SDATA (program); |
| 764 | unixtodos_filename (cmdname); | 764 | unixtodos_filename (cmdname); |
| 765 | argv[0] = cmdname; | 765 | argv[0] = cmdname; |
| 766 | 766 | ||
| @@ -784,7 +784,7 @@ sys_spawnve (int mode, char *cmdname, char **argv, char **envp) | |||
| 784 | strcpy (cmdname, egetenv ("CMDPROXY")); | 784 | strcpy (cmdname, egetenv ("CMDPROXY")); |
| 785 | else | 785 | else |
| 786 | { | 786 | { |
| 787 | strcpy (cmdname, XSTRING (Vinvocation_directory)->data); | 787 | strcpy (cmdname, SDATA (Vinvocation_directory)); |
| 788 | strcat (cmdname, "cmdproxy.exe"); | 788 | strcat (cmdname, "cmdproxy.exe"); |
| 789 | } | 789 | } |
| 790 | unixtodos_filename (cmdname); | 790 | unixtodos_filename (cmdname); |
| @@ -1723,7 +1723,7 @@ All path elements in FILENAME are converted to their short names. */) | |||
| 1723 | filename = Fexpand_file_name (filename, Qnil); | 1723 | filename = Fexpand_file_name (filename, Qnil); |
| 1724 | 1724 | ||
| 1725 | /* luckily, this returns the short version of each element in the path. */ | 1725 | /* luckily, this returns the short version of each element in the path. */ |
| 1726 | if (GetShortPathName (XSTRING (filename)->data, shortname, MAX_PATH) == 0) | 1726 | if (GetShortPathName (SDATA (filename), shortname, MAX_PATH) == 0) |
| 1727 | return Qnil; | 1727 | return Qnil; |
| 1728 | 1728 | ||
| 1729 | CORRECT_DIR_SEPS (shortname); | 1729 | CORRECT_DIR_SEPS (shortname); |
| @@ -1747,7 +1747,7 @@ All path elements in FILENAME are converted to their long names. */) | |||
| 1747 | /* first expand it. */ | 1747 | /* first expand it. */ |
| 1748 | filename = Fexpand_file_name (filename, Qnil); | 1748 | filename = Fexpand_file_name (filename, Qnil); |
| 1749 | 1749 | ||
| 1750 | if (!w32_get_long_filename (XSTRING (filename)->data, longname, MAX_PATH)) | 1750 | if (!w32_get_long_filename (SDATA (filename), longname, MAX_PATH)) |
| 1751 | return Qnil; | 1751 | return Qnil; |
| 1752 | 1752 | ||
| 1753 | CORRECT_DIR_SEPS (longname); | 1753 | CORRECT_DIR_SEPS (longname); |
diff --git a/src/w32select.c b/src/w32select.c index ef0910964e8..1cb5838c6fc 100644 --- a/src/w32select.c +++ b/src/w32select.c | |||
| @@ -125,8 +125,8 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, | |||
| 125 | 125 | ||
| 126 | BLOCK_INPUT; | 126 | BLOCK_INPUT; |
| 127 | 127 | ||
| 128 | nbytes = STRING_BYTES (XSTRING (string)) + 1; | 128 | nbytes = SBYTES (string) + 1; |
| 129 | src = XSTRING (string)->data; | 129 | src = SDATA (string); |
| 130 | dst = src; | 130 | dst = src; |
| 131 | 131 | ||
| 132 | /* We need to know how many lines there are, since we need CRLF line | 132 | /* We need to know how many lines there are, since we need CRLF line |
| @@ -141,7 +141,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, | |||
| 141 | { | 141 | { |
| 142 | /* Since we are now handling multilingual text, we must consider | 142 | /* Since we are now handling multilingual text, we must consider |
| 143 | encoding text for the clipboard. */ | 143 | encoding text for the clipboard. */ |
| 144 | int charset_info = find_charset_in_text (src, XSTRING (string)->size, | 144 | int charset_info = find_charset_in_text (src, SCHARS (string), |
| 145 | nbytes, NULL, Qnil); | 145 | nbytes, NULL, Qnil); |
| 146 | 146 | ||
| 147 | if (charset_info == 0) | 147 | if (charset_info == 0) |
| @@ -202,8 +202,8 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, | |||
| 202 | && !NILP (Ffboundp (coding.pre_write_conversion))) | 202 | && !NILP (Ffboundp (coding.pre_write_conversion))) |
| 203 | { | 203 | { |
| 204 | string = run_pre_post_conversion_on_str (string, &coding, 1); | 204 | string = run_pre_post_conversion_on_str (string, &coding, 1); |
| 205 | src = XSTRING (string)->data; | 205 | src = SDATA (string); |
| 206 | nbytes = STRING_BYTES (XSTRING (string)); | 206 | nbytes = SBYTES (string); |
| 207 | } | 207 | } |
| 208 | coding.src_multibyte = 1; | 208 | coding.src_multibyte = 1; |
| 209 | coding.dst_multibyte = 0; | 209 | coding.dst_multibyte = 0; |
| @@ -368,7 +368,7 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data, | |||
| 368 | /* Convert CRLF line endings (the standard CF_TEXT clipboard | 368 | /* Convert CRLF line endings (the standard CF_TEXT clipboard |
| 369 | format) to LF endings as used internally by Emacs. */ | 369 | format) to LF endings as used internally by Emacs. */ |
| 370 | 370 | ||
| 371 | dst = XSTRING (ret)->data; | 371 | dst = SDATA (ret); |
| 372 | while (1) | 372 | while (1) |
| 373 | { | 373 | { |
| 374 | unsigned char *next; | 374 | unsigned char *next; |
diff --git a/src/w32term.c b/src/w32term.c index f8c3a7bd69b..c9628277a47 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -6508,9 +6508,9 @@ note_mode_line_highlight (w, x, mode_line_p) | |||
| 6508 | 6508 | ||
| 6509 | if (glyph < end | 6509 | if (glyph < end |
| 6510 | && STRINGP (glyph->object) | 6510 | && STRINGP (glyph->object) |
| 6511 | && XSTRING (glyph->object)->intervals | 6511 | && STRING_INTERVALS (glyph->object) |
| 6512 | && glyph->charpos >= 0 | 6512 | && glyph->charpos >= 0 |
| 6513 | && glyph->charpos < XSTRING (glyph->object)->size) | 6513 | && glyph->charpos < SCHARS (glyph->object)) |
| 6514 | { | 6514 | { |
| 6515 | /* If we're on a string with `help-echo' text property, | 6515 | /* If we're on a string with `help-echo' text property, |
| 6516 | arrange for the help to be displayed. This is done by | 6516 | arrange for the help to be displayed. This is done by |
| @@ -6829,7 +6829,7 @@ note_mouse_highlight (f, x, y) | |||
| 6829 | if (NILP (b)) | 6829 | if (NILP (b)) |
| 6830 | b = make_number (0); | 6830 | b = make_number (0); |
| 6831 | if (NILP (e)) | 6831 | if (NILP (e)) |
| 6832 | e = make_number (XSTRING (object)->size - 1); | 6832 | e = make_number (SCHARS (object) - 1); |
| 6833 | fast_find_string_pos (w, XINT (b), object, | 6833 | fast_find_string_pos (w, XINT (b), object, |
| 6834 | &dpyinfo->mouse_face_beg_col, | 6834 | &dpyinfo->mouse_face_beg_col, |
| 6835 | &dpyinfo->mouse_face_beg_row, | 6835 | &dpyinfo->mouse_face_beg_row, |
| @@ -6927,7 +6927,7 @@ note_mouse_highlight (f, x, y) | |||
| 6927 | /* Try text properties. */ | 6927 | /* Try text properties. */ |
| 6928 | if (STRINGP (object) | 6928 | if (STRINGP (object) |
| 6929 | && charpos >= 0 | 6929 | && charpos >= 0 |
| 6930 | && charpos < XSTRING (object)->size) | 6930 | && charpos < SCHARS (object)) |
| 6931 | { | 6931 | { |
| 6932 | help = Fget_text_property (make_number (charpos), | 6932 | help = Fget_text_property (make_number (charpos), |
| 6933 | Qhelp_echo, object); | 6933 | Qhelp_echo, object); |
| @@ -8619,7 +8619,7 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 8619 | /* We may get paint messages even though the client | 8619 | /* We may get paint messages even though the client |
| 8620 | area is clipped - these are not expose events. */ | 8620 | area is clipped - these are not expose events. */ |
| 8621 | DebPrint (("clipped frame %p (%s) got WM_PAINT - ignored\n", f, | 8621 | DebPrint (("clipped frame %p (%s) got WM_PAINT - ignored\n", f, |
| 8622 | XSTRING (f->name)->data)); | 8622 | SDATA (f->name))); |
| 8623 | } | 8623 | } |
| 8624 | else if (f->async_visible != 1) | 8624 | else if (f->async_visible != 1) |
| 8625 | { | 8625 | { |
| @@ -8628,7 +8628,7 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 8628 | f->async_iconified = 0; | 8628 | f->async_iconified = 0; |
| 8629 | SET_FRAME_GARBAGED (f); | 8629 | SET_FRAME_GARBAGED (f); |
| 8630 | DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, | 8630 | DebPrint (("frame %p (%s) reexposed by WM_PAINT\n", f, |
| 8631 | XSTRING (f->name)->data)); | 8631 | SDATA (f->name))); |
| 8632 | 8632 | ||
| 8633 | /* WM_PAINT serves as MapNotify as well, so report | 8633 | /* WM_PAINT serves as MapNotify as well, so report |
| 8634 | visibility changes properly. */ | 8634 | visibility changes properly. */ |
| @@ -9308,7 +9308,7 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 9308 | if (!FRAME_OBSCURED_P (f)) | 9308 | if (!FRAME_OBSCURED_P (f)) |
| 9309 | { | 9309 | { |
| 9310 | DebPrint (("frame %p (%s) obscured\n", f, | 9310 | DebPrint (("frame %p (%s) obscured\n", f, |
| 9311 | XSTRING (f->name)->data)); | 9311 | SDATA (f->name))); |
| 9312 | } | 9312 | } |
| 9313 | } | 9313 | } |
| 9314 | else | 9314 | else |
| @@ -9320,7 +9320,7 @@ w32_read_socket (sd, bufp, numchars, expected) | |||
| 9320 | { | 9320 | { |
| 9321 | SET_FRAME_GARBAGED (f); | 9321 | SET_FRAME_GARBAGED (f); |
| 9322 | DebPrint (("obscured frame %p (%s) found to be visible\n", f, | 9322 | DebPrint (("obscured frame %p (%s) found to be visible\n", f, |
| 9323 | XSTRING (f->name)->data)); | 9323 | SDATA (f->name))); |
| 9324 | 9324 | ||
| 9325 | /* Force a redisplay sooner or later. */ | 9325 | /* Force a redisplay sooner or later. */ |
| 9326 | record_asynch_buffer_change (); | 9326 | record_asynch_buffer_change (); |
| @@ -9991,7 +9991,7 @@ x_bitmap_icon (f, icon) | |||
| 9991 | if (NILP (icon)) | 9991 | if (NILP (icon)) |
| 9992 | hicon = LoadIcon (hinst, EMACS_CLASS); | 9992 | hicon = LoadIcon (hinst, EMACS_CLASS); |
| 9993 | else if (STRINGP (icon)) | 9993 | else if (STRINGP (icon)) |
| 9994 | hicon = LoadImage (NULL, (LPCTSTR) XSTRING (icon)->data, IMAGE_ICON, 0, 0, | 9994 | hicon = LoadImage (NULL, (LPCTSTR) SDATA (icon), IMAGE_ICON, 0, 0, |
| 9995 | LR_DEFAULTSIZE | LR_LOADFROMFILE); | 9995 | LR_DEFAULTSIZE | LR_LOADFROMFILE); |
| 9996 | else if (SYMBOLP (icon)) | 9996 | else if (SYMBOLP (icon)) |
| 9997 | { | 9997 | { |
| @@ -10121,7 +10121,7 @@ x_new_fontset (f, fontsetname) | |||
| 10121 | to do. */ | 10121 | to do. */ |
| 10122 | return fontset_name (fontset); | 10122 | return fontset_name (fontset); |
| 10123 | 10123 | ||
| 10124 | result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data)); | 10124 | result = x_new_font (f, (SDATA (fontset_ascii (fontset)))); |
| 10125 | 10125 | ||
| 10126 | if (!STRINGP (result)) | 10126 | if (!STRINGP (result)) |
| 10127 | /* Can't load ASCII font. */ | 10127 | /* Can't load ASCII font. */ |
| @@ -11047,11 +11047,11 @@ w32_initialize_display_info (display_name) | |||
| 11047 | dpyinfo->name_list_element = XCAR (w32_display_name_list); | 11047 | dpyinfo->name_list_element = XCAR (w32_display_name_list); |
| 11048 | 11048 | ||
| 11049 | dpyinfo->w32_id_name | 11049 | dpyinfo->w32_id_name |
| 11050 | = (char *) xmalloc (XSTRING (Vinvocation_name)->size | 11050 | = (char *) xmalloc (SCHARS (Vinvocation_name) |
| 11051 | + XSTRING (Vsystem_name)->size | 11051 | + SCHARS (Vsystem_name) |
| 11052 | + 2); | 11052 | + 2); |
| 11053 | sprintf (dpyinfo->w32_id_name, "%s@%s", | 11053 | sprintf (dpyinfo->w32_id_name, "%s@%s", |
| 11054 | XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data); | 11054 | SDATA (Vinvocation_name), SDATA (Vsystem_name)); |
| 11055 | 11055 | ||
| 11056 | /* Default Console mode values - overridden when running in GUI mode | 11056 | /* Default Console mode values - overridden when running in GUI mode |
| 11057 | with values obtained from system metrics. */ | 11057 | with values obtained from system metrics. */ |
diff --git a/src/window.c b/src/window.c index 0bacf5fd549..333e07b142d 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -2747,7 +2747,7 @@ BUFFER can be a buffer or buffer name. */) | |||
| 2747 | { | 2747 | { |
| 2748 | if (!NILP (w->dedicated) && !EQ (tem, buffer)) | 2748 | if (!NILP (w->dedicated) && !EQ (tem, buffer)) |
| 2749 | error ("Window is dedicated to `%s'", | 2749 | error ("Window is dedicated to `%s'", |
| 2750 | XSTRING (XBUFFER (tem)->name)->data); | 2750 | SDATA (XBUFFER (tem)->name)); |
| 2751 | 2751 | ||
| 2752 | unshow_buffer (w); | 2752 | unshow_buffer (w); |
| 2753 | } | 2753 | } |
diff --git a/src/xdisp.c b/src/xdisp.c index e594ca20c74..d391a37f229 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -3698,7 +3698,7 @@ get_overlay_strings (it, charpos) | |||
| 3698 | it->stop_charpos = 0; | 3698 | it->stop_charpos = 0; |
| 3699 | xassert (STRINGP (it->string)); | 3699 | xassert (STRINGP (it->string)); |
| 3700 | it->end_charpos = SCHARS (it->string); | 3700 | it->end_charpos = SCHARS (it->string); |
| 3701 | it->multibyte_p = SMBP (it->string); | 3701 | it->multibyte_p = STRING_MULTIBYTE (it->string); |
| 3702 | it->method = next_element_from_string; | 3702 | it->method = next_element_from_string; |
| 3703 | } | 3703 | } |
| 3704 | else | 3704 | else |
| @@ -6102,9 +6102,9 @@ message_with_string (m, string, log) | |||
| 6102 | message = Fformat (2, args); | 6102 | message = Fformat (2, args); |
| 6103 | 6103 | ||
| 6104 | if (log) | 6104 | if (log) |
| 6105 | message3 (message, SBYTES (message), SMBP (message)); | 6105 | message3 (message, SBYTES (message), STRING_MULTIBYTE (message)); |
| 6106 | else | 6106 | else |
| 6107 | message3_nolog (message, SBYTES (message), SMBP (message)); | 6107 | message3_nolog (message, SBYTES (message), STRING_MULTIBYTE (message)); |
| 6108 | 6108 | ||
| 6109 | UNGCPRO; | 6109 | UNGCPRO; |
| 6110 | 6110 | ||
| @@ -6824,7 +6824,7 @@ restore_message () | |||
| 6824 | xassert (CONSP (Vmessage_stack)); | 6824 | xassert (CONSP (Vmessage_stack)); |
| 6825 | msg = XCAR (Vmessage_stack); | 6825 | msg = XCAR (Vmessage_stack); |
| 6826 | if (STRINGP (msg)) | 6826 | if (STRINGP (msg)) |
| 6827 | message3_nolog (msg, SBYTES (msg), SMBP (msg)); | 6827 | message3_nolog (msg, SBYTES (msg), STRING_MULTIBYTE (msg)); |
| 6828 | else | 6828 | else |
| 6829 | message3_nolog (msg, 0, 0); | 6829 | message3_nolog (msg, 0, 0); |
| 6830 | } | 6830 | } |
diff --git a/src/xfaces.c b/src/xfaces.c index 085a0929751..65ce504d270 100644 --- a/src/xfaces.c +++ b/src/xfaces.c | |||
| @@ -290,7 +290,7 @@ Boston, MA 02111-1307, USA. */ | |||
| 290 | /* Make a copy of the contents of Lisp string S on the stack using | 290 | /* Make a copy of the contents of Lisp string S on the stack using |
| 291 | alloca. Value is a pointer to the copy. */ | 291 | alloca. Value is a pointer to the copy. */ |
| 292 | 292 | ||
| 293 | #define LSTRDUPA(S) STRDUPA (XSTRING ((S))->data) | 293 | #define LSTRDUPA(S) STRDUPA (SDATA ((S))) |
| 294 | 294 | ||
| 295 | /* Size of hash table of realized faces in face caches (should be a | 295 | /* Size of hash table of realized faces in face caches (should be a |
| 296 | prime number). */ | 296 | prime number). */ |
| @@ -1146,7 +1146,7 @@ the pixmap. Bits are stored row by row, each row occupies | |||
| 1146 | { | 1146 | { |
| 1147 | int bytes_per_row = ((XFASTINT (width) + BITS_PER_CHAR - 1) | 1147 | int bytes_per_row = ((XFASTINT (width) + BITS_PER_CHAR - 1) |
| 1148 | / BITS_PER_CHAR); | 1148 | / BITS_PER_CHAR); |
| 1149 | if (STRING_BYTES (XSTRING (data)) >= bytes_per_row * XINT (height)) | 1149 | if (SBYTES (data) >= bytes_per_row * XINT (height)) |
| 1150 | pixmap_p = 1; | 1150 | pixmap_p = 1; |
| 1151 | } | 1151 | } |
| 1152 | } | 1152 | } |
| @@ -1190,7 +1190,7 @@ load_pixmap (f, name, w_ptr, h_ptr) | |||
| 1190 | h = XINT (Fcar (Fcdr (name))); | 1190 | h = XINT (Fcar (Fcdr (name))); |
| 1191 | bits = Fcar (Fcdr (Fcdr (name))); | 1191 | bits = Fcar (Fcdr (Fcdr (name))); |
| 1192 | 1192 | ||
| 1193 | bitmap_id = x_create_bitmap_from_data (f, XSTRING (bits)->data, | 1193 | bitmap_id = x_create_bitmap_from_data (f, SDATA (bits), |
| 1194 | w, h); | 1194 | w, h); |
| 1195 | } | 1195 | } |
| 1196 | else | 1196 | else |
| @@ -1569,7 +1569,7 @@ If FRAME is nil or omitted, use the selected frame. */) | |||
| 1569 | CHECK_FRAME (frame); | 1569 | CHECK_FRAME (frame); |
| 1570 | CHECK_STRING (color); | 1570 | CHECK_STRING (color); |
| 1571 | f = XFRAME (frame); | 1571 | f = XFRAME (frame); |
| 1572 | return face_color_gray_p (f, XSTRING (color)->data) ? Qt : Qnil; | 1572 | return face_color_gray_p (f, SDATA (color)) ? Qt : Qnil; |
| 1573 | } | 1573 | } |
| 1574 | 1574 | ||
| 1575 | 1575 | ||
| @@ -1587,7 +1587,7 @@ COLOR must be a valid color name. */) | |||
| 1587 | CHECK_FRAME (frame); | 1587 | CHECK_FRAME (frame); |
| 1588 | CHECK_STRING (color); | 1588 | CHECK_STRING (color); |
| 1589 | f = XFRAME (frame); | 1589 | f = XFRAME (frame); |
| 1590 | if (face_color_supported_p (f, XSTRING (color)->data, !NILP (background_p))) | 1590 | if (face_color_supported_p (f, SDATA (color), !NILP (background_p))) |
| 1591 | return Qt; | 1591 | return Qt; |
| 1592 | return Qnil; | 1592 | return Qnil; |
| 1593 | } | 1593 | } |
| @@ -1621,7 +1621,7 @@ load_color (f, face, name, target_index) | |||
| 1621 | 1621 | ||
| 1622 | /* if the color map is full, defined_color will return a best match | 1622 | /* if the color map is full, defined_color will return a best match |
| 1623 | to the values in an existing cell. */ | 1623 | to the values in an existing cell. */ |
| 1624 | if (!defined_color (f, XSTRING (name)->data, &color, 1)) | 1624 | if (!defined_color (f, SDATA (name), &color, 1)) |
| 1625 | { | 1625 | { |
| 1626 | add_to_log ("Unable to load color \"%s\"", name, Qnil); | 1626 | add_to_log ("Unable to load color \"%s\"", name, Qnil); |
| 1627 | 1627 | ||
| @@ -1701,7 +1701,7 @@ load_face_colors (f, face, attrs) | |||
| 1701 | face_color_supported_p is smart enough to know that grays are | 1701 | face_color_supported_p is smart enough to know that grays are |
| 1702 | "supported" as background because we are supposed to use stipple | 1702 | "supported" as background because we are supposed to use stipple |
| 1703 | for them. */ | 1703 | for them. */ |
| 1704 | if (!face_color_supported_p (f, XSTRING (bg)->data, 0) | 1704 | if (!face_color_supported_p (f, SDATA (bg), 0) |
| 1705 | && !NILP (Fbitmap_spec_p (Vface_default_stipple))) | 1705 | && !NILP (Fbitmap_spec_p (Vface_default_stipple))) |
| 1706 | { | 1706 | { |
| 1707 | x_destroy_bitmap (f, face->stipple); | 1707 | x_destroy_bitmap (f, face->stipple); |
| @@ -2476,7 +2476,7 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p) | |||
| 2476 | for (tem = lfonts; CONSP (tem) && n < nfonts; tem = XCDR (tem)) | 2476 | for (tem = lfonts; CONSP (tem) && n < nfonts; tem = XCDR (tem)) |
| 2477 | { | 2477 | { |
| 2478 | Lisp_Object elt, tail; | 2478 | Lisp_Object elt, tail; |
| 2479 | char *name = XSTRING (XCAR (tem))->data; | 2479 | char *name = SDATA (XCAR (tem)); |
| 2480 | 2480 | ||
| 2481 | /* Ignore fonts matching a pattern from face-ignored-fonts. */ | 2481 | /* Ignore fonts matching a pattern from face-ignored-fonts. */ |
| 2482 | for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail)) | 2482 | for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail)) |
| @@ -2520,7 +2520,7 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p) | |||
| 2520 | Lisp_Object entry = XCAR (list); | 2520 | Lisp_Object entry = XCAR (list); |
| 2521 | if (CONSP (entry) | 2521 | if (CONSP (entry) |
| 2522 | && STRINGP (XCAR (entry)) | 2522 | && STRINGP (XCAR (entry)) |
| 2523 | && strcmp (XSTRING (XCAR (entry))->data, pattern) == 0) | 2523 | && strcmp (SDATA (XCAR (entry)), pattern) == 0) |
| 2524 | break; | 2524 | break; |
| 2525 | list = XCDR (list); | 2525 | list = XCDR (list); |
| 2526 | } | 2526 | } |
| @@ -2536,8 +2536,8 @@ x_face_list_fonts (f, pattern, fonts, nfonts, try_alternatives_p) | |||
| 2536 | STRINGP (name)) | 2536 | STRINGP (name)) |
| 2537 | /* Ignore patterns equal to PATTERN because we tried that | 2537 | /* Ignore patterns equal to PATTERN because we tried that |
| 2538 | already with no success. */ | 2538 | already with no success. */ |
| 2539 | && (strcmp (XSTRING (name)->data, pattern) == 0 | 2539 | && (strcmp (SDATA (name), pattern) == 0 |
| 2540 | || (n = x_face_list_fonts (f, XSTRING (name)->data, | 2540 | || (n = x_face_list_fonts (f, SDATA (name), |
| 2541 | fonts, nfonts, 0), | 2541 | fonts, nfonts, 0), |
| 2542 | n == 0))) | 2542 | n == 0))) |
| 2543 | patterns = XCDR (patterns); | 2543 | patterns = XCDR (patterns); |
| @@ -2647,8 +2647,8 @@ font_list_1 (f, pattern, family, registry, fonts) | |||
| 2647 | 2647 | ||
| 2648 | if (NILP (pattern)) | 2648 | if (NILP (pattern)) |
| 2649 | { | 2649 | { |
| 2650 | family_str = (NILP (family) ? "*" : (char *) XSTRING (family)->data); | 2650 | family_str = (NILP (family) ? "*" : (char *) SDATA (family)); |
| 2651 | registry_str = (NILP (registry) ? "*" : (char *) XSTRING (registry)->data); | 2651 | registry_str = (NILP (registry) ? "*" : (char *) SDATA (registry)); |
| 2652 | 2652 | ||
| 2653 | pattern_str = (char *) alloca (strlen (family_str) | 2653 | pattern_str = (char *) alloca (strlen (family_str) |
| 2654 | + strlen (registry_str) | 2654 | + strlen (registry_str) |
| @@ -2666,7 +2666,7 @@ font_list_1 (f, pattern, family, registry, fonts) | |||
| 2666 | } | 2666 | } |
| 2667 | } | 2667 | } |
| 2668 | else | 2668 | else |
| 2669 | pattern_str = (char *) XSTRING (pattern)->data; | 2669 | pattern_str = (char *) SDATA (pattern); |
| 2670 | 2670 | ||
| 2671 | return sorted_font_list (f, pattern_str, cmp_font_names, fonts); | 2671 | return sorted_font_list (f, pattern_str, cmp_font_names, fonts); |
| 2672 | } | 2672 | } |
| @@ -3087,7 +3087,7 @@ resolve_face_name (face_name) | |||
| 3087 | Lisp_Object aliased; | 3087 | Lisp_Object aliased; |
| 3088 | 3088 | ||
| 3089 | if (STRINGP (face_name)) | 3089 | if (STRINGP (face_name)) |
| 3090 | face_name = intern (XSTRING (face_name)->data); | 3090 | face_name = intern (SDATA (face_name)); |
| 3091 | 3091 | ||
| 3092 | while (SYMBOLP (face_name)) | 3092 | while (SYMBOLP (face_name)) |
| 3093 | { | 3093 | { |
| @@ -3210,13 +3210,13 @@ set_lface_from_font_name (f, lface, fontname, force_p, may_fail_p) | |||
| 3210 | int pt; | 3210 | int pt; |
| 3211 | int have_xlfd_p; | 3211 | int have_xlfd_p; |
| 3212 | int fontset; | 3212 | int fontset; |
| 3213 | char *font_name = XSTRING (fontname)->data; | 3213 | char *font_name = SDATA (fontname); |
| 3214 | struct font_info *font_info; | 3214 | struct font_info *font_info; |
| 3215 | 3215 | ||
| 3216 | /* If FONTNAME is actually a fontset name, get ASCII font name of it. */ | 3216 | /* If FONTNAME is actually a fontset name, get ASCII font name of it. */ |
| 3217 | fontset = fs_query_fontset (fontname, 0); | 3217 | fontset = fs_query_fontset (fontname, 0); |
| 3218 | if (fontset >= 0) | 3218 | if (fontset >= 0) |
| 3219 | font_name = XSTRING (fontset_ascii (fontset))->data; | 3219 | font_name = SDATA (fontset_ascii (fontset)); |
| 3220 | 3220 | ||
| 3221 | /* Check if FONT_NAME is surely available on the system. Usually | 3221 | /* Check if FONT_NAME is surely available on the system. Usually |
| 3222 | FONT_NAME is already cached for the frame F and FS_LOAD_FONT | 3222 | FONT_NAME is already cached for the frame F and FS_LOAD_FONT |
| @@ -3522,7 +3522,7 @@ merge_face_vector_with_property (f, to, prop) | |||
| 3522 | add_to_log ("Invalid face color", color_name, Qnil); | 3522 | add_to_log ("Invalid face color", color_name, Qnil); |
| 3523 | } | 3523 | } |
| 3524 | else if (SYMBOLP (first) | 3524 | else if (SYMBOLP (first) |
| 3525 | && *XSTRING (SYMBOL_NAME (first))->data == ':') | 3525 | && *SDATA (SYMBOL_NAME (first)) == ':') |
| 3526 | { | 3526 | { |
| 3527 | /* Assume this is the property list form. */ | 3527 | /* Assume this is the property list form. */ |
| 3528 | while (CONSP (prop) && CONSP (XCDR (prop))) | 3528 | while (CONSP (prop) && CONSP (XCDR (prop))) |
| @@ -3904,7 +3904,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 3904 | if (!UNSPECIFIEDP (value)) | 3904 | if (!UNSPECIFIEDP (value)) |
| 3905 | { | 3905 | { |
| 3906 | CHECK_STRING (value); | 3906 | CHECK_STRING (value); |
| 3907 | if (XSTRING (value)->size == 0) | 3907 | if (SCHARS (value) == 0) |
| 3908 | signal_error ("Invalid face family", value); | 3908 | signal_error ("Invalid face family", value); |
| 3909 | } | 3909 | } |
| 3910 | old_value = LFACE_FAMILY (lface); | 3910 | old_value = LFACE_FAMILY (lface); |
| @@ -3964,7 +3964,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 3964 | && !EQ (value, Qnil)) | 3964 | && !EQ (value, Qnil)) |
| 3965 | /* Underline color. */ | 3965 | /* Underline color. */ |
| 3966 | || (STRINGP (value) | 3966 | || (STRINGP (value) |
| 3967 | && XSTRING (value)->size == 0)) | 3967 | && SCHARS (value) == 0)) |
| 3968 | signal_error ("Invalid face underline", value); | 3968 | signal_error ("Invalid face underline", value); |
| 3969 | 3969 | ||
| 3970 | old_value = LFACE_UNDERLINE (lface); | 3970 | old_value = LFACE_UNDERLINE (lface); |
| @@ -3978,7 +3978,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 3978 | && !EQ (value, Qnil)) | 3978 | && !EQ (value, Qnil)) |
| 3979 | /* Overline color. */ | 3979 | /* Overline color. */ |
| 3980 | || (STRINGP (value) | 3980 | || (STRINGP (value) |
| 3981 | && XSTRING (value)->size == 0)) | 3981 | && SCHARS (value) == 0)) |
| 3982 | signal_error ("Invalid face overline", value); | 3982 | signal_error ("Invalid face overline", value); |
| 3983 | 3983 | ||
| 3984 | old_value = LFACE_OVERLINE (lface); | 3984 | old_value = LFACE_OVERLINE (lface); |
| @@ -3992,7 +3992,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 3992 | && !EQ (value, Qnil)) | 3992 | && !EQ (value, Qnil)) |
| 3993 | /* Strike-through color. */ | 3993 | /* Strike-through color. */ |
| 3994 | || (STRINGP (value) | 3994 | || (STRINGP (value) |
| 3995 | && XSTRING (value)->size == 0)) | 3995 | && SCHARS (value) == 0)) |
| 3996 | signal_error ("Invalid face strike-through", value); | 3996 | signal_error ("Invalid face strike-through", value); |
| 3997 | 3997 | ||
| 3998 | old_value = LFACE_STRIKE_THROUGH (lface); | 3998 | old_value = LFACE_STRIKE_THROUGH (lface); |
| @@ -4014,7 +4014,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 4014 | else if (INTEGERP (value)) | 4014 | else if (INTEGERP (value)) |
| 4015 | valid_p = XINT (value) != 0; | 4015 | valid_p = XINT (value) != 0; |
| 4016 | else if (STRINGP (value)) | 4016 | else if (STRINGP (value)) |
| 4017 | valid_p = XSTRING (value)->size > 0; | 4017 | valid_p = SCHARS (value) > 0; |
| 4018 | else if (CONSP (value)) | 4018 | else if (CONSP (value)) |
| 4019 | { | 4019 | { |
| 4020 | Lisp_Object tem; | 4020 | Lisp_Object tem; |
| @@ -4038,7 +4038,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 4038 | } | 4038 | } |
| 4039 | else if (EQ (k, QCcolor)) | 4039 | else if (EQ (k, QCcolor)) |
| 4040 | { | 4040 | { |
| 4041 | if (!STRINGP (v) || XSTRING (v)->size == 0) | 4041 | if (!STRINGP (v) || SCHARS (v) == 0) |
| 4042 | break; | 4042 | break; |
| 4043 | } | 4043 | } |
| 4044 | else if (EQ (k, QCstyle)) | 4044 | else if (EQ (k, QCstyle)) |
| @@ -4081,7 +4081,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 4081 | on the frame (display) whether the color will be valid | 4081 | on the frame (display) whether the color will be valid |
| 4082 | when the face is realized. */ | 4082 | when the face is realized. */ |
| 4083 | CHECK_STRING (value); | 4083 | CHECK_STRING (value); |
| 4084 | if (XSTRING (value)->size == 0) | 4084 | if (SCHARS (value) == 0) |
| 4085 | signal_error ("Empty foreground color value", value); | 4085 | signal_error ("Empty foreground color value", value); |
| 4086 | } | 4086 | } |
| 4087 | old_value = LFACE_FOREGROUND (lface); | 4087 | old_value = LFACE_FOREGROUND (lface); |
| @@ -4095,7 +4095,7 @@ FRAME 0 means change the face on all frames, and change the default | |||
| 4095 | on the frame (display) whether the color will be valid | 4095 | on the frame (display) whether the color will be valid |
| 4096 | when the face is realized. */ | 4096 | when the face is realized. */ |
| 4097 | CHECK_STRING (value); | 4097 | CHECK_STRING (value); |
| 4098 | if (XSTRING (value)->size == 0) | 4098 | if (SCHARS (value) == 0) |
| 4099 | signal_error ("Empty background color value", value); | 4099 | signal_error ("Empty background color value", value); |
| 4100 | } | 4100 | } |
| 4101 | old_value = LFACE_BACKGROUND (lface); | 4101 | old_value = LFACE_BACKGROUND (lface); |
| @@ -4445,13 +4445,13 @@ face_boolean_x_resource_value (value, signal_p) | |||
| 4445 | 4445 | ||
| 4446 | xassert (STRINGP (value)); | 4446 | xassert (STRINGP (value)); |
| 4447 | 4447 | ||
| 4448 | if (xstricmp (XSTRING (value)->data, "on") == 0 | 4448 | if (xstricmp (SDATA (value), "on") == 0 |
| 4449 | || xstricmp (XSTRING (value)->data, "true") == 0) | 4449 | || xstricmp (SDATA (value), "true") == 0) |
| 4450 | result = Qt; | 4450 | result = Qt; |
| 4451 | else if (xstricmp (XSTRING (value)->data, "off") == 0 | 4451 | else if (xstricmp (SDATA (value), "off") == 0 |
| 4452 | || xstricmp (XSTRING (value)->data, "false") == 0) | 4452 | || xstricmp (SDATA (value), "false") == 0) |
| 4453 | result = Qnil; | 4453 | result = Qnil; |
| 4454 | else if (xstricmp (XSTRING (value)->data, "unspecified") == 0) | 4454 | else if (xstricmp (SDATA (value), "unspecified") == 0) |
| 4455 | result = Qunspecified; | 4455 | result = Qunspecified; |
| 4456 | else if (signal_p) | 4456 | else if (signal_p) |
| 4457 | signal_error ("Invalid face attribute value from X resource", value); | 4457 | signal_error ("Invalid face attribute value from X resource", value); |
| @@ -4471,7 +4471,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource", | |||
| 4471 | CHECK_SYMBOL (attr); | 4471 | CHECK_SYMBOL (attr); |
| 4472 | CHECK_STRING (value); | 4472 | CHECK_STRING (value); |
| 4473 | 4473 | ||
| 4474 | if (xstricmp (XSTRING (value)->data, "unspecified") == 0) | 4474 | if (xstricmp (SDATA (value), "unspecified") == 0) |
| 4475 | value = Qunspecified; | 4475 | value = Qunspecified; |
| 4476 | else if (EQ (attr, QCheight)) | 4476 | else if (EQ (attr, QCheight)) |
| 4477 | { | 4477 | { |
| @@ -4482,7 +4482,7 @@ DEFUN ("internal-set-lisp-face-attribute-from-resource", | |||
| 4482 | else if (EQ (attr, QCbold) || EQ (attr, QCitalic)) | 4482 | else if (EQ (attr, QCbold) || EQ (attr, QCitalic)) |
| 4483 | value = face_boolean_x_resource_value (value, 1); | 4483 | value = face_boolean_x_resource_value (value, 1); |
| 4484 | else if (EQ (attr, QCweight) || EQ (attr, QCslant) || EQ (attr, QCwidth)) | 4484 | else if (EQ (attr, QCweight) || EQ (attr, QCslant) || EQ (attr, QCwidth)) |
| 4485 | value = intern (XSTRING (value)->data); | 4485 | value = intern (SDATA (value)); |
| 4486 | else if (EQ (attr, QCreverse_video) || EQ (attr, QCinverse_video)) | 4486 | else if (EQ (attr, QCreverse_video) || EQ (attr, QCinverse_video)) |
| 4487 | value = face_boolean_x_resource_value (value, 1); | 4487 | value = face_boolean_x_resource_value (value, 1); |
| 4488 | else if (EQ (attr, QCunderline) | 4488 | else if (EQ (attr, QCunderline) |
| @@ -4528,7 +4528,7 @@ x_update_menu_appearance (f) | |||
| 4528 | char line[512]; | 4528 | char line[512]; |
| 4529 | Lisp_Object lface = lface_from_face_name (f, Qmenu, 1); | 4529 | Lisp_Object lface = lface_from_face_name (f, Qmenu, 1); |
| 4530 | struct face *face = FACE_FROM_ID (f, MENU_FACE_ID); | 4530 | struct face *face = FACE_FROM_ID (f, MENU_FACE_ID); |
| 4531 | char *myname = XSTRING (Vx_resource_name)->data; | 4531 | char *myname = SDATA (Vx_resource_name); |
| 4532 | int changed_p = 0; | 4532 | int changed_p = 0; |
| 4533 | #ifdef USE_MOTIF | 4533 | #ifdef USE_MOTIF |
| 4534 | const char *popup_path = "popup_menu"; | 4534 | const char *popup_path = "popup_menu"; |
| @@ -4540,10 +4540,10 @@ x_update_menu_appearance (f) | |||
| 4540 | { | 4540 | { |
| 4541 | sprintf (line, "%s.%s*foreground: %s", | 4541 | sprintf (line, "%s.%s*foreground: %s", |
| 4542 | myname, popup_path, | 4542 | myname, popup_path, |
| 4543 | XSTRING (LFACE_FOREGROUND (lface))->data); | 4543 | SDATA (LFACE_FOREGROUND (lface))); |
| 4544 | XrmPutLineResource (&rdb, line); | 4544 | XrmPutLineResource (&rdb, line); |
| 4545 | sprintf (line, "%s.pane.menubar*foreground: %s", | 4545 | sprintf (line, "%s.pane.menubar*foreground: %s", |
| 4546 | myname, XSTRING (LFACE_FOREGROUND (lface))->data); | 4546 | myname, SDATA (LFACE_FOREGROUND (lface))); |
| 4547 | XrmPutLineResource (&rdb, line); | 4547 | XrmPutLineResource (&rdb, line); |
| 4548 | changed_p = 1; | 4548 | changed_p = 1; |
| 4549 | } | 4549 | } |
| @@ -4552,10 +4552,10 @@ x_update_menu_appearance (f) | |||
| 4552 | { | 4552 | { |
| 4553 | sprintf (line, "%s.%s*background: %s", | 4553 | sprintf (line, "%s.%s*background: %s", |
| 4554 | myname, popup_path, | 4554 | myname, popup_path, |
| 4555 | XSTRING (LFACE_BACKGROUND (lface))->data); | 4555 | SDATA (LFACE_BACKGROUND (lface))); |
| 4556 | XrmPutLineResource (&rdb, line); | 4556 | XrmPutLineResource (&rdb, line); |
| 4557 | sprintf (line, "%s.pane.menubar*background: %s", | 4557 | sprintf (line, "%s.pane.menubar*background: %s", |
| 4558 | myname, XSTRING (LFACE_BACKGROUND (lface))->data); | 4558 | myname, SDATA (LFACE_BACKGROUND (lface))); |
| 4559 | XrmPutLineResource (&rdb, line); | 4559 | XrmPutLineResource (&rdb, line); |
| 4560 | changed_p = 1; | 4560 | changed_p = 1; |
| 4561 | } | 4561 | } |
| @@ -4837,10 +4837,10 @@ lface_equal_p (v1, v2) | |||
| 4837 | switch (XTYPE (a)) | 4837 | switch (XTYPE (a)) |
| 4838 | { | 4838 | { |
| 4839 | case Lisp_String: | 4839 | case Lisp_String: |
| 4840 | equal_p = ((STRING_BYTES (XSTRING (a)) | 4840 | equal_p = ((SBYTES (a) |
| 4841 | == STRING_BYTES (XSTRING (b))) | 4841 | == SBYTES (b)) |
| 4842 | && bcmp (XSTRING (a)->data, XSTRING (b)->data, | 4842 | && bcmp (SDATA (a), SDATA (b), |
| 4843 | STRING_BYTES (XSTRING (a))) == 0); | 4843 | SBYTES (a)) == 0); |
| 4844 | break; | 4844 | break; |
| 4845 | 4845 | ||
| 4846 | case Lisp_Int: | 4846 | case Lisp_Int: |
| @@ -4942,7 +4942,7 @@ hash_string_case_insensitive (string) | |||
| 4942 | unsigned char *s; | 4942 | unsigned char *s; |
| 4943 | unsigned hash = 0; | 4943 | unsigned hash = 0; |
| 4944 | xassert (STRINGP (string)); | 4944 | xassert (STRINGP (string)); |
| 4945 | for (s = XSTRING (string)->data; *s; ++s) | 4945 | for (s = SDATA (string); *s; ++s) |
| 4946 | hash = (hash << 1) ^ tolower (*s); | 4946 | hash = (hash << 1) ^ tolower (*s); |
| 4947 | return hash; | 4947 | return hash; |
| 4948 | } | 4948 | } |
| @@ -4975,8 +4975,8 @@ lface_same_font_attributes_p (lface1, lface2) | |||
| 4975 | { | 4975 | { |
| 4976 | xassert (lface_fully_specified_p (lface1) | 4976 | xassert (lface_fully_specified_p (lface1) |
| 4977 | && lface_fully_specified_p (lface2)); | 4977 | && lface_fully_specified_p (lface2)); |
| 4978 | return (xstricmp (XSTRING (lface1[LFACE_FAMILY_INDEX])->data, | 4978 | return (xstricmp (SDATA (lface1[LFACE_FAMILY_INDEX]), |
| 4979 | XSTRING (lface2[LFACE_FAMILY_INDEX])->data) == 0 | 4979 | SDATA (lface2[LFACE_FAMILY_INDEX])) == 0 |
| 4980 | && EQ (lface1[LFACE_HEIGHT_INDEX], lface2[LFACE_HEIGHT_INDEX]) | 4980 | && EQ (lface1[LFACE_HEIGHT_INDEX], lface2[LFACE_HEIGHT_INDEX]) |
| 4981 | && EQ (lface1[LFACE_SWIDTH_INDEX], lface2[LFACE_SWIDTH_INDEX]) | 4981 | && EQ (lface1[LFACE_SWIDTH_INDEX], lface2[LFACE_SWIDTH_INDEX]) |
| 4982 | && EQ (lface1[LFACE_AVGWIDTH_INDEX], lface2[LFACE_AVGWIDTH_INDEX]) | 4982 | && EQ (lface1[LFACE_AVGWIDTH_INDEX], lface2[LFACE_AVGWIDTH_INDEX]) |
| @@ -4985,8 +4985,8 @@ lface_same_font_attributes_p (lface1, lface2) | |||
| 4985 | && (EQ (lface1[LFACE_FONT_INDEX], lface2[LFACE_FONT_INDEX]) | 4985 | && (EQ (lface1[LFACE_FONT_INDEX], lface2[LFACE_FONT_INDEX]) |
| 4986 | || (STRINGP (lface1[LFACE_FONT_INDEX]) | 4986 | || (STRINGP (lface1[LFACE_FONT_INDEX]) |
| 4987 | && STRINGP (lface2[LFACE_FONT_INDEX]) | 4987 | && STRINGP (lface2[LFACE_FONT_INDEX]) |
| 4988 | && xstricmp (XSTRING (lface1[LFACE_FONT_INDEX])->data, | 4988 | && xstricmp (SDATA (lface1[LFACE_FONT_INDEX]), |
| 4989 | XSTRING (lface2[LFACE_FONT_INDEX])->data)))); | 4989 | SDATA (lface2[LFACE_FONT_INDEX]))))); |
| 4990 | } | 4990 | } |
| 4991 | 4991 | ||
| 4992 | 4992 | ||
| @@ -5141,11 +5141,11 @@ If FRAME is unspecified or nil, the current frame is used. */) | |||
| 5141 | 5141 | ||
| 5142 | if ((CONSP (color1) && !parse_rgb_list (color1, &cdef1)) | 5142 | if ((CONSP (color1) && !parse_rgb_list (color1, &cdef1)) |
| 5143 | || !STRINGP (color1) | 5143 | || !STRINGP (color1) |
| 5144 | || !defined_color (f, XSTRING (color1)->data, &cdef1, 0)) | 5144 | || !defined_color (f, SDATA (color1), &cdef1, 0)) |
| 5145 | signal_error ("Invalid color", color1); | 5145 | signal_error ("Invalid color", color1); |
| 5146 | if ((CONSP (color2) && !parse_rgb_list (color2, &cdef2)) | 5146 | if ((CONSP (color2) && !parse_rgb_list (color2, &cdef2)) |
| 5147 | || !STRINGP (color2) | 5147 | || !STRINGP (color2) |
| 5148 | || !defined_color (f, XSTRING (color2)->data, &cdef2, 0)) | 5148 | || !defined_color (f, SDATA (color2), &cdef2, 0)) |
| 5149 | signal_error ("Invalid color", color2); | 5149 | signal_error ("Invalid color", color2); |
| 5150 | 5150 | ||
| 5151 | return make_number (color_distance (&cdef1, &cdef2)); | 5151 | return make_number (color_distance (&cdef1, &cdef2)); |
| @@ -6347,7 +6347,7 @@ try_font_list (f, attrs, family, registry, fonts) | |||
| 6347 | if the family is -etl-fixed, e.g. The following widens the | 6347 | if the family is -etl-fixed, e.g. The following widens the |
| 6348 | choices and fixes that problem. */ | 6348 | choices and fixes that problem. */ |
| 6349 | if (nfonts == 0 && STRINGP (face_family) && STRINGP (registry) | 6349 | if (nfonts == 0 && STRINGP (face_family) && STRINGP (registry) |
| 6350 | && xstricmp (XSTRING (registry)->data, "mac-roman") == 0) | 6350 | && xstricmp (SDATA (registry), "mac-roman") == 0) |
| 6351 | nfonts = try_alternative_families (f, face_family, Qnil, fonts); | 6351 | nfonts = try_alternative_families (f, face_family, Qnil, fonts); |
| 6352 | #endif | 6352 | #endif |
| 6353 | 6353 | ||
| @@ -6421,7 +6421,7 @@ choose_face_font (f, attrs, fontset, c) | |||
| 6421 | 6421 | ||
| 6422 | /* If what we got is a name pattern, return it. */ | 6422 | /* If what we got is a name pattern, return it. */ |
| 6423 | if (STRINGP (pattern)) | 6423 | if (STRINGP (pattern)) |
| 6424 | return xstrdup (XSTRING (pattern)->data); | 6424 | return xstrdup (SDATA (pattern)); |
| 6425 | 6425 | ||
| 6426 | /* Get a list of fonts matching that pattern and choose the | 6426 | /* Get a list of fonts matching that pattern and choose the |
| 6427 | best match for the specified face attributes from it. */ | 6427 | best match for the specified face attributes from it. */ |
| @@ -6927,7 +6927,7 @@ map_tty_color (f, face, idx, defaulted) | |||
| 6927 | color = face->lface[idx]; | 6927 | color = face->lface[idx]; |
| 6928 | 6928 | ||
| 6929 | if (STRINGP (color) | 6929 | if (STRINGP (color) |
| 6930 | && XSTRING (color)->size | 6930 | && SCHARS (color) |
| 6931 | && CONSP (Vtty_defined_color_alist) | 6931 | && CONSP (Vtty_defined_color_alist) |
| 6932 | && (def = assq_no_quit (color, call1 (Qtty_color_alist, frame)), | 6932 | && (def = assq_no_quit (color, call1 (Qtty_color_alist, frame)), |
| 6933 | CONSP (def))) | 6933 | CONSP (def))) |
| @@ -7277,7 +7277,7 @@ face_at_string_position (w, string, pos, bufpos, region_beg, | |||
| 7277 | Limit is the maximum position up to which to check for property | 7277 | Limit is the maximum position up to which to check for property |
| 7278 | changes in Fnext_single_property_change. Strings are usually | 7278 | changes in Fnext_single_property_change. Strings are usually |
| 7279 | short, so set the limit to the end of the string. */ | 7279 | short, so set the limit to the end of the string. */ |
| 7280 | XSETFASTINT (limit, XSTRING (string)->size); | 7280 | XSETFASTINT (limit, SCHARS (string)); |
| 7281 | end = Fnext_single_property_change (position, prop_name, string, limit); | 7281 | end = Fnext_single_property_change (position, prop_name, string, limit); |
| 7282 | if (INTEGERP (end)) | 7282 | if (INTEGERP (end)) |
| 7283 | *endptr = XFASTINT (end); | 7283 | *endptr = XFASTINT (end); |
| @@ -7345,13 +7345,13 @@ dump_realized_face (face) | |||
| 7345 | #endif | 7345 | #endif |
| 7346 | fprintf (stderr, "foreground: 0x%lx (%s)\n", | 7346 | fprintf (stderr, "foreground: 0x%lx (%s)\n", |
| 7347 | face->foreground, | 7347 | face->foreground, |
| 7348 | XSTRING (face->lface[LFACE_FOREGROUND_INDEX])->data); | 7348 | SDATA (face->lface[LFACE_FOREGROUND_INDEX])); |
| 7349 | fprintf (stderr, "background: 0x%lx (%s)\n", | 7349 | fprintf (stderr, "background: 0x%lx (%s)\n", |
| 7350 | face->background, | 7350 | face->background, |
| 7351 | XSTRING (face->lface[LFACE_BACKGROUND_INDEX])->data); | 7351 | SDATA (face->lface[LFACE_BACKGROUND_INDEX])); |
| 7352 | fprintf (stderr, "font_name: %s (%s)\n", | 7352 | fprintf (stderr, "font_name: %s (%s)\n", |
| 7353 | face->font_name, | 7353 | face->font_name, |
| 7354 | XSTRING (face->lface[LFACE_FAMILY_INDEX])->data); | 7354 | SDATA (face->lface[LFACE_FAMILY_INDEX])); |
| 7355 | #ifdef HAVE_X_WINDOWS | 7355 | #ifdef HAVE_X_WINDOWS |
| 7356 | fprintf (stderr, "font = %p\n", face->font); | 7356 | fprintf (stderr, "font = %p\n", face->font); |
| 7357 | #endif | 7357 | #endif |
| @@ -7359,7 +7359,7 @@ dump_realized_face (face) | |||
| 7359 | fprintf (stderr, "fontset: %d\n", face->fontset); | 7359 | fprintf (stderr, "fontset: %d\n", face->fontset); |
| 7360 | fprintf (stderr, "underline: %d (%s)\n", | 7360 | fprintf (stderr, "underline: %d (%s)\n", |
| 7361 | face->underline_p, | 7361 | face->underline_p, |
| 7362 | XSTRING (Fsymbol_name (face->lface[LFACE_UNDERLINE_INDEX]))->data); | 7362 | SDATA (Fsymbol_name (face->lface[LFACE_UNDERLINE_INDEX]))); |
| 7363 | fprintf (stderr, "hash: %d\n", face->hash); | 7363 | fprintf (stderr, "hash: %d\n", face->hash); |
| 7364 | fprintf (stderr, "charset: %d\n", face->charset); | 7364 | fprintf (stderr, "charset: %d\n", face->charset); |
| 7365 | } | 7365 | } |
diff --git a/src/xfns.c b/src/xfns.c index 920b3b13a38..2b84c6d0376 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -636,7 +636,7 @@ x_create_bitmap_from_file (f, file) | |||
| 636 | { | 636 | { |
| 637 | if (dpyinfo->bitmaps[id].refcount | 637 | if (dpyinfo->bitmaps[id].refcount |
| 638 | && dpyinfo->bitmaps[id].file | 638 | && dpyinfo->bitmaps[id].file |
| 639 | && !strcmp (dpyinfo->bitmaps[id].file, (char *) XSTRING (file)->data)) | 639 | && !strcmp (dpyinfo->bitmaps[id].file, (char *) SDATA (file))) |
| 640 | { | 640 | { |
| 641 | ++dpyinfo->bitmaps[id].refcount; | 641 | ++dpyinfo->bitmaps[id].refcount; |
| 642 | return id + 1; | 642 | return id + 1; |
| @@ -649,7 +649,7 @@ x_create_bitmap_from_file (f, file) | |||
| 649 | return -1; | 649 | return -1; |
| 650 | emacs_close (fd); | 650 | emacs_close (fd); |
| 651 | 651 | ||
| 652 | filename = (char *) XSTRING (found)->data; | 652 | filename = (char *) SDATA (found); |
| 653 | 653 | ||
| 654 | result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 654 | result = XReadBitmapFile (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 655 | filename, &width, &height, &bitmap, &xhot, &yhot); | 655 | filename, &width, &height, &bitmap, &xhot, &yhot); |
| @@ -660,11 +660,11 @@ x_create_bitmap_from_file (f, file) | |||
| 660 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; | 660 | dpyinfo->bitmaps[id - 1].pixmap = bitmap; |
| 661 | dpyinfo->bitmaps[id - 1].refcount = 1; | 661 | dpyinfo->bitmaps[id - 1].refcount = 1; |
| 662 | dpyinfo->bitmaps[id - 1].file | 662 | dpyinfo->bitmaps[id - 1].file |
| 663 | = (char *) xmalloc (STRING_BYTES (XSTRING (file)) + 1); | 663 | = (char *) xmalloc (SBYTES (file) + 1); |
| 664 | dpyinfo->bitmaps[id - 1].depth = 1; | 664 | dpyinfo->bitmaps[id - 1].depth = 1; |
| 665 | dpyinfo->bitmaps[id - 1].height = height; | 665 | dpyinfo->bitmaps[id - 1].height = height; |
| 666 | dpyinfo->bitmaps[id - 1].width = width; | 666 | dpyinfo->bitmaps[id - 1].width = width; |
| 667 | strcpy (dpyinfo->bitmaps[id - 1].file, XSTRING (file)->data); | 667 | strcpy (dpyinfo->bitmaps[id - 1].file, SDATA (file)); |
| 668 | 668 | ||
| 669 | return id; | 669 | return id; |
| 670 | } | 670 | } |
| @@ -1385,9 +1385,9 @@ x_decode_color (f, color_name, mono_color) | |||
| 1385 | #if 0 /* Don't do this. It's wrong when we're not using the default | 1385 | #if 0 /* Don't do this. It's wrong when we're not using the default |
| 1386 | colormap, it makes freeing difficult, and it's probably not | 1386 | colormap, it makes freeing difficult, and it's probably not |
| 1387 | an important optimization. */ | 1387 | an important optimization. */ |
| 1388 | if (strcmp (XSTRING (color_name)->data, "black") == 0) | 1388 | if (strcmp (SDATA (color_name), "black") == 0) |
| 1389 | return BLACK_PIX_DEFAULT (f); | 1389 | return BLACK_PIX_DEFAULT (f); |
| 1390 | else if (strcmp (XSTRING (color_name)->data, "white") == 0) | 1390 | else if (strcmp (SDATA (color_name), "white") == 0) |
| 1391 | return WHITE_PIX_DEFAULT (f); | 1391 | return WHITE_PIX_DEFAULT (f); |
| 1392 | #endif | 1392 | #endif |
| 1393 | 1393 | ||
| @@ -1397,7 +1397,7 @@ x_decode_color (f, color_name, mono_color) | |||
| 1397 | 1397 | ||
| 1398 | /* x_defined_color is responsible for coping with failures | 1398 | /* x_defined_color is responsible for coping with failures |
| 1399 | by looking for a near-miss. */ | 1399 | by looking for a near-miss. */ |
| 1400 | if (x_defined_color (f, XSTRING (color_name)->data, &cdef, 1)) | 1400 | if (x_defined_color (f, SDATA (color_name), &cdef, 1)) |
| 1401 | return cdef.pixel; | 1401 | return cdef.pixel; |
| 1402 | 1402 | ||
| 1403 | Fsignal (Qerror, Fcons (build_string ("Undefined color"), | 1403 | Fsignal (Qerror, Fcons (build_string ("Undefined color"), |
| @@ -1914,9 +1914,9 @@ x_set_icon_type (f, arg, oldval) | |||
| 1914 | BLOCK_INPUT; | 1914 | BLOCK_INPUT; |
| 1915 | if (NILP (arg)) | 1915 | if (NILP (arg)) |
| 1916 | result = x_text_icon (f, | 1916 | result = x_text_icon (f, |
| 1917 | (char *) XSTRING ((!NILP (f->icon_name) | 1917 | (char *) SDATA ((!NILP (f->icon_name) |
| 1918 | ? f->icon_name | 1918 | ? f->icon_name |
| 1919 | : f->name))->data); | 1919 | : f->name))); |
| 1920 | else | 1920 | else |
| 1921 | result = x_bitmap_icon (f, arg); | 1921 | result = x_bitmap_icon (f, arg); |
| 1922 | 1922 | ||
| @@ -1968,11 +1968,11 @@ x_set_icon_name (f, arg, oldval) | |||
| 1968 | BLOCK_INPUT; | 1968 | BLOCK_INPUT; |
| 1969 | 1969 | ||
| 1970 | result = x_text_icon (f, | 1970 | result = x_text_icon (f, |
| 1971 | (char *) XSTRING ((!NILP (f->icon_name) | 1971 | (char *) SDATA ((!NILP (f->icon_name) |
| 1972 | ? f->icon_name | 1972 | ? f->icon_name |
| 1973 | : !NILP (f->title) | 1973 | : !NILP (f->title) |
| 1974 | ? f->title | 1974 | ? f->title |
| 1975 | : f->name))->data); | 1975 | : f->name))); |
| 1976 | 1976 | ||
| 1977 | if (result) | 1977 | if (result) |
| 1978 | { | 1978 | { |
| @@ -2000,12 +2000,12 @@ x_set_font (f, arg, oldval) | |||
| 2000 | 2000 | ||
| 2001 | BLOCK_INPUT; | 2001 | BLOCK_INPUT; |
| 2002 | result = (STRINGP (fontset_name) | 2002 | result = (STRINGP (fontset_name) |
| 2003 | ? x_new_fontset (f, XSTRING (fontset_name)->data) | 2003 | ? x_new_fontset (f, SDATA (fontset_name)) |
| 2004 | : x_new_font (f, XSTRING (arg)->data)); | 2004 | : x_new_font (f, SDATA (arg))); |
| 2005 | UNBLOCK_INPUT; | 2005 | UNBLOCK_INPUT; |
| 2006 | 2006 | ||
| 2007 | if (EQ (result, Qnil)) | 2007 | if (EQ (result, Qnil)) |
| 2008 | error ("Font `%s' is not defined", XSTRING (arg)->data); | 2008 | error ("Font `%s' is not defined", SDATA (arg)); |
| 2009 | else if (EQ (result, Qt)) | 2009 | else if (EQ (result, Qt)) |
| 2010 | error ("The characters of the given font have varying widths"); | 2010 | error ("The characters of the given font have varying widths"); |
| 2011 | else if (STRINGP (result)) | 2011 | else if (STRINGP (result)) |
| @@ -2375,9 +2375,9 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp) | |||
| 2375 | int *text_bytes, *stringp; | 2375 | int *text_bytes, *stringp; |
| 2376 | int selectionp; | 2376 | int selectionp; |
| 2377 | { | 2377 | { |
| 2378 | unsigned char *str = XSTRING (string)->data; | 2378 | unsigned char *str = SDATA (string); |
| 2379 | int chars = XSTRING (string)->size; | 2379 | int chars = SCHARS (string); |
| 2380 | int bytes = STRING_BYTES (XSTRING (string)); | 2380 | int bytes = SBYTES (string); |
| 2381 | int charset_info; | 2381 | int charset_info; |
| 2382 | int bufsize; | 2382 | int bufsize; |
| 2383 | unsigned char *buf; | 2383 | unsigned char *buf; |
| @@ -2399,9 +2399,9 @@ x_encode_text (string, coding_system, selectionp, text_bytes, stringp) | |||
| 2399 | && !NILP (Ffboundp (coding.pre_write_conversion))) | 2399 | && !NILP (Ffboundp (coding.pre_write_conversion))) |
| 2400 | { | 2400 | { |
| 2401 | string = run_pre_post_conversion_on_str (string, &coding, 1); | 2401 | string = run_pre_post_conversion_on_str (string, &coding, 1); |
| 2402 | str = XSTRING (string)->data; | 2402 | str = SDATA (string); |
| 2403 | chars = XSTRING (string)->size; | 2403 | chars = SCHARS (string); |
| 2404 | bytes = STRING_BYTES (XSTRING (string)); | 2404 | bytes = SBYTES (string); |
| 2405 | } | 2405 | } |
| 2406 | coding.src_multibyte = 1; | 2406 | coding.src_multibyte = 1; |
| 2407 | coding.dst_multibyte = 0; | 2407 | coding.dst_multibyte = 0; |
| @@ -2458,7 +2458,7 @@ x_set_name (f, name, explicit) | |||
| 2458 | /* Check for no change needed in this very common case | 2458 | /* Check for no change needed in this very common case |
| 2459 | before we do any consing. */ | 2459 | before we do any consing. */ |
| 2460 | if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name, | 2460 | if (!strcmp (FRAME_X_DISPLAY_INFO (f)->x_id_name, |
| 2461 | XSTRING (f->name)->data)) | 2461 | SDATA (f->name))) |
| 2462 | return; | 2462 | return; |
| 2463 | name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name); | 2463 | name = build_string (FRAME_X_DISPLAY_INFO (f)->x_id_name); |
| 2464 | } | 2464 | } |
| @@ -2517,16 +2517,16 @@ x_set_name (f, name, explicit) | |||
| 2517 | XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon); | 2517 | XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon); |
| 2518 | #endif /* not USE_X_TOOLKIT */ | 2518 | #endif /* not USE_X_TOOLKIT */ |
| 2519 | if (!NILP (f->icon_name) | 2519 | if (!NILP (f->icon_name) |
| 2520 | && icon.value != XSTRING (f->icon_name)->data) | 2520 | && icon.value != SDATA (f->icon_name)) |
| 2521 | xfree (icon.value); | 2521 | xfree (icon.value); |
| 2522 | if (text.value != XSTRING (name)->data) | 2522 | if (text.value != SDATA (name)) |
| 2523 | xfree (text.value); | 2523 | xfree (text.value); |
| 2524 | } | 2524 | } |
| 2525 | #else /* not HAVE_X11R4 */ | 2525 | #else /* not HAVE_X11R4 */ |
| 2526 | XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 2526 | XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 2527 | XSTRING (name)->data); | 2527 | SDATA (name)); |
| 2528 | XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 2528 | XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 2529 | XSTRING (name)->data); | 2529 | SDATA (name)); |
| 2530 | #endif /* not HAVE_X11R4 */ | 2530 | #endif /* not HAVE_X11R4 */ |
| 2531 | UNBLOCK_INPUT; | 2531 | UNBLOCK_INPUT; |
| 2532 | } | 2532 | } |
| @@ -2624,16 +2624,16 @@ x_set_title (f, name, old_name) | |||
| 2624 | XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon); | 2624 | XSetWMIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &icon); |
| 2625 | #endif /* not USE_X_TOOLKIT */ | 2625 | #endif /* not USE_X_TOOLKIT */ |
| 2626 | if (!NILP (f->icon_name) | 2626 | if (!NILP (f->icon_name) |
| 2627 | && icon.value != XSTRING (f->icon_name)->data) | 2627 | && icon.value != SDATA (f->icon_name)) |
| 2628 | xfree (icon.value); | 2628 | xfree (icon.value); |
| 2629 | if (text.value != XSTRING (name)->data) | 2629 | if (text.value != SDATA (name)) |
| 2630 | xfree (text.value); | 2630 | xfree (text.value); |
| 2631 | } | 2631 | } |
| 2632 | #else /* not HAVE_X11R4 */ | 2632 | #else /* not HAVE_X11R4 */ |
| 2633 | XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 2633 | XSetIconName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 2634 | XSTRING (name)->data); | 2634 | SDATA (name)); |
| 2635 | XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 2635 | XStoreName (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 2636 | XSTRING (name)->data); | 2636 | SDATA (name)); |
| 2637 | #endif /* not HAVE_X11R4 */ | 2637 | #endif /* not HAVE_X11R4 */ |
| 2638 | UNBLOCK_INPUT; | 2638 | UNBLOCK_INPUT; |
| 2639 | } | 2639 | } |
| @@ -2758,10 +2758,10 @@ validate_x_resource_name () | |||
| 2758 | 2758 | ||
| 2759 | if (STRINGP (Vx_resource_name)) | 2759 | if (STRINGP (Vx_resource_name)) |
| 2760 | { | 2760 | { |
| 2761 | unsigned char *p = XSTRING (Vx_resource_name)->data; | 2761 | unsigned char *p = SDATA (Vx_resource_name); |
| 2762 | int i; | 2762 | int i; |
| 2763 | 2763 | ||
| 2764 | len = STRING_BYTES (XSTRING (Vx_resource_name)); | 2764 | len = SBYTES (Vx_resource_name); |
| 2765 | 2765 | ||
| 2766 | /* Only letters, digits, - and _ are valid in resource names. | 2766 | /* Only letters, digits, - and _ are valid in resource names. |
| 2767 | Count the valid characters and count the invalid ones. */ | 2767 | Count the valid characters and count the invalid ones. */ |
| @@ -2800,12 +2800,12 @@ validate_x_resource_name () | |||
| 2800 | 2800 | ||
| 2801 | for (i = 0; i < len; i++) | 2801 | for (i = 0; i < len; i++) |
| 2802 | { | 2802 | { |
| 2803 | int c = XSTRING (new)->data[i]; | 2803 | int c = SREF (new, i); |
| 2804 | if (! ((c >= 'a' && c <= 'z') | 2804 | if (! ((c >= 'a' && c <= 'z') |
| 2805 | || (c >= 'A' && c <= 'Z') | 2805 | || (c >= 'A' && c <= 'Z') |
| 2806 | || (c >= '0' && c <= '9') | 2806 | || (c >= '0' && c <= '9') |
| 2807 | || c == '-' || c == '_')) | 2807 | || c == '-' || c == '_')) |
| 2808 | XSTRING (new)->data[i] = '_'; | 2808 | SREF (new, i) = '_'; |
| 2809 | } | 2809 | } |
| 2810 | } | 2810 | } |
| 2811 | 2811 | ||
| @@ -2845,37 +2845,37 @@ and the class is `Emacs.CLASS.SUBCLASS'. */) | |||
| 2845 | 2845 | ||
| 2846 | /* Allocate space for the components, the dots which separate them, | 2846 | /* Allocate space for the components, the dots which separate them, |
| 2847 | and the final '\0'. Make them big enough for the worst case. */ | 2847 | and the final '\0'. Make them big enough for the worst case. */ |
| 2848 | name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) | 2848 | name_key = (char *) alloca (SBYTES (Vx_resource_name) |
| 2849 | + (STRINGP (component) | 2849 | + (STRINGP (component) |
| 2850 | ? STRING_BYTES (XSTRING (component)) : 0) | 2850 | ? SBYTES (component) : 0) |
| 2851 | + STRING_BYTES (XSTRING (attribute)) | 2851 | + SBYTES (attribute) |
| 2852 | + 3); | 2852 | + 3); |
| 2853 | 2853 | ||
| 2854 | class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class)) | 2854 | class_key = (char *) alloca (SBYTES (Vx_resource_class) |
| 2855 | + STRING_BYTES (XSTRING (class)) | 2855 | + SBYTES (class) |
| 2856 | + (STRINGP (subclass) | 2856 | + (STRINGP (subclass) |
| 2857 | ? STRING_BYTES (XSTRING (subclass)) : 0) | 2857 | ? SBYTES (subclass) : 0) |
| 2858 | + 3); | 2858 | + 3); |
| 2859 | 2859 | ||
| 2860 | /* Start with emacs.FRAMENAME for the name (the specific one) | 2860 | /* Start with emacs.FRAMENAME for the name (the specific one) |
| 2861 | and with `Emacs' for the class key (the general one). */ | 2861 | and with `Emacs' for the class key (the general one). */ |
| 2862 | strcpy (name_key, XSTRING (Vx_resource_name)->data); | 2862 | strcpy (name_key, SDATA (Vx_resource_name)); |
| 2863 | strcpy (class_key, XSTRING (Vx_resource_class)->data); | 2863 | strcpy (class_key, SDATA (Vx_resource_class)); |
| 2864 | 2864 | ||
| 2865 | strcat (class_key, "."); | 2865 | strcat (class_key, "."); |
| 2866 | strcat (class_key, XSTRING (class)->data); | 2866 | strcat (class_key, SDATA (class)); |
| 2867 | 2867 | ||
| 2868 | if (!NILP (component)) | 2868 | if (!NILP (component)) |
| 2869 | { | 2869 | { |
| 2870 | strcat (class_key, "."); | 2870 | strcat (class_key, "."); |
| 2871 | strcat (class_key, XSTRING (subclass)->data); | 2871 | strcat (class_key, SDATA (subclass)); |
| 2872 | 2872 | ||
| 2873 | strcat (name_key, "."); | 2873 | strcat (name_key, "."); |
| 2874 | strcat (name_key, XSTRING (component)->data); | 2874 | strcat (name_key, SDATA (component)); |
| 2875 | } | 2875 | } |
| 2876 | 2876 | ||
| 2877 | strcat (name_key, "."); | 2877 | strcat (name_key, "."); |
| 2878 | strcat (name_key, XSTRING (attribute)->data); | 2878 | strcat (name_key, SDATA (attribute)); |
| 2879 | 2879 | ||
| 2880 | value = x_get_string_resource (check_x_display_info (Qnil)->xrdb, | 2880 | value = x_get_string_resource (check_x_display_info (Qnil)->xrdb, |
| 2881 | name_key, class_key); | 2881 | name_key, class_key); |
| @@ -2911,37 +2911,37 @@ display_x_get_resource (dpyinfo, attribute, class, component, subclass) | |||
| 2911 | 2911 | ||
| 2912 | /* Allocate space for the components, the dots which separate them, | 2912 | /* Allocate space for the components, the dots which separate them, |
| 2913 | and the final '\0'. Make them big enough for the worst case. */ | 2913 | and the final '\0'. Make them big enough for the worst case. */ |
| 2914 | name_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_name)) | 2914 | name_key = (char *) alloca (SBYTES (Vx_resource_name) |
| 2915 | + (STRINGP (component) | 2915 | + (STRINGP (component) |
| 2916 | ? STRING_BYTES (XSTRING (component)) : 0) | 2916 | ? SBYTES (component) : 0) |
| 2917 | + STRING_BYTES (XSTRING (attribute)) | 2917 | + SBYTES (attribute) |
| 2918 | + 3); | 2918 | + 3); |
| 2919 | 2919 | ||
| 2920 | class_key = (char *) alloca (STRING_BYTES (XSTRING (Vx_resource_class)) | 2920 | class_key = (char *) alloca (SBYTES (Vx_resource_class) |
| 2921 | + STRING_BYTES (XSTRING (class)) | 2921 | + SBYTES (class) |
| 2922 | + (STRINGP (subclass) | 2922 | + (STRINGP (subclass) |
| 2923 | ? STRING_BYTES (XSTRING (subclass)) : 0) | 2923 | ? SBYTES (subclass) : 0) |
| 2924 | + 3); | 2924 | + 3); |
| 2925 | 2925 | ||
| 2926 | /* Start with emacs.FRAMENAME for the name (the specific one) | 2926 | /* Start with emacs.FRAMENAME for the name (the specific one) |
| 2927 | and with `Emacs' for the class key (the general one). */ | 2927 | and with `Emacs' for the class key (the general one). */ |
| 2928 | strcpy (name_key, XSTRING (Vx_resource_name)->data); | 2928 | strcpy (name_key, SDATA (Vx_resource_name)); |
| 2929 | strcpy (class_key, XSTRING (Vx_resource_class)->data); | 2929 | strcpy (class_key, SDATA (Vx_resource_class)); |
| 2930 | 2930 | ||
| 2931 | strcat (class_key, "."); | 2931 | strcat (class_key, "."); |
| 2932 | strcat (class_key, XSTRING (class)->data); | 2932 | strcat (class_key, SDATA (class)); |
| 2933 | 2933 | ||
| 2934 | if (!NILP (component)) | 2934 | if (!NILP (component)) |
| 2935 | { | 2935 | { |
| 2936 | strcat (class_key, "."); | 2936 | strcat (class_key, "."); |
| 2937 | strcat (class_key, XSTRING (subclass)->data); | 2937 | strcat (class_key, SDATA (subclass)); |
| 2938 | 2938 | ||
| 2939 | strcat (name_key, "."); | 2939 | strcat (name_key, "."); |
| 2940 | strcat (name_key, XSTRING (component)->data); | 2940 | strcat (name_key, SDATA (component)); |
| 2941 | } | 2941 | } |
| 2942 | 2942 | ||
| 2943 | strcat (name_key, "."); | 2943 | strcat (name_key, "."); |
| 2944 | strcat (name_key, XSTRING (attribute)->data); | 2944 | strcat (name_key, SDATA (attribute)); |
| 2945 | 2945 | ||
| 2946 | value = x_get_string_resource (dpyinfo->xrdb, name_key, class_key); | 2946 | value = x_get_string_resource (dpyinfo->xrdb, name_key, class_key); |
| 2947 | 2947 | ||
| @@ -2963,13 +2963,13 @@ x_get_resource_string (attribute, class) | |||
| 2963 | 2963 | ||
| 2964 | /* Allocate space for the components, the dots which separate them, | 2964 | /* Allocate space for the components, the dots which separate them, |
| 2965 | and the final '\0'. */ | 2965 | and the final '\0'. */ |
| 2966 | name_key = (char *) alloca (STRING_BYTES (XSTRING (Vinvocation_name)) | 2966 | name_key = (char *) alloca (SBYTES (Vinvocation_name) |
| 2967 | + strlen (attribute) + 2); | 2967 | + strlen (attribute) + 2); |
| 2968 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) | 2968 | class_key = (char *) alloca ((sizeof (EMACS_CLASS) - 1) |
| 2969 | + strlen (class) + 2); | 2969 | + strlen (class) + 2); |
| 2970 | 2970 | ||
| 2971 | sprintf (name_key, "%s.%s", | 2971 | sprintf (name_key, "%s.%s", |
| 2972 | XSTRING (Vinvocation_name)->data, | 2972 | SDATA (Vinvocation_name), |
| 2973 | attribute); | 2973 | attribute); |
| 2974 | sprintf (class_key, "%s.%s", EMACS_CLASS, class); | 2974 | sprintf (class_key, "%s.%s", EMACS_CLASS, class); |
| 2975 | 2975 | ||
| @@ -3027,15 +3027,15 @@ x_get_arg (dpyinfo, alist, param, attribute, class, type) | |||
| 3027 | switch (type) | 3027 | switch (type) |
| 3028 | { | 3028 | { |
| 3029 | case RES_TYPE_NUMBER: | 3029 | case RES_TYPE_NUMBER: |
| 3030 | return make_number (atoi (XSTRING (tem)->data)); | 3030 | return make_number (atoi (SDATA (tem))); |
| 3031 | 3031 | ||
| 3032 | case RES_TYPE_FLOAT: | 3032 | case RES_TYPE_FLOAT: |
| 3033 | return make_float (atof (XSTRING (tem)->data)); | 3033 | return make_float (atof (SDATA (tem))); |
| 3034 | 3034 | ||
| 3035 | case RES_TYPE_BOOLEAN: | 3035 | case RES_TYPE_BOOLEAN: |
| 3036 | tem = Fdowncase (tem); | 3036 | tem = Fdowncase (tem); |
| 3037 | if (!strcmp (XSTRING (tem)->data, "on") | 3037 | if (!strcmp (SDATA (tem), "on") |
| 3038 | || !strcmp (XSTRING (tem)->data, "true")) | 3038 | || !strcmp (SDATA (tem), "true")) |
| 3039 | return Qt; | 3039 | return Qt; |
| 3040 | else | 3040 | else |
| 3041 | return Qnil; | 3041 | return Qnil; |
| @@ -3049,11 +3049,11 @@ x_get_arg (dpyinfo, alist, param, attribute, class, type) | |||
| 3049 | { | 3049 | { |
| 3050 | Lisp_Object lower; | 3050 | Lisp_Object lower; |
| 3051 | lower = Fdowncase (tem); | 3051 | lower = Fdowncase (tem); |
| 3052 | if (!strcmp (XSTRING (lower)->data, "on") | 3052 | if (!strcmp (SDATA (lower), "on") |
| 3053 | || !strcmp (XSTRING (lower)->data, "true")) | 3053 | || !strcmp (SDATA (lower), "true")) |
| 3054 | return Qt; | 3054 | return Qt; |
| 3055 | else if (!strcmp (XSTRING (lower)->data, "off") | 3055 | else if (!strcmp (SDATA (lower), "off") |
| 3056 | || !strcmp (XSTRING (lower)->data, "false")) | 3056 | || !strcmp (SDATA (lower), "false")) |
| 3057 | return Qnil; | 3057 | return Qnil; |
| 3058 | else | 3058 | else |
| 3059 | return Fintern (tem, Qnil); | 3059 | return Fintern (tem, Qnil); |
| @@ -3186,7 +3186,7 @@ or a list (- N) meaning -N pixels relative to bottom/right corner. */) | |||
| 3186 | 3186 | ||
| 3187 | CHECK_STRING (string); | 3187 | CHECK_STRING (string); |
| 3188 | 3188 | ||
| 3189 | geometry = XParseGeometry ((char *) XSTRING (string)->data, | 3189 | geometry = XParseGeometry ((char *) SDATA (string), |
| 3190 | &x, &y, &width, &height); | 3190 | &x, &y, &width, &height); |
| 3191 | 3191 | ||
| 3192 | #if 0 | 3192 | #if 0 |
| @@ -3559,7 +3559,7 @@ create_frame_xic (f) | |||
| 3559 | { | 3559 | { |
| 3560 | /* Determine the base fontname from the ASCII font name of | 3560 | /* Determine the base fontname from the ASCII font name of |
| 3561 | FONTSET. */ | 3561 | FONTSET. */ |
| 3562 | char *ascii_font = (char *) XSTRING (fontset_ascii (fontset))->data; | 3562 | char *ascii_font = (char *) SDATA (fontset_ascii (fontset)); |
| 3563 | char *p = ascii_font; | 3563 | char *p = ascii_font; |
| 3564 | int i; | 3564 | int i; |
| 3565 | 3565 | ||
| @@ -3780,7 +3780,7 @@ x_window (f, window_prompting, minibuffer_only) | |||
| 3780 | Elsewhere we specify the window name for the window manager. */ | 3780 | Elsewhere we specify the window name for the window manager. */ |
| 3781 | 3781 | ||
| 3782 | { | 3782 | { |
| 3783 | char *str = (char *) XSTRING (Vx_resource_name)->data; | 3783 | char *str = (char *) SDATA (Vx_resource_name); |
| 3784 | f->namebuf = (char *) xmalloc (strlen (str) + 1); | 3784 | f->namebuf = (char *) xmalloc (strlen (str) + 1); |
| 3785 | strcpy (f->namebuf, str); | 3785 | strcpy (f->namebuf, str); |
| 3786 | } | 3786 | } |
| @@ -3913,8 +3913,8 @@ x_window (f, window_prompting, minibuffer_only) | |||
| 3913 | 3913 | ||
| 3914 | validate_x_resource_name (); | 3914 | validate_x_resource_name (); |
| 3915 | 3915 | ||
| 3916 | class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; | 3916 | class_hints.res_name = (char *) SDATA (Vx_resource_name); |
| 3917 | class_hints.res_class = (char *) XSTRING (Vx_resource_class)->data; | 3917 | class_hints.res_class = (char *) SDATA (Vx_resource_class); |
| 3918 | XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints); | 3918 | XSetClassHint (FRAME_X_DISPLAY (f), XtWindow (shell_widget), &class_hints); |
| 3919 | 3919 | ||
| 3920 | #ifdef HAVE_X_I18N | 3920 | #ifdef HAVE_X_I18N |
| @@ -4041,8 +4041,8 @@ x_window (f) | |||
| 4041 | 4041 | ||
| 4042 | validate_x_resource_name (); | 4042 | validate_x_resource_name (); |
| 4043 | 4043 | ||
| 4044 | class_hints.res_name = (char *) XSTRING (Vx_resource_name)->data; | 4044 | class_hints.res_name = (char *) SDATA (Vx_resource_name); |
| 4045 | class_hints.res_class = (char *) XSTRING (Vx_resource_class)->data; | 4045 | class_hints.res_class = (char *) SDATA (Vx_resource_class); |
| 4046 | XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints); | 4046 | XSetClassHint (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), &class_hints); |
| 4047 | 4047 | ||
| 4048 | /* The menubar is part of the ordinary display; | 4048 | /* The menubar is part of the ordinary display; |
| @@ -4129,9 +4129,9 @@ x_icon (f, parms) | |||
| 4129 | ? IconicState | 4129 | ? IconicState |
| 4130 | : NormalState)); | 4130 | : NormalState)); |
| 4131 | 4131 | ||
| 4132 | x_text_icon (f, (char *) XSTRING ((!NILP (f->icon_name) | 4132 | x_text_icon (f, (char *) SDATA ((!NILP (f->icon_name) |
| 4133 | ? f->icon_name | 4133 | ? f->icon_name |
| 4134 | : f->name))->data); | 4134 | : f->name))); |
| 4135 | 4135 | ||
| 4136 | UNBLOCK_INPUT; | 4136 | UNBLOCK_INPUT; |
| 4137 | } | 4137 | } |
| @@ -4464,9 +4464,9 @@ This function is an internal primitive--use `make-frame' instead. */) | |||
| 4464 | { | 4464 | { |
| 4465 | tem = Fquery_fontset (font, Qnil); | 4465 | tem = Fquery_fontset (font, Qnil); |
| 4466 | if (STRINGP (tem)) | 4466 | if (STRINGP (tem)) |
| 4467 | font = x_new_fontset (f, XSTRING (tem)->data); | 4467 | font = x_new_fontset (f, SDATA (tem)); |
| 4468 | else | 4468 | else |
| 4469 | font = x_new_font (f, XSTRING (font)->data); | 4469 | font = x_new_font (f, SDATA (font)); |
| 4470 | } | 4470 | } |
| 4471 | 4471 | ||
| 4472 | /* Try out a font which we hope has bold and italic variations. */ | 4472 | /* Try out a font which we hope has bold and italic variations. */ |
| @@ -4780,7 +4780,7 @@ DEFUN ("xw-color-defined-p", Fxw_color_defined_p, Sxw_color_defined_p, 1, 2, 0, | |||
| 4780 | 4780 | ||
| 4781 | CHECK_STRING (color); | 4781 | CHECK_STRING (color); |
| 4782 | 4782 | ||
| 4783 | if (x_defined_color (f, XSTRING (color)->data, &foo, 0)) | 4783 | if (x_defined_color (f, SDATA (color), &foo, 0)) |
| 4784 | return Qt; | 4784 | return Qt; |
| 4785 | else | 4785 | else |
| 4786 | return Qnil; | 4786 | return Qnil; |
| @@ -4796,7 +4796,7 @@ DEFUN ("xw-color-values", Fxw_color_values, Sxw_color_values, 1, 2, 0, | |||
| 4796 | 4796 | ||
| 4797 | CHECK_STRING (color); | 4797 | CHECK_STRING (color); |
| 4798 | 4798 | ||
| 4799 | if (x_defined_color (f, XSTRING (color)->data, &foo, 0)) | 4799 | if (x_defined_color (f, SDATA (color), &foo, 0)) |
| 4800 | { | 4800 | { |
| 4801 | Lisp_Object rgb[3]; | 4801 | Lisp_Object rgb[3]; |
| 4802 | 4802 | ||
| @@ -5207,12 +5207,12 @@ select_visual (dpyinfo) | |||
| 5207 | /* VALUE should be of the form CLASS-DEPTH, where CLASS is one | 5207 | /* VALUE should be of the form CLASS-DEPTH, where CLASS is one |
| 5208 | of `PseudoColor', `TrueColor' etc. and DEPTH is the color | 5208 | of `PseudoColor', `TrueColor' etc. and DEPTH is the color |
| 5209 | depth, a decimal number. NAME is compared with case ignored. */ | 5209 | depth, a decimal number. NAME is compared with case ignored. */ |
| 5210 | char *s = (char *) alloca (STRING_BYTES (XSTRING (value)) + 1); | 5210 | char *s = (char *) alloca (SBYTES (value) + 1); |
| 5211 | char *dash; | 5211 | char *dash; |
| 5212 | int i, class = -1; | 5212 | int i, class = -1; |
| 5213 | XVisualInfo vinfo; | 5213 | XVisualInfo vinfo; |
| 5214 | 5214 | ||
| 5215 | strcpy (s, XSTRING (value)->data); | 5215 | strcpy (s, SDATA (value)); |
| 5216 | dash = index (s, '-'); | 5216 | dash = index (s, '-'); |
| 5217 | if (dash) | 5217 | if (dash) |
| 5218 | { | 5218 | { |
| @@ -5236,7 +5236,7 @@ select_visual (dpyinfo) | |||
| 5236 | if (class == -1 | 5236 | if (class == -1 |
| 5237 | || !XMatchVisualInfo (dpy, XScreenNumberOfScreen (screen), | 5237 | || !XMatchVisualInfo (dpy, XScreenNumberOfScreen (screen), |
| 5238 | dpyinfo->n_planes, class, &vinfo)) | 5238 | dpyinfo->n_planes, class, &vinfo)) |
| 5239 | fatal ("Invalid visual specification `%s'", XSTRING (value)->data); | 5239 | fatal ("Invalid visual specification `%s'", SDATA (value)); |
| 5240 | 5240 | ||
| 5241 | dpyinfo->visual = vinfo.visual; | 5241 | dpyinfo->visual = vinfo.visual; |
| 5242 | } | 5242 | } |
| @@ -5295,10 +5295,10 @@ x_display_info_for_name (name) | |||
| 5295 | validate_x_resource_name (); | 5295 | validate_x_resource_name (); |
| 5296 | 5296 | ||
| 5297 | dpyinfo = x_term_init (name, (char *)0, | 5297 | dpyinfo = x_term_init (name, (char *)0, |
| 5298 | (char *) XSTRING (Vx_resource_name)->data); | 5298 | (char *) SDATA (Vx_resource_name)); |
| 5299 | 5299 | ||
| 5300 | if (dpyinfo == 0) | 5300 | if (dpyinfo == 0) |
| 5301 | error ("Cannot connect to X server %s", XSTRING (name)->data); | 5301 | error ("Cannot connect to X server %s", SDATA (name)); |
| 5302 | 5302 | ||
| 5303 | x_in_use = 1; | 5303 | x_in_use = 1; |
| 5304 | XSETFASTINT (Vwindow_system_version, 11); | 5304 | XSETFASTINT (Vwindow_system_version, 11); |
| @@ -5328,7 +5328,7 @@ terminate Emacs if we can't open the connection. */) | |||
| 5328 | error ("Not using X Windows"); | 5328 | error ("Not using X Windows"); |
| 5329 | 5329 | ||
| 5330 | if (! NILP (xrm_string)) | 5330 | if (! NILP (xrm_string)) |
| 5331 | xrm_option = (unsigned char *) XSTRING (xrm_string)->data; | 5331 | xrm_option = (unsigned char *) SDATA (xrm_string); |
| 5332 | else | 5332 | else |
| 5333 | xrm_option = (unsigned char *) 0; | 5333 | xrm_option = (unsigned char *) 0; |
| 5334 | 5334 | ||
| @@ -5337,7 +5337,7 @@ terminate Emacs if we can't open the connection. */) | |||
| 5337 | /* This is what opens the connection and sets x_current_display. | 5337 | /* This is what opens the connection and sets x_current_display. |
| 5338 | This also initializes many symbols, such as those used for input. */ | 5338 | This also initializes many symbols, such as those used for input. */ |
| 5339 | dpyinfo = x_term_init (display, xrm_option, | 5339 | dpyinfo = x_term_init (display, xrm_option, |
| 5340 | (char *) XSTRING (Vx_resource_name)->data); | 5340 | (char *) SDATA (Vx_resource_name)); |
| 5341 | 5341 | ||
| 5342 | if (dpyinfo == 0) | 5342 | if (dpyinfo == 0) |
| 5343 | { | 5343 | { |
| @@ -5346,9 +5346,9 @@ terminate Emacs if we can't open the connection. */) | |||
| 5346 | Check the DISPLAY environment variable or use `-d'.\n\ | 5346 | Check the DISPLAY environment variable or use `-d'.\n\ |
| 5347 | Also use the `xhost' program to verify that it is set to permit\n\ | 5347 | Also use the `xhost' program to verify that it is set to permit\n\ |
| 5348 | connections from your machine.\n", | 5348 | connections from your machine.\n", |
| 5349 | XSTRING (display)->data); | 5349 | SDATA (display)); |
| 5350 | else | 5350 | else |
| 5351 | error ("Cannot connect to X server %s", XSTRING (display)->data); | 5351 | error ("Cannot connect to X server %s", SDATA (display)); |
| 5352 | } | 5352 | } |
| 5353 | 5353 | ||
| 5354 | x_in_use = 1; | 5354 | x_in_use = 1; |
| @@ -5662,7 +5662,7 @@ parse_image_spec (spec, keywords, nkeywords, type) | |||
| 5662 | 5662 | ||
| 5663 | /* Find key in KEYWORDS. Error if not found. */ | 5663 | /* Find key in KEYWORDS. Error if not found. */ |
| 5664 | for (i = 0; i < nkeywords; ++i) | 5664 | for (i = 0; i < nkeywords; ++i) |
| 5665 | if (strcmp (keywords[i].name, XSTRING (SYMBOL_NAME (key))->data) == 0) | 5665 | if (strcmp (keywords[i].name, SDATA (SYMBOL_NAME (key))) == 0) |
| 5666 | break; | 5666 | break; |
| 5667 | 5667 | ||
| 5668 | if (i == nkeywords) | 5668 | if (i == nkeywords) |
| @@ -6142,7 +6142,7 @@ x_alloc_image_color (f, img, color_name, dflt) | |||
| 6142 | 6142 | ||
| 6143 | xassert (STRINGP (color_name)); | 6143 | xassert (STRINGP (color_name)); |
| 6144 | 6144 | ||
| 6145 | if (x_defined_color (f, XSTRING (color_name)->data, &color, 1)) | 6145 | if (x_defined_color (f, SDATA (color_name), &color, 1)) |
| 6146 | { | 6146 | { |
| 6147 | /* This isn't called frequently so we get away with simply | 6147 | /* This isn't called frequently so we get away with simply |
| 6148 | reallocating the color vector to the needed size, here. */ | 6148 | reallocating the color vector to the needed size, here. */ |
| @@ -6880,7 +6880,7 @@ xbm_image_p (object) | |||
| 6880 | 6880 | ||
| 6881 | if (STRINGP (elt)) | 6881 | if (STRINGP (elt)) |
| 6882 | { | 6882 | { |
| 6883 | if (XSTRING (elt)->size | 6883 | if (SCHARS (elt) |
| 6884 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) | 6884 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR) |
| 6885 | return 0; | 6885 | return 0; |
| 6886 | } | 6886 | } |
| @@ -6895,7 +6895,7 @@ xbm_image_p (object) | |||
| 6895 | } | 6895 | } |
| 6896 | else if (STRINGP (data)) | 6896 | else if (STRINGP (data)) |
| 6897 | { | 6897 | { |
| 6898 | if (XSTRING (data)->size | 6898 | if (SCHARS (data) |
| 6899 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) | 6899 | < (width + BITS_PER_CHAR - 1) / BITS_PER_CHAR * height) |
| 6900 | return 0; | 6900 | return 0; |
| 6901 | } | 6901 | } |
| @@ -7225,9 +7225,9 @@ xbm_file_p (data) | |||
| 7225 | { | 7225 | { |
| 7226 | int w, h; | 7226 | int w, h; |
| 7227 | return (STRINGP (data) | 7227 | return (STRINGP (data) |
| 7228 | && xbm_read_bitmap_data (XSTRING (data)->data, | 7228 | && xbm_read_bitmap_data (SDATA (data), |
| 7229 | (XSTRING (data)->data | 7229 | (SDATA (data) |
| 7230 | + STRING_BYTES (XSTRING (data))), | 7230 | + SBYTES (data)), |
| 7231 | &w, &h, NULL)); | 7231 | &w, &h, NULL)); |
| 7232 | } | 7232 | } |
| 7233 | 7233 | ||
| @@ -7263,7 +7263,7 @@ xbm_load (f, img) | |||
| 7263 | return 0; | 7263 | return 0; |
| 7264 | } | 7264 | } |
| 7265 | 7265 | ||
| 7266 | contents = slurp_file (XSTRING (file)->data, &size); | 7266 | contents = slurp_file (SDATA (file), &size); |
| 7267 | if (contents == NULL) | 7267 | if (contents == NULL) |
| 7268 | { | 7268 | { |
| 7269 | image_error ("Error loading XBM image `%s'", img->spec, Qnil); | 7269 | image_error ("Error loading XBM image `%s'", img->spec, Qnil); |
| @@ -7313,9 +7313,9 @@ xbm_load (f, img) | |||
| 7313 | background); | 7313 | background); |
| 7314 | 7314 | ||
| 7315 | if (in_memory_file_p) | 7315 | if (in_memory_file_p) |
| 7316 | success_p = xbm_load_image (f, img, XSTRING (data)->data, | 7316 | success_p = xbm_load_image (f, img, SDATA (data), |
| 7317 | (XSTRING (data)->data | 7317 | (SDATA (data) |
| 7318 | + STRING_BYTES (XSTRING (data)))); | 7318 | + SBYTES (data))); |
| 7319 | else | 7319 | else |
| 7320 | { | 7320 | { |
| 7321 | if (VECTORP (data)) | 7321 | if (VECTORP (data)) |
| @@ -7329,13 +7329,13 @@ xbm_load (f, img) | |||
| 7329 | { | 7329 | { |
| 7330 | Lisp_Object line = XVECTOR (data)->contents[i]; | 7330 | Lisp_Object line = XVECTOR (data)->contents[i]; |
| 7331 | if (STRINGP (line)) | 7331 | if (STRINGP (line)) |
| 7332 | bcopy (XSTRING (line)->data, p, nbytes); | 7332 | bcopy (SDATA (line), p, nbytes); |
| 7333 | else | 7333 | else |
| 7334 | bcopy (XBOOL_VECTOR (line)->data, p, nbytes); | 7334 | bcopy (XBOOL_VECTOR (line)->data, p, nbytes); |
| 7335 | } | 7335 | } |
| 7336 | } | 7336 | } |
| 7337 | else if (STRINGP (data)) | 7337 | else if (STRINGP (data)) |
| 7338 | bits = XSTRING (data)->data; | 7338 | bits = SDATA (data); |
| 7339 | else | 7339 | else |
| 7340 | bits = XBOOL_VECTOR (data)->data; | 7340 | bits = XBOOL_VECTOR (data)->data; |
| 7341 | 7341 | ||
| @@ -7737,10 +7737,10 @@ xpm_load (f, img) | |||
| 7737 | { | 7737 | { |
| 7738 | Lisp_Object name = XCAR (XCAR (tail)); | 7738 | Lisp_Object name = XCAR (XCAR (tail)); |
| 7739 | Lisp_Object color = XCDR (XCAR (tail)); | 7739 | Lisp_Object color = XCDR (XCAR (tail)); |
| 7740 | xpm_syms[i].name = (char *) alloca (XSTRING (name)->size + 1); | 7740 | xpm_syms[i].name = (char *) alloca (SCHARS (name) + 1); |
| 7741 | strcpy (xpm_syms[i].name, XSTRING (name)->data); | 7741 | strcpy (xpm_syms[i].name, SDATA (name)); |
| 7742 | xpm_syms[i].value = (char *) alloca (XSTRING (color)->size + 1); | 7742 | xpm_syms[i].value = (char *) alloca (SCHARS (color) + 1); |
| 7743 | strcpy (xpm_syms[i].value, XSTRING (color)->data); | 7743 | strcpy (xpm_syms[i].value, SDATA (color)); |
| 7744 | } | 7744 | } |
| 7745 | } | 7745 | } |
| 7746 | 7746 | ||
| @@ -7761,14 +7761,14 @@ xpm_load (f, img) | |||
| 7761 | } | 7761 | } |
| 7762 | 7762 | ||
| 7763 | rc = XpmReadFileToPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 7763 | rc = XpmReadFileToPixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 7764 | XSTRING (file)->data, &img->pixmap, &img->mask, | 7764 | SDATA (file), &img->pixmap, &img->mask, |
| 7765 | &attrs); | 7765 | &attrs); |
| 7766 | } | 7766 | } |
| 7767 | else | 7767 | else |
| 7768 | { | 7768 | { |
| 7769 | Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); | 7769 | Lisp_Object buffer = image_spec_value (img->spec, QCdata, NULL); |
| 7770 | rc = XpmCreatePixmapFromBuffer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 7770 | rc = XpmCreatePixmapFromBuffer (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 7771 | XSTRING (buffer)->data, | 7771 | SDATA (buffer), |
| 7772 | &img->pixmap, &img->mask, | 7772 | &img->pixmap, &img->mask, |
| 7773 | &attrs); | 7773 | &attrs); |
| 7774 | } | 7774 | } |
| @@ -8568,7 +8568,7 @@ pbm_load (f, img) | |||
| 8568 | return 0; | 8568 | return 0; |
| 8569 | } | 8569 | } |
| 8570 | 8570 | ||
| 8571 | contents = slurp_file (XSTRING (file)->data, &size); | 8571 | contents = slurp_file (SDATA (file), &size); |
| 8572 | if (contents == NULL) | 8572 | if (contents == NULL) |
| 8573 | { | 8573 | { |
| 8574 | image_error ("Error reading `%s'", file, Qnil); | 8574 | image_error ("Error reading `%s'", file, Qnil); |
| @@ -8583,8 +8583,8 @@ pbm_load (f, img) | |||
| 8583 | { | 8583 | { |
| 8584 | Lisp_Object data; | 8584 | Lisp_Object data; |
| 8585 | data = image_spec_value (img->spec, QCdata, NULL); | 8585 | data = image_spec_value (img->spec, QCdata, NULL); |
| 8586 | p = XSTRING (data)->data; | 8586 | p = SDATA (data); |
| 8587 | end = p + STRING_BYTES (XSTRING (data)); | 8587 | end = p + SBYTES (data); |
| 8588 | } | 8588 | } |
| 8589 | 8589 | ||
| 8590 | /* Check magic number. */ | 8590 | /* Check magic number. */ |
| @@ -8933,7 +8933,7 @@ png_load (f, img) | |||
| 8933 | } | 8933 | } |
| 8934 | 8934 | ||
| 8935 | /* Open the image file. */ | 8935 | /* Open the image file. */ |
| 8936 | fp = fopen (XSTRING (file)->data, "rb"); | 8936 | fp = fopen (SDATA (file), "rb"); |
| 8937 | if (!fp) | 8937 | if (!fp) |
| 8938 | { | 8938 | { |
| 8939 | image_error ("Cannot open image file `%s'", file, Qnil); | 8939 | image_error ("Cannot open image file `%s'", file, Qnil); |
| @@ -8955,8 +8955,8 @@ png_load (f, img) | |||
| 8955 | else | 8955 | else |
| 8956 | { | 8956 | { |
| 8957 | /* Read from memory. */ | 8957 | /* Read from memory. */ |
| 8958 | tbr.bytes = XSTRING (specified_data)->data; | 8958 | tbr.bytes = SDATA (specified_data); |
| 8959 | tbr.len = STRING_BYTES (XSTRING (specified_data)); | 8959 | tbr.len = SBYTES (specified_data); |
| 8960 | tbr.index = 0; | 8960 | tbr.index = 0; |
| 8961 | 8961 | ||
| 8962 | /* Check PNG signature. */ | 8962 | /* Check PNG signature. */ |
| @@ -9079,7 +9079,7 @@ png_load (f, img) | |||
| 9079 | /* The user specified `:background', use that. */ | 9079 | /* The user specified `:background', use that. */ |
| 9080 | { | 9080 | { |
| 9081 | XColor color; | 9081 | XColor color; |
| 9082 | if (x_defined_color (f, XSTRING (specified_bg)->data, &color, 0)) | 9082 | if (x_defined_color (f, SDATA (specified_bg), &color, 0)) |
| 9083 | { | 9083 | { |
| 9084 | png_color_16 user_bg; | 9084 | png_color_16 user_bg; |
| 9085 | 9085 | ||
| @@ -9499,7 +9499,7 @@ jpeg_load (f, img) | |||
| 9499 | return 0; | 9499 | return 0; |
| 9500 | } | 9500 | } |
| 9501 | 9501 | ||
| 9502 | fp = fopen (XSTRING (file)->data, "r"); | 9502 | fp = fopen (SDATA (file), "r"); |
| 9503 | if (fp == NULL) | 9503 | if (fp == NULL) |
| 9504 | { | 9504 | { |
| 9505 | image_error ("Cannot open `%s'", file, Qnil); | 9505 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -9546,8 +9546,8 @@ jpeg_load (f, img) | |||
| 9546 | if (NILP (specified_data)) | 9546 | if (NILP (specified_data)) |
| 9547 | jpeg_stdio_src (&cinfo, (FILE *) fp); | 9547 | jpeg_stdio_src (&cinfo, (FILE *) fp); |
| 9548 | else | 9548 | else |
| 9549 | jpeg_memory_src (&cinfo, XSTRING (specified_data)->data, | 9549 | jpeg_memory_src (&cinfo, SDATA (specified_data), |
| 9550 | STRING_BYTES (XSTRING (specified_data))); | 9550 | SBYTES (specified_data)); |
| 9551 | 9551 | ||
| 9552 | jpeg_read_header (&cinfo, TRUE); | 9552 | jpeg_read_header (&cinfo, TRUE); |
| 9553 | 9553 | ||
| @@ -9893,7 +9893,7 @@ tiff_load (f, img) | |||
| 9893 | } | 9893 | } |
| 9894 | 9894 | ||
| 9895 | /* Try to open the image file. */ | 9895 | /* Try to open the image file. */ |
| 9896 | tiff = TIFFOpen (XSTRING (file)->data, "r"); | 9896 | tiff = TIFFOpen (SDATA (file), "r"); |
| 9897 | if (tiff == NULL) | 9897 | if (tiff == NULL) |
| 9898 | { | 9898 | { |
| 9899 | image_error ("Cannot open `%s'", file, Qnil); | 9899 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -9904,8 +9904,8 @@ tiff_load (f, img) | |||
| 9904 | else | 9904 | else |
| 9905 | { | 9905 | { |
| 9906 | /* Memory source! */ | 9906 | /* Memory source! */ |
| 9907 | memsrc.bytes = XSTRING (specified_data)->data; | 9907 | memsrc.bytes = SDATA (specified_data); |
| 9908 | memsrc.len = STRING_BYTES (XSTRING (specified_data)); | 9908 | memsrc.len = SBYTES (specified_data); |
| 9909 | memsrc.index = 0; | 9909 | memsrc.index = 0; |
| 9910 | 9910 | ||
| 9911 | tiff = TIFFClientOpen ("memory_source", "r", &memsrc, | 9911 | tiff = TIFFClientOpen ("memory_source", "r", &memsrc, |
| @@ -10142,7 +10142,7 @@ gif_load (f, img) | |||
| 10142 | } | 10142 | } |
| 10143 | 10143 | ||
| 10144 | /* Open the GIF file. */ | 10144 | /* Open the GIF file. */ |
| 10145 | gif = DGifOpenFileName (XSTRING (file)->data); | 10145 | gif = DGifOpenFileName (SDATA (file)); |
| 10146 | if (gif == NULL) | 10146 | if (gif == NULL) |
| 10147 | { | 10147 | { |
| 10148 | image_error ("Cannot open `%s'", file, Qnil); | 10148 | image_error ("Cannot open `%s'", file, Qnil); |
| @@ -10154,8 +10154,8 @@ gif_load (f, img) | |||
| 10154 | { | 10154 | { |
| 10155 | /* Read from memory! */ | 10155 | /* Read from memory! */ |
| 10156 | current_gif_memory_src = &memsrc; | 10156 | current_gif_memory_src = &memsrc; |
| 10157 | memsrc.bytes = XSTRING (specified_data)->data; | 10157 | memsrc.bytes = SDATA (specified_data); |
| 10158 | memsrc.len = STRING_BYTES (XSTRING (specified_data)); | 10158 | memsrc.len = SBYTES (specified_data); |
| 10159 | memsrc.index = 0; | 10159 | memsrc.index = 0; |
| 10160 | 10160 | ||
| 10161 | gif = DGifOpen(&memsrc, gif_read_from_memory); | 10161 | gif = DGifOpen(&memsrc, gif_read_from_memory); |
| @@ -10605,10 +10605,10 @@ selected frame. Value is VALUE. */) | |||
| 10605 | CHECK_STRING (value); | 10605 | CHECK_STRING (value); |
| 10606 | 10606 | ||
| 10607 | BLOCK_INPUT; | 10607 | BLOCK_INPUT; |
| 10608 | prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False); | 10608 | prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False); |
| 10609 | XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 10609 | XChangeProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 10610 | prop_atom, XA_STRING, 8, PropModeReplace, | 10610 | prop_atom, XA_STRING, 8, PropModeReplace, |
| 10611 | XSTRING (value)->data, XSTRING (value)->size); | 10611 | SDATA (value), SCHARS (value)); |
| 10612 | 10612 | ||
| 10613 | /* Make sure the property is set when we return. */ | 10613 | /* Make sure the property is set when we return. */ |
| 10614 | XFlush (FRAME_X_DISPLAY (f)); | 10614 | XFlush (FRAME_X_DISPLAY (f)); |
| @@ -10630,7 +10630,7 @@ FRAME nil or omitted means use the selected frame. Value is PROP. */) | |||
| 10630 | 10630 | ||
| 10631 | CHECK_STRING (prop); | 10631 | CHECK_STRING (prop); |
| 10632 | BLOCK_INPUT; | 10632 | BLOCK_INPUT; |
| 10633 | prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False); | 10633 | prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False); |
| 10634 | XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom); | 10634 | XDeleteProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), prop_atom); |
| 10635 | 10635 | ||
| 10636 | /* Make sure the property is removed when we return. */ | 10636 | /* Make sure the property is removed when we return. */ |
| @@ -10661,7 +10661,7 @@ value. */) | |||
| 10661 | 10661 | ||
| 10662 | CHECK_STRING (prop); | 10662 | CHECK_STRING (prop); |
| 10663 | BLOCK_INPUT; | 10663 | BLOCK_INPUT; |
| 10664 | prop_atom = XInternAtom (FRAME_X_DISPLAY (f), XSTRING (prop)->data, False); | 10664 | prop_atom = XInternAtom (FRAME_X_DISPLAY (f), SDATA (prop), False); |
| 10665 | rc = XGetWindowProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 10665 | rc = XGetWindowProperty (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
| 10666 | prop_atom, 0, 0, False, XA_STRING, | 10666 | prop_atom, 0, 0, False, XA_STRING, |
| 10667 | &actual_type, &actual_format, &actual_size, | 10667 | &actual_type, &actual_format, &actual_size, |
| @@ -11054,9 +11054,9 @@ x_create_tip_frame (dpyinfo, parms, text) | |||
| 11054 | { | 11054 | { |
| 11055 | tem = Fquery_fontset (font, Qnil); | 11055 | tem = Fquery_fontset (font, Qnil); |
| 11056 | if (STRINGP (tem)) | 11056 | if (STRINGP (tem)) |
| 11057 | font = x_new_fontset (f, XSTRING (tem)->data); | 11057 | font = x_new_fontset (f, SDATA (tem)); |
| 11058 | else | 11058 | else |
| 11059 | font = x_new_font (f, XSTRING (font)->data); | 11059 | font = x_new_font (f, SDATA (font)); |
| 11060 | } | 11060 | } |
| 11061 | 11061 | ||
| 11062 | /* Try out a font which we hope has bold and italic variations. */ | 11062 | /* Try out a font which we hope has bold and italic variations. */ |
| @@ -11620,10 +11620,10 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */) | |||
| 11620 | /* Create the dialog with PROMPT as title, using DIR as initial | 11620 | /* Create the dialog with PROMPT as title, using DIR as initial |
| 11621 | directory and using "*" as pattern. */ | 11621 | directory and using "*" as pattern. */ |
| 11622 | dir = Fexpand_file_name (dir, Qnil); | 11622 | dir = Fexpand_file_name (dir, Qnil); |
| 11623 | dir_xmstring = XmStringCreateLocalized (XSTRING (dir)->data); | 11623 | dir_xmstring = XmStringCreateLocalized (SDATA (dir)); |
| 11624 | pattern_xmstring = XmStringCreateLocalized ("*"); | 11624 | pattern_xmstring = XmStringCreateLocalized ("*"); |
| 11625 | 11625 | ||
| 11626 | XtSetArg (al[ac], XmNtitle, XSTRING (prompt)->data); ++ac; | 11626 | XtSetArg (al[ac], XmNtitle, SDATA (prompt)); ++ac; |
| 11627 | XtSetArg (al[ac], XmNdirectory, dir_xmstring); ++ac; | 11627 | XtSetArg (al[ac], XmNdirectory, dir_xmstring); ++ac; |
| 11628 | XtSetArg (al[ac], XmNpattern, pattern_xmstring); ++ac; | 11628 | XtSetArg (al[ac], XmNpattern, pattern_xmstring); ++ac; |
| 11629 | XtSetArg (al[ac], XmNresizePolicy, XmRESIZE_GROW); ++ac; | 11629 | XtSetArg (al[ac], XmNresizePolicy, XmRESIZE_GROW); ++ac; |
| @@ -11674,7 +11674,7 @@ selection dialog's entry field, if MUSTMATCH is non-nil. */) | |||
| 11674 | int item_pos; | 11674 | int item_pos; |
| 11675 | 11675 | ||
| 11676 | default_xmstring | 11676 | default_xmstring |
| 11677 | = XmStringCreateLocalized (XSTRING (default_filename)->data); | 11677 | = XmStringCreateLocalized (SDATA (default_filename)); |
| 11678 | 11678 | ||
| 11679 | if (!XmListItemExists (list, default_xmstring)) | 11679 | if (!XmListItemExists (list, default_xmstring)) |
| 11680 | { | 11680 | { |
diff --git a/src/xmenu.c b/src/xmenu.c index 35ddfe9258a..cc613bedeb1 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -505,7 +505,7 @@ single_menu_item (key, item, pending_maps_ptr, notreal, maxdepth, | |||
| 505 | enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; | 505 | enabled = XVECTOR (item_properties)->contents[ITEM_PROPERTY_ENABLE]; |
| 506 | item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; | 506 | item_string = XVECTOR (item_properties)->contents[ITEM_PROPERTY_NAME]; |
| 507 | 507 | ||
| 508 | if (!NILP (map) && XSTRING (item_string)->data[0] == '@') | 508 | if (!NILP (map) && SREF (item_string, 0) == '@') |
| 509 | { | 509 | { |
| 510 | if (!NILP (enabled)) | 510 | if (!NILP (enabled)) |
| 511 | /* An enabled separate pane. Remember this to handle it later. */ | 511 | /* An enabled separate pane. Remember this to handle it later. */ |
| @@ -551,8 +551,8 @@ single_menu_item (key, item, pending_maps_ptr, notreal, maxdepth, | |||
| 551 | index++; /* Skip a left, right divider. */ | 551 | index++; /* Skip a left, right divider. */ |
| 552 | else | 552 | else |
| 553 | { | 553 | { |
| 554 | if (!submenu && XSTRING (tem)->data[0] != '\0' | 554 | if (!submenu && SREF (tem, 0) != '\0' |
| 555 | && XSTRING (tem)->data[0] != '-') | 555 | && SREF (tem, 0) != '-') |
| 556 | XVECTOR (menu_items)->contents[index + MENU_ITEMS_ITEM_NAME] | 556 | XVECTOR (menu_items)->contents[index + MENU_ITEMS_ITEM_NAME] |
| 557 | = concat2 (build_string (" "), tem); | 557 | = concat2 (build_string (" "), tem); |
| 558 | index += MENU_ITEMS_ITEM_LENGTH; | 558 | index += MENU_ITEMS_ITEM_LENGTH; |
| @@ -568,8 +568,8 @@ single_menu_item (key, item, pending_maps_ptr, notreal, maxdepth, | |||
| 568 | prefix = build_string (NILP (selected) ? "( ) " : "(*) "); | 568 | prefix = build_string (NILP (selected) ? "( ) " : "(*) "); |
| 569 | } | 569 | } |
| 570 | /* Not a button. If we have earlier buttons, then we need a prefix. */ | 570 | /* Not a button. If we have earlier buttons, then we need a prefix. */ |
| 571 | else if (!*notbuttons_ptr && XSTRING (item_string)->data[0] != '\0' | 571 | else if (!*notbuttons_ptr && SREF (item_string, 0) != '\0' |
| 572 | && XSTRING (item_string)->data[0] != '-') | 572 | && SREF (item_string, 0) != '-') |
| 573 | prefix = build_string (" "); | 573 | prefix = build_string (" "); |
| 574 | 574 | ||
| 575 | if (!NILP (prefix)) | 575 | if (!NILP (prefix)) |
| @@ -1453,7 +1453,7 @@ single_submenu (item_key, item_name, maps) | |||
| 1453 | } | 1453 | } |
| 1454 | #endif | 1454 | #endif |
| 1455 | pane_string = (NILP (pane_name) | 1455 | pane_string = (NILP (pane_name) |
| 1456 | ? "" : (char *) XSTRING (pane_name)->data); | 1456 | ? "" : (char *) SDATA (pane_name)); |
| 1457 | /* If there is just one top-level pane, put all its items directly | 1457 | /* If there is just one top-level pane, put all its items directly |
| 1458 | under the top-level menu. */ | 1458 | under the top-level menu. */ |
| 1459 | if (menu_items_n_panes == 1) | 1459 | if (menu_items_n_panes == 1) |
| @@ -1517,9 +1517,9 @@ single_submenu (item_key, item_name, maps) | |||
| 1517 | else | 1517 | else |
| 1518 | save_wv->contents = wv; | 1518 | save_wv->contents = wv; |
| 1519 | 1519 | ||
| 1520 | wv->name = (char *) XSTRING (item_name)->data; | 1520 | wv->name = (char *) SDATA (item_name); |
| 1521 | if (!NILP (descrip)) | 1521 | if (!NILP (descrip)) |
| 1522 | wv->key = (char *) XSTRING (descrip)->data; | 1522 | wv->key = (char *) SDATA (descrip); |
| 1523 | wv->value = 0; | 1523 | wv->value = 0; |
| 1524 | /* The EMACS_INT cast avoids a warning. There's no problem | 1524 | /* The EMACS_INT cast avoids a warning. There's no problem |
| 1525 | as long as pointers have enough bits to hold small integers. */ | 1525 | as long as pointers have enough bits to hold small integers. */ |
| @@ -1753,7 +1753,7 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1753 | string = XVECTOR (items)->contents[i + 1]; | 1753 | string = XVECTOR (items)->contents[i + 1]; |
| 1754 | if (NILP (string)) | 1754 | if (NILP (string)) |
| 1755 | break; | 1755 | break; |
| 1756 | wv->name = (char *) XSTRING (string)->data; | 1756 | wv->name = (char *) SDATA (string); |
| 1757 | wv = wv->next; | 1757 | wv = wv->next; |
| 1758 | } | 1758 | } |
| 1759 | 1759 | ||
| @@ -1776,7 +1776,7 @@ set_frame_menubar (f, first_time, deep_p) | |||
| 1776 | break; | 1776 | break; |
| 1777 | 1777 | ||
| 1778 | wv = xmalloc_widget_value (); | 1778 | wv = xmalloc_widget_value (); |
| 1779 | wv->name = (char *) XSTRING (string)->data; | 1779 | wv->name = (char *) SDATA (string); |
| 1780 | wv->value = 0; | 1780 | wv->value = 0; |
| 1781 | wv->enabled = 1; | 1781 | wv->enabled = 1; |
| 1782 | wv->button_type = BUTTON_TYPE_NONE; | 1782 | wv->button_type = BUTTON_TYPE_NONE; |
| @@ -2051,7 +2051,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2051 | } | 2051 | } |
| 2052 | #endif | 2052 | #endif |
| 2053 | pane_string = (NILP (pane_name) | 2053 | pane_string = (NILP (pane_name) |
| 2054 | ? "" : (char *) XSTRING (pane_name)->data); | 2054 | ? "" : (char *) SDATA (pane_name)); |
| 2055 | /* If there is just one top-level pane, put all its items directly | 2055 | /* If there is just one top-level pane, put all its items directly |
| 2056 | under the top-level menu. */ | 2056 | under the top-level menu. */ |
| 2057 | if (menu_items_n_panes == 1) | 2057 | if (menu_items_n_panes == 1) |
| @@ -2116,9 +2116,9 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2116 | prev_wv->next = wv; | 2116 | prev_wv->next = wv; |
| 2117 | else | 2117 | else |
| 2118 | save_wv->contents = wv; | 2118 | save_wv->contents = wv; |
| 2119 | wv->name = (char *) XSTRING (item_name)->data; | 2119 | wv->name = (char *) SDATA (item_name); |
| 2120 | if (!NILP (descrip)) | 2120 | if (!NILP (descrip)) |
| 2121 | wv->key = (char *) XSTRING (descrip)->data; | 2121 | wv->key = (char *) SDATA (descrip); |
| 2122 | wv->value = 0; | 2122 | wv->value = 0; |
| 2123 | /* If this item has a null value, | 2123 | /* If this item has a null value, |
| 2124 | make the call_data null so that it won't display a box | 2124 | make the call_data null so that it won't display a box |
| @@ -2169,7 +2169,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2169 | title = ENCODE_SYSTEM (title); | 2169 | title = ENCODE_SYSTEM (title); |
| 2170 | #endif | 2170 | #endif |
| 2171 | 2171 | ||
| 2172 | wv_title->name = (char *) XSTRING (title)->data; | 2172 | wv_title->name = (char *) SDATA (title); |
| 2173 | wv_title->enabled = TRUE; | 2173 | wv_title->enabled = TRUE; |
| 2174 | wv_title->button_type = BUTTON_TYPE_NONE; | 2174 | wv_title->button_type = BUTTON_TYPE_NONE; |
| 2175 | wv_title->next = wv_sep1; | 2175 | wv_title->next = wv_sep1; |
| @@ -2370,7 +2370,7 @@ xdialog_show (f, keymaps, title, error) | |||
| 2370 | pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; | 2370 | pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; |
| 2371 | prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; | 2371 | prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; |
| 2372 | pane_string = (NILP (pane_name) | 2372 | pane_string = (NILP (pane_name) |
| 2373 | ? "" : (char *) XSTRING (pane_name)->data); | 2373 | ? "" : (char *) SDATA (pane_name)); |
| 2374 | prev_wv = xmalloc_widget_value (); | 2374 | prev_wv = xmalloc_widget_value (); |
| 2375 | prev_wv->value = pane_string; | 2375 | prev_wv->value = pane_string; |
| 2376 | if (keymaps && !NILP (prefix)) | 2376 | if (keymaps && !NILP (prefix)) |
| @@ -2417,8 +2417,8 @@ xdialog_show (f, keymaps, title, error) | |||
| 2417 | prev_wv->next = wv; | 2417 | prev_wv->next = wv; |
| 2418 | wv->name = (char *) button_names[nb_buttons]; | 2418 | wv->name = (char *) button_names[nb_buttons]; |
| 2419 | if (!NILP (descrip)) | 2419 | if (!NILP (descrip)) |
| 2420 | wv->key = (char *) XSTRING (descrip)->data; | 2420 | wv->key = (char *) SDATA (descrip); |
| 2421 | wv->value = (char *) XSTRING (item_name)->data; | 2421 | wv->value = (char *) SDATA (item_name); |
| 2422 | wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; | 2422 | wv->call_data = (void *) &XVECTOR (menu_items)->contents[i]; |
| 2423 | wv->enabled = !NILP (enable); | 2423 | wv->enabled = !NILP (enable); |
| 2424 | wv->help = Qnil; | 2424 | wv->help = Qnil; |
| @@ -2656,7 +2656,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2656 | pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; | 2656 | pane_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_NAME]; |
| 2657 | prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; | 2657 | prefix = XVECTOR (menu_items)->contents[i + MENU_ITEMS_PANE_PREFIX]; |
| 2658 | pane_string = (NILP (pane_name) | 2658 | pane_string = (NILP (pane_name) |
| 2659 | ? "" : (char *) XSTRING (pane_name)->data); | 2659 | ? "" : (char *) SDATA (pane_name)); |
| 2660 | if (keymaps && !NILP (prefix)) | 2660 | if (keymaps && !NILP (prefix)) |
| 2661 | pane_string++; | 2661 | pane_string++; |
| 2662 | 2662 | ||
| @@ -2683,7 +2683,7 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2683 | j++; | 2683 | j++; |
| 2684 | continue; | 2684 | continue; |
| 2685 | } | 2685 | } |
| 2686 | width = STRING_BYTES (XSTRING (item)); | 2686 | width = SBYTES (item); |
| 2687 | if (width > maxwidth) | 2687 | if (width > maxwidth) |
| 2688 | maxwidth = width; | 2688 | maxwidth = width; |
| 2689 | 2689 | ||
| @@ -2706,34 +2706,34 @@ xmenu_show (f, x, y, for_click, keymaps, title, error) | |||
| 2706 | descrip | 2706 | descrip |
| 2707 | = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; | 2707 | = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY]; |
| 2708 | help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP]; | 2708 | help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP]; |
| 2709 | help_string = STRINGP (help) ? XSTRING (help)->data : NULL; | 2709 | help_string = STRINGP (help) ? SDATA (help) : NULL; |
| 2710 | 2710 | ||
| 2711 | if (!NILP (descrip)) | 2711 | if (!NILP (descrip)) |
| 2712 | { | 2712 | { |
| 2713 | int gap = maxwidth - STRING_BYTES (XSTRING (item_name)); | 2713 | int gap = maxwidth - SBYTES (item_name); |
| 2714 | #ifdef C_ALLOCA | 2714 | #ifdef C_ALLOCA |
| 2715 | Lisp_Object spacer; | 2715 | Lisp_Object spacer; |
| 2716 | spacer = Fmake_string (make_number (gap), make_number (' ')); | 2716 | spacer = Fmake_string (make_number (gap), make_number (' ')); |
| 2717 | item_name = concat2 (item_name, spacer); | 2717 | item_name = concat2 (item_name, spacer); |
| 2718 | item_name = concat2 (item_name, descrip); | 2718 | item_name = concat2 (item_name, descrip); |
| 2719 | item_data = XSTRING (item_name)->data; | 2719 | item_data = SDATA (item_name); |
| 2720 | #else | 2720 | #else |
| 2721 | /* if alloca is fast, use that to make the space, | 2721 | /* if alloca is fast, use that to make the space, |
| 2722 | to reduce gc needs. */ | 2722 | to reduce gc needs. */ |
| 2723 | item_data | 2723 | item_data |
| 2724 | = (unsigned char *) alloca (maxwidth | 2724 | = (unsigned char *) alloca (maxwidth |
| 2725 | + STRING_BYTES (XSTRING (descrip)) + 1); | 2725 | + SBYTES (descrip) + 1); |
| 2726 | bcopy (XSTRING (item_name)->data, item_data, | 2726 | bcopy (SDATA (item_name), item_data, |
| 2727 | STRING_BYTES (XSTRING (item_name))); | 2727 | SBYTES (item_name)); |
| 2728 | for (j = XSTRING (item_name)->size; j < maxwidth; j++) | 2728 | for (j = SCHARS (item_name); j < maxwidth; j++) |
| 2729 | item_data[j] = ' '; | 2729 | item_data[j] = ' '; |
| 2730 | bcopy (XSTRING (descrip)->data, item_data + j, | 2730 | bcopy (SDATA (descrip), item_data + j, |
| 2731 | STRING_BYTES (XSTRING (descrip))); | 2731 | SBYTES (descrip)); |
| 2732 | item_data[j + STRING_BYTES (XSTRING (descrip))] = 0; | 2732 | item_data[j + SBYTES (descrip)] = 0; |
| 2733 | #endif | 2733 | #endif |
| 2734 | } | 2734 | } |
| 2735 | else | 2735 | else |
| 2736 | item_data = XSTRING (item_name)->data; | 2736 | item_data = SDATA (item_name); |
| 2737 | 2737 | ||
| 2738 | if (XMenuAddSelection (FRAME_X_DISPLAY (f), | 2738 | if (XMenuAddSelection (FRAME_X_DISPLAY (f), |
| 2739 | menu, lpane, 0, item_data, | 2739 | menu, lpane, 0, item_data, |
diff --git a/src/xselect.c b/src/xselect.c index 1d5fe0b8ea2..5519eecf64c 100644 --- a/src/xselect.c +++ b/src/xselect.c | |||
| @@ -200,9 +200,9 @@ symbol_to_x_atom (dpyinfo, display, sym) | |||
| 200 | #endif | 200 | #endif |
| 201 | if (!SYMBOLP (sym)) abort (); | 201 | if (!SYMBOLP (sym)) abort (); |
| 202 | 202 | ||
| 203 | TRACE1 (" XInternAtom %s", (char *) XSTRING (SYMBOL_NAME (sym))->data); | 203 | TRACE1 (" XInternAtom %s", (char *) SDATA (SYMBOL_NAME (sym))); |
| 204 | BLOCK_INPUT; | 204 | BLOCK_INPUT; |
| 205 | val = XInternAtom (display, (char *) XSTRING (SYMBOL_NAME (sym))->data, False); | 205 | val = XInternAtom (display, (char *) SDATA (SYMBOL_NAME (sym)), False); |
| 206 | UNBLOCK_INPUT; | 206 | UNBLOCK_INPUT; |
| 207 | return val; | 207 | return val; |
| 208 | } | 208 | } |
| @@ -1272,7 +1272,7 @@ x_get_foreign_selection (selection_symbol, target_type) | |||
| 1272 | if (NILP (XCAR (reading_selection_reply))) | 1272 | if (NILP (XCAR (reading_selection_reply))) |
| 1273 | error ("Timed out waiting for reply from selection owner"); | 1273 | error ("Timed out waiting for reply from selection owner"); |
| 1274 | if (EQ (XCAR (reading_selection_reply), Qlambda)) | 1274 | if (EQ (XCAR (reading_selection_reply), Qlambda)) |
| 1275 | error ("No `%s' selection", XSTRING (SYMBOL_NAME (selection_symbol))->data); | 1275 | error ("No `%s' selection", SDATA (SYMBOL_NAME (selection_symbol))); |
| 1276 | 1276 | ||
| 1277 | /* Otherwise, the selection is waiting for us on the requested property. */ | 1277 | /* Otherwise, the selection is waiting for us on the requested property. */ |
| 1278 | return | 1278 | return |
| @@ -1662,7 +1662,7 @@ selection_data_to_lisp_data (display, data, size, type, format) | |||
| 1662 | str = run_pre_post_conversion_on_str (str, &coding, 0); | 1662 | str = run_pre_post_conversion_on_str (str, &coding, 0); |
| 1663 | Vlast_coding_system_used = coding.symbol; | 1663 | Vlast_coding_system_used = coding.symbol; |
| 1664 | } | 1664 | } |
| 1665 | compose_chars_in_text (0, XSTRING (str)->size, str); | 1665 | compose_chars_in_text (0, SCHARS (str), str); |
| 1666 | return str; | 1666 | return str; |
| 1667 | } | 1667 | } |
| 1668 | /* Convert a single atom to a Lisp_Symbol. Convert a set of atoms to | 1668 | /* Convert a single atom to a Lisp_Symbol. Convert a set of atoms to |
| @@ -1778,7 +1778,7 @@ lisp_data_to_selection_data (display, obj, | |||
| 1778 | Lisp_Object unibyte_string; | 1778 | Lisp_Object unibyte_string; |
| 1779 | 1779 | ||
| 1780 | unibyte_string = string_make_unibyte (obj); | 1780 | unibyte_string = string_make_unibyte (obj); |
| 1781 | *data_ret = XSTRING (unibyte_string)->data; | 1781 | *data_ret = SDATA (unibyte_string); |
| 1782 | *nofree_ret = 1; | 1782 | *nofree_ret = 1; |
| 1783 | *size_ret = SBYTES (unibyte_string); | 1783 | *size_ret = SBYTES (unibyte_string); |
| 1784 | } | 1784 | } |
| @@ -1786,7 +1786,7 @@ lisp_data_to_selection_data (display, obj, | |||
| 1786 | { | 1786 | { |
| 1787 | *data_ret = x_encode_text (obj, Vnext_selection_coding_system, 1, | 1787 | *data_ret = x_encode_text (obj, Vnext_selection_coding_system, 1, |
| 1788 | (int *) size_ret, &stringp); | 1788 | (int *) size_ret, &stringp); |
| 1789 | *nofree_ret = (*data_ret == XSTRING (obj)->data); | 1789 | *nofree_ret = (*data_ret == SDATA (obj)); |
| 1790 | } | 1790 | } |
| 1791 | if (NILP (type)) | 1791 | if (NILP (type)) |
| 1792 | type = (stringp ? QSTRING : QCOMPOUND_TEXT); | 1792 | type = (stringp ? QSTRING : QCOMPOUND_TEXT); |
| @@ -2277,8 +2277,8 @@ DEFUN ("x-store-cut-buffer-internal", Fx_store_cut_buffer_internal, | |||
| 2277 | CHECK_STRING (string); | 2277 | CHECK_STRING (string); |
| 2278 | buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf), | 2278 | buffer_atom = symbol_to_x_atom (FRAME_X_DISPLAY_INFO (sf), |
| 2279 | display, buffer); | 2279 | display, buffer); |
| 2280 | data = (unsigned char *) XSTRING (string)->data; | 2280 | data = (unsigned char *) SDATA (string); |
| 2281 | bytes = STRING_BYTES (XSTRING (string)); | 2281 | bytes = SBYTES (string); |
| 2282 | bytes_remaining = bytes; | 2282 | bytes_remaining = bytes; |
| 2283 | 2283 | ||
| 2284 | if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized) | 2284 | if (! FRAME_X_DISPLAY_INFO (sf)->cut_buffers_initialized) |
diff --git a/src/xsmfns.c b/src/xsmfns.c index 44f083048e9..6db774e7a9f 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c | |||
| @@ -216,8 +216,8 @@ smc_save_yourself_CB (smcConn, | |||
| 216 | props[props_idx]->type = SmARRAY8; | 216 | props[props_idx]->type = SmARRAY8; |
| 217 | props[props_idx]->num_vals = 1; | 217 | props[props_idx]->num_vals = 1; |
| 218 | props[props_idx]->vals = &values[val_idx++]; | 218 | props[props_idx]->vals = &values[val_idx++]; |
| 219 | props[props_idx]->vals[0].length = strlen (XSTRING (Vinvocation_name)->data); | 219 | props[props_idx]->vals[0].length = strlen (SDATA (Vinvocation_name)); |
| 220 | props[props_idx]->vals[0].value = XSTRING (Vinvocation_name)->data; | 220 | props[props_idx]->vals[0].value = SDATA (Vinvocation_name); |
| 221 | ++props_idx; | 221 | ++props_idx; |
| 222 | 222 | ||
| 223 | /* How to restart Emacs (i.e.: /path/to/emacs --smid=xxxx). */ | 223 | /* How to restart Emacs (i.e.: /path/to/emacs --smid=xxxx). */ |
| @@ -244,8 +244,8 @@ smc_save_yourself_CB (smcConn, | |||
| 244 | props[props_idx]->type = SmARRAY8; | 244 | props[props_idx]->type = SmARRAY8; |
| 245 | props[props_idx]->num_vals = 1; | 245 | props[props_idx]->num_vals = 1; |
| 246 | props[props_idx]->vals = &values[val_idx++]; | 246 | props[props_idx]->vals = &values[val_idx++]; |
| 247 | props[props_idx]->vals[0].length = strlen (XSTRING (Vuser_login_name)->data); | 247 | props[props_idx]->vals[0].length = strlen (SDATA (Vuser_login_name)); |
| 248 | props[props_idx]->vals[0].value = XSTRING (Vuser_login_name)->data; | 248 | props[props_idx]->vals[0].value = SDATA (Vuser_login_name); |
| 249 | ++props_idx; | 249 | ++props_idx; |
| 250 | 250 | ||
| 251 | /* The current directory property, not mandatory */ | 251 | /* The current directory property, not mandatory */ |
| @@ -407,12 +407,12 @@ x_session_initialize () | |||
| 407 | /* Check if we where started by the session manager. If so, we will | 407 | /* Check if we where started by the session manager. If so, we will |
| 408 | have a previous id. */ | 408 | have a previous id. */ |
| 409 | if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) | 409 | if (! EQ (Vx_session_previous_id, Qnil) && STRINGP (Vx_session_previous_id)) |
| 410 | previous_id = XSTRING (Vx_session_previous_id)->data; | 410 | previous_id = SDATA (Vx_session_previous_id); |
| 411 | 411 | ||
| 412 | /* Construct the path to the Emacs program. */ | 412 | /* Construct the path to the Emacs program. */ |
| 413 | if (! EQ (Vinvocation_directory, Qnil)) | 413 | if (! EQ (Vinvocation_directory, Qnil)) |
| 414 | name_len += strlen (XSTRING (Vinvocation_directory)->data); | 414 | name_len += strlen (SDATA (Vinvocation_directory)); |
| 415 | name_len += strlen (XSTRING (Vinvocation_name)->data); | 415 | name_len += strlen (SDATA (Vinvocation_name)); |
| 416 | 416 | ||
| 417 | /* This malloc will not be freed, but it is only done once, and hopefully | 417 | /* This malloc will not be freed, but it is only done once, and hopefully |
| 418 | not very large */ | 418 | not very large */ |
| @@ -420,8 +420,8 @@ x_session_initialize () | |||
| 420 | emacs_program[0] = '\0'; | 420 | emacs_program[0] = '\0'; |
| 421 | 421 | ||
| 422 | if (! EQ (Vinvocation_directory, Qnil)) | 422 | if (! EQ (Vinvocation_directory, Qnil)) |
| 423 | strcpy (emacs_program, XSTRING (Vinvocation_directory)->data); | 423 | strcpy (emacs_program, SDATA (Vinvocation_directory)); |
| 424 | strcat (emacs_program, XSTRING (Vinvocation_name)->data); | 424 | strcat (emacs_program, SDATA (Vinvocation_name)); |
| 425 | 425 | ||
| 426 | /* The SM protocol says all callbacks are mandatory, so set up all | 426 | /* The SM protocol says all callbacks are mandatory, so set up all |
| 427 | here and in the mask passed to SmcOpenConnection */ | 427 | here and in the mask passed to SmcOpenConnection */ |
diff --git a/src/xterm.c b/src/xterm.c index 0067643c89f..5796ff9e8b9 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -7269,7 +7269,7 @@ note_mouse_highlight (f, x, y) | |||
| 7269 | if (NILP (b)) | 7269 | if (NILP (b)) |
| 7270 | b = make_number (0); | 7270 | b = make_number (0); |
| 7271 | if (NILP (e)) | 7271 | if (NILP (e)) |
| 7272 | e = make_number (XSTRING (object)->size - 1); | 7272 | e = make_number (SCHARS (object) - 1); |
| 7273 | fast_find_string_pos (w, XINT (b), object, | 7273 | fast_find_string_pos (w, XINT (b), object, |
| 7274 | &dpyinfo->mouse_face_beg_col, | 7274 | &dpyinfo->mouse_face_beg_col, |
| 7275 | &dpyinfo->mouse_face_beg_row, | 7275 | &dpyinfo->mouse_face_beg_row, |
| @@ -7367,7 +7367,7 @@ note_mouse_highlight (f, x, y) | |||
| 7367 | /* Try text properties. */ | 7367 | /* Try text properties. */ |
| 7368 | if (STRINGP (object) | 7368 | if (STRINGP (object) |
| 7369 | && charpos >= 0 | 7369 | && charpos >= 0 |
| 7370 | && charpos < XSTRING (object)->size) | 7370 | && charpos < SCHARS (object)) |
| 7371 | { | 7371 | { |
| 7372 | help = Fget_text_property (make_number (charpos), | 7372 | help = Fget_text_property (make_number (charpos), |
| 7373 | Qhelp_echo, object); | 7373 | Qhelp_echo, object); |
| @@ -12099,7 +12099,7 @@ x_error_catcher (display, error) | |||
| 12099 | XErrorEvent *error; | 12099 | XErrorEvent *error; |
| 12100 | { | 12100 | { |
| 12101 | XGetErrorText (display, error->error_code, | 12101 | XGetErrorText (display, error->error_code, |
| 12102 | XSTRING (x_error_message_string)->data, | 12102 | SDATA (x_error_message_string), |
| 12103 | X_ERROR_MESSAGE_SIZE); | 12103 | X_ERROR_MESSAGE_SIZE); |
| 12104 | } | 12104 | } |
| 12105 | 12105 | ||
| @@ -12131,7 +12131,7 @@ x_catch_errors (dpy) | |||
| 12131 | record_unwind_protect (x_catch_errors_unwind, x_error_message_string); | 12131 | record_unwind_protect (x_catch_errors_unwind, x_error_message_string); |
| 12132 | 12132 | ||
| 12133 | x_error_message_string = make_uninit_string (X_ERROR_MESSAGE_SIZE); | 12133 | x_error_message_string = make_uninit_string (X_ERROR_MESSAGE_SIZE); |
| 12134 | XSTRING (x_error_message_string)->data[0] = 0; | 12134 | SREF (x_error_message_string, 0) = 0; |
| 12135 | 12135 | ||
| 12136 | return count; | 12136 | return count; |
| 12137 | } | 12137 | } |
| @@ -12158,8 +12158,8 @@ x_check_errors (dpy, format) | |||
| 12158 | /* Make sure to catch any errors incurred so far. */ | 12158 | /* Make sure to catch any errors incurred so far. */ |
| 12159 | XSync (dpy, False); | 12159 | XSync (dpy, False); |
| 12160 | 12160 | ||
| 12161 | if (XSTRING (x_error_message_string)->data[0]) | 12161 | if (SREF (x_error_message_string, 0)) |
| 12162 | error (format, XSTRING (x_error_message_string)->data); | 12162 | error (format, SDATA (x_error_message_string)); |
| 12163 | } | 12163 | } |
| 12164 | 12164 | ||
| 12165 | /* Nonzero if we had any X protocol errors | 12165 | /* Nonzero if we had any X protocol errors |
| @@ -12172,7 +12172,7 @@ x_had_errors_p (dpy) | |||
| 12172 | /* Make sure to catch any errors incurred so far. */ | 12172 | /* Make sure to catch any errors incurred so far. */ |
| 12173 | XSync (dpy, False); | 12173 | XSync (dpy, False); |
| 12174 | 12174 | ||
| 12175 | return XSTRING (x_error_message_string)->data[0] != 0; | 12175 | return SREF (x_error_message_string, 0) != 0; |
| 12176 | } | 12176 | } |
| 12177 | 12177 | ||
| 12178 | /* Forget about any errors we have had, since we did x_catch_errors on DPY. */ | 12178 | /* Forget about any errors we have had, since we did x_catch_errors on DPY. */ |
| @@ -12181,7 +12181,7 @@ void | |||
| 12181 | x_clear_errors (dpy) | 12181 | x_clear_errors (dpy) |
| 12182 | Display *dpy; | 12182 | Display *dpy; |
| 12183 | { | 12183 | { |
| 12184 | XSTRING (x_error_message_string)->data[0] = 0; | 12184 | SREF (x_error_message_string, 0) = 0; |
| 12185 | } | 12185 | } |
| 12186 | 12186 | ||
| 12187 | /* Stop catching X protocol errors and let them make Emacs die. | 12187 | /* Stop catching X protocol errors and let them make Emacs die. |
| @@ -12481,7 +12481,7 @@ x_new_fontset (f, fontsetname) | |||
| 12481 | to do. */ | 12481 | to do. */ |
| 12482 | return fontset_name (fontset); | 12482 | return fontset_name (fontset); |
| 12483 | 12483 | ||
| 12484 | result = x_new_font (f, (XSTRING (fontset_ascii (fontset))->data)); | 12484 | result = x_new_font (f, (SDATA (fontset_ascii (fontset)))); |
| 12485 | 12485 | ||
| 12486 | if (!STRINGP (result)) | 12486 | if (!STRINGP (result)) |
| 12487 | /* Can't load ASCII font. */ | 12487 | /* Can't load ASCII font. */ |
| @@ -12493,7 +12493,7 @@ x_new_fontset (f, fontsetname) | |||
| 12493 | #ifdef HAVE_X_I18N | 12493 | #ifdef HAVE_X_I18N |
| 12494 | if (FRAME_XIC (f) | 12494 | if (FRAME_XIC (f) |
| 12495 | && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea))) | 12495 | && (FRAME_XIC_STYLE (f) & (XIMPreeditPosition | XIMStatusArea))) |
| 12496 | xic_set_xfontset (f, XSTRING (fontset_ascii (fontset))->data); | 12496 | xic_set_xfontset (f, SDATA (fontset_ascii (fontset))); |
| 12497 | #endif | 12497 | #endif |
| 12498 | 12498 | ||
| 12499 | return build_string (fontsetname); | 12499 | return build_string (fontsetname); |
| @@ -14093,7 +14093,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 14093 | XFontStruct *font; | 14093 | XFontStruct *font; |
| 14094 | unsigned long value; | 14094 | unsigned long value; |
| 14095 | 14095 | ||
| 14096 | font = XLoadQueryFont (dpy, XSTRING (pattern)->data); | 14096 | font = XLoadQueryFont (dpy, SDATA (pattern)); |
| 14097 | if (x_had_errors_p (dpy)) | 14097 | if (x_had_errors_p (dpy)) |
| 14098 | { | 14098 | { |
| 14099 | /* This error is perhaps due to insufficient memory on X | 14099 | /* This error is perhaps due to insufficient memory on X |
| @@ -14136,7 +14136,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 14136 | { | 14136 | { |
| 14137 | /* We try at least 10 fonts because XListFonts will return | 14137 | /* We try at least 10 fonts because XListFonts will return |
| 14138 | auto-scaled fonts at the head. */ | 14138 | auto-scaled fonts at the head. */ |
| 14139 | names = XListFonts (dpy, XSTRING (pattern)->data, max (maxnames, 10), | 14139 | names = XListFonts (dpy, SDATA (pattern), max (maxnames, 10), |
| 14140 | &num_fonts); | 14140 | &num_fonts); |
| 14141 | if (x_had_errors_p (dpy)) | 14141 | if (x_had_errors_p (dpy)) |
| 14142 | { | 14142 | { |
| @@ -14237,7 +14237,7 @@ x_list_fonts (f, pattern, size, maxnames) | |||
| 14237 | BLOCK_INPUT; | 14237 | BLOCK_INPUT; |
| 14238 | count = x_catch_errors (dpy); | 14238 | count = x_catch_errors (dpy); |
| 14239 | thisinfo = XLoadQueryFont (dpy, | 14239 | thisinfo = XLoadQueryFont (dpy, |
| 14240 | XSTRING (XCAR (tem))->data); | 14240 | SDATA (XCAR (tem))); |
| 14241 | if (x_had_errors_p (dpy)) | 14241 | if (x_had_errors_p (dpy)) |
| 14242 | { | 14242 | { |
| 14243 | /* This error is perhaps due to insufficient memory on X | 14243 | /* This error is perhaps due to insufficient memory on X |
| @@ -14417,9 +14417,9 @@ x_load_font (f, fontname, size) | |||
| 14417 | for (tail = font_names; CONSP (tail); tail = XCDR (tail)) | 14417 | for (tail = font_names; CONSP (tail); tail = XCDR (tail)) |
| 14418 | if (dpyinfo->font_table[i].name | 14418 | if (dpyinfo->font_table[i].name |
| 14419 | && (!strcmp (dpyinfo->font_table[i].name, | 14419 | && (!strcmp (dpyinfo->font_table[i].name, |
| 14420 | XSTRING (XCAR (tail))->data) | 14420 | SDATA (XCAR (tail))) |
| 14421 | || !strcmp (dpyinfo->font_table[i].full_name, | 14421 | || !strcmp (dpyinfo->font_table[i].full_name, |
| 14422 | XSTRING (XCAR (tail))->data))) | 14422 | SDATA (XCAR (tail))))) |
| 14423 | return (dpyinfo->font_table + i); | 14423 | return (dpyinfo->font_table + i); |
| 14424 | } | 14424 | } |
| 14425 | 14425 | ||
| @@ -14437,7 +14437,7 @@ x_load_font (f, fontname, size) | |||
| 14437 | a bug of not finding a font even if the font surely exists and | 14437 | a bug of not finding a font even if the font surely exists and |
| 14438 | is loadable by XLoadQueryFont. */ | 14438 | is loadable by XLoadQueryFont. */ |
| 14439 | if (size > 0 && !NILP (font_names)) | 14439 | if (size > 0 && !NILP (font_names)) |
| 14440 | fontname = (char *) XSTRING (XCAR (font_names))->data; | 14440 | fontname = (char *) SDATA (XCAR (font_names)); |
| 14441 | 14441 | ||
| 14442 | BLOCK_INPUT; | 14442 | BLOCK_INPUT; |
| 14443 | count = x_catch_errors (FRAME_X_DISPLAY (f)); | 14443 | count = x_catch_errors (FRAME_X_DISPLAY (f)); |
| @@ -14689,7 +14689,7 @@ same_x_server (name1, name2) | |||
| 14689 | char *name1, *name2; | 14689 | char *name1, *name2; |
| 14690 | { | 14690 | { |
| 14691 | int seen_colon = 0; | 14691 | int seen_colon = 0; |
| 14692 | unsigned char *system_name = XSTRING (Vsystem_name)->data; | 14692 | unsigned char *system_name = SDATA (Vsystem_name); |
| 14693 | int system_name_length = strlen (system_name); | 14693 | int system_name_length = strlen (system_name); |
| 14694 | int length_until_period = 0; | 14694 | int length_until_period = 0; |
| 14695 | 14695 | ||
| @@ -14771,7 +14771,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14771 | argv[argc++] = xrm_option; | 14771 | argv[argc++] = xrm_option; |
| 14772 | } | 14772 | } |
| 14773 | stop_polling (); | 14773 | stop_polling (); |
| 14774 | dpy = XtOpenDisplay (Xt_app_con, XSTRING (display_name)->data, | 14774 | dpy = XtOpenDisplay (Xt_app_con, SDATA (display_name), |
| 14775 | resource_name, EMACS_CLASS, | 14775 | resource_name, EMACS_CLASS, |
| 14776 | emacs_options, XtNumber (emacs_options), | 14776 | emacs_options, XtNumber (emacs_options), |
| 14777 | &argc, argv); | 14777 | &argc, argv); |
| @@ -14787,7 +14787,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14787 | #ifdef HAVE_X11R5 | 14787 | #ifdef HAVE_X11R5 |
| 14788 | XSetLocaleModifiers (""); | 14788 | XSetLocaleModifiers (""); |
| 14789 | #endif | 14789 | #endif |
| 14790 | dpy = XOpenDisplay (XSTRING (display_name)->data); | 14790 | dpy = XOpenDisplay (SDATA (display_name)); |
| 14791 | #endif /* not USE_X_TOOLKIT */ | 14791 | #endif /* not USE_X_TOOLKIT */ |
| 14792 | 14792 | ||
| 14793 | /* Detect failure. */ | 14793 | /* Detect failure. */ |
| @@ -14809,8 +14809,8 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14809 | 14809 | ||
| 14810 | for (share = x_display_list, tail = x_display_name_list; share; | 14810 | for (share = x_display_list, tail = x_display_name_list; share; |
| 14811 | share = share->next, tail = XCDR (tail)) | 14811 | share = share->next, tail = XCDR (tail)) |
| 14812 | if (same_x_server (XSTRING (XCAR (XCAR (tail)))->data, | 14812 | if (same_x_server (SDATA (XCAR (XCAR (tail))), |
| 14813 | XSTRING (display_name)->data)) | 14813 | SDATA (display_name))) |
| 14814 | break; | 14814 | break; |
| 14815 | if (share) | 14815 | if (share) |
| 14816 | dpyinfo->kboard = share->kboard; | 14816 | dpyinfo->kboard = share->kboard; |
| @@ -14856,11 +14856,11 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14856 | #endif /* ! 0 */ | 14856 | #endif /* ! 0 */ |
| 14857 | 14857 | ||
| 14858 | dpyinfo->x_id_name | 14858 | dpyinfo->x_id_name |
| 14859 | = (char *) xmalloc (STRING_BYTES (XSTRING (Vinvocation_name)) | 14859 | = (char *) xmalloc (SBYTES (Vinvocation_name) |
| 14860 | + STRING_BYTES (XSTRING (Vsystem_name)) | 14860 | + SBYTES (Vsystem_name) |
| 14861 | + 2); | 14861 | + 2); |
| 14862 | sprintf (dpyinfo->x_id_name, "%s@%s", | 14862 | sprintf (dpyinfo->x_id_name, "%s@%s", |
| 14863 | XSTRING (Vinvocation_name)->data, XSTRING (Vsystem_name)->data); | 14863 | SDATA (Vinvocation_name), SDATA (Vsystem_name)); |
| 14864 | 14864 | ||
| 14865 | /* Figure out which modifier bits mean what. */ | 14865 | /* Figure out which modifier bits mean what. */ |
| 14866 | x_find_modifier_meanings (dpyinfo); | 14866 | x_find_modifier_meanings (dpyinfo); |
| @@ -14923,8 +14923,8 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 14923 | build_string ("PrivateColormap"), | 14923 | build_string ("PrivateColormap"), |
| 14924 | Qnil, Qnil); | 14924 | Qnil, Qnil); |
| 14925 | if (STRINGP (value) | 14925 | if (STRINGP (value) |
| 14926 | && (!strcmp (XSTRING (value)->data, "true") | 14926 | && (!strcmp (SDATA (value), "true") |
| 14927 | || !strcmp (XSTRING (value)->data, "on"))) | 14927 | || !strcmp (SDATA (value), "on"))) |
| 14928 | dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap); | 14928 | dpyinfo->cmap = XCopyColormapAndFree (dpyinfo->display, dpyinfo->cmap); |
| 14929 | } | 14929 | } |
| 14930 | } | 14930 | } |
| @@ -15084,8 +15084,8 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 15084 | build_string ("Synchronous"), | 15084 | build_string ("Synchronous"), |
| 15085 | Qnil, Qnil); | 15085 | Qnil, Qnil); |
| 15086 | if (STRINGP (value) | 15086 | if (STRINGP (value) |
| 15087 | && (!strcmp (XSTRING (value)->data, "true") | 15087 | && (!strcmp (SDATA (value), "true") |
| 15088 | || !strcmp (XSTRING (value)->data, "on"))) | 15088 | || !strcmp (SDATA (value), "on"))) |
| 15089 | XSynchronize (dpyinfo->display, True); | 15089 | XSynchronize (dpyinfo->display, True); |
| 15090 | } | 15090 | } |
| 15091 | 15091 | ||