]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - larn/help.c
2 static char rcsid
[] = "$NetBSD: help.c,v 1.3 1995/03/23 08:33:33 cgd Exp $";
5 /* help.c Larn is copyrighted 1986 by Noah Morgan. */
8 * help function to display the help info
10 * format of the .larn.help file
12 * 1st character of file: # of pages of help available (ascii digit)
13 * page (23 lines) for the introductory message (not counted in above)
14 * pages of help text (23 lines per page)
16 extern char helpfile
[];
21 char tmbuf
[128]; /* intermediate translation buffer when not a VT100 */
23 if ((j
=openhelp()) < 0) return; /* open the help file and get # pages */
24 for (i
=0; i
<23; i
++) lgetl(); /* skip over intro message */
30 lprcat(lgetl()); /* print out each line that we read in */
32 { tmcapcnv(tmbuf
,lgetl()); lprcat(tmbuf
); } /* intercept \33's */
36 lprcat(" ---- Press "); standout("return");
37 lprcat(" to exit, "); standout("space");
38 lprcat(" for more help ---- ");
39 i
=0; while ((i
!=' ') && (i
!='\n') && (i
!='\33')) i
=getchar();
40 if ((i
=='\n') || (i
=='\33'))
42 lrclose(); setscroll(); drawscreen(); return;
46 lrclose(); retcont(); drawscreen();
50 * function to display the welcome message and background
56 char tmbuf
[128]; /* intermediate translation buffer when not a VT100 */
58 if (openhelp() < 0) return; /* open the help file */
62 lprcat(lgetl()); /* print out each line that we read in */
64 { tmcapcnv(tmbuf
,lgetl()); lprcat(tmbuf
); } /* intercept \33's */
66 lrclose(); retcont(); /* press return to continue */
70 * function to say press return to continue and reset scroll when done
74 cursor(1,24); lprcat("Press "); standout("return");
75 lprcat(" to continue: "); while (getchar() != '\n');
80 * routine to open the help file and return the first character - '0'
84 if (lopen(helpfile
)<0)
86 lprintf("Can't open help file \"%s\" ",helpfile
);
87 lflush(); sleep(4); drawscreen(); setscroll(); return(-1);
89 resetscroll(); return(lgetc() - '0');