annotate lib-src/digest-doc.c @ 329:58bac07dfa74 r21-0-62

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