diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2004-04-07 19:18:42 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2004-04-07 19:18:42 +0000 |
commit | d5d66b7edaf3ee8b3c5e87ee9147f63efa8c1439 (patch) | |
tree | 35cb148949cbbfbdd0f46e22951c52cfa0ec76fe | |
parent | a12a9bd6ab48161007d71e5fa6eb5009297a94e0 (diff) | |
download | emacs-d5d66b7edaf3ee8b3c5e87ee9147f63efa8c1439.tar.gz |
(xmalloc): Fix return type.
(put_filename): New fun.
(scan_file): Use it.
-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 @@ +2004-04-07 Stefan Monnier <monnier@iro.umontreal.ca> + + * make-docfile.c (xmalloc): Fix return type. + (put_filename): New fun. + (scan_file): Use it. + 2004-03-09 Juanma Barranquero <lektu@terra.es> * 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 @@ /* Generate doc-string file for GNU Emacs from source files. - Copyright (C) 1985, 86, 92, 93, 94, 97, 1999, 2000, 2001 + Copyright (C) 1985, 86, 92, 93, 94, 97, 1999, 2000, 01, 2004 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -105,11 +105,11 @@ fatal (s1, s2) /* Like malloc but get fatal error if memory is exhausted. */ -long * +void * xmalloc (size) unsigned int size; { - long *result = (long *) malloc (size); + void *result = (void *) malloc (size); if (result == NULL) fatal ("virtual memory exhausted", 0); return result; @@ -178,6 +178,22 @@ main (argc, argv) return (err_count > 0 ? EXIT_FAILURE : EXIT_SUCCESS); } +/* Add a source file name boundary marker in the output file. */ +void +put_filename (filename) + char *filename; +{ + char *tmp = filename; + int len; + + while ((tmp = index (filename, '/'))) + filename = tmp + 1; + + putc (037, outfile); + putc ('S', outfile); + fprintf (outfile, "%s\n", filename); +} + /* Read file FILENAME and output its doc strings to outfile. */ /* Return 1 if file is not found, 0 if it is found. */ @@ -186,6 +202,8 @@ scan_file (filename) char *filename; { int len = strlen (filename); + + put_filename (filename); if (len > 4 && !strcmp (filename + len - 4, ".elc")) return scan_lisp_file (filename, READ_BINARY); else if (len > 3 && !strcmp (filename + len - 3, ".el")) |