comparison src/doc.c @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children 9ee227acff29
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
109 } 109 }
110 p += buffer - old_buffer; 110 p += buffer - old_buffer;
111 space_left = buffer_size - (p - buffer); 111 space_left = buffer_size - (p - buffer);
112 } 112 }
113 113
114 /* Don't read too too much at one go. */ 114 /* Don't read too much at one go. */
115 if (space_left > 1024 * 8) 115 if (space_left > 1024 * 8)
116 space_left = 1024 * 8; 116 space_left = 1024 * 8;
117 nread = read (fd, p, space_left); 117 nread = read (fd, p, space_left);
118 if (nread < 0) 118 if (nread < 0)
119 { 119 {
169 if (buffer != buf) /* We must have allocated buffer above */ 169 if (buffer != buf) /* We must have allocated buffer above */
170 xfree (buffer); 170 xfree (buffer);
171 return return_me; 171 return return_me;
172 } 172 }
173 173
174 #define string_join(dest, s1, s2) \
175 memcpy ((void *) dest, (void *) XSTRING_data (s1), XSTRING_length (s1)); \
176 memcpy ((void *) ((Bufbyte *) dest + XSTRING_length (s1)), \
177 (void *) XSTRING_data (s2), XSTRING_length (s2)); \
178 dest[XSTRING_length (s1) + XSTRING_length (s2)] = '\0'
179
174 /* Extract a doc string from a file. FILEPOS says where to get it. 180 /* Extract a doc string from a file. FILEPOS says where to get it.
175 (This could actually be byte code instructions/constants instead 181 (This could actually be byte code instructions/constants instead
176 of a doc string.) 182 of a doc string.)
177 If it is an integer, use that position in the standard DOC-... file. 183 If it is an integer, use that position in the standard DOC-... file.
178 If it is (FILE . INTEGER), use FILE as the file name 184 If it is (FILE . INTEGER), use FILE as the file name
225 /* sizeof ("../lib-src/") == 12 */ 231 /* sizeof ("../lib-src/") == 12 */
226 if (minsize < 12) 232 if (minsize < 12)
227 minsize = 12; 233 minsize = 12;
228 name_nonreloc 234 name_nonreloc
229 = (char *) alloca (minsize + string_length (XSTRING (file)) + 8); 235 = (char *) alloca (minsize + string_length (XSTRING (file)) + 8);
236 /*
230 strcpy (name_nonreloc, (char *) string_data (XSTRING (Vdoc_directory))); 237 strcpy (name_nonreloc, (char *) string_data (XSTRING (Vdoc_directory)));
231 strcat (name_nonreloc, (char *) string_data (XSTRING (file))); 238 strcat (name_nonreloc, (char *) string_data (XSTRING (file)));
239 */
240 string_join (name_nonreloc, Vdoc_directory, file);
232 munge_doc_file_name (name_nonreloc); 241 munge_doc_file_name (name_nonreloc);
233 } 242 }
234 else 243 else
235 name_reloc = file; 244 name_reloc = file;
236 245