aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src/make-docfile.c
diff options
context:
space:
mode:
authorKenichi Handa2004-04-16 12:51:06 +0000
committerKenichi Handa2004-04-16 12:51:06 +0000
commit6b61353c0a0320ee15bb6488149735381fed62ec (patch)
treee69adba60e504a5a37beb556ad70084de88a7aab /lib-src/make-docfile.c
parentdc6a28319312fe81f7a1015e363174022313f0bd (diff)
downloademacs-6b61353c0a0320ee15bb6488149735381fed62ec.tar.gz
emacs-6b61353c0a0320ee15bb6488149735381fed62ec.zip
Sync to HEAD
Diffstat (limited to 'lib-src/make-docfile.c')
-rw-r--r--lib-src/make-docfile.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index ed6dde3a0bf..ba73f5800a7 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -1,5 +1,5 @@
1/* Generate doc-string file for GNU Emacs from source files. 1/* Generate doc-string file for GNU Emacs from source files.
2 Copyright (C) 1985, 86, 92, 93, 94, 97, 1999, 2000, 2001 2 Copyright (C) 1985, 86, 92, 93, 94, 97, 1999, 2000, 01, 2004
3 Free Software Foundation, Inc. 3 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
@@ -23,6 +23,7 @@ Boston, MA 02111-1307, USA. */
23 of GNU Emacs. .elc and .el and .c files are allowed. 23 of GNU Emacs. .elc and .el and .c files are allowed.
24 A .o file can also be specified; the .c file it was made from is used. 24 A .o file can also be specified; the .c file it was made from is used.
25 This helps the makefile pass the correct list of files. 25 This helps the makefile pass the correct list of files.
26 Option -d DIR means change to DIR before looking for files.
26 27
27 The results, which go to standard output or to a file 28 The results, which go to standard output or to a file
28 specified with -a or -o (-a to append, -o to start from nothing), 29 specified with -a or -o (-a to append, -o to start from nothing),
@@ -104,11 +105,11 @@ fatal (s1, s2)
104 105
105/* Like malloc but get fatal error if memory is exhausted. */ 106/* Like malloc but get fatal error if memory is exhausted. */
106 107
107long * 108void *
108xmalloc (size) 109xmalloc (size)
109 unsigned int size; 110 unsigned int size;
110{ 111{
111 long *result = (long *) malloc (size); 112 void *result = (void *) malloc (size);
112 if (result == NULL) 113 if (result == NULL)
113 fatal ("virtual memory exhausted", 0); 114 fatal ("virtual memory exhausted", 0);
114 return result; 115 return result;
@@ -174,10 +175,23 @@ main (argc, argv)
174 if (j == i) 175 if (j == i)
175 err_count += scan_file (argv[i]); 176 err_count += scan_file (argv[i]);
176 } 177 }
177#ifndef VMS 178 return (err_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS);
178 exit (err_count > 0); 179}
179#endif /* VMS */ 180
180 return err_count > 0; 181/* Add a source file name boundary marker in the output file. */
182void
183put_filename (filename)
184 char *filename;
185{
186 char *tmp = filename;
187 int len;
188
189 while ((tmp = index (filename, '/')))
190 filename = tmp + 1;
191
192 putc (037, outfile);
193 putc ('S', outfile);
194 fprintf (outfile, "%s\n", filename);
181} 195}
182 196
183/* Read file FILENAME and output its doc strings to outfile. */ 197/* Read file FILENAME and output its doc strings to outfile. */
@@ -188,6 +202,8 @@ scan_file (filename)
188 char *filename; 202 char *filename;
189{ 203{
190 int len = strlen (filename); 204 int len = strlen (filename);
205
206 put_filename (filename);
191 if (len > 4 && !strcmp (filename + len - 4, ".elc")) 207 if (len > 4 && !strcmp (filename + len - 4, ".elc"))
192 return scan_lisp_file (filename, READ_BINARY); 208 return scan_lisp_file (filename, READ_BINARY);
193 else if (len > 3 && !strcmp (filename + len - 3, ".el")) 209 else if (len > 3 && !strcmp (filename + len - 3, ".el"))
@@ -1185,3 +1201,6 @@ scan_lisp_file (filename, mode)
1185 fclose (infile); 1201 fclose (infile);
1186 return 0; 1202 return 0;
1187} 1203}
1204
1205/* arch-tag: f7203aaf-991a-4238-acb5-601db56f2894
1206 (do not change this comment) */