]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - larn/help.c
1 /* $NetBSD: help.c,v 1.4 1997/10/18 20:03:24 christos Exp $ */
3 /* help.c Larn is copyrighted 1986 by Noah Morgan. */
6 __RCSID("$NetBSD: help.c,v 1.4 1997/10/18 20:03:24 christos Exp $");
14 * help function to display the help info
16 * format of the .larn.help file
18 * 1st character of file: # of pages of help available (ascii digit)
19 * page (23 lines) for the introductory message (not counted in above)
20 * pages of help text (23 lines per page)
27 char tmbuf
[128]; /* intermediate translation buffer
30 if ((j
= openhelp()) < 0)
31 return; /* open the help file and get # pages */
32 for (i
= 0; i
< 23; i
++)
33 lgetl(); /* skip over intro message */
36 for (i
= 0; i
< 23; i
++)
38 lprcat(lgetl()); /* print out each line that
42 tmcapcnv(tmbuf
, lgetl());
44 } /* intercept \33's */
47 lprcat(" ---- Press ");
51 lprcat(" for more help ---- ");
53 while ((i
!= ' ') && (i
!= '\n') && (i
!= '\33'))
55 if ((i
== '\n') || (i
== '\33')) {
69 * function to display the welcome message and background
76 char tmbuf
[128]; /* intermediate translation buffer
80 return; /* open the help file */
82 for (i
= 0; i
< 23; i
++)
84 lprcat(lgetl());/* print out each line that we read in */
87 tmcapcnv(tmbuf
, lgetl());
89 } /* intercept \33's */
92 retcont(); /* press return to continue */
96 * function to say press return to continue and reset scroll when done
104 lprcat(" to continue: ");
105 while (getchar() != '\n');
110 * routine to open the help file and return the first character - '0'
115 if (lopen(helpfile
) < 0) {
116 lprintf("Can't open help file \"%s\" ", helpfile
);
124 return (lgetc() - '0');