| 1 | #ifndef CIDBX_HPP |
|---|
| 2 | #define CIDBX_HPP |
|---|
| 3 | |
|---|
| 4 | //#include <cisis.hpp> |
|---|
| 5 | #include <cisisx.hpp> |
|---|
| 6 | #include <string.h> |
|---|
| 7 | |
|---|
| 8 | #ifndef ErrorCode |
|---|
| 9 | #define ErrorCode long |
|---|
| 10 | #endif // ErrorCode |
|---|
| 11 | |
|---|
| 12 | #ifndef TRUE |
|---|
| 13 | # define TRUE 1 |
|---|
| 14 | #endif // TRUE |
|---|
| 15 | |
|---|
| 16 | #ifndef FALSE |
|---|
| 17 | # define FALSE 0 |
|---|
| 18 | #endif // FALSE |
|---|
| 19 | |
|---|
| 20 | #define ERRMESLEN 256 // Error message lenght. |
|---|
| 21 | |
|---|
| 22 | class Fatal // Exception handling. |
|---|
| 23 | { |
|---|
| 24 | public: |
|---|
| 25 | |
|---|
| 26 | ErrorCode Fa_ECode; // Error code. |
|---|
| 27 | LONGX Fa_Abort; // Abort the execution. (yes=1, no=0) |
|---|
| 28 | char Fa_EMess[ERRMESLEN]; // Error message. |
|---|
| 29 | char Fa_AuxEMess[ERRMESLEN]; // Auxiliary error message. |
|---|
| 30 | |
|---|
| 31 | Fatal (void) |
|---|
| 32 | { |
|---|
| 33 | Fa_ECode = Fa_Abort = 0; |
|---|
| 34 | |
|---|
| 35 | *Fa_EMess='\0'; |
|---|
| 36 | *Fa_AuxEMess='\0'; |
|---|
| 37 | } |
|---|
| 38 | |
|---|
| 39 | LONGX Fa_Fill (ErrorCode ecode, |
|---|
| 40 | char *emess, |
|---|
| 41 | LONGX abort = FALSE, |
|---|
| 42 | char *auxemess = "") |
|---|
| 43 | { |
|---|
| 44 | if (!auxemess || *auxemess == '\0') |
|---|
| 45 | strcpy (Fa_EMess, emess); |
|---|
| 46 | else |
|---|
| 47 | { |
|---|
| 48 | sprintf (Fa_AuxEMess, " ->\n%s", auxemess); |
|---|
| 49 | strcpy (Fa_EMess, emess); |
|---|
| 50 | strcat (Fa_EMess, Fa_AuxEMess); |
|---|
| 51 | } |
|---|
| 52 | |
|---|
| 53 | Fa_Abort = abort; |
|---|
| 54 | *Fa_AuxEMess = '\0'; |
|---|
| 55 | return (Fa_ECode = ecode); |
|---|
| 56 | } |
|---|
| 57 | }; |
|---|
| 58 | /* bode da dll_utl.hpp ... */ |
|---|
| 59 | |
|---|
| 60 | class _YOURCLASS DBXSTRU //: public CISIS |
|---|
| 61 | { |
|---|
| 62 | public: |
|---|
| 63 | |
|---|
| 64 | char dbxname[CIMPL+1]; /* dbname + .ext + NULL */ |
|---|
| 65 | int dbxxropn; /* =dbxopen(.xrf) */ |
|---|
| 66 | int dbxmsopn; /* =dbxopen(.mst) */ |
|---|
| 67 | int dbxxropw; /* dbxopenw/w(.xrf) */ |
|---|
| 68 | int dbxmsopw; /* dbxopenw/w(.mst) */ |
|---|
| 69 | int dbxmsopv; /* dbxflock/dbxulock(.mst) */ |
|---|
| 70 | XRSTRU *dbxxribp; /* ptr .xrf ibuf */ |
|---|
| 71 | MSSTRU *dbxmsibp; /* ptr .mst ibuf */ |
|---|
| 72 | #if GIPAR |
|---|
| 73 | char *dbxgicip; /* .par contents */ |
|---|
| 74 | #endif |
|---|
| 75 | #if DBXMSTXL |
|---|
| 76 | int dbxmstxl; /* extended .mst capacity */ |
|---|
| 77 | #endif |
|---|
| 78 | int dbxmflush; /* mstflush() flag */ |
|---|
| 79 | int dbxmclose; /* mstclose() flag */ |
|---|
| 80 | int dbxiflush; /* invflush() flag */ |
|---|
| 81 | #if MULTI |
|---|
| 82 | int dbxnetws; /* type of network support */ |
|---|
| 83 | int dbxdelxx; /* flag data entry lock */ |
|---|
| 84 | int dbxewlxx; /* flag exclusive write lock */ |
|---|
| 85 | int dbxmxtmp; /* mx() tmpseq master file */ |
|---|
| 86 | #endif |
|---|
| 87 | LONGX dbxmsmfn; /* mstsetup() .mst nxtmfn */ |
|---|
| 88 | INVMAP *dbxifmap; /* .cnt, .n0x, .l0x, .ifp */ |
|---|
| 89 | void *dbxifupp; /* CIIFU_PROCX_SOURCE */ |
|---|
| 90 | #if 1 /* SAMEL */ |
|---|
| 91 | int dbxiflxx; /* dbx samel */ |
|---|
| 92 | #endif |
|---|
| 93 | char *dbxxryyp; /* all .xrf blocks */ |
|---|
| 94 | char *dbxmsyyp; /* all .mst blocks */ |
|---|
| 95 | #if RECGIZM |
|---|
| 96 | VGIZPSTRU *dbxvgzrp; /* gizmo processing */ |
|---|
| 97 | #endif |
|---|
| 98 | #if RECXPND |
|---|
| 99 | int dbxxpn01; /* expand processing */ |
|---|
| 100 | int dbxxpn02; /* expand processing */ |
|---|
| 101 | #endif |
|---|
| 102 | #if RECDECO |
|---|
| 103 | VDECPSTRU *dbxvderp; /* decod processing */ |
|---|
| 104 | #endif |
|---|
| 105 | #if IFUPDATE |
|---|
| 106 | int dbxiinit; /* ifupdat() init */ |
|---|
| 107 | int dbxitrac; /* ifupdat() trace parameter */ |
|---|
| 108 | LONGX dbxitell; /* ifupdat() tell parameter */ |
|---|
| 109 | LONGX dbxirang; /* ifupdat() tell parameter */ |
|---|
| 110 | LONGX dbxirecs; /* ifupdat() records updated */ |
|---|
| 111 | LONGX dbxipadd[2]; /* ifupdat() added lk1/lk2 posts */ |
|---|
| 112 | LONGX dbxipdel[2]; /* ifupdat() deleted lk1/lk2 posts */ |
|---|
| 113 | #endif |
|---|
| 114 | CISISX *cisisxp; |
|---|
| 115 | |
|---|
| 116 | DBXSTRU(CISISX *parm_cisixp); |
|---|
| 117 | |
|---|
| 118 | #if MULTI |
|---|
| 119 | //int xdbxcinet(char *dbnamp); |
|---|
| 120 | |
|---|
| 121 | int xdbxflock(DBXSTRU *dbxp, |
|---|
| 122 | char *typ); |
|---|
| 123 | |
|---|
| 124 | int xdbxulock(DBXSTRU *dbxp, |
|---|
| 125 | char *typ); |
|---|
| 126 | |
|---|
| 127 | /* int xdbxilock(DBXSTRU *dbxp, |
|---|
| 128 | char *mdbnp, |
|---|
| 129 | char *typ); |
|---|
| 130 | */ |
|---|
| 131 | int xdbxwlock(DBXSTRU *dbxp, |
|---|
| 132 | char *m0p, |
|---|
| 133 | int times); |
|---|
| 134 | #endif |
|---|
| 135 | |
|---|
| 136 | //void xdbxinit(void); |
|---|
| 137 | |
|---|
| 138 | //DBXSTRU *xdbxstorp(char *dbnamp); |
|---|
| 139 | |
|---|
| 140 | //DBXSTRU *xdbxsrchp(char *dbnamp); |
|---|
| 141 | |
|---|
| 142 | //int xdbxopen(char *gidbnp, |
|---|
| 143 | // char *dbname, |
|---|
| 144 | // char *extp); |
|---|
| 145 | |
|---|
| 146 | //int xdbxopenw(char *gidbnp, |
|---|
| 147 | // char *dbname, |
|---|
| 148 | // char *extp, |
|---|
| 149 | // int *opnp, |
|---|
| 150 | // int *opwp, |
|---|
| 151 | // char *errmsgp); |
|---|
| 152 | |
|---|
| 153 | //char *xdbxopenc(char *gidbnp, |
|---|
| 154 | // char *filnamp, |
|---|
| 155 | // int *opnp, |
|---|
| 156 | // int *opwp, |
|---|
| 157 | // char *errmsgp, int xcreate, int xappend); |
|---|
| 158 | |
|---|
| 159 | // static void xfatal(char *msg); |
|---|
| 160 | |
|---|
| 161 | void xdbxflush(char *dbnamp); |
|---|
| 162 | |
|---|
| 163 | void xmstflush(char *dbnamp); |
|---|
| 164 | |
|---|
| 165 | void xmstclose(DBXSTRU *dbxp); |
|---|
| 166 | |
|---|
| 167 | //#if RECGIZM |
|---|
| 168 | // void xgizflush(VGIZPSTRU *vgizmap); |
|---|
| 169 | //#endif |
|---|
| 170 | |
|---|
| 171 | //#if RECDECO |
|---|
| 172 | // void xdecflush(VDECPSTRU *vdecmap); |
|---|
| 173 | //#endif |
|---|
| 174 | |
|---|
| 175 | INVMAP *xdbxinvmp(DBXSTRU *dbxp); |
|---|
| 176 | |
|---|
| 177 | void xinvclose(DBXSTRU *dbxp); |
|---|
| 178 | |
|---|
| 179 | void xinvflush(char *dbnamp); |
|---|
| 180 | |
|---|
| 181 | //char *xloadfile(char *gidbnp, |
|---|
| 182 | // char at, |
|---|
| 183 | // char *atp, |
|---|
| 184 | // char *areap, |
|---|
| 185 | // LONGX asize, |
|---|
| 186 | // char lf2x); |
|---|
| 187 | |
|---|
| 188 | //char *xloadstw(char *gidbnp, |
|---|
| 189 | // char *atp, |
|---|
| 190 | // char *areap, |
|---|
| 191 | // LONGX asize, |
|---|
| 192 | // int *nstws); |
|---|
| 193 | |
|---|
| 194 | //void xdbxciset(void); |
|---|
| 195 | |
|---|
| 196 | //char *xdbxcipar(char *gidbnp, |
|---|
| 197 | // char *argkey, |
|---|
| 198 | // char argchar); |
|---|
| 199 | |
|---|
| 200 | //#if GIPAR |
|---|
| 201 | //char *xdbxgipar(char *gidbnp, |
|---|
| 202 | // char *gikeyp, |
|---|
| 203 | // int *namlenp, |
|---|
| 204 | // int *extlenp); |
|---|
| 205 | //#endif |
|---|
| 206 | |
|---|
| 207 | #if GEN_CORELEFT |
|---|
| 208 | unsigned LONGX xcoreleft(void); |
|---|
| 209 | #endif |
|---|
| 210 | |
|---|
| 211 | #if GEN_LABS |
|---|
| 212 | static long xlabs(long x); |
|---|
| 213 | #endif |
|---|
| 214 | |
|---|
| 215 | #if GEN_STRSTR |
|---|
| 216 | static char *xstrstr (CONST char *p1, |
|---|
| 217 | CONST char *p2); |
|---|
| 218 | #endif |
|---|
| 219 | |
|---|
| 220 | #if GEN_STRUPR |
|---|
| 221 | static char *xstrupr (char* p); |
|---|
| 222 | #endif |
|---|
| 223 | |
|---|
| 224 | #if GEN_STRREV |
|---|
| 225 | static char *xstrrev (char *p); |
|---|
| 226 | #endif |
|---|
| 227 | |
|---|
| 228 | #if GEN_MEMICMP |
|---|
| 229 | static int xmemicmp(CONST void *s1, |
|---|
| 230 | CONST void *s2, |
|---|
| 231 | size_t n); |
|---|
| 232 | #endif |
|---|
| 233 | |
|---|
| 234 | int xfpccreat(char *gidbnp, |
|---|
| 235 | char *namp, |
|---|
| 236 | char *extp, |
|---|
| 237 | int lrecl); |
|---|
| 238 | |
|---|
| 239 | void xfpcwrite(char *recbufp, |
|---|
| 240 | FFI reclen); |
|---|
| 241 | |
|---|
| 242 | void xfpcclose(void); |
|---|
| 243 | |
|---|
| 244 | //char *xdbxtmpnm(char *dirtmp, |
|---|
| 245 | // int strip, |
|---|
| 246 | // char *filnamp); |
|---|
| 247 | |
|---|
| 248 | char *xcicopyr(char *namep); |
|---|
| 249 | |
|---|
| 250 | }; |
|---|
| 251 | |
|---|
| 252 | #endif //CIDBX_HPP |
|---|