home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / DATABASE / CHX8010B.LBR / CHECKS.HZ / CHECKS.H
Text File  |  2000-06-30  |  7KB  |  153 lines

  1. /*  checks.h -- header file for check register program                       */
  2.  
  3. /*  copyright (c) 1986 by Jim Woolley and WoolleyWare, San Jose, CA          */
  4.  
  5. /*  vers. 1.0, 12/85 thru 5/86
  6.  */
  7.  
  8. #include    "a:bdscio.h"
  9.  
  10. #define     BBF             "BALANCE BROUGHT FORWARD"
  11. #define     PAYEEFILL       '_'         /*  used to fill Payee               */
  12. #define     DEPCLRFIL       "    "      /*  used to fill DEP and CLR         */
  13. #define     DEFCAT          ' '         /*  default category code            */
  14. #define     CLRCOM          "     "     /*  clear command display            */
  15.  
  16. #define     ENTRYSIZE       128         /*  max entries (see Entry)          */
  17. #define     PAYEESIZE       43          /*  max chars in Entry->payee        */
  18. #define     HASHSIZE        64          /*  size of abrev. hash table        */
  19. #define     FNAMSIZE        15          /*  max chars in Filename            */
  20. #define     CLRSIZE         384         /*  max records in CLR file          */
  21. #define     COLS            80          /*  number of screen columns         */
  22. #define     ROWS            24          /*  number of screen rows            */
  23. #define     HEAD            6           /*  number of heading rows           */
  24. #define     LAST            ( ROWS - HEAD - 1)
  25. #define     PAGE            ( ROWS - HEAD - 6)
  26. #define     BALCOL          ( COLS - 9) /*  where Balance display starts     */
  27. #define     AMTCOL          54          /*  where amount display starts      */
  28. #define     DLOOP           250         /*  loops for 100 msec on 4 MHz Z80  */
  29. #define     MAXDOLLAR       999         /*  max dollar entry (see edamount)  */
  30.  
  31. #define     MAXFIELD        8                /*  number of displayed fields  */
  32. #define     CLRFIELD        ( MAXFIELD - 1)  /*  Entry->clear field          */
  33. #define     DEPFIELD        ( MAXFIELD - 2)  /*  Entry->deposit field        */
  34. #define     AMTFIELD        ( MAXFIELD - 3)  /*  Entry->amount field         */
  35. #define     CATFIELD        ( MAXFIELD - 4)  /*  Entry->category field       */
  36. #define     PAYFIELD        ( MAXFIELD - 5)  /*  Entry->payee field          */
  37. #define     YYFIELD         ( MAXFIELD - 6)  /*  Entry->year field           */
  38. #define     DDFIELD         ( MAXFIELD - 7)  /*  Entry->date field           */
  39. #define     MMFIELD         ( MAXFIELD - 8)  /*  Entry->month field          */
  40.  
  41. #define     CTRLA           0x01        /*  ASCII definitions                */
  42. #define     CTRLB           0x02
  43. #define     CTRLC           0x03
  44. #define     CTRLD           0x04
  45. #define     CTRLE           0x05
  46. #define     CTRLF           0x06
  47. #define     CTRLG           0x07
  48. #define     BEL             0x07
  49. #define     CTRLH           0x08
  50. #define     BS              0x08
  51. #define     CTRLI           0x09
  52. #define     HT              0x09
  53. #define     CTRLJ           0x0a
  54. #define     LF              0x0a
  55. #define     CTRLK           0x0b
  56. #define     CTRLL           0x0c
  57. #define     FF              0x0c
  58. #define     CTRLM           0x0d
  59. #define     CR              0x0d
  60. #define     CTRLN           0x0e
  61. #define     CTRLO           0x0f
  62. #define     CTRLP           0x10
  63. #define     CTRLQ           0x11
  64. #define     CTRLR           0x12
  65. #define     CTRLS           0x13
  66. #define     CTRLT           0x14
  67. #define     CTRLU           0x15
  68. #define     CTRLV           0x16
  69. #define     CTRLW           0x17
  70. #define     CTRLX           0x18
  71. #define     CTRLY           0x19
  72. #define     CTRLZ           0x1a
  73. #define     CTRL_           0x1f
  74. #define     ESC             0x1b
  75. #define     DEL             0x7f
  76. #define     CTRLTOA         0x40        /*  offset CTRL to upper case alpha  */
  77.  
  78. #define     DEFNAM          "CHECKS."   /*  default filename                 */
  79. #define     SCRTYP          "SCR"       /*  screen controls/messages         */
  80. #define     DATTYP          "DAT"       /*  Entry data                       */
  81. #define     BAKTYP          "BAK"       /*  Entry data backup                */
  82. #define     CLRTYP          "CLR"       /*  cleared entries                  */
  83. #define     TMPTYP          "$$$"       /*  temporary CLR file               */
  84. #define     INFTYP          "INF"       /*  TITLE, ABREV, and AUTOM info     */
  85.  
  86. #define     NO              FALSE
  87. #define     YES             TRUE
  88.  
  89. #define     isprint( c)     !iscntrl( c)
  90. #define     FOREVER         for ( ; ; )                /*  loop forever      */
  91.  
  92. /*  define additional global variables and data structures                   */
  93.  
  94. struct calendar                         /*  month, day, year                 */
  95.     {
  96.     char mm, dd, yy;
  97.     } Today;
  98.  
  99. struct money                            /*  example:  $1234.56               */
  100.     {                                   /*      dollar = 12, cent = 3456     */
  101.     int dollar;                         /*  $/100 (range of signed int)      */
  102.     int cent;                           /*  $%100 + cents (-9999 to +9999)   */
  103.     } Memory, Balance[ ENTRYSIZE];
  104.  
  105. struct record                           /*  one entry                        */
  106.     {
  107.     struct calendar date;
  108.     char payee[ PAYEESIZE], category;
  109.     struct money amount;
  110.     char deposit, clear;
  111.     } Entry[ ENTRYSIZE], Entryundo;
  112.  
  113. #define     RECSIZ          ( sizeof( Entry[ 0]))
  114.  
  115. struct nlist                            /*  ref. K & R, p. 135               */
  116.     {
  117.     char *abrev, *fullname;
  118.     struct nlist *next;
  119.     } *Hashtab[ HASHSIZE], *install(), *lookup();
  120.  
  121. char *alloc(), *index(), *skipspace(), *strsave(), witch(), help();
  122. char putcommand(), putcntrl(), putnext();
  123. char eddate(), edamount(), eddeposit(), edclear(), edcategory(), edpayee();
  124.  
  125. char Modified, Ctrlyundo, Printing, Inserton;
  126. char Filename[ FNAMSIZE], Savpayee[ PAYEESIZE], Ftoc[ MAXFIELD];
  127. char Title[ COLS - FNAMSIZE - 2];       /*  (COLS-1) - (5+2+FNAMSIZE-5) + 1  */
  128.  
  129. int First, Last, Maxentry, Recno, Field, Oldfield, Character, Speed, Savrecno;
  130. int Dloop;
  131.  
  132. /*  the following global variables mimic WordStar cursor/screen controls     */
  133.  
  134. char Clead1[ 9], Clead2[ 5], Ctrail[ 5], Cb4flg, Linoff, Coloff, Ascur;
  135. char Eraeol[ 7], Lindel[ 7], Linins[ 7], Ivon[ 7], Ivoff[ 7], Trmini[ 9];
  136.  
  137. /*  The functions getchar(), ungetch( c), putchar( c), and kbhit() are defined
  138.  *  in xio.c to provide char I/O without BDOS interaction; therefore, ^C, ^S,
  139.  *  ^Q, and ^P will have no effect during console I/O.  For putchar( c), the
  140.  *  global variable _Outdev MUST be initialized to CONOUT for screen output;
  141.  *  _Outdev may be temporarily set to LSTOUT for printer output, then reset to
  142.  *  CONOUT.  For getchar() and ungetch( c), the global variable _Lastch MUST be
  143.  *  initialized to 0.  Note that getc( 0) may NOT be equivalent to getchar()
  144.  *  and putc( c, 1) may NOT be equivalent to putchar( c); however, each may be
  145.  *  expected to function normally (using BDOS).  The object file xio.crl MUST
  146.  *  be linked with the Check Register Program.
  147.  */
  148.  
  149. #define     CONOUT          4           /*  BIOS console output              */
  150. #define     LSTOUT          5           /*  BIOS list output                 */
  151. char        _Outdev;                    /*  global variable for putchar( c)  */
  152. char        _Lastch;                    /*  global for getchar()/ungetch()   */
  153.