home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / compiler / sozobon / scsrc20 / szadb / help.c < prev    next >
C/C++ Source or Header  |  1990-02-21  |  1KB  |  73 lines

  1. /* Copyright (c) 1990 by Sozobon, Limited.  Authors: Johann Ruegg, Don Dugger
  2.  *
  3.  * Permission is granted to anyone to use this software for any purpose
  4.  * on any computer system, and to redistribute it freely, with the
  5.  * following restrictions:
  6.  * 1) No charge may be made other than reasonable charges for reproduction.
  7.  * 2) Modified versions must be clearly marked as such.
  8.  * 3) The authors are not responsible for any harmful consequences
  9.  *    of using this software, even if they result from defects in it.
  10.  *
  11.  *    help.c
  12.  */
  13.  
  14. #include <setjmp.h>
  15. #include "adb.h"
  16.  
  17. #define IN_HELP
  18. #include "lang.h"
  19.  
  20. char **helplist[] = {
  21.     help3,
  22.     help2,
  23.     help1,
  24.     0
  25. };
  26.  
  27. help()
  28. {
  29.     char ***p;
  30.     char **q;
  31.     int i;
  32.  
  33.     w_help(0);
  34.     for (p=helplist; *p; ) {
  35.         q = *p++;
  36.         helpscr(q, *p != 0);
  37.         if (*p) {
  38.             i = gemdos(7) & 0xff;
  39.             if (i == 'q' || i == 'Q')
  40.                 break;
  41.         }
  42.     }
  43.     w_help(1);
  44. }
  45.  
  46. helpscr(p, more)
  47. char **p;
  48. {
  49.     int nlines = 0;
  50.  
  51.     for (nlines = 0; nlines < 24; nlines++) {
  52.         if (*p)
  53.             helpline(*p++, nlines, 40);
  54.         else
  55.             helpline("", nlines, 40);
  56.     }
  57. /*    helpline(more ? "   q - quit  <space> - more" : "", nlines, 39); */
  58.     helpline(more ? M1 : "", nlines, 39);
  59. }
  60.  
  61. helpline(p, line, n)
  62. char *p;
  63. {
  64.     int i;
  65.  
  66.     w_hline(line);
  67.     for (i=0; i<n; i++)
  68.         if (*p)
  69.             w_hchr(*p++);
  70.         else
  71.             w_hchr(' ');
  72. }
  73.