annotate lib-src/digest-doc.c @ 42016:3900be0515b0

Add custom-define-hook.
author Richard M. Stallman <rms@gnu.org>
date Fri, 14 Dec 2001 03:08:47 +0000
parents c8fb06423da0
children c9f9c2f9d025
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36226
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
1 /* Give this program DOCSTR.mm.nn as standard input and it outputs to
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
2 standard output a file of nroff output containing the doc strings.
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
3
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
4 Copyright (C) 1987, 1994, 2001 Free Software Foundation Inc.
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
5
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
6 This file is part of GNU Emacs.
9
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7
36226
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
8 GNU Emacs is free software; you can redistribute it and/or modify
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
9 it under the terms of the GNU General Public License as published by
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
10 the Free Software Foundation; either version 2, or (at your option)
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
11 any later version.
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
12
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
13 GNU Emacs is distributed in the hope that it will be useful,
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
16 GNU General Public License for more details.
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
17
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
18 You should have received a copy of the GNU General Public License
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
19 along with GNU Emacs; see the file COPYING. If not, write to
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
20 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
c8fb06423da0 Add copyright notice.
Gerd Moellmann <gerd@gnu.org>
parents: 9491
diff changeset
21
9
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 See also sorted-doc.c, which produces similar output
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23 but in texinfo format and sorted by function/variable name. */
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 #include <stdio.h>
9491
dd3b83e4ceb0 Eliminate some -Wall warnings.
David J. MacKenzie <djm@gnu.org>
parents: 9
diff changeset
26
dd3b83e4ceb0 Eliminate some -Wall warnings.
David J. MacKenzie <djm@gnu.org>
parents: 9
diff changeset
27 int
9
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 main ()
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 {
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 register int ch;
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 register int notfirst = 0;
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 printf (".TL\n");
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 printf ("Command Summary for GNU Emacs\n");
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 printf (".AU\nRichard M. Stallman\n");
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 while ((ch = getchar ()) != EOF)
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 {
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 if (ch == '\037')
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 {
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 if (notfirst)
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 printf ("\n.DE");
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 else
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 notfirst = 1;
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 printf ("\n.SH\n");
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 ch = getchar ();
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48 printf (ch == 'F' ? "Function " : "Variable ");
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
49
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50 while ((ch = getchar ()) != '\n') /* Changed this line */
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
51 {
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 if (ch != EOF)
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
53 putchar (ch);
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
54 else
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 {
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
56 ungetc (ch, stdin);
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
57 break;
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
58 }
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
59 }
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 printf ("\n.DS L\n");
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 }
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
62 else
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 putchar (ch);
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64 }
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
65 return 0;
bba832d91c66 entered into RCS
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
66 }