diff options
| author | Roland McGrath | 1994-01-16 08:35:01 +0000 |
|---|---|---|
| committer | Roland McGrath | 1994-01-16 08:35:01 +0000 |
| commit | 069ad9ead4a4f1f48dceb3677ed4601799034a8f (patch) | |
| tree | 4fc22149d05a371d9e3c2a2f7a96db88b61d8b12 /lib-src | |
| parent | a1d528953c09ac8f78cc5efd9bc64265412221d3 (diff) | |
| download | emacs-069ad9ead4a4f1f48dceb3677ed4601799034a8f.tar.gz emacs-069ad9ead4a4f1f48dceb3677ed4601799034a8f.zip | |
Make the argument list output look more like the Lisp docstrings do.
(write_c_args): Take new arg FUNC. Make output look like lisp call
prototypes: (function ARG1 ARG2), upcasing arg names.
(scan_c_file): Pass BUF to write_c_args for FUNC arg.
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/make-docfile.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 366c784075f..b865845cfcf 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, 1986, 1992, 1993 Free Software Foundation, Inc. | 2 | Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc. |
| 3 | 3 | ||
| 4 | This file is part of GNU Emacs. | 4 | This file is part of GNU Emacs. |
| 5 | 5 | ||
| @@ -153,19 +153,23 @@ read_c_string (infile, printflag) | |||
| 153 | return c; | 153 | return c; |
| 154 | } | 154 | } |
| 155 | 155 | ||
| 156 | /* Write to file OUT the argument names of the function whose text is in BUF. | 156 | /* Write to file OUT the argument names of function FUNC, whose text is in BUF. |
| 157 | MINARGS and MAXARGS are the minimum and maximum number of arguments. */ | 157 | MINARGS and MAXARGS are the minimum and maximum number of arguments. */ |
| 158 | 158 | ||
| 159 | write_c_args (out, buf, minargs, maxargs) | 159 | write_c_args (out, func, buf, minargs, maxargs) |
| 160 | FILE *out; | 160 | FILE *out; |
| 161 | char *buf; | 161 | char *func, *buf; |
| 162 | int minargs, maxargs; | 162 | int minargs, maxargs; |
| 163 | { | 163 | { |
| 164 | register char *p; | 164 | register char *p; |
| 165 | int in_ident = 0; | 165 | int in_ident = 0; |
| 166 | int just_spaced = 0; | 166 | int just_spaced = 0; |
| 167 | int need_space = 1; | ||
| 167 | 168 | ||
| 168 | fprintf (out, "arguments: "); | 169 | fprintf (out, "(%s", func); |
| 170 | |||
| 171 | if (*buf == '(') | ||
| 172 | ++buf; | ||
| 169 | 173 | ||
| 170 | for (p = buf; *p; p++) | 174 | for (p = buf; *p; p++) |
| 171 | { | 175 | { |
| @@ -184,6 +188,9 @@ write_c_args (out, buf, minargs, maxargs) | |||
| 184 | in_ident = 1; | 188 | in_ident = 1; |
| 185 | ident_start = 1; | 189 | ident_start = 1; |
| 186 | 190 | ||
| 191 | if (need_space) | ||
| 192 | putc (' ', out); | ||
| 193 | |||
| 187 | if (minargs == 0 && maxargs > 0) | 194 | if (minargs == 0 && maxargs > 0) |
| 188 | fprintf (out, "&optional "); | 195 | fprintf (out, "&optional "); |
| 189 | just_spaced = 1; | 196 | just_spaced = 1; |
| @@ -216,9 +223,15 @@ write_c_args (out, buf, minargs, maxargs) | |||
| 216 | just_spaced = 0; | 223 | just_spaced = 0; |
| 217 | } | 224 | } |
| 218 | else if (c != ' ' || ! just_spaced) | 225 | else if (c != ' ' || ! just_spaced) |
| 219 | putc (c, out); | 226 | { |
| 227 | if (c >= 'a' && c <= 'z') | ||
| 228 | /* Upcase the letter. */ | ||
| 229 | c += 'A' - 'a'; | ||
| 230 | putc (c, out); | ||
| 231 | } | ||
| 220 | 232 | ||
| 221 | just_spaced = (c == ' '); | 233 | just_spaced = (c == ' '); |
| 234 | need_space = 0; | ||
| 222 | } | 235 | } |
| 223 | } | 236 | } |
| 224 | 237 | ||
| @@ -398,7 +411,7 @@ scan_c_file (filename, mode) | |||
| 398 | *p = '\0'; | 411 | *p = '\0'; |
| 399 | /* Output them. */ | 412 | /* Output them. */ |
| 400 | fprintf (outfile, "\n\n"); | 413 | fprintf (outfile, "\n\n"); |
| 401 | write_c_args (outfile, argbuf, minargs, maxargs); | 414 | write_c_args (outfile, buf, argbuf, minargs, maxargs); |
| 402 | } | 415 | } |
| 403 | } | 416 | } |
| 404 | } | 417 | } |