| 1 | #ifndef CIFST_HPP |
|---|
| 2 | #define CIFST_HPP |
|---|
| 3 | |
|---|
| 4 | #include <cirec.hpp> |
|---|
| 5 | |
|---|
| 6 | #if USE_GDBFMT |
|---|
| 7 | #include <mffunc.hpp> |
|---|
| 8 | #include <iffunc.hpp> |
|---|
| 9 | #endif |
|---|
| 10 | |
|---|
| 11 | class _YOURCLASS FSTSTRU |
|---|
| 12 | { |
|---|
| 13 | public: |
|---|
| 14 | |
|---|
| 15 | int cifstfix; /* key %8ld %5d %4d %4d */ |
|---|
| 16 | int cifstfim; /* key %8ld w/ cifstfix */ |
|---|
| 17 | LONGX fst_error; /* gener - fst spec error */ |
|---|
| 18 | LONGX fst_errl; /* gener - fst spec line where error occured */ |
|---|
| 19 | char *fst_errp; /* gener - fst spec ptr where error occured */ |
|---|
| 20 | char *fst_fmtap; /* inter - default: no static format area */ |
|---|
| 21 | LONGX fst_fmtby; /* inter - bytes for dynamic format area */ |
|---|
| 22 | char fst_rdlm; /* inter - new occ delimiter */ |
|---|
| 23 | char *fst_batchup; /* inter - batchp for fldupdat() area */ |
|---|
| 24 | char *fst_batchp; /* inter - batchp for fldupdat() commands */ |
|---|
| 25 | int fst_batch0; /* inter - batchp ^mmfn^oocc^ccnt^l1/2 option */ |
|---|
| 26 | char fst_a351; /* inter - 351 */ |
|---|
| 27 | UCHR *fst_fbuff[2]; /* writbsiz */ |
|---|
| 28 | UWORD fst_fbsiz; |
|---|
| 29 | UWORD fst_fleft[2]; |
|---|
| 30 | UWORD fst_ffree[2]; |
|---|
| 31 | int fst_fd[2]; /* inter - file descriptor for .ln1/.ln2 */ |
|---|
| 32 | LONGX fst_fx[2]; /* inter - output records to .ln1/.ln2 */ |
|---|
| 33 | |
|---|
| 34 | char *fst_hdrp; /* inter - hit file headers - area */ |
|---|
| 35 | int fst_hdrx; /* inter - hit file headers - #bytes allocated */ |
|---|
| 36 | int fst_hdru; /* inter - hit file headers - #bytes used */ |
|---|
| 37 | int fst_hdrt; /* inter - hit file headers - for area+^m^t^o^c */ |
|---|
| 38 | |
|---|
| 39 | char *fst_wlupifnp; /* inter - word lookup I/F for TW processing */ |
|---|
| 40 | TRMSTRU *fst_wluptrmp; /* inter - word lookup I/F for TW processing */ |
|---|
| 41 | LONGX *fst_wlupitrm; /* inter - word lookup I/F for TW processing */ |
|---|
| 42 | |
|---|
| 43 | FST_CODE *fst_pgmp; // inter |
|---|
| 44 | char *fst_stwp; // inter |
|---|
| 45 | int fst_nstws; // inter |
|---|
| 46 | char *fst_area1p; // inter |
|---|
| 47 | LONGX fst_maxlk1; // inter |
|---|
| 48 | char *fst_area2p; // inter |
|---|
| 49 | LONGX fst_maxlk2; // inter |
|---|
| 50 | LONGX fst_qtylk1; // inter |
|---|
| 51 | LONGX fst_qtylk2; // inter |
|---|
| 52 | |
|---|
| 53 | char *fst_oarea1p; // inter |
|---|
| 54 | char *fst_oarea2p; // inter |
|---|
| 55 | LONGX fst_oqtylk1; // inter |
|---|
| 56 | LONGX fst_oqtylk2; // inter |
|---|
| 57 | |
|---|
| 58 | #if USE_GDBFMT |
|---|
| 59 | MST_FILE *fst_mst; |
|---|
| 60 | BTREE *fst_btree; |
|---|
| 61 | #endif |
|---|
| 62 | RECSTRU *fst_recp; |
|---|
| 63 | |
|---|
| 64 | CISISX *cisisxp; |
|---|
| 65 | |
|---|
| 66 | FSTSTRU (CISISX *parm_cisisxp, char *gidbnp, char *fstfile, char *stwfile, |
|---|
| 67 | #if USE_GDBFMT |
|---|
| 68 | MST_FILE *mst, BTREE *btree, |
|---|
| 69 | #endif |
|---|
| 70 | LONGX maxlk1,LONGX maxlk2,int instream=0, int stw_instream=0); |
|---|
| 71 | |
|---|
| 72 | ~FSTSTRU(void); |
|---|
| 73 | |
|---|
| 74 | char * xfst_loadfst(char *gidbnp,char *file,int instream=0); |
|---|
| 75 | char * xfst_loadstw(char *gidbnp,char *file, int *nstwsp, int instream=0); |
|---|
| 76 | |
|---|
| 77 | RECSTRU * xfst_getrecp(void); |
|---|
| 78 | void xfst_setrecp(RECSTRU *recp); |
|---|
| 79 | |
|---|
| 80 | char * xfst_batch(LONGX nbytes, int option); |
|---|
| 81 | |
|---|
| 82 | LONGX xfst_gener(char *fstspecp); |
|---|
| 83 | |
|---|
| 84 | LONGX xfst_inter(int bwcase=0); |
|---|
| 85 | |
|---|
| 86 | void xfst_free(void); |
|---|
| 87 | |
|---|
| 88 | int xfst_link(char *pfxp, |
|---|
| 89 | int plen, |
|---|
| 90 | char *keyp, |
|---|
| 91 | int klen, |
|---|
| 92 | LONGX mfn, |
|---|
| 93 | UWORD tag, |
|---|
| 94 | UWORD occ, |
|---|
| 95 | UWORD cnt, |
|---|
| 96 | char *lk1p, |
|---|
| 97 | char *lk2p, |
|---|
| 98 | LONGX *lft1, |
|---|
| 99 | LONGX *lft2); |
|---|
| 100 | |
|---|
| 101 | int xfst_writ(int treecase, |
|---|
| 102 | LONGX mfn, |
|---|
| 103 | UWORD tag, |
|---|
| 104 | UWORD occ, |
|---|
| 105 | UWORD cnt, |
|---|
| 106 | char *keyp, |
|---|
| 107 | int keylen, |
|---|
| 108 | UCHR *uctabp); |
|---|
| 109 | |
|---|
| 110 | int xfst_open(char *gidbnp, char *filnamp, |
|---|
| 111 | int treecase); |
|---|
| 112 | |
|---|
| 113 | int xfst_clos(int treecase); |
|---|
| 114 | |
|---|
| 115 | void xpstdecod(POSTSTRU *pst, |
|---|
| 116 | LONGX *mfn, |
|---|
| 117 | UWORD *tag, |
|---|
| 118 | UWORD *occ, |
|---|
| 119 | UWORD *cnt); |
|---|
| 120 | |
|---|
| 121 | void xprtlink(char *stubp, |
|---|
| 122 | LONGX pmfn, |
|---|
| 123 | UWORD ptag, |
|---|
| 124 | UWORD pocc, |
|---|
| 125 | UWORD pcnt, |
|---|
| 126 | UCHR *keyp, |
|---|
| 127 | int len); |
|---|
| 128 | |
|---|
| 129 | char * xloadmemstw(char *memp, |
|---|
| 130 | int *nstws); |
|---|
| 131 | |
|---|
| 132 | }; |
|---|
| 133 | |
|---|
| 134 | #endif // CIFST_HPP |
|---|
| 135 | |
|---|
| 136 | |
|---|