comparison src/doc.c @ 167:85ec50267440 r20-3b10

Import from CVS: tag r20-3b10
author cvs
date Mon, 13 Aug 2007 09:45:46 +0200
parents 25f70ba0133c
children 8eaf7971accc
comparison
equal deleted inserted replaced
166:7a77eb660975 167:85ec50267440
33 33
34 #include "sysfile.h" 34 #include "sysfile.h"
35 35
36 36
37 Lisp_Object Vdoc_file_name; 37 Lisp_Object Vdoc_file_name;
38
39 #ifdef VMS
40 /* For VMS versions with limited file name syntax,
41 convert the name to something VMS will allow. */
42 static void
43 munge_doc_file_name (char *name)
44 {
45 #ifndef VMS4_4
46 /* For VMS versions with limited file name syntax,
47 convert the name to something VMS will allow. */
48 p = name;
49 while (*p)
50 {
51 if (*p == '-')
52 *p = '_';
53 p++;
54 }
55 #endif /* not VMS4_4 */
56 #ifdef VMS4_4
57 strcpy (name, sys_translate_unix (name));
58 #endif /* VMS4_4 */
59 }
60 #else /* NOT VMS */
61 #define munge_doc_file_name(name)
62 #endif /* VMS */
63 38
64 /* Read and return doc string from open file descriptor FD 39 /* Read and return doc string from open file descriptor FD
65 at position POSITION. Does not close the file. Returns 40 at position POSITION. Does not close the file. Returns
66 string; or if error, returns a cons holding the error 41 string; or if error, returns a cons holding the error
67 data to pass to Fsignal. NAME_NONRELOC and NAME_RELOC 42 data to pass to Fsignal. NAME_NONRELOC and NAME_RELOC
231 /* sizeof ("../lib-src/") == 12 */ 206 /* sizeof ("../lib-src/") == 12 */
232 if (minsize < 12) 207 if (minsize < 12)
233 minsize = 12; 208 minsize = 12;
234 name_nonreloc = (char *) alloca (minsize + XSTRING_LENGTH (file) + 8); 209 name_nonreloc = (char *) alloca (minsize + XSTRING_LENGTH (file) + 8);
235 string_join (name_nonreloc, Vdoc_directory, file); 210 string_join (name_nonreloc, Vdoc_directory, file);
236 munge_doc_file_name (name_nonreloc);
237 } 211 }
238 else 212 else
239 name_reloc = file; 213 name_reloc = file;
240 214
241 fd = open (name_nonreloc ? name_nonreloc : 215 fd = open (name_nonreloc ? name_nonreloc :
249 name_nonreloc = (char *) alloca (12 + XSTRING_LENGTH (file) + 8); 223 name_nonreloc = (char *) alloca (12 + XSTRING_LENGTH (file) + 8);
250 /* Preparing to dump; DOC file is probably not installed. 224 /* Preparing to dump; DOC file is probably not installed.
251 So check in ../lib-src. */ 225 So check in ../lib-src. */
252 strcpy (name_nonreloc, "../lib-src/"); 226 strcpy (name_nonreloc, "../lib-src/");
253 strcat (name_nonreloc, (char *) XSTRING_DATA (file)); 227 strcat (name_nonreloc, (char *) XSTRING_DATA (file));
254 munge_doc_file_name (name_nonreloc);
255 228
256 fd = open (name_nonreloc, O_RDONLY, 0); 229 fd = open (name_nonreloc, O_RDONLY, 0);
257 } 230 }
258 #endif /* CANNOT_DUMP */ 231 #endif /* CANNOT_DUMP */
259 232
461 + XSTRING_LENGTH (Vdoc_directory) 434 + XSTRING_LENGTH (Vdoc_directory)
462 + 1); 435 + 1);
463 strcpy (name, (char *) XSTRING_DATA (Vdoc_directory)); 436 strcpy (name, (char *) XSTRING_DATA (Vdoc_directory));
464 #endif /* CANNOT_DUMP */ 437 #endif /* CANNOT_DUMP */
465 strcat (name, (char *) XSTRING_DATA (filename)); 438 strcat (name, (char *) XSTRING_DATA (filename));
466 #ifdef VMS
467 #ifndef VMS4_4
468 /* For VMS versions with limited file name syntax,
469 convert the name to something VMS will allow. */
470 p = name;
471 while (*p)
472 {
473 if (*p == '-')
474 *p = '_';
475 p++;
476 }
477 #endif /* not VMS4_4 */
478 #ifdef VMS4_4
479 strcpy (name, sys_translate_unix (name));
480 #endif /* VMS4_4 */
481 #endif /* VMS */
482 439
483 fd = open (name, O_RDONLY, 0); 440 fd = open (name, O_RDONLY, 0);
484 if (fd < 0) 441 if (fd < 0)
485 report_file_error ("Opening doc string file", 442 report_file_error ("Opening doc string file",
486 Fcons (build_string (name), Qnil)); 443 Fcons (build_string (name), Qnil));