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 void retcont(void);
15 static int openhelp(void);
18 * help function to display the help info
20 * format of the .larn.help file
22 * 1st character of file: # of pages of help available (ascii digit)
23 * page (23 lines) for the introductory message (not counted in above)
24 * pages of help text (23 lines per page)
31 char tmbuf
[128]; /* intermediate translation buffer
34 if ((j
= openhelp()) < 0)
35 return; /* open the help file and get # pages */
36 for (i
= 0; i
< 23; i
++)
37 lgetl(); /* skip over intro message */
40 for (i
= 0; i
< 23; i
++)
42 lprcat(lgetl()); /* print out each line that
46 tmcapcnv(tmbuf
, lgetl());
48 } /* intercept \33's */
51 lprcat(" ---- Press ");
55 lprcat(" for more help ---- ");
57 while ((i
!= ' ') && (i
!= '\n') && (i
!= '\33'))
59 if ((i
== '\n') || (i
== '\33')) {
73 * function to display the welcome message and background
80 char tmbuf
[128]; /* intermediate translation buffer
84 return; /* open the help file */
86 for (i
= 0; i
< 23; i
++)
88 lprcat(lgetl());/* print out each line that we read in */
91 tmcapcnv(tmbuf
, lgetl());
93 } /* intercept \33's */
96 retcont(); /* press return to continue */
100 * function to say press return to continue and reset scroll when done
108 lprcat(" to continue: ");
109 while (ttgetch() != '\n');
114 * routine to open the help file and return the first character - '0'
119 if (lopen(helpfile
) < 0) {
120 lprintf("Can't open help file \"%s\" ", helpfile
);
128 return (lgetc() - '0');