diff options
| author | Stefan Monnier | 2004-04-07 19:18:42 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-04-07 19:18:42 +0000 |
| commit | d5d66b7edaf3ee8b3c5e87ee9147f63efa8c1439 (patch) | |
| tree | 35cb148949cbbfbdd0f46e22951c52cfa0ec76fe /lib-src | |
| parent | a12a9bd6ab48161007d71e5fa6eb5009297a94e0 (diff) | |
| download | emacs-d5d66b7edaf3ee8b3c5e87ee9147f63efa8c1439.tar.gz emacs-d5d66b7edaf3ee8b3c5e87ee9147f63efa8c1439.zip | |
(xmalloc): Fix return type.
(put_filename): New fun.
(scan_file): Use it.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/ChangeLog | 6 | ||||
| -rw-r--r-- | lib-src/make-docfile.c | 24 |
2 files changed, 27 insertions, 3 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog index 819b4db4a1d..75b3be839e1 100644 --- a/lib-src/ChangeLog +++ b/lib-src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2004-04-07 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * make-docfile.c (xmalloc): Fix return type. | ||
| 4 | (put_filename): New fun. | ||
| 5 | (scan_file): Use it. | ||
| 6 | |||
| 1 | 2004-03-09 Juanma Barranquero <lektu@terra.es> | 7 | 2004-03-09 Juanma Barranquero <lektu@terra.es> |
| 2 | 8 | ||
| 3 | * grep-changelog: Changes to support ChangeLog.10+. | 9 | * grep-changelog: Changes to support ChangeLog.10+. |
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 4210320b591..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 | ||
| 5 | This file is part of GNU Emacs. | 5 | This file is part of GNU Emacs. |
| @@ -105,11 +105,11 @@ fatal (s1, s2) | |||
| 105 | 105 | ||
| 106 | /* Like malloc but get fatal error if memory is exhausted. */ | 106 | /* Like malloc but get fatal error if memory is exhausted. */ |
| 107 | 107 | ||
| 108 | long * | 108 | void * |
| 109 | xmalloc (size) | 109 | xmalloc (size) |
| 110 | unsigned int size; | 110 | unsigned int size; |
| 111 | { | 111 | { |
| 112 | long *result = (long *) malloc (size); | 112 | void *result = (void *) malloc (size); |
| 113 | if (result == NULL) | 113 | if (result == NULL) |
| 114 | fatal ("virtual memory exhausted", 0); | 114 | fatal ("virtual memory exhausted", 0); |
| 115 | return result; | 115 | return result; |
| @@ -178,6 +178,22 @@ main (argc, argv) | |||
| 178 | return (err_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS); | 178 | return (err_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS); |
| 179 | } | 179 | } |
| 180 | 180 | ||
| 181 | /* Add a source file name boundary marker in the output file. */ | ||
| 182 | void | ||
| 183 | put_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); | ||
| 195 | } | ||
| 196 | |||
| 181 | /* Read file FILENAME and output its doc strings to outfile. */ | 197 | /* Read file FILENAME and output its doc strings to outfile. */ |
| 182 | /* Return 1 if file is not found, 0 if it is found. */ | 198 | /* Return 1 if file is not found, 0 if it is found. */ |
| 183 | 199 | ||
| @@ -186,6 +202,8 @@ scan_file (filename) | |||
| 186 | char *filename; | 202 | char *filename; |
| 187 | { | 203 | { |
| 188 | int len = strlen (filename); | 204 | int len = strlen (filename); |
| 205 | |||
| 206 | put_filename (filename); | ||
| 189 | if (len > 4 && !strcmp (filename + len - 4, ".elc")) | 207 | if (len > 4 && !strcmp (filename + len - 4, ".elc")) |
| 190 | return scan_lisp_file (filename, READ_BINARY); | 208 | return scan_lisp_file (filename, READ_BINARY); |
| 191 | else if (len > 3 && !strcmp (filename + len - 3, ".el")) | 209 | else if (len > 3 && !strcmp (filename + len - 3, ".el")) |