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

  1. /*
  2.  *      HIST.H
  3.  *      UTREE history list definitions.
  4.  *      3.03-um klin, Tue Feb 11 22:35:29 1992, Shell command history added
  5.  *
  6.  *      Copyright (c) 1991/92 by Peter Klingebiel & UNIX Magazin Muenchen.
  7.  *      For copying and distribution information see the file COPYRIGHT.
  8.  */
  9. #if     defined(_MAIN_) && !defined(lint)
  10. static char sccsid_hist[] = "@(#) utree 3.03-um (klin) Feb 11 1992 hist.h";
  11. #endif  /* _MAIN_ && !lint */
  12.  
  13. /*
  14.  *      Shell commands are hold in a dynamically lined list of
  15.  *      struct _clist.
  16.  */
  17.  
  18. typedef struct _clist {
  19.   glist list;                   /* Containing command and pointers      */
  20.   int length;                   /* Length of current command            */
  21.   int number;                   /* Event number                         */
  22.   int counter;                  /* Event counter                        */
  23. } clist;
  24.  
  25. #define CHNULL  ((clist *) 0)   /* The clist NIL pointer                */
  26.  
  27. /*
  28.  *      Access to entries in the command history list is done
  29.  *      with macros to hide this record and for abbreviation.
  30.  */
  31.  
  32. #define CHLST(p)        (&(p)->list)
  33. #define CHCMD(p)        ((p)->list.string)
  34. #define CHPRV(p)        ((p)->list.prev)
  35. #define CHNXT(p)        ((p)->list.next)
  36. #define CHLEN(p)        ((p)->length)
  37. #define CHNUM(p)        ((p)->number)
  38. #define CHCNT(p)        ((p)->counter)
  39.  
  40.