annotate lib-src/digest-doc.c @ 428:3ecd8885ac67 r21-2-22

Import from CVS: tag r21-2-22
author cvs
date Mon, 13 Aug 2007 11:28:15 +0200
parents
children 84b14dcb0985
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 /* Give this program DOCSTR.mm.nn as standard input
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 and it outputs to standard output
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 a file of nroff output containing the doc strings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 See also sorted-doc.c, which produces similar output
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 but in texinfo format and sorted by function/variable name. */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 #ifdef emacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 #include <../src/config.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 #endif
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 #include <stdio.h>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 int
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 main (int argc, char *argv[])
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 register int ch;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 register int notfirst = 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 printf (".TL\n");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 printf ("Command Summary for GNU Emacs\n");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 printf (".AU\nRichard M. Stallman\n");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 while ((ch = getchar ()) != EOF)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 if (ch == '\037')
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 if (notfirst)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 printf ("\n.DE");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 notfirst = 1;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 printf ("\n.SH\n");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 ch = getchar ();
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 printf (ch == 'F' ? "Function " : "Variable ");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 while ((ch = getchar ()) != '\n') /* Changed this line */
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 if (ch != EOF)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39 putchar (ch);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 {
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 ungetc (ch, stdin);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 break;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 printf ("\n.DS L\n");
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 else
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 putchar (ch);
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 }
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 return 0;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 }