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.3 2006/01/22 03:43:37 swildner Exp $ */
6 * help function to display the help info
8 * format of the .larn.help file
10 * 1st character of file: # of pages of help available (ascii digit)
11 * page (23 lines) for the introductory message (not counted in above)
12 * pages of help text (23 lines per page)
14 extern char helpfile[];
19 char tmbuf[128]; /* intermediate translation buffer when not a VT100 */
21 if ((j=openhelp()) < 0) return; /* open the help file and get # pages */
22 for (i=0; i<23; i++) lgetl(); /* skip over intro message */
28 lprcat(lgetl()); /* print out each line that we read in */
30 { tmcapcnv(tmbuf,lgetl()); lprcat(tmbuf); } /* intercept \33's */
34 lprcat(" ---- Press "); standout("return");
35 lprcat(" to exit, "); standout("space");
36 lprcat(" for more help ---- ");
37 i=0; while ((i!=' ') && (i!='\n') && (i!='\33')) i=getchar();
38 if ((i=='\n') || (i=='\33'))
40 lrclose(); setscroll(); drawscreen(); return;
44 lrclose(); retcont(); drawscreen();
48 * function to display the welcome message and background
54 char tmbuf[128]; /* intermediate translation buffer when not a VT100 */
56 if (openhelp() < 0) return; /* open the help file */
60 lprcat(lgetl()); /* print out each line that we read in */
62 { tmcapcnv(tmbuf,lgetl()); lprcat(tmbuf); } /* intercept \33's */
64 lrclose(); retcont(); /* press return to continue */
68 * function to say press return to continue and reset scroll when done
72 cursor(1,24); lprcat("Press "); standout("return");
73 lprcat(" to continue: "); while (getchar() != '\n');
78 * routine to open the help file and return the first character - '0'
82 if (lopen(helpfile)<0)
84 lprintf("Can't open help file \"%s\" ",helpfile);
85 lflush(); sleep(4); drawscreen(); setscroll(); return(-1);
87 resetscroll(); return(lgetc() - '0');