5491
+ − 1 /* Give this program DOC-mm.nn.oo as standard input and it outputs to
+ − 2 standard output a file of nroff output containing the doc strings.
+ − 3
+ − 4 Copyright (C) 1987, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
+ − 5 2008, 2009, 2010 Free Software Foundation, Inc.
+ − 6
+ − 7 This file is part of XEmacs.
+ − 8
+ − 9 XEmacs is free software: you can redistribute it and/or modify
+ − 10 it under the terms of the GNU General Public License as published by
+ − 11 the Free Software Foundation, either version 3 of the License, or
+ − 12 (at your option) any later version.
428
+ − 13
5491
+ − 14 XEmacs is distributed in the hope that it will be useful,
+ − 15 but WITHOUT ANY WARRANTY; without even the implied warranty of
+ − 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ − 17 GNU General Public License for more details.
+ − 18
+ − 19 You should have received a copy of the GNU General Public License
+ − 20 along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
+ − 21
+ − 22
+ − 23 See also sorted-doc.c, which produces similar output
+ − 24 but in texinfo format and sorted by function/variable name. */
+ − 25
+ − 26 /* Synced up with: GNU 23.1.92. */
+ − 27 /* Synced by: Ben Wing, 2-17-10. */
428
+ − 28
+ − 29 #ifdef emacs
438
+ − 30 #include <config.h>
428
+ − 31 #endif
+ − 32 #include <stdio.h>
+ − 33
5491
+ − 34 #ifdef WIN32_NATIVE
+ − 35 #include <fcntl.h> /* for O_BINARY */
+ − 36 #include <io.h> /* for setmode */
+ − 37 #endif
+ − 38
428
+ − 39 int
2367
+ − 40 main (int argc, char **argv)
428
+ − 41 {
+ − 42 register int ch;
+ − 43 register int notfirst = 0;
+ − 44
5491
+ − 45 #ifdef WIN32_NATIVE
+ − 46 /* DOC is a binary file. */
+ − 47 if (!isatty (fileno (stdin)))
+ − 48 setmode (fileno (stdin), O_BINARY);
+ − 49 #endif
+ − 50
428
+ − 51 printf (".TL\n");
613
+ − 52 printf ("Command Summary for XEmacs\n");
+ − 53 printf (".AU\nThe XEmacs Advocacy Group\n");
428
+ − 54 while ((ch = getchar ()) != EOF)
+ − 55 {
+ − 56 if (ch == '\037')
+ − 57 {
+ − 58 if (notfirst)
+ − 59 printf ("\n.DE");
+ − 60 else
+ − 61 notfirst = 1;
+ − 62
+ − 63 printf ("\n.SH\n");
+ − 64
+ − 65 ch = getchar ();
+ − 66 printf (ch == 'F' ? "Function " : "Variable ");
+ − 67
+ − 68 while ((ch = getchar ()) != '\n') /* Changed this line */
+ − 69 {
+ − 70 if (ch != EOF)
+ − 71 putchar (ch);
+ − 72 else
+ − 73 {
+ − 74 ungetc (ch, stdin);
+ − 75 break;
+ − 76 }
+ − 77 }
+ − 78 printf ("\n.DS L\n");
+ − 79 }
+ − 80 else
+ − 81 putchar (ch);
+ − 82 }
+ − 83 return 0;
+ − 84 }
5491
+ − 85
+ − 86 /* arch-tag: 2ba2c9b0-4157-4eba-bd9f-967e3677e35f
+ − 87 (do not change this comment) */