aboutsummaryrefslogtreecommitdiffstats
path: root/src/doc.c
diff options
context:
space:
mode:
authorKen Raeburn2002-07-15 00:01:34 +0000
committerKen Raeburn2002-07-15 00:01:34 +0000
commitd5db40779d7505244d37476b4f046641f07eea2b (patch)
tree5c8bf4dad41639287e722cb7cbdc0709e47a9e53 /src/doc.c
parent491c2516d32fa8b9ba9422ec142c8925dd82af00 (diff)
downloademacs-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/doc.c')
-rw-r--r--src/doc.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/doc.c b/src/doc.c
index 957c43d07b7..473ba911023 100644
--- a/src/doc.c
+++ b/src/doc.c
@@ -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)