home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Utilities / amiCheck / Source / dataBaseFile.h < prev    next >
C/C++ Source or Header  |  1995-09-17  |  5KB  |  266 lines

  1. #ifndef DATABASEFILE_H
  2. #define DATABASEFILE_H
  3. /************************************************
  4. * dataBaseFile.h
  5. *
  6. *       This header defines old versions of 
  7. *    structures used in versions past.  They
  8. *    are kept here for compatability when converting
  9. *    old accounts to the new format.
  10. *
  11. *    The dataBaseFile.c routines use these structures
  12. *    to load and update structures.
  13. *
  14. ************************************************/
  15. #include <stdio.h>
  16. #include <libraries/guifront.h>
  17. #include <proto/guifront.h>
  18. #include <clib/exec_protos.h>
  19.  
  20. #define MAGICNUMOLD1    0xAAA1
  21. #define MAGICNUMOLD2    0xAAA2
  22. #define MAGICNUMOLD3    0xAAA3
  23. #define MAGICNUMOLD4    0xAAA4
  24. #define MAGICNUMOLD5    0xAAA5
  25. #define MAGICNUMOLD6    0xAAA6
  26. #define MAGICNUMOLD7    0xAAA7
  27. #define MAGICNUMOLD8    0xAAA8
  28. #define MAGICNUMOLD9    0xAAA9
  29. #define MAGICNUM    0xAAAA
  30.  
  31.  
  32. /* not an old structure but the private entry one */
  33. struct packit {
  34.     UWORD check;
  35.     amountType amount;
  36.     dateType date;
  37.     UBYTE type;
  38.     UBYTE flags;
  39.     UBYTE namesize;
  40.     UBYTE memosize;
  41.     /*UBYTE catsize;*/
  42.     UBYTE addr1size;
  43.     UBYTE addr2size;
  44.     UBYTE addr3size;
  45.     UBYTE addr4size;
  46.     UBYTE numBudgets;
  47. };
  48.  
  49. /* taxVariables */
  50. struct netInfoVarsAAA9 {
  51.     ULONG taxdeductcurr;
  52.     ULONG taxdeductstate;
  53.     ULONG currbal;
  54.     ULONG statebal;
  55. };
  56.  
  57. /* state variables */
  58. struct stateVarsAAA9 {
  59.     ULONG currDollar;
  60.     UBYTE currCent;
  61.     UWORD currTemplate;
  62.     ULONG stateDollar;
  63.     UBYTE stateCent;
  64.     UWORD currCheckNumber;
  65. };
  66.  
  67. /* private file format structure */
  68. struct packitAAA9 {
  69.     UWORD check;
  70.     USHORT year;
  71.     ULONG dollar;
  72.     UBYTE type;
  73.     UBYTE day,month;
  74.     UBYTE cent;
  75.     UBYTE flags;
  76.     UBYTE namesize;
  77.     UBYTE memosize;
  78.     UBYTE catsize;
  79. };
  80.  
  81. /* an item node */
  82. typedef struct {
  83.         struct  MinNode node;
  84.     WORD    type;
  85.         
  86.         UWORD   check;
  87.         char    name[STRINGSIZE];
  88.         char    memo[STRINGSIZE];
  89.  
  90.     BYTE    day;
  91.     BYTE    month;
  92.     USHORT    year;
  93.                     
  94.         ULONG   amnt_dollar;
  95.         BYTE    amnt_cent;
  96.         
  97.     UBYTE    flags;
  98.         
  99.     char     category[CATNAMESIZE];
  100.     
  101. } entryNodeAAA9;
  102.  
  103. typedef struct {
  104.     struct Node node;
  105.         char    tempname[TEMPNAMESIZE];
  106.         entryNodeAAA9 template;
  107. } templateNodeAAA9;
  108.  
  109. /* networth structure */
  110. typedef struct {
  111.     struct Node node;
  112.     char acname[100];
  113.     amountType currbal;
  114.     amountType statebal;
  115.     amountType taxdeductcurr;
  116.     amountType taxdeductstate;
  117.     char actype;
  118. } netNodeAAA9;
  119.  
  120. /* filter settings */
  121. typedef struct {
  122.  
  123.     /* types */
  124.     BOOL    checks;
  125.     BOOL    withdrawals;
  126.     BOOL    deposits;
  127.  
  128.     /* type state(s) */
  129.     UBYTE    andflag;    /* AND set */
  130.     UBYTE    notflag;    /* NOT set */
  131.  
  132.     /* ranges */
  133.     UBYTE    checkrange; /* flag ->0, 1=in, 2=out */
  134.     UWORD    checkfrom;
  135.     UWORD    checkto;
  136.  
  137.     UBYTE    amntrange; /* flag -> 0, 1=in, 2=out */
  138.     ULONG    dollarfrom;
  139.     UBYTE    centfrom;
  140.     ULONG    dollarto;
  141.     UBYTE    centto;
  142.  
  143.     UBYTE    daterange; /* flag -> 0, 1=in, 2=out */
  144.     BYTE    dayfrom;
  145.     BYTE    monthfrom;
  146.     USHORT    yearfrom;
  147.     BYTE    dayto;
  148.     BYTE    monthto;
  149.     USHORT    yearto;      
  150.  
  151.     /* budget */
  152.     UBYTE    usecategory; /* flags -> 0, 1=in, 2=out */
  153.     UBYTE    category[CATNAMESIZE+1];
  154.  
  155.     /* storage */
  156.     UBYTE    printcode, taxcode, voidcode, reconcilecode, clearcode;    
  157.  
  158. } filterSettingAAA1;
  159.  
  160. typedef struct {
  161.  
  162.     /* types */
  163.     BOOL    checks;
  164.     BOOL    withdrawals;
  165.     BOOL    deposits;
  166.  
  167.     /* type state(s) */
  168.     UBYTE    andflag;    /* AND set */
  169.     UBYTE    notflag;    /* NOT set */
  170.  
  171.     /* ranges */
  172.     UBYTE    checkrange; /* flag ->0, 1=in, 2=out */
  173.     UWORD    checkfrom;
  174.     UWORD    checkto;
  175.  
  176.     UBYTE    amntrange; /* flag -> 0, 1=in, 2=out */
  177.     ULONG    dollarfrom;
  178.     UBYTE    centfrom;
  179.     ULONG    dollarto;
  180.     UBYTE    centto;
  181.  
  182.     UBYTE    daterange; /* flag -> 0, 1=in, 2=out */
  183.     BYTE    dayfrom;
  184.     BYTE    monthfrom;
  185.     USHORT    yearfrom;
  186.     BYTE    dayto;
  187.     BYTE    monthto;
  188.     USHORT    yearto; 
  189.  
  190.     /* budget */
  191.     UBYTE    usecategory; /* flags -> 0, 1=in, 2=out */
  192.     UBYTE    category[CATNAMESIZE+1];
  193.  
  194.     /* storage */
  195.     UBYTE    printcode, taxcode, voidcode, reconcilecode, clearcode;    
  196.  
  197.     /* fields */
  198.     UBYTE    usepayee, usememo;
  199.     char     payee[STRINGSIZE+1], memo[STRINGSIZE+1];
  200.     char    payeetoken[STRINGSIZE*2 + 2], memotoken[STRINGSIZE*2+2];
  201.  
  202. } filterSettingAAA9;
  203.  
  204. /* account global info structure */
  205. typedef struct {
  206.     char accnt[STRINGSIZE];
  207.     char bank[STRINGSIZE];
  208.     char holder[STRINGSIZE];
  209.  
  210.     BOOL    negative;
  211.     ULONG    begindollar;
  212.     UBYTE    begincent;
  213.  
  214.     BYTE    openday;
  215.     BYTE    openmonth;
  216.     USHORT    openyear;
  217.  
  218.     BOOL    closed;
  219.     BYTE    closeday;
  220.     BYTE    closemonth;
  221.     USHORT    closeyear;
  222.  
  223.     UWORD    checknumber;
  224. } accntStateAAA9;
  225.  
  226. /* search criteria structure */
  227. typedef struct {
  228.     BOOL     check;
  229.     UWORD    checknum;
  230.  
  231.     BOOL    memo;
  232.     char    memostr[STRINGSIZE];
  233.     char     memostrtoken[STRINGSIZE*2 + 2];
  234.  
  235.     BOOL    name;
  236.     char    namestr[STRINGSIZE];
  237.     char     namestrtoken[STRINGSIZE*2 + 2];
  238.  
  239.     BOOL    amnt;
  240.     ULONG    dollar;
  241.     UBYTE    cent;
  242.  
  243.     BOOL    date;
  244.     USHORT    year;
  245.     UBYTE    day;
  246.     UBYTE    month;
  247.  
  248.     BOOL    category;
  249.     char    catstr[CATNAMESIZE];
  250.     char    catstrtoken[CATNAMESIZE*2 + 2];
  251.  
  252.     LONG    lastrow;
  253. } searchStateAAA9;
  254.  
  255.  
  256. /* prototypes */
  257. DataReadTaxVars(UWORD, int, struct netInfoVars *);
  258. DataReadFilterSetting(UWORD, int, filterSetting *);
  259. DataReadSearchControl(UWORD,int,searchState *);
  260. DataReadAccountInfo(UWORD, int, accntState *);
  261. DataReadTemplate(UWORD , int , templateNode *);
  262. DataReadEntry(UWORD, int, entryNode *);
  263. DataReadStateVars(UWORD, int, struct stateVars *);
  264.  
  265. #endif
  266.