]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - larn/help.c
1 /* help.c Larn is copyrighted 1986 by Noah Morgan. */
4 * help function to display the help info
6 * format of the .larn.help file
8 * 1st character of file: # of pages of help available (ascii digit)
9 * page (23 lines) for the introductory message (not counted in above)
10 * pages of help text (23 lines per page)
12 extern char helpfile
[];
17 char tmbuf
[128]; /* intermediate translation buffer when not a VT100 */
19 if ((j
=openhelp()) < 0) return; /* open the help file and get # pages */
20 for (i
=0; i
<23; i
++) lgetl(); /* skip over intro message */
26 lprcat(lgetl()); /* print out each line that we read in */
28 { tmcapcnv(tmbuf
,lgetl()); lprcat(tmbuf
); } /* intercept \33's */
32 lprcat(" ---- Press "); standout("return");
33 lprcat(" to exit, "); standout("space");
34 lprcat(" for more help ---- ");
35 i
=0; while ((i
!=' ') && (i
!='\n') && (i
!='\33')) i
=getchar();
36 if ((i
=='\n') || (i
=='\33'))
38 lrclose(); setscroll(); drawscreen(); return;
42 lrclose(); retcont(); drawscreen();
46 * function to display the welcome message and background
52 char tmbuf
[128]; /* intermediate translation buffer when not a VT100 */
54 if (openhelp() < 0) return; /* open the help file */
58 lprcat(lgetl()); /* print out each line that we read in */
60 { tmcapcnv(tmbuf
,lgetl()); lprcat(tmbuf
); } /* intercept \33's */
62 lrclose(); retcont(); /* press return to continue */
66 * function to say press return to continue and reset scroll when done
70 cursor(1,24); lprcat("Press "); standout("return");
71 lprcat(" to continue: "); while (getchar() != '\n');
76 * routine to open the help file and return the first character - '0'
80 if (lopen(helpfile
)<0)
82 lprintf("Can't open help file \"%s\" ",helpfile
);
83 lflush(); sleep(4); drawscreen(); setscroll(); return(-1);
85 resetscroll(); return(lgetc() - '0');