Mercurial > emacs
comparison lib-src/make-docfile.c @ 35293:39b2af5f7ee2
(write_c_args): Print newlines as spaces.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Sat, 13 Jan 2001 16:49:22 +0000 |
parents | 65f19ae2c578 |
children | 3e6f2f2a0a62 |
comparison
equal
deleted
inserted
replaced
35292:a0b80b4a7fa1 | 35293:39b2af5f7ee2 |
---|---|
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 Free Software Foundation, Inc. | 2 Copyright (C) 1985, 86, 92, 93, 94, 97, 1999, 2000, 2001 |
3 Free Software Foundation, Inc. | |
3 | 4 |
4 This file is part of GNU Emacs. | 5 This file is part of GNU Emacs. |
5 | 6 |
6 GNU Emacs is free software; you can redistribute it and/or modify | 7 GNU Emacs is free software; you can redistribute it and/or modify |
7 it under the terms of the GNU General Public License as published by | 8 it under the terms of the GNU General Public License as published by |
298 else | 299 else |
299 in_ident = 0; | 300 in_ident = 0; |
300 } | 301 } |
301 | 302 |
302 /* Print the C argument list as it would appear in lisp: | 303 /* Print the C argument list as it would appear in lisp: |
303 print underscores as hyphens, and print commas as spaces. | 304 print underscores as hyphens, and print commas and newlines |
304 Collapse adjacent spaces into one. */ | 305 as spaces. Collapse adjacent spaces into one. */ |
305 if (c == '_') c = '-'; | 306 if (c == '_') |
306 if (c == ',') c = ' '; | 307 c = '-'; |
308 else if (c == ',' || c == '\n') | |
309 c = ' '; | |
307 | 310 |
308 /* In C code, `default' is a reserved word, so we spell it | 311 /* In C code, `default' is a reserved word, so we spell it |
309 `defalt'; unmangle that here. */ | 312 `defalt'; unmangle that here. */ |
310 if (ident_start | 313 if (ident_start |
311 && strncmp (p, "defalt", 6) == 0 | 314 && strncmp (p, "defalt", 6) == 0 |
317 fprintf (out, "DEFAULT"); | 320 fprintf (out, "DEFAULT"); |
318 p += 5; | 321 p += 5; |
319 in_ident = 0; | 322 in_ident = 0; |
320 just_spaced = 0; | 323 just_spaced = 0; |
321 } | 324 } |
322 else if (c != ' ' || ! just_spaced) | 325 else if (c != ' ' || !just_spaced) |
323 { | 326 { |
324 if (c >= 'a' && c <= 'z') | 327 if (c >= 'a' && c <= 'z') |
325 /* Upcase the letter. */ | 328 /* Upcase the letter. */ |
326 c += 'A' - 'a'; | 329 c += 'A' - 'a'; |
327 putc (c, out); | 330 putc (c, out); |
328 } | 331 } |
329 | 332 |
330 just_spaced = (c == ' '); | 333 just_spaced = c == ' '; |
331 need_space = 0; | 334 need_space = 0; |
332 } | 335 } |
333 } | 336 } |
334 | 337 |
335 /* Read through a c file. If a .o file is named, | 338 /* Read through a c file. If a .o file is named, |