]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - larn/help.c
1 /* $NetBSD: help.c,v 1.7 2008/02/03 21:24:58 dholland Exp $ */
3 /* help.c Larn is copyrighted 1986 by Noah Morgan. */
6 __RCSID("$NetBSD: help.c,v 1.7 2008/02/03 21:24:58 dholland Exp $");
14 static int openhelp(void);
17 * help function to display the help info
19 * format of the .larn.help file
21 * 1st character of file: # of pages of help available (ascii digit)
22 * page (23 lines) for the introductory message (not counted in above)
23 * pages of help text (23 lines per page)
30 char tmbuf
[128]; /* intermediate translation buffer
33 if ((j
= openhelp()) < 0)
34 return; /* open the help file and get # pages */
35 for (i
= 0; i
< 23; i
++)
36 lgetl(); /* skip over intro message */
39 for (i
= 0; i
< 23; i
++)
41 lprcat(lgetl()); /* print out each line that
45 tmcapcnv(tmbuf
, lgetl());
47 } /* intercept \33's */
50 lprcat(" ---- Press ");
54 lprcat(" for more help ---- ");
56 while ((i
!= ' ') && (i
!= '\n') && (i
!= '\33'))
58 if ((i
== '\n') || (i
== '\33')) {
72 * function to display the welcome message and background
79 char tmbuf
[128]; /* intermediate translation buffer
83 return; /* open the help file */
85 for (i
= 0; i
< 23; i
++)
87 lprcat(lgetl());/* print out each line that we read in */
90 tmcapcnv(tmbuf
, lgetl());
92 } /* intercept \33's */
95 retcont(); /* press return to continue */
99 * function to say press return to continue and reset scroll when done
107 lprcat(" to continue: ");
108 while (ttgetch() != '\n');
113 * routine to open the help file and return the first character - '0'
118 if (lopen(helpfile
) < 0) {
119 lprintf("Can't open help file \"%s\" ", helpfile
);
127 return (lgetc() - '0');