home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume26 / utree / part01 / src / help.h next >
Encoding:
C/C++ Source or Header  |  1992-09-06  |  1.9 KB  |  50 lines

  1. /*
  2.  *      HELP.H
  3.  *      UTREE help definitions.
  4.  *      3.01-um klin, Sat Apr 20 11:02:33 1991
  5.  *      3.03-um klin, Sat Feb 15 18:33:14 1992, Minor changes
  6.  *
  7.  *      Copyright (c) 1991/92 by Peter Klingebiel & UNIX Magazin Muenchen.
  8.  *      For copying and distribution information see the file COPYRIGHT.
  9.  */
  10. #if     defined(_MAIN_) && !defined(lint)
  11. static char sccsid_help[] = "@(#) utree 3.03-um (klin) Feb 15 1992 help.h";
  12. #endif  /* _MAIN_ && !lint */
  13.  
  14. /* Max length of a menu item in the help menuline                       */
  15. #define ITEMLEN 16
  16.  
  17. /*
  18.  *      Utree help pages are hold in a dynamically linked list of the
  19.  *      following data structure _hlist which is built up at runtime.
  20.  *      The record contains information about help items from a help
  21.  *      file, i.e. a menu title or item, the starting position of a help
  22.  *      page about this item in the help file and the number of lines
  23.  *      of this help page. Displaying a help page about an item is
  24.  *      therefore searching this item in the help page list, positioning
  25.  *      to the starting position in the help file and putting as many
  26.  *      lines from the helpfile to screen as this help page has.
  27.  */
  28.  
  29. typedef struct _hlist {
  30.   char item[ITEMLEN];           /* Menu line item                       */
  31.   char hotkey;                  /* Menu hot key                         */
  32.   int nlines;                   /* Number of lines in help file         */
  33.   long position;                /* Start position in help file          */
  34.   struct _hlist *next;          /* Pointer to next help page            */
  35. } hlist;
  36.  
  37. #define HNULL   ((hlist *) 0)   /* The hlist NIL pointer                */
  38.  
  39. /*
  40.  *      Access to items of hlist record is done with macros
  41.  *      to hide this record and for abbreviation.
  42.  */
  43.  
  44. #define HITEM(p)        ((p)->item)
  45. #define HHKEY(p)        ((p)->hotkey)
  46. #define HNLIN(p)        ((p)->nlines)
  47. #define HSPOS(p)        ((p)->position)
  48. #define HNEXT(p)        ((p)->next)
  49.  
  50.