1 /* help.c Larn is copyrighted 1986 by Noah Morgan. */
2 /* $FreeBSD: src/games/larn/help.c,v 1.4 1999/11/16 02:57:21 billf Exp $ */
3 /* $DragonFly: src/games/larn/help.c,v 1.4 2006/08/26 17:05:05 pavalos Exp $ */
6 static void retcont(void);
7 static int openhelp(void);
9 * help function to display the help info
11 * format of the .larn.help file
13 * 1st character of file: # of pages of help available (ascii digit)
14 * page (23 lines) for the introductory message (not counted in above)
15 * pages of help text (23 lines per page)
22 char tmbuf
[128]; /* intermediate translation buffer when not a VT100 */
24 if ((j
= openhelp()) < 0) /* open the help file and get # pages */
26 for (i
= 0; i
< 23; i
++) /* skip over intro message */
30 for (i
= 0; i
< 23; i
++)
32 lprcat(lgetl()); /* print out each line that we read in */
35 tmcapcnv(tmbuf
, lgetl());
37 } /* intercept \33's */
40 lprcat(" ---- Press ");
44 lprcat(" for more help ---- ");
46 while ((i
!= ' ') && (i
!= '\n') && (i
!= '\33'))
48 if ((i
== '\n') || (i
== '\33')) {
62 * function to display the welcome message and background
69 char tmbuf
[128]; /* intermediate translation buffer when not a VT100 */
71 if (openhelp() < 0) /* open the help file */
74 for (i
= 0; i
< 23; i
++)
76 lprcat(lgetl());/* print out each line that we read in */
79 tmcapcnv(tmbuf
, lgetl());
81 } /* intercept \33's */
84 retcont(); /* press return to continue */
88 * function to say press return to continue and reset scroll when done
96 lprcat(" to continue: ");
97 while (getchr() != '\n')
103 * routine to open the help file and return the first character - '0'
108 if (lopen(helpfile
) < 0) {
109 lprintf("Can't open help file \"%s\" ", helpfile
);
117 return (lgetc() - '0');