51 |
|
|
52 |
Lisp_Object Qfunction_documentation; |
Lisp_Object Qfunction_documentation; |
53 |
|
|
54 |
|
/* A list of files used to build this Emacs binary. */ |
55 |
|
static Lisp_Object Vbuild_files; |
56 |
|
|
57 |
extern Lisp_Object Voverriding_local_map; |
extern Lisp_Object Voverriding_local_map; |
58 |
|
|
59 |
/* For VMS versions with limited file name syntax, |
/* For VMS versions with limited file name syntax, |
584 |
register char *p, *end; |
register char *p, *end; |
585 |
Lisp_Object sym; |
Lisp_Object sym; |
586 |
char *name; |
char *name; |
587 |
|
int skip_file = 0; |
588 |
|
|
589 |
CHECK_STRING (filename); |
CHECK_STRING (filename); |
590 |
|
|
622 |
#endif /* VMS4_4 */ |
#endif /* VMS4_4 */ |
623 |
#endif /* VMS */ |
#endif /* VMS */ |
624 |
|
|
625 |
|
/* Vbuild_files is nil when temacs is run, and non-nil after that. */ |
626 |
|
if (NILP (Vbuild_files)) |
627 |
|
{ |
628 |
|
size_t cp_size = 0; |
629 |
|
size_t to_read; |
630 |
|
int nr_read; |
631 |
|
char *cp = NULL; |
632 |
|
char *beg, *end; |
633 |
|
|
634 |
|
fd = emacs_open ("buildobj.lst", O_RDONLY, 0); |
635 |
|
if (fd < 0) |
636 |
|
report_file_error ("Opening file buildobj.lst", Qnil); |
637 |
|
|
638 |
|
filled = 0; |
639 |
|
for (;;) |
640 |
|
{ |
641 |
|
cp_size += 1024; |
642 |
|
to_read = cp_size - 1 - filled; |
643 |
|
cp = xrealloc (cp, cp_size); |
644 |
|
nr_read = emacs_read (fd, &cp[filled], to_read); |
645 |
|
filled += nr_read; |
646 |
|
if (nr_read < to_read) |
647 |
|
break; |
648 |
|
} |
649 |
|
|
650 |
|
emacs_close (fd); |
651 |
|
cp[filled] = 0; |
652 |
|
|
653 |
|
for (beg = cp; *beg; beg = end) |
654 |
|
{ |
655 |
|
int len; |
656 |
|
|
657 |
|
while (*beg && isspace (*beg)) ++beg; |
658 |
|
|
659 |
|
for (end = beg; *end && ! isspace (*end); ++end) |
660 |
|
if (*end == '/') beg = end+1; /* skip directory part */ |
661 |
|
|
662 |
|
len = end - beg; |
663 |
|
if (len > 4 && end[-4] == '.' && end[-3] == 'o') |
664 |
|
len -= 2; /* Just take .o if it ends in .obj */ |
665 |
|
|
666 |
|
if (len > 0) |
667 |
|
Vbuild_files = Fcons (make_string (beg, len), Vbuild_files); |
668 |
|
} |
669 |
|
|
670 |
|
xfree (cp); |
671 |
|
} |
672 |
|
|
673 |
fd = emacs_open (name, O_RDONLY, 0); |
fd = emacs_open (name, O_RDONLY, 0); |
674 |
if (fd < 0) |
if (fd < 0) |
675 |
report_file_error ("Opening doc string file", |
report_file_error ("Opening doc string file", |
692 |
if (p != end) |
if (p != end) |
693 |
{ |
{ |
694 |
end = (char *) index (p, '\n'); |
end = (char *) index (p, '\n'); |
695 |
|
|
696 |
|
/* See if this is a file name, and if it is a file in build-files. */ |
697 |
|
if (p[1] == 'S' && end - p > 4 && end[-2] == '.' |
698 |
|
&& (end[-1] == 'o' || end[-1] == 'c')) |
699 |
|
{ |
700 |
|
int len = end - p - 2; |
701 |
|
char *fromfile = alloca (len + 1); |
702 |
|
strncpy (fromfile, &p[2], len); |
703 |
|
fromfile[len] = 0; |
704 |
|
if (fromfile[len-1] == 'c') |
705 |
|
fromfile[len-1] = 'o'; |
706 |
|
|
707 |
|
if (EQ (Fmember (build_string (fromfile), Vbuild_files), Qnil)) |
708 |
|
skip_file = 1; |
709 |
|
else |
710 |
|
skip_file = 0; |
711 |
|
} |
712 |
|
|
713 |
sym = oblookup (Vobarray, p + 2, |
sym = oblookup (Vobarray, p + 2, |
714 |
multibyte_chars_in_text (p + 2, end - p - 2), |
multibyte_chars_in_text (p + 2, end - p - 2), |
715 |
end - p - 2); |
end - p - 2); |
716 |
if (SYMBOLP (sym)) |
if (! skip_file && SYMBOLP (sym)) |
717 |
{ |
{ |
718 |
/* Attach a docstring to a variable? */ |
/* Attach a docstring to a variable? */ |
719 |
if (p[1] == 'V') |
if (p[1] == 'V') |
989 |
doc: /* Name of file containing documentation strings of built-in symbols. */); |
doc: /* Name of file containing documentation strings of built-in symbols. */); |
990 |
Vdoc_file_name = Qnil; |
Vdoc_file_name = Qnil; |
991 |
|
|
992 |
|
DEFVAR_LISP ("build-files", &Vbuild_files, |
993 |
|
doc: /* A list of files used to build this Emacs binary. */); |
994 |
|
Vbuild_files = Qnil; |
995 |
|
|
996 |
defsubr (&Sdocumentation); |
defsubr (&Sdocumentation); |
997 |
defsubr (&Sdocumentation_property); |
defsubr (&Sdocumentation_property); |
998 |
defsubr (&Ssnarf_documentation); |
defsubr (&Ssnarf_documentation); |