| 1 | /* *********************************************************** |
|---|
| 2 | CISIS.H |
|---|
| 3 | |
|---|
| 4 | CISIS application programs and functions include CISIS.H |
|---|
| 5 | as their main header file. |
|---|
| 6 | |
|---|
| 7 | CISIS application programs include CIRUN.H, providing |
|---|
| 8 | the CISIS Interface run time pointers, control variables |
|---|
| 9 | and other CISIS application mandatory areas. |
|---|
| 10 | |
|---|
| 11 | Please replace ciaot.h to cirun.h in include statements |
|---|
| 12 | of existing CISIS Interface applications. |
|---|
| 13 | |
|---|
| 14 | AOT, August 19, 1992. |
|---|
| 15 | |
|---|
| 16 | CISIS Interface v3.20 supports MicroISIS dbn.par file. |
|---|
| 17 | It might be necessary to change existing CISIS applications |
|---|
| 18 | to add a data base name parameter - to get a dbn.par file - |
|---|
| 19 | in the following functions: dbxopen(), dbxcipar(), |
|---|
| 20 | loadfile() and loadstw(). |
|---|
| 21 | |
|---|
| 22 | AOT, March 6, 1996. |
|---|
| 23 | |
|---|
| 24 | *********************************************************** */ |
|---|
| 25 | |
|---|
| 26 | |
|---|
| 27 | #ifndef CISIS_H |
|---|
| 28 | #define CISIS_H |
|---|
| 29 | |
|---|
| 30 | /* ***************************************************** |
|---|
| 31 | CISIS environment |
|---|
| 32 | ***************************************************** */ |
|---|
| 33 | |
|---|
| 34 | #define GCC 01 |
|---|
| 35 | #if GCCx |
|---|
| 36 | #ifndef PACKED |
|---|
| 37 | #define PACKED __attribute__ ((aligned(2),packed)) |
|---|
| 38 | #endif |
|---|
| 39 | #endif |
|---|
| 40 | |
|---|
| 41 | #define PC 0 |
|---|
| 42 | #define DOS32BITS 0 |
|---|
| 43 | #define MSC 0 |
|---|
| 44 | #define VAX 0 |
|---|
| 45 | #define MPE 0 |
|---|
| 46 | #define UNIX 01 |
|---|
| 47 | #define SUN 0 |
|---|
| 48 | #define UNISYS 0 |
|---|
| 49 | #define UNISYSGDB 0 |
|---|
| 50 | #define UNISYSCPU 0 |
|---|
| 51 | #define INTELCPU 1 |
|---|
| 52 | #define BRME 0 |
|---|
| 53 | #define BRMXCPU 0 |
|---|
| 54 | #define CDCS4320 0 |
|---|
| 55 | |
|---|
| 56 | #define CNV_PCFILES 0 /* Standard MicroISIS PC format conversion */ |
|---|
| 57 | #define CNV_PCBINUM 0 /* PC data representation (swapped) conversion */ |
|---|
| 58 | |
|---|
| 59 | #define PCREADLINUX 0 /* Read Linux's M/F in PC */ |
|---|
| 60 | |
|---|
| 61 | #ifdef CIAPI_SOURCE |
|---|
| 62 | #define CICPP 1 /* CISIS CPP preprocessor */ |
|---|
| 63 | #endif |
|---|
| 64 | #ifdef ISIS_DLL |
|---|
| 65 | #define CICPP 1 /* CISIS CPP preprocessor */ |
|---|
| 66 | #endif |
|---|
| 67 | #ifdef CI_WINISIS |
|---|
| 68 | #define CICPP 1 /* CISIS CPP preprocessor */ |
|---|
| 69 | #endif |
|---|
| 70 | #ifndef CICPP |
|---|
| 71 | #define CICPP 0 /* CISIS CPP preprocessor */ |
|---|
| 72 | #endif |
|---|
| 73 | |
|---|
| 74 | #if CICPP |
|---|
| 75 | #ifndef USE_GDBFMT |
|---|
| 76 | #ifdef CI_WINISIS |
|---|
| 77 | #define USE_GDBFMT 1 /* CICPP/FST+IFU with GDB New FORMAT Release 2 */ |
|---|
| 78 | #else |
|---|
| 79 | #define USE_GDBFMT 0 /* CICPP/FST+IFU with CISIS FORMAT */ |
|---|
| 80 | #endif |
|---|
| 81 | #endif |
|---|
| 82 | #endif /* CICPP */ |
|---|
| 83 | |
|---|
| 84 | #if CICPP |
|---|
| 85 | #ifndef MAXNDBX |
|---|
| 86 | #if BEFORE990318 |
|---|
| 87 | #define MAXNDBX 256L /* maximum #entries in vdbxp[] */ |
|---|
| 88 | #else |
|---|
| 89 | #define MAXNDBX 2048L /* maximum #entries in vdbxp[] */ |
|---|
| 90 | #endif /* BEFORE990318 */ |
|---|
| 91 | #endif |
|---|
| 92 | #endif /* CICPP */ |
|---|
| 93 | |
|---|
| 94 | #if UNISYS || UNISYSCPU |
|---|
| 95 | #define ISISUNISYS 1 |
|---|
| 96 | #endif |
|---|
| 97 | |
|---|
| 98 | #if PC || VAX || GCC || (UNISYS && !UNISYSGDB) |
|---|
| 99 | #define ANSI 1 |
|---|
| 100 | #endif |
|---|
| 101 | |
|---|
| 102 | #if PC /* || VAX */ |
|---|
| 103 | #define CRLF 1 |
|---|
| 104 | #else |
|---|
| 105 | #define CRLF 0 |
|---|
| 106 | #endif |
|---|
| 107 | |
|---|
| 108 | #if PC || VAX || UNISYSCPU || INTELCPU || SUN |
|---|
| 109 | #define SWAPPED 1 |
|---|
| 110 | #endif |
|---|
| 111 | |
|---|
| 112 | #ifdef PACKED |
|---|
| 113 | #define ISPACKED 1 |
|---|
| 114 | #else |
|---|
| 115 | #if SWAPPED |
|---|
| 116 | #if !UNIX /*#if PC || VAX*/ |
|---|
| 117 | #define ISPACKED 1 |
|---|
| 118 | #endif /* !UNIX */ |
|---|
| 119 | #endif |
|---|
| 120 | #define PACKED |
|---|
| 121 | #endif |
|---|
| 122 | |
|---|
| 123 | #if MPE || VAX || UNIX |
|---|
| 124 | #define O_BINARY 0 |
|---|
| 125 | #define O_DENYNONE 0 |
|---|
| 126 | #endif |
|---|
| 127 | |
|---|
| 128 | #if SUN |
|---|
| 129 | #define SUNBUG_UNSIGNED 1 /* cannot test if link records have sorted postings */ |
|---|
| 130 | #if GCC |
|---|
| 131 | #define SUNBUG_GCC1 1 /* cannot access node just read in noderead() */ |
|---|
| 132 | #endif |
|---|
| 133 | #endif /* SUN */ |
|---|
| 134 | |
|---|
| 135 | |
|---|
| 136 | /* ***************************************************** |
|---|
| 137 | CISIS configuration |
|---|
| 138 | ***************************************************** */ |
|---|
| 139 | |
|---|
| 140 | #define UC_EXTENSION ISISUNISYS /* ISIS/UNISYS upper case .extension */ |
|---|
| 141 | #define LINK_7544KEY ISISUNISYS /* ISIS/UNISYS fixed-length link */ |
|---|
| 142 | #define MST0FILL0XFF ISISUNISYS /* ISIS/UNISYS .mst 1st block filler */ |
|---|
| 143 | |
|---|
| 144 | #if !CICPP |
|---|
| 145 | #ifndef CIAPI |
|---|
| 146 | #define CIAPI 0 /* para compilar aplicacoes em C que usem CIAPI */ |
|---|
| 147 | #endif |
|---|
| 148 | #if CIAPI |
|---|
| 149 | #ifndef TLS |
|---|
| 150 | #define TLS 0 /* setar 1 para compilar zserver em windows-95 */ |
|---|
| 151 | #endif |
|---|
| 152 | #endif |
|---|
| 153 | #endif |
|---|
| 154 | #ifndef CIB71 |
|---|
| 155 | #define CIB71 1 /* CISIS Rosnier Mijares Valdes' search function */ |
|---|
| 156 | #endif |
|---|
| 157 | #ifndef CIB64 |
|---|
| 158 | #define CIB64 0 /* cib62 using ISIS I/F */ |
|---|
| 159 | #endif |
|---|
| 160 | #ifndef CDMDL |
|---|
| 161 | #define CDMDL 0 /* BRM CD-ROM Retrieval Interface */ |
|---|
| 162 | #endif |
|---|
| 163 | #ifndef WWWISIS |
|---|
| 164 | #define WWWISIS 00 |
|---|
| 165 | #endif /* WWWISIS */ |
|---|
| 166 | #define BIGREC 0 /* BRM CD-ROM Retrieval Interface */ |
|---|
| 167 | #ifndef LINDLUX |
|---|
| 168 | #define LINDLUX 0 /* ifupd2 */ |
|---|
| 169 | #endif |
|---|
| 170 | #define DBXMSTXL 1 /* extended .mst capacity */ |
|---|
| 171 | #if !EXCFMCGI |
|---|
| 172 | #define CICGI 1 /* cicgi0/cicgi1 */ |
|---|
| 173 | #endif |
|---|
| 174 | #if CICPP |
|---|
| 175 | #define FATRAP 0 /* fatal() trapping */ |
|---|
| 176 | #else /* CICPP */ |
|---|
| 177 | #define FATRAP 1 /* fatal() trapping */ |
|---|
| 178 | #endif /* CICPP */ |
|---|
| 179 | |
|---|
| 180 | #ifndef CIFFI |
|---|
| 181 | #define CIFFI 0 /* size-t mfrl/base/pos/len */ |
|---|
| 182 | #endif |
|---|
| 183 | #ifndef CIWTF |
|---|
| 184 | #if !CICPP |
|---|
| 185 | #if !CIAPI |
|---|
| 186 | #if GCC |
|---|
| 187 | #if CIFFI |
|---|
| 188 | #define CIWTF 1 /* WTFUN support */ |
|---|
| 189 | #else |
|---|
| 190 | #define CIWTF 0 /* WTFUN support */ |
|---|
| 191 | #endif |
|---|
| 192 | #endif /* GCC */ |
|---|
| 193 | #endif /* CIAPI */ |
|---|
| 194 | #endif /* CICPP */ |
|---|
| 195 | #endif |
|---|
| 196 | |
|---|
| 197 | |
|---|
| 198 | #if !CDMDL |
|---|
| 199 | |
|---|
| 200 | #ifndef LIND |
|---|
| 201 | #if CIFFI |
|---|
| 202 | #define LIND 1 /* MY: must be off */ |
|---|
| 203 | #else |
|---|
| 204 | #define LIND 0 /* MY: must be off */ |
|---|
| 205 | #endif |
|---|
| 206 | #endif |
|---|
| 207 | #ifndef ISISXL |
|---|
| 208 | #if CIFFI || LIND |
|---|
| 209 | #define ISISXL 1 /* Large keys - standard for CIFFI */ |
|---|
| 210 | #else |
|---|
| 211 | #define ISISXL 00 /* Large keys */ |
|---|
| 212 | #endif |
|---|
| 213 | #endif |
|---|
| 214 | #ifndef ISISXL512 |
|---|
| 215 | #define ISISXL512 00 /* very Large keys */ |
|---|
| 216 | #endif |
|---|
| 217 | #ifndef CNLI |
|---|
| 218 | #define CNLI 1 /* MY: must be off */ |
|---|
| 219 | #endif |
|---|
| 220 | #define ZTREE 1 /* MY: must be off */ |
|---|
| 221 | #define SAMEL 0 /* MY: must be off */ |
|---|
| 222 | |
|---|
| 223 | #ifndef CI_WINISIS |
|---|
| 224 | #define RECGIZM 1 /* CIGIZ */ |
|---|
| 225 | #define RECXPND 0 /* MX: putdir/getdir */ |
|---|
| 226 | #define RECDECO 1 /* DEC */ |
|---|
| 227 | #endif |
|---|
| 228 | #define GEN_ISI 1 /* enable iso_open()/iso_read() */ |
|---|
| 229 | #define GEN_UTL 1 /* enable except loaductb() */ |
|---|
| 230 | |
|---|
| 231 | #define INVXBOOL (LIND || CIB64 || CIB71) /* 0 */ /* Bx0 use several inverted files */ |
|---|
| 232 | #define TW_BOOL 0 /* Bx0 multiple ifp's for text word */ |
|---|
| 233 | |
|---|
| 234 | #define CIPAR 1 /* dbxcipfp & dbxcdcip processing */ |
|---|
| 235 | #define CIPARIC 0 /* CIPAR ignore case */ |
|---|
| 236 | #ifdef ISIS_DLL |
|---|
| 237 | #define GIPAR 1 /* dbn.par & dbxgicip processing */ |
|---|
| 238 | #endif |
|---|
| 239 | #ifdef CI_WINISIS |
|---|
| 240 | #define GIPAR 1 /* dbn.par & dbxgicip processing */ |
|---|
| 241 | #endif |
|---|
| 242 | #ifndef GIPAR |
|---|
| 243 | #define GIPAR 0 /* dbn.par & dbxgicip processing */ |
|---|
| 244 | #endif |
|---|
| 245 | |
|---|
| 246 | #define MULTI 1 /* Multi-user operation */ |
|---|
| 247 | #define IFUPDATE 1 /* Inverted file update */ |
|---|
| 248 | #define MFUPDATE 1 /* Master file update */ |
|---|
| 249 | |
|---|
| 250 | #else /* CDMDL */ |
|---|
| 251 | |
|---|
| 252 | #define ISISXL 1 /* Large keys */ |
|---|
| 253 | #define LIND 1 /* MY: must be off */ |
|---|
| 254 | #define CNLI 1 /* MY: must be off */ |
|---|
| 255 | #define ZTREE 1 /* MY: must be off */ |
|---|
| 256 | #define SAMEL 0 /* MY: must be off */ |
|---|
| 257 | |
|---|
| 258 | #define RECGIZM 1 /* CIGIZ */ |
|---|
| 259 | #define RECXPND 0 /* MX: putdir/getdir */ |
|---|
| 260 | #define RECDECO 1 /* DEC */ |
|---|
| 261 | #define GEN_ISI 1 /* enable iso_open()/iso_read() */ |
|---|
| 262 | #define GEN_UTL 1 /* enable except loaductb() */ |
|---|
| 263 | |
|---|
| 264 | #define INVXBOOL 1 /* Bx0 use several inverted files */ |
|---|
| 265 | #define TW_BOOL 0 /* Bx0 multiple ifp's for text word */ |
|---|
| 266 | |
|---|
| 267 | #define CIPAR 1 /* dbxcipfp & dbxcdcip processing */ |
|---|
| 268 | #define CIPARIC 0 /* CIPAR ignore case */ |
|---|
| 269 | #define GIPAR 0 /* dbn.par & dbxgicip processing */ |
|---|
| 270 | |
|---|
| 271 | #define MULTI 01 /* Multi-user operation */ |
|---|
| 272 | #define IFUPDATE 01 /* Inverted file update */ |
|---|
| 273 | #define MFUPDATE 1 /* Master file update */ |
|---|
| 274 | |
|---|
| 275 | #endif /* CDMDL */ |
|---|
| 276 | |
|---|
| 277 | #if _LARGEFILE64_SOURCE |
|---|
| 278 | #if (_FILE_OFFSET_BITS != 64) |
|---|
| 279 | #error "_FILE_OFFSET_BITS != 64" |
|---|
| 280 | #endif |
|---|
| 281 | #define LSEEK64 lseek64 |
|---|
| 282 | #define P_OFF_T "lld" |
|---|
| 283 | #define LONG_LONG long long |
|---|
| 284 | #else /* _LARGEFILE64_SOURCE */ |
|---|
| 285 | #if (_FILE_OFFSET_BITS == 64) |
|---|
| 286 | #error "_FILE_OFFSET_BITS == 64" |
|---|
| 287 | #endif |
|---|
| 288 | #define LSEEK64 lseek |
|---|
| 289 | #define P_OFF_T "ld" |
|---|
| 290 | #define LONG_LONG long |
|---|
| 291 | #endif /* _LARGEFILE64_SOURCE */ |
|---|
| 292 | |
|---|
| 293 | |
|---|
| 294 | /* ***************************************************** |
|---|
| 295 | CISIS/C++ DLL export |
|---|
| 296 | ***************************************************** */ |
|---|
| 297 | #if CICPP |
|---|
| 298 | /* DLL export */ |
|---|
| 299 | #if defined (BUILDING_YOUR_DLL) |
|---|
| 300 | #define _YOURCLASS _export |
|---|
| 301 | #else |
|---|
| 302 | #if defined (USING_YOUR_DLL) |
|---|
| 303 | #define _YOURCLASS _import |
|---|
| 304 | #else |
|---|
| 305 | #define _YOURCLASS |
|---|
| 306 | #endif /* USING_YOUR_DLL */ |
|---|
| 307 | #endif /* BUILDING_YOUR_DLL */ |
|---|
| 308 | #endif /* CICPP */ |
|---|
| 309 | |
|---|
| 310 | /* |
|---|
| 311 | Required CISIS.H header files |
|---|
| 312 | */ |
|---|
| 313 | |
|---|
| 314 | #include <stdio.h> /* FILE */ |
|---|
| 315 | |
|---|
| 316 | /* |
|---|
| 317 | Compiler dependent header files |
|---|
| 318 | */ |
|---|
| 319 | |
|---|
| 320 | #if PC |
|---|
| 321 | #include <fcntl.h> |
|---|
| 322 | #include <process.h> |
|---|
| 323 | #include <io.h> |
|---|
| 324 | #include <stdlib.h> |
|---|
| 325 | #include <limits.h> |
|---|
| 326 | #include <dos.h> |
|---|
| 327 | #include <sys/types.h> |
|---|
| 328 | #endif |
|---|
| 329 | |
|---|
| 330 | #if VAX |
|---|
| 331 | #include <file.h> |
|---|
| 332 | #include <stdlib.h> |
|---|
| 333 | #endif |
|---|
| 334 | |
|---|
| 335 | #if MPE |
|---|
| 336 | #include <fcntl.h> |
|---|
| 337 | #include <stdlib.h> |
|---|
| 338 | #include <limits.h> |
|---|
| 339 | #endif |
|---|
| 340 | |
|---|
| 341 | #if UNIX |
|---|
| 342 | #include <fcntl.h> |
|---|
| 343 | #include <unistd.h> |
|---|
| 344 | #include <sys/types.h> |
|---|
| 345 | #include <stdlib.h> |
|---|
| 346 | #include <limits.h> |
|---|
| 347 | #include <errno.h> |
|---|
| 348 | #endif |
|---|
| 349 | |
|---|
| 350 | #ifndef SIXTY_FOUR |
|---|
| 351 | #define SIXTY_FOUR 0 |
|---|
| 352 | #endif /* SIXTY_FOUR */ |
|---|
| 353 | |
|---|
| 354 | #if SIXTY_FOUR |
|---|
| 355 | #define LONGX int |
|---|
| 356 | #define LONGX_MAX INT_MAX |
|---|
| 357 | #else /* SIXTY_FOUR */ |
|---|
| 358 | #define LONGX long |
|---|
| 359 | #define LONGX_MAX LONG_MAX |
|---|
| 360 | #endif /* SIXTY_FOUR */ |
|---|
| 361 | |
|---|
| 362 | #define UBYTE unsigned char /* UCHR */ |
|---|
| 363 | #define UWORD unsigned short /* INT */ |
|---|
| 364 | #if BEFOREWINDEFH |
|---|
| 365 | #define ULONG unsigned LONGX /* */ |
|---|
| 366 | #endif |
|---|
| 367 | #if BEFOREWINNTH |
|---|
| 368 | #define CHAR UBYTE |
|---|
| 369 | #else |
|---|
| 370 | #define UCHR UBYTE |
|---|
| 371 | #endif |
|---|
| 372 | #if BEFOREWINDEFH |
|---|
| 373 | #define INT UWORD |
|---|
| 374 | #endif |
|---|
| 375 | |
|---|
| 376 | #if CIFFI |
|---|
| 377 | #define FFI unsigned int /* size_t = bug no linux - RP, 27/05/2003 */ |
|---|
| 378 | #define MFRL_MAX INT_MAX |
|---|
| 379 | #else |
|---|
| 380 | #define FFI UWORD /* UWORD = UWORD unsigned short */ |
|---|
| 381 | #define MFRL_MAX SHRT_MAX |
|---|
| 382 | #endif |
|---|
| 383 | |
|---|
| 384 | |
|---|
| 385 | /* |
|---|
| 386 | Memory allocation |
|---|
| 387 | */ |
|---|
| 388 | |
|---|
| 389 | #if CICPP /* alloc substituido por new */ |
|---|
| 390 | |
|---|
| 391 | #ifndef CINEWCPP |
|---|
| 392 | #define CINEWCPP 1 // AOT,HB 31/07/2002 */ |
|---|
| 393 | #endif |
|---|
| 394 | |
|---|
| 395 | #if MSC || !CINEWCPP /* HB, 27/05/2002 */ |
|---|
| 396 | #define BAD_ALLOC ... /* catch qualquer coisa */ |
|---|
| 397 | #else /* MSC || !CINEWCPP */ |
|---|
| 398 | #if 0 /* catch especifico */ |
|---|
| 399 | #define BAD_ALLOC xalloc |
|---|
| 400 | #include <except.h> |
|---|
| 401 | #else /* 0 */ |
|---|
| 402 | #include <new> |
|---|
| 403 | #define BAD_ALLOC std::bad_alloc |
|---|
| 404 | #endif /* 0 */ |
|---|
| 405 | #endif /* MSC || !CINEWCPP */ |
|---|
| 406 | |
|---|
| 407 | #define ALLOMAXV 64000U /* <==== RPIVA VAI MUDAR 20010214*/ |
|---|
| 408 | #define ALLOPARM unsigned int |
|---|
| 409 | #define ALLONULL NULL |
|---|
| 410 | //#define CORELEFT() 640000 |
|---|
| 411 | |
|---|
| 412 | #else /* CICPP */ |
|---|
| 413 | |
|---|
| 414 | #if PC |
|---|
| 415 | #if MSC |
|---|
| 416 | #include <malloc.h> |
|---|
| 417 | #define ALLOMAXV 64000U |
|---|
| 418 | #define ALLOC malloc |
|---|
| 419 | #define ALLOPARM unsigned int |
|---|
| 420 | #define ALLONULL NULL |
|---|
| 421 | #define FREE free |
|---|
| 422 | #define CORELEFT coreleft |
|---|
| 423 | #else /* MSC */ |
|---|
| 424 | #if DOS32BITS /* 20000518 */ |
|---|
| 425 | #include <alloc.h> |
|---|
| 426 | #if BEFORE20010105 |
|---|
| 427 | #define ALLOMAXV UINT_MAX /* 640000L */ /* AOT/RP, 27/03/2001 */ |
|---|
| 428 | #else |
|---|
| 429 | #define ALLOMAXV INT_MAX /* 640000L */ /* AOT/RP, 27/03/2001 */ |
|---|
| 430 | #endif |
|---|
| 431 | #define ALLOC malloc |
|---|
| 432 | #define ALLOPARM size_t |
|---|
| 433 | #define ALLONULL NULL |
|---|
| 434 | #define FREE free |
|---|
| 435 | #define CORELEFT coreleft |
|---|
| 436 | #else /* DOS32BITS 20000518 */ |
|---|
| 437 | #include <alloc.h> |
|---|
| 438 | #define ALLOMAXV 64000L |
|---|
| 439 | #define ALLOC farmalloc |
|---|
| 440 | #define ALLOPARM unsigned LONGX |
|---|
| 441 | #define ALLONULL NULL |
|---|
| 442 | #define FREE farfree |
|---|
| 443 | #define CORELEFT farcoreleft |
|---|
| 444 | #endif /* DOS32BITS 20000518 */ |
|---|
| 445 | #endif |
|---|
| 446 | #endif /* PC */ |
|---|
| 447 | |
|---|
| 448 | #if VAX |
|---|
| 449 | #define ALLOC malloc |
|---|
| 450 | #define ALLOPARM size_t |
|---|
| 451 | #define ALLOMAXV 640000L |
|---|
| 452 | #define ALLONULL NULL |
|---|
| 453 | #define FREE free |
|---|
| 454 | #define CORELEFT coreleft |
|---|
| 455 | #endif |
|---|
| 456 | |
|---|
| 457 | #if MPE |
|---|
| 458 | #include <malloc.h> |
|---|
| 459 | #define ALLOC malloc |
|---|
| 460 | #define ALLOPARM unsigned int |
|---|
| 461 | #define ALLOMAXV 64000000L |
|---|
| 462 | #define ALLONULL NULL |
|---|
| 463 | #define FREE free |
|---|
| 464 | #define CORELEFT coreleft |
|---|
| 465 | #endif |
|---|
| 466 | |
|---|
| 467 | #if UNIX |
|---|
| 468 | #include <malloc.h> |
|---|
| 469 | #define ALLOC malloc |
|---|
| 470 | #define ALLOPARM unsigned |
|---|
| 471 | #define ALLOMAXV INT_MAX /* 64000000L */ /* 64000L*/ /* 128000000L*/ /* UINT_MAX */ |
|---|
| 472 | #define ALLONULL NULL |
|---|
| 473 | #define FREE free |
|---|
| 474 | #define CORELEFT coreleft |
|---|
| 475 | #if !GCC |
|---|
| 476 | #define size_t int |
|---|
| 477 | #endif |
|---|
| 478 | #endif |
|---|
| 479 | |
|---|
| 480 | #endif /* CICPP */ |
|---|
| 481 | |
|---|
| 482 | |
|---|
| 483 | /* |
|---|
| 484 | MAX PATH NAME |
|---|
| 485 | */ |
|---|
| 486 | #if PC |
|---|
| 487 | #if DOS32BITS |
|---|
| 488 | #define CIMPL 512 |
|---|
| 489 | #else /* DOS32BITS */ |
|---|
| 490 | #define CIMPL (128+4) |
|---|
| 491 | #endif /* DOS32BITS */ |
|---|
| 492 | #else |
|---|
| 493 | #define CIMPL 512 |
|---|
| 494 | #endif /* PC */ |
|---|
| 495 | |
|---|
| 496 | |
|---|
| 497 | /* |
|---|
| 498 | Unbuffered low level I/O |
|---|
| 499 | */ |
|---|
| 500 | #if CICPP |
|---|
| 501 | #define PERMIS 0644 |
|---|
| 502 | #define CREAT creat |
|---|
| 503 | #define OPEN open |
|---|
| 504 | #define CLOSE close |
|---|
| 505 | #define CIREAD read |
|---|
| 506 | #define CIWRITE write |
|---|
| 507 | #else /* CICPP */ |
|---|
| 508 | #if PC |
|---|
| 509 | #if MSC |
|---|
| 510 | #define PERMIS 0644 |
|---|
| 511 | #define CREAT creat |
|---|
| 512 | #if MULTI |
|---|
| 513 | #define OPEN sopen |
|---|
| 514 | #else |
|---|
| 515 | #define OPEN open |
|---|
| 516 | #endif |
|---|
| 517 | #define CLOSE close |
|---|
| 518 | #define CIREAD read |
|---|
| 519 | #define CIWRITE write |
|---|
| 520 | #else /* MSC */ |
|---|
| 521 | #define PERMIS 0000 |
|---|
| 522 | #if DOS32BITS /* UINT_MAX -1 */ |
|---|
| 523 | #define CREAT _rtl_creat |
|---|
| 524 | #define OPEN _rtl_open |
|---|
| 525 | #define CLOSE _rtl_close |
|---|
| 526 | #define CIREAD _rtl_read |
|---|
| 527 | #define CIWRITE _rtl_write |
|---|
| 528 | #else /* DOS32BITS */ |
|---|
| 529 | #define CREAT _creat |
|---|
| 530 | #define OPEN _open |
|---|
| 531 | #define CLOSE _close |
|---|
| 532 | #define CIREAD _read |
|---|
| 533 | #define CIWRITE _write |
|---|
| 534 | #endif /* DOS32BITS */ |
|---|
| 535 | #endif /* MSC */ |
|---|
| 536 | #else |
|---|
| 537 | #if VAX |
|---|
| 538 | #define PERMIS 0644 |
|---|
| 539 | #endif |
|---|
| 540 | #if MPE |
|---|
| 541 | #define PERMIS 0644 |
|---|
| 542 | #endif |
|---|
| 543 | #if UNIX |
|---|
| 544 | #define PERMIS 0644 |
|---|
| 545 | #endif |
|---|
| 546 | #define CREAT creat |
|---|
| 547 | #define OPEN open |
|---|
| 548 | #define CLOSE close |
|---|
| 549 | #define CIREAD read |
|---|
| 550 | #define CIWRITE write |
|---|
| 551 | #endif |
|---|
| 552 | #endif /* CICPP */ |
|---|
| 553 | |
|---|
| 554 | /* |
|---|
| 555 | Standard Library extensions |
|---|
| 556 | */ |
|---|
| 557 | |
|---|
| 558 | |
|---|
| 559 | #define GEN_CORELEFT MSC || MPE || VAX || UNIX || DOS32BITS /* 20000518 */ |
|---|
| 560 | #define GEN_LABS MPE || VAX || (UNIX && !UNISYS) |
|---|
| 561 | #define GEN_STRSTR MPE || VAX || (UNIX && !UNISYSGDB && !SUN && !BRME && !GCC) |
|---|
| 562 | #define GEN_STRUPR MPE || VAX || UNIX |
|---|
| 563 | #define GEN_STRREV MPE || VAX || UNIX |
|---|
| 564 | #define GEN_MEMICMP /* CIPARIC && */ (MPE || VAX || (UNIX && !BRME)) |
|---|
| 565 | |
|---|
| 566 | #if CDCS4320 || MPE || (GCC && !CICPP) || BRME |
|---|
| 567 | #define CONST /* not supported */ |
|---|
| 568 | #else |
|---|
| 569 | #define CONST const |
|---|
| 570 | #endif |
|---|
| 571 | |
|---|
| 572 | #if GEN_CORELEFT |
|---|
| 573 | #if ANSI |
|---|
| 574 | unsigned LONGX coreleft(void); |
|---|
| 575 | #else |
|---|
| 576 | unsigned LONGX coreleft(); |
|---|
| 577 | #endif |
|---|
| 578 | #endif |
|---|
| 579 | |
|---|
| 580 | #if GEN_LABS |
|---|
| 581 | #if ANSI |
|---|
| 582 | long labs(long x); |
|---|
| 583 | #else |
|---|
| 584 | long labs(); |
|---|
| 585 | #endif |
|---|
| 586 | #endif |
|---|
| 587 | |
|---|
| 588 | #if GEN_STRSTR |
|---|
| 589 | #if ANSI |
|---|
| 590 | char *strstr(CONST char *s1, CONST char *s2); |
|---|
| 591 | #else |
|---|
| 592 | char *strstr(); |
|---|
| 593 | #endif |
|---|
| 594 | #endif |
|---|
| 595 | |
|---|
| 596 | #if GEN_STRUPR |
|---|
| 597 | #if ANSI |
|---|
| 598 | char *strupr(char *p); |
|---|
| 599 | #else |
|---|
| 600 | char *strupr(); |
|---|
| 601 | #endif |
|---|
| 602 | #endif |
|---|
| 603 | |
|---|
| 604 | #if GEN_STRREV |
|---|
| 605 | #if ANSI |
|---|
| 606 | char *strrev(char *p); |
|---|
| 607 | #else |
|---|
| 608 | char *strrev(); |
|---|
| 609 | #endif |
|---|
| 610 | #endif |
|---|
| 611 | |
|---|
| 612 | #if GEN_MEMICMP |
|---|
| 613 | #if ANSI |
|---|
| 614 | int memicmp(CONST void *s1, CONST void *s2, size_t n); |
|---|
| 615 | #else |
|---|
| 616 | int memicmp(); |
|---|
| 617 | #endif |
|---|
| 618 | #endif |
|---|
| 619 | |
|---|
| 620 | |
|---|
| 621 | #if CICPP |
|---|
| 622 | class _YOURCLASS CISISX; |
|---|
| 623 | #endif /* CICPP */ |
|---|
| 624 | |
|---|
| 625 | /* |
|---|
| 626 | FATRAP support |
|---|
| 627 | */ |
|---|
| 628 | |
|---|
| 629 | #if FATRAP |
|---|
| 630 | #include <setjmp.h> |
|---|
| 631 | #endif |
|---|
| 632 | |
|---|
| 633 | /* ***************************************************** |
|---|
| 634 | CISIS/C++ extern "C" |
|---|
| 635 | ***************************************************** */ |
|---|
| 636 | #if CICPP |
|---|
| 637 | #ifdef __cplusplus |
|---|
| 638 | extern "C" { |
|---|
| 639 | #endif |
|---|
| 640 | #endif /* CICPP */ |
|---|
| 641 | |
|---|
| 642 | |
|---|
| 643 | /* ***************************************************** |
|---|
| 644 | CIDBX.H |
|---|
| 645 | ***************************************************** */ |
|---|
| 646 | |
|---|
| 647 | #if CIFFI |
|---|
| 648 | #define MAXMFRL 1048576L /* 1024*1024 ! */ |
|---|
| 649 | #else /* CIFFI */ |
|---|
| 650 | #if UNIX || WWWISIS || USE_CIREC || DOS32BITS |
|---|
| 651 | #if BEFORE20010109 |
|---|
| 652 | #define MAXMFRL 30000L /* */ |
|---|
| 653 | #else |
|---|
| 654 | #if MULTI |
|---|
| 655 | #define MAXMFRL 32767L /* */ |
|---|
| 656 | #else /* MULTI */ |
|---|
| 657 | #define MAXMFRL 63002L /* */ |
|---|
| 658 | #endif /* MULTI */ |
|---|
| 659 | #endif |
|---|
| 660 | #else /* UNIX || WWWISIS || USE_CIREC || DOS32BITS */ |
|---|
| 661 | #define MAXMFRL 8192L /* gdb */ |
|---|
| 662 | #endif /* UNIX || WWWISIS || USE_CIREC || DOS32BITS */ |
|---|
| 663 | #endif /* CIFFI */ |
|---|
| 664 | |
|---|
| 665 | |
|---|
| 666 | #if ISISXL |
|---|
| 667 | #define LE1 16 /* gdb ISISXL */ |
|---|
| 668 | #if ISISXL512 |
|---|
| 669 | #define LE2 512 /* gdb ISISXL */ |
|---|
| 670 | #else |
|---|
| 671 | #define LE2 60 /* gdb ISISXL */ |
|---|
| 672 | #endif |
|---|
| 673 | #else /* ISISXL */ |
|---|
| 674 | #define LE1 10 /* gdb */ |
|---|
| 675 | #define LE2 30 /* gdb */ |
|---|
| 676 | #endif /* ISISXL */ |
|---|
| 677 | |
|---|
| 678 | |
|---|
| 679 | #define XRBSIZ 512 /* gdb */ |
|---|
| 680 | #define XRSHIFT 9 /* */ |
|---|
| 681 | |
|---|
| 682 | #define XRMAXTIV 127 /* gdb */ |
|---|
| 683 | #define XRMAXTV1 126 /* */ |
|---|
| 684 | |
|---|
| 685 | #define MSBSIZ 512 /* gdb */ |
|---|
| 686 | #define MSBSHIFT 9 /* */ |
|---|
| 687 | |
|---|
| 688 | #define XRXDIVIDE 2048 /* gdb */ |
|---|
| 689 | #define XRXSHIFT 11 /* */ |
|---|
| 690 | #define XRXMASK 0x000001FF /* gdb no IF pending */ |
|---|
| 691 | #define XRXMASKN 0x00000400 /* gdb ++ IF pending */ |
|---|
| 692 | #define XRXMASKU 0x00000200 /* gdb ++ IF pending */ |
|---|
| 693 | |
|---|
| 694 | #if LIND |
|---|
| 695 | #ifndef LIND4 |
|---|
| 696 | #define LIND4 1 /*0*/ |
|---|
| 697 | #endif /* LIND4 */ |
|---|
| 698 | #endif /* LIND */ |
|---|
| 699 | |
|---|
| 700 | #if LIND4 |
|---|
| 701 | #define MAXUPDMFN 0x7FFFFFFFL /* gdb posting */ |
|---|
| 702 | #else /* LIND4 */ |
|---|
| 703 | #define MAXUPDMFN 0x00FFFFFFL /* gdb posting */ |
|---|
| 704 | #endif /* LIND4 */ |
|---|
| 705 | |
|---|
| 706 | #define MSMFTUSR 0 /* gdb non system */ |
|---|
| 707 | #define MSMFTMSG 1 /* gdb msg data base */ |
|---|
| 708 | |
|---|
| 709 | #define XRPOS LONGX |
|---|
| 710 | #define XRPTR /*off_t*/ LONGX |
|---|
| 711 | #define XRPOSSIZ sizeof(XRPOS) |
|---|
| 712 | #define XRPTRSIZ sizeof(XRPTR) |
|---|
| 713 | |
|---|
| 714 | typedef struct xrstru { |
|---|
| 715 | XRPOS xrxrpos; /* gdb .xrf blk order */ |
|---|
| 716 | XRPTR xrmfptr[XRMAXTIV]; /* gdb mfr ptrs */ |
|---|
| 717 | } XRSTRU; |
|---|
| 718 | |
|---|
| 719 | typedef struct msstru { |
|---|
| 720 | char msbuff[MSBSIZ]; /* gdb .mst blk */ |
|---|
| 721 | LONGX msbufn; /* gdb .mst blk order - simulated */ |
|---|
| 722 | } MSSTRU; |
|---|
| 723 | |
|---|
| 724 | |
|---|
| 725 | #define IFBSIZ 512 /* gdb */ |
|---|
| 726 | #define IFSHIFT 9 /* */ |
|---|
| 727 | |
|---|
| 728 | #define IFMAXTIV 127 /* gdb */ |
|---|
| 729 | |
|---|
| 730 | #define PUNT LONGX /* gdb paho 1988 */ |
|---|
| 731 | |
|---|
| 732 | #define INFO LONGX /* gdb */ |
|---|
| 733 | |
|---|
| 734 | #if LIND |
|---|
| 735 | #ifndef INFO8 |
|---|
| 736 | #define INFO8 1 /* 8-byte ptr and size (info1/info3) in .ly1/.ly2 IDXE - AOT/HB 14/03/2008 */ |
|---|
| 737 | #endif /* INFO8 */ |
|---|
| 738 | #if INFO8 |
|---|
| 739 | #define INFX off_t /* gdb */ |
|---|
| 740 | #else |
|---|
| 741 | #define INFX LONGX /* gdb */ |
|---|
| 742 | #endif /* INFO8 */ |
|---|
| 743 | #else /* LIND */ |
|---|
| 744 | #define INFX LONGX /* gdb */ |
|---|
| 745 | #endif /* LIND */ |
|---|
| 746 | |
|---|
| 747 | #define INFOSIZE sizeof(INFO) |
|---|
| 748 | #define IFHDRINFOS 5 /* check in trminit() */ |
|---|
| 749 | #define IFPSTINFOS 2 /* */ |
|---|
| 750 | #define IFNVSPLT 28 /* gdb .ifp never split - header+posting */ |
|---|
| 751 | |
|---|
| 752 | #define MAXLIV 8 /* INVMAP.nx */ |
|---|
| 753 | #define NEGLIV (-1) /* INVMAP.cn[treecase].liv - gdb */ |
|---|
| 754 | |
|---|
| 755 | #define ORDN 5 /* gdb */ |
|---|
| 756 | #define TWORDN 10 /* */ |
|---|
| 757 | |
|---|
| 758 | #define ORDF 5 /* gdb */ |
|---|
| 759 | #define TWORDF 10 /* */ |
|---|
| 760 | |
|---|
| 761 | #define CNTN 15 /* gdb */ |
|---|
| 762 | #define CNTK 5 /* gdb */ |
|---|
| 763 | |
|---|
| 764 | #if SAMEL |
|---|
| 765 | #define MAXSAMEL 8 /* max no. of .ifp on same leaf */ |
|---|
| 766 | #endif |
|---|
| 767 | |
|---|
| 768 | |
|---|
| 769 | typedef struct cnstru { |
|---|
| 770 | UWORD idtype PACKED;/* gdb .cnt idtype */ |
|---|
| 771 | UWORD ordn PACKED;/* gdb .cnt ordn */ |
|---|
| 772 | UWORD ordf PACKED;/* gdb .cnt ordf */ |
|---|
| 773 | UWORD n PACKED;/* gdb .cnt n */ |
|---|
| 774 | UWORD k PACKED;/* gdb .cnt k */ |
|---|
| 775 | short liv PACKED;/* gdb .cnt liv = no of index levels */ |
|---|
| 776 | /* 6*2=12 */ |
|---|
| 777 | PUNT posrx PACKED;/* gdb .cnt posrx = pos of root node */ |
|---|
| 778 | PUNT nmaxpos PACKED;/* gdb .cnt nmaxpos */ |
|---|
| 779 | PUNT fmaxpos PACKED;/* gdb .cnt fmaxpos */ |
|---|
| 780 | UWORD abnormal PACKED;/* gdb .cnt abnormal */ |
|---|
| 781 | /* CNBUNI +2 */ |
|---|
| 782 | } CNSTRU; |
|---|
| 783 | |
|---|
| 784 | typedef struct n0stru { |
|---|
| 785 | PUNT pos PACKED;/* gdb .n0x pos */ |
|---|
| 786 | UWORD ock PACKED;/* gdb .n0x ock */ |
|---|
| 787 | UWORD it PACKED;/* gdb .n0x it */ |
|---|
| 788 | char idxchars[1] PACKED;/* gdb .n01 and .n02 idx */ |
|---|
| 789 | } N0STRU; |
|---|
| 790 | |
|---|
| 791 | typedef struct l0stru { |
|---|
| 792 | PUNT pos PACKED;/* gdb .l0x pos */ |
|---|
| 793 | UWORD ock PACKED;/* gdb .l0x ock */ |
|---|
| 794 | UWORD it PACKED;/* gdb .l0x it */ |
|---|
| 795 | PUNT ps PACKED;/* gdb .l0x ps */ |
|---|
| 796 | #if LIND |
|---|
| 797 | PUNT psb PACKED;/* tlc gdb .l0x ps backward */ |
|---|
| 798 | #endif |
|---|
| 799 | char idxchars[1] PACKED;/* gdb .l01 and .l02 idx */ |
|---|
| 800 | } L0STRU; |
|---|
| 801 | |
|---|
| 802 | |
|---|
| 803 | typedef struct nxstru { |
|---|
| 804 | int pages; /* no of memo buffers alloced */ |
|---|
| 805 | int left; /* no of memo buffers still free */ |
|---|
| 806 | char *basep; /* area addr */ |
|---|
| 807 | } NXSTRU; |
|---|
| 808 | |
|---|
| 809 | #define NTREE 2 |
|---|
| 810 | #define LTXPAGES 128L |
|---|
| 811 | #define LUXPAGES 1024L |
|---|
| 812 | #define LVXPAGES 1024L /* lvxmxmfn/8+1 */ |
|---|
| 813 | #define LVXIYPBS 8192L /* ou INT_MAX */ |
|---|
| 814 | |
|---|
| 815 | typedef struct invmap { |
|---|
| 816 | #if LINDLUX |
|---|
| 817 | LONGX ltxthresh; |
|---|
| 818 | LONGX ltxpages[NTREE]; |
|---|
| 819 | N0STRU *ltxvpagp[NTREE][1+LTXPAGES]; |
|---|
| 820 | LONGX luxthresh; |
|---|
| 821 | LONGX luxpages[NTREE]; |
|---|
| 822 | L0STRU *luxvpagp[NTREE][1+LUXPAGES]; |
|---|
| 823 | int lvxiflind; |
|---|
| 824 | LONGX lvxmaxmfn; |
|---|
| 825 | LONGX lvxpages; |
|---|
| 826 | char *lvxvpagp[1+LVXPAGES]; |
|---|
| 827 | FILE *lvxfplog; |
|---|
| 828 | #endif /* LINDLUX */ |
|---|
| 829 | char *ifl1p; /* .l01 block */ |
|---|
| 830 | char *ifl2p; /* .l02 block */ |
|---|
| 831 | #if SAMEL |
|---|
| 832 | int iflxn; /* #total */ |
|---|
| 833 | #endif |
|---|
| 834 | #if ZTREE |
|---|
| 835 | int iflzx; /* ztree */ |
|---|
| 836 | #endif |
|---|
| 837 | #if 1 /* IFUPDATE */ |
|---|
| 838 | int cnopn; /* =dbxopen(.cnt) */ |
|---|
| 839 | #endif |
|---|
| 840 | int n1opn; /* =dbxopen(.n01) */ |
|---|
| 841 | int n2opn; /* =dbxopen(.n02) */ |
|---|
| 842 | int l1opn; /* =dbxopen(.l01) */ |
|---|
| 843 | int l2opn; /* =dbxopen(.l02) */ |
|---|
| 844 | #if SAMEL |
|---|
| 845 | int ifopn[MAXSAMEL]; /* =dbxopen(.ifp) */ |
|---|
| 846 | #else |
|---|
| 847 | int ifopn; /* =dbxopen(.ifp) */ |
|---|
| 848 | #endif |
|---|
| 849 | #if 1 /* IFUPDATE */ |
|---|
| 850 | int cnopw; /* dbxopenw/w(.cnt) */ |
|---|
| 851 | #endif |
|---|
| 852 | int n1opw; /* dbxopenw/w(.n01) */ |
|---|
| 853 | int n2opw; /* dbxopenw/w(.n02) */ |
|---|
| 854 | int l1opw; /* dbxopenw/w(.l01) */ |
|---|
| 855 | int l2opw; /* dbxopenw/w(.l02) */ |
|---|
| 856 | int ifopw; /* dbxopenw/w(.ifp) */ |
|---|
| 857 | int ifopv; /* dbxflock/dbxulock(.ifp) */ |
|---|
| 858 | CNSTRU cn[2]; /* .cnt recs */ |
|---|
| 859 | NXSTRU nx[2][MAXLIV]; /* .n01 and .n02 pages */ |
|---|
| 860 | char *nybasep[2]; /* all .n01 and .n02 pages */ |
|---|
| 861 | char *lybasep[2]; /* all .l01 and .l02 pages */ |
|---|
| 862 | char *iybasep; /* all .ifp blocks */ |
|---|
| 863 | off_t cc_offset; /* .cnt SEEK_SET offset */ |
|---|
| 864 | #if CNLI |
|---|
| 865 | off_t cn_offset[2]; /* .n0x SEEK_SET offset */ |
|---|
| 866 | off_t cl_offset[2]; /* .l0x SEEK_SET offset */ |
|---|
| 867 | off_t ci_offset; /* .ifp SEEK_SET offset */ |
|---|
| 868 | #endif |
|---|
| 869 | } INVMAP; |
|---|
| 870 | |
|---|
| 871 | |
|---|
| 872 | #if RECGIZM |
|---|
| 873 | typedef struct gizmstru { |
|---|
| 874 | short isize; |
|---|
| 875 | short osize; |
|---|
| 876 | unsigned char *ipatt; |
|---|
| 877 | unsigned char *opatt; |
|---|
| 878 | LONGX nused; |
|---|
| 879 | struct gizmstru *nextp; |
|---|
| 880 | } GIZMSTRU; |
|---|
| 881 | |
|---|
| 882 | #define MAXGIZR 16 |
|---|
| 883 | |
|---|
| 884 | typedef struct vgizpstru { |
|---|
| 885 | GIZMSTRU *ghdrp[256]; |
|---|
| 886 | int grngs; |
|---|
| 887 | UWORD grng1[MAXGIZR]; |
|---|
| 888 | UWORD grng2[MAXGIZR]; |
|---|
| 889 | unsigned char *gdbnp; |
|---|
| 890 | struct vgizpstru *nextp; |
|---|
| 891 | } VGIZPSTRU; |
|---|
| 892 | |
|---|
| 893 | #endif |
|---|
| 894 | |
|---|
| 895 | |
|---|
| 896 | #if RECDECO |
|---|
| 897 | #define MAXDECR 16 |
|---|
| 898 | #define MAXDECX 16 |
|---|
| 899 | |
|---|
| 900 | typedef struct vdecpstru { |
|---|
| 901 | unsigned char *ddbnp; |
|---|
| 902 | int drngs; |
|---|
| 903 | UWORD drng1[MAXDECR]; |
|---|
| 904 | UWORD drng2[MAXDECR]; |
|---|
| 905 | unsigned char drdlm; |
|---|
| 906 | int dsflds; |
|---|
| 907 | unsigned char dsfld[MAXDECX]; |
|---|
| 908 | unsigned char dsfldx[MAXDECX]; |
|---|
| 909 | LONGX dsfldv[MAXDECX]; |
|---|
| 910 | struct vdecpstru *nextp; |
|---|
| 911 | } VDECPSTRU; |
|---|
| 912 | #endif |
|---|
| 913 | |
|---|
| 914 | #if CIAPI |
|---|
| 915 | typedef void DBXSTRU; |
|---|
| 916 | #else /* CIAPI */ |
|---|
| 917 | #if CICPP |
|---|
| 918 | class _YOURCLASS DBXSTRU; /* Para substituir def da struct */ |
|---|
| 919 | #else |
|---|
| 920 | typedef struct dbxstru { |
|---|
| 921 | char dbxname[CIMPL+1]; /* dbname + .ext + NULL */ |
|---|
| 922 | int dbxxropn; /* =dbxopen(.xrf) */ |
|---|
| 923 | int dbxmsopn; /* =dbxopen(.mst) */ |
|---|
| 924 | int dbxxropw; /* dbxopenw/w(.xrf) */ |
|---|
| 925 | int dbxmsopw; /* dbxopenw/w(.mst) */ |
|---|
| 926 | int dbxmsopv; /* dbxflock/dbxulock(.mst) */ |
|---|
| 927 | XRSTRU *dbxxribp; /* ptr .xrf ibuf */ |
|---|
| 928 | MSSTRU *dbxmsibp; /* ptr .mst ibuf */ |
|---|
| 929 | #if GIPAR |
|---|
| 930 | char *dbxgicip; /* extended .mst capacity */ |
|---|
| 931 | #endif |
|---|
| 932 | #if DBXMSTXL |
|---|
| 933 | int dbxmstxl; /* extended .mst capacity */ |
|---|
| 934 | #endif |
|---|
| 935 | int dbxmflush; /* mstflush() flag */ |
|---|
| 936 | int dbxmclose; /* mstclose() flag */ |
|---|
| 937 | int dbxiflush; /* invflush() flag */ |
|---|
| 938 | #if MULTI |
|---|
| 939 | int dbxnetws; /* type of network support */ |
|---|
| 940 | int dbxdelxx; /* flag data entry lock */ |
|---|
| 941 | int dbxewlxx; /* flag exclusive write lock */ |
|---|
| 942 | int dbxmxtmp; /* mx() tmpseq master file */ |
|---|
| 943 | #endif |
|---|
| 944 | LONGX dbxmsmfn; /* mstsetup() .mst nxtmfn */ |
|---|
| 945 | INVMAP *dbxifmap; /* .cnt, .n0x, .l0x, .ifp */ |
|---|
| 946 | #if 1 /* SAMEL */ |
|---|
| 947 | int dbxiflxx; /* dbx samel */ |
|---|
| 948 | #endif |
|---|
| 949 | char *dbxxryyp; /* all .xrf blocks */ |
|---|
| 950 | char *dbxmsyyp; /* all .mst blocks */ |
|---|
| 951 | #if RECGIZM |
|---|
| 952 | VGIZPSTRU *dbxvgzrp; /* gizmo processing */ |
|---|
| 953 | #endif |
|---|
| 954 | #if RECXPND |
|---|
| 955 | int dbxxpn01; /* expand processing */ |
|---|
| 956 | int dbxxpn02; /* expand processing */ |
|---|
| 957 | #endif |
|---|
| 958 | #if RECDECO |
|---|
| 959 | VDECPSTRU *dbxvderp; /* decod processing */ |
|---|
| 960 | #endif |
|---|
| 961 | #if IFUPDATE |
|---|
| 962 | int dbxiinit; /* ifupdat() init */ |
|---|
| 963 | int dbxitrac; /* ifupdat() trace parameter */ |
|---|
| 964 | LONGX dbxitell; /* ifupdat() tell parameter */ |
|---|
| 965 | LONGX dbxirang; /* ifupdat() tell parameter */ |
|---|
| 966 | LONGX dbxirecs; /* ifupdat() records updated */ |
|---|
| 967 | LONGX dbxipadd[2]; /* ifupdat() added lk1/lk2 posts */ |
|---|
| 968 | LONGX dbxipdel[2]; /* ifupdat() deleted lk1/lk2 posts */ |
|---|
| 969 | #endif |
|---|
| 970 | } DBXSTRU; |
|---|
| 971 | #endif /* CICPP */ |
|---|
| 972 | |
|---|
| 973 | #define DBXname dbxp->dbxname |
|---|
| 974 | #define DBXxropn dbxp->dbxxropn |
|---|
| 975 | #define DBXmsopn dbxp->dbxmsopn |
|---|
| 976 | #define DBXxropw dbxp->dbxxropw |
|---|
| 977 | #define DBXmsopw dbxp->dbxmsopw |
|---|
| 978 | #define DBXmsopv dbxp->dbxmsopv |
|---|
| 979 | #define DBXxribp dbxp->dbxxribp |
|---|
| 980 | #define DBXmsibp dbxp->dbxmsibp |
|---|
| 981 | #if GIPAR |
|---|
| 982 | #define DBXgicip dbxp->dbxgicip |
|---|
| 983 | #endif |
|---|
| 984 | #if DBXMSTXL |
|---|
| 985 | #define DBXmstxl dbxp->dbxmstxl |
|---|
| 986 | #endif |
|---|
| 987 | #define DBXmflush dbxp->dbxmflush |
|---|
| 988 | #define DBXmclose dbxp->dbxmclose |
|---|
| 989 | #define DBXiflush dbxp->dbxiflush |
|---|
| 990 | #if MULTI |
|---|
| 991 | #define DBXnetws dbxp->dbxnetws |
|---|
| 992 | #define DBXdelxx dbxp->dbxdelxx |
|---|
| 993 | #define DBXewlxx dbxp->dbxewlxx |
|---|
| 994 | #define DBXmxtmp dbxp->dbxmxtmp |
|---|
| 995 | #endif |
|---|
| 996 | #define DBXmsmfn dbxp->dbxmsmfn |
|---|
| 997 | #define DBXifmap dbxp->dbxifmap |
|---|
| 998 | #define DBXiflxx dbxp->dbxiflxx |
|---|
| 999 | #define DBXxryyp dbxp->dbxxryyp |
|---|
| 1000 | #define DBXmsyyp dbxp->dbxmsyyp |
|---|
| 1001 | #if RECGIZM |
|---|
| 1002 | #define DBXvgzrp dbxp->dbxvgzrp |
|---|
| 1003 | #endif |
|---|
| 1004 | #if RECXPND |
|---|
| 1005 | #define DBXxpn01 dbxp->dbxxpn01 |
|---|
| 1006 | #define DBXxpn02 dbxp->dbxxpn02 |
|---|
| 1007 | #endif |
|---|
| 1008 | #if RECDECO |
|---|
| 1009 | #define DBXvderp dbxp->dbxvderp |
|---|
| 1010 | #endif |
|---|
| 1011 | #if IFUPDATE |
|---|
| 1012 | #define DBXiinit dbxp->dbxiinit |
|---|
| 1013 | #define DBXitrac dbxp->dbxitrac |
|---|
| 1014 | #define DBXitell dbxp->dbxitell |
|---|
| 1015 | #define DBXirang dbxp->dbxirang |
|---|
| 1016 | #define DBXirecs dbxp->dbxirecs |
|---|
| 1017 | #define DBXipadd dbxp->dbxipadd |
|---|
| 1018 | #define DBXipdel dbxp->dbxipdel |
|---|
| 1019 | #endif |
|---|
| 1020 | |
|---|
| 1021 | #define VDBXname(i) vdbxp[i]->dbxname |
|---|
| 1022 | #define VDBXxropn(i) vdbxp[i]->dbxxropn |
|---|
| 1023 | #define VDBXmsopn(i) vdbxp[i]->dbxmsopn |
|---|
| 1024 | #define VDBXxropw(i) vdbxp[i]->dbxxropw |
|---|
| 1025 | #define VDBXmsopw(i) vdbxp[i]->dbxmsopw |
|---|
| 1026 | #define VDBXmsopv(i) vdbxp[i]->dbxmsopv |
|---|
| 1027 | #define VDBXxribp(i) vdbxp[i]->dbxxribp |
|---|
| 1028 | #define VDBXmsibp(i) vdbxp[i]->dbxmsibp |
|---|
| 1029 | #if GIPAR |
|---|
| 1030 | #define VDBXgicip(i) vdbxp[i]->dbxgicip |
|---|
| 1031 | #endif |
|---|
| 1032 | #if DBXMSTXL |
|---|
| 1033 | #define VDBXmstxl(i) vdbxp[i]->dbxmstxl |
|---|
| 1034 | #endif |
|---|
| 1035 | #define VDBXmflush(i) vdbxp[i]->dbxmflush |
|---|
| 1036 | #define VDBXmclose(i) vdbxp[i]->dbxmclose |
|---|
| 1037 | #define VDBXiflush(i) vdbxp[i]->dbxiflush |
|---|
| 1038 | #if MULTI |
|---|
| 1039 | #define VDBXnetws(i) vdbxp[i]->dbxnetws |
|---|
| 1040 | #define VDBXdelxx(i) vdbxp[i]->dbxdelxx |
|---|
| 1041 | #define VDBXewlxx(i) vdbxp[i]->dbxewlxx |
|---|
| 1042 | #define VDBXmxtmp(i) vdbxp[i]->dbxmxtmp |
|---|
| 1043 | #endif |
|---|
| 1044 | #define VDBXmsmfn(i) vdbxp[i]->dbxmsmfn |
|---|
| 1045 | #define VDBXifmap(i) vdbxp[i]->dbxifmap |
|---|
| 1046 | #define VDBXiflxx(i) vdbxp[i]->dbxiflxx |
|---|
| 1047 | #define VDBXxryyp(i) vdbxp[i]->dbxxryyp |
|---|
| 1048 | #define VDBXmsyyp(i) vdbxp[i]->dbxmsyyp |
|---|
| 1049 | #if RECGIZM |
|---|
| 1050 | #define VDBXvgzrp(i) vdbxp[i]->dbxvgzrp |
|---|
| 1051 | #endif |
|---|
| 1052 | #if RECXPND |
|---|
| 1053 | #define VDBXxpn01(i) vdbxp[i]->dbxxpn01 |
|---|
| 1054 | #define VDBXxpn02(i) vdbxp[i]->dbxxpn02 |
|---|
| 1055 | #endif |
|---|
| 1056 | #if RECDECO |
|---|
| 1057 | #define VDBXvderp(i) vdbxp[i]->dbxvderp |
|---|
| 1058 | #endif |
|---|
| 1059 | #if IFUPDATE |
|---|
| 1060 | #define VDBXiinit(i) vdbxp[i]->dbxiinit |
|---|
| 1061 | #define VDBXitrac(i) vdbxp[i]->dbxitrac |
|---|
| 1062 | #define VDBXitell(i) vdbxp[i]->dbxitell |
|---|
| 1063 | #define VDBXirang(i) vdbxp[i]->dbxirang |
|---|
| 1064 | #define VDBXirecs(i) vdbxp[i]->dbxirecs |
|---|
| 1065 | #define VDBXipadd(i) vdbxp[i]->dbxipadd |
|---|
| 1066 | #define VDBXipdel(i) vdbxp[i]->dbxipdel |
|---|
| 1067 | #endif |
|---|
| 1068 | |
|---|
| 1069 | #define DBIifl1p dbxp->dbxifmap->ifl1p |
|---|
| 1070 | #define DBIifl2p dbxp->dbxifmap->ifl2p |
|---|
| 1071 | #define DBIiflxn dbxp->dbxifmap->iflxn |
|---|
| 1072 | #define DBIiflzx dbxp->dbxifmap->iflzx |
|---|
| 1073 | #define DBIcnopn dbxp->dbxifmap->cnopn |
|---|
| 1074 | #define DBIn1opn dbxp->dbxifmap->n1opn |
|---|
| 1075 | #define DBIn2opn dbxp->dbxifmap->n2opn |
|---|
| 1076 | #define DBIl1opn dbxp->dbxifmap->l1opn |
|---|
| 1077 | #define DBIl2opn dbxp->dbxifmap->l2opn |
|---|
| 1078 | #if SAMEL |
|---|
| 1079 | #define DBIifopn(lxx) dbxp->dbxifmap->ifopn[lxx] |
|---|
| 1080 | #else |
|---|
| 1081 | #define DBIifopn dbxp->dbxifmap->ifopn |
|---|
| 1082 | #endif |
|---|
| 1083 | #define DBIcnopw dbxp->dbxifmap->cnopw |
|---|
| 1084 | #define DBIn1opw dbxp->dbxifmap->n1opw |
|---|
| 1085 | #define DBIn2opw dbxp->dbxifmap->n2opw |
|---|
| 1086 | #define DBIl1opw dbxp->dbxifmap->l1opw |
|---|
| 1087 | #define DBIl2opw dbxp->dbxifmap->l2opw |
|---|
| 1088 | #define DBIifopw dbxp->dbxifmap->ifopw |
|---|
| 1089 | #define DBIifopv dbxp->dbxifmap->ifopv |
|---|
| 1090 | #define DBIcn(i) dbxp->dbxifmap->cn[i] |
|---|
| 1091 | #define DBInx(i,j) dbxp->dbxifmap->nx[i][j] |
|---|
| 1092 | #define DBInybasep(i) dbxp->dbxifmap->nybasep[i] |
|---|
| 1093 | #define DBIlybasep(i) dbxp->dbxifmap->lybasep[i] |
|---|
| 1094 | #define DBIiybasep dbxp->dbxifmap->iybasep |
|---|
| 1095 | #if CNLI |
|---|
| 1096 | #define DBIcn_offset(i) dbxp->dbxifmap->cn_offset[i] |
|---|
| 1097 | #define DBIcl_offset(i) dbxp->dbxifmap->cl_offset[i] |
|---|
| 1098 | #define DBIci_offset dbxp->dbxifmap->ci_offset |
|---|
| 1099 | #endif |
|---|
| 1100 | |
|---|
| 1101 | #endif /* CIAPI */ |
|---|
| 1102 | |
|---|
| 1103 | #if !CIAPI |
|---|
| 1104 | #if !CICPP /* Deslocados para classe DBXSTRU */ |
|---|
| 1105 | /* CIDBX Interface */ |
|---|
| 1106 | #if ANSI |
|---|
| 1107 | #if MULTI |
|---|
| 1108 | int dbxcinet(char *dbnamp); |
|---|
| 1109 | int dbxflock(DBXSTRU *dbxp, char *type); |
|---|
| 1110 | int dbxulock(DBXSTRU *dbxp, char *type); |
|---|
| 1111 | int dbxilock(DBXSTRU *dbxp, char *mdbnp, char *type); |
|---|
| 1112 | int dbxwlock(DBXSTRU *dbxp, char *m0p, int times); |
|---|
| 1113 | #endif /* MULTI */ |
|---|
| 1114 | void dbxflush(char *dbnamp); |
|---|
| 1115 | DBXSTRU *dbxsrchp(char *dbnamp); |
|---|
| 1116 | DBXSTRU *dbxstorp(char *dbnamp); |
|---|
| 1117 | int dbxopen(char *gidbnp, char *dbnamp, char *extp); |
|---|
| 1118 | #if CLOSEX |
|---|
| 1119 | int CLOSE(int fd); |
|---|
| 1120 | #endif |
|---|
| 1121 | int dbxopenw(char *gidbnp, char *dbnamp,char *extp,int *opnp,int *opwp,char *errmsgp); |
|---|
| 1122 | char *dbxopenc(char *gidbnp, char *filnamp,int *opnp,int *opwp,char *errmsgp, int xcreate, int xappend); |
|---|
| 1123 | void dbxinit(void); |
|---|
| 1124 | void fatal(char *msg); |
|---|
| 1125 | int fpccreat(char *gidbnp, char *namp,char *extp,int lrecl); |
|---|
| 1126 | void fpcwrite(char *recbufp,FFI reclen); |
|---|
| 1127 | void fpcclose(void); |
|---|
| 1128 | char *dbxtmpnm(char *dirtmp, int strip, char *filnamp); |
|---|
| 1129 | char *cicopyr(char *namep); |
|---|
| 1130 | #else |
|---|
| 1131 | #if MULTI |
|---|
| 1132 | int dbxcinet(); |
|---|
| 1133 | int dbxflock(); |
|---|
| 1134 | int dbxulock(); |
|---|
| 1135 | int dbxilock(); |
|---|
| 1136 | int dbxwlock(); |
|---|
| 1137 | #endif /* MULTI */ |
|---|
| 1138 | void dbxflush(); |
|---|
| 1139 | DBXSTRU *dbxsrchp(); |
|---|
| 1140 | DBXSTRU *dbxstorp(); |
|---|
| 1141 | int dbxopen(); |
|---|
| 1142 | int CLOSE(); |
|---|
| 1143 | int dbxopenw(); |
|---|
| 1144 | char *dbxopenc(); |
|---|
| 1145 | void dbxinit(); |
|---|
| 1146 | void fatal(); |
|---|
| 1147 | int fpccreat(); |
|---|
| 1148 | void fpcwrite(); |
|---|
| 1149 | void fpcclose(); |
|---|
| 1150 | char *dbxtmpnm(); |
|---|
| 1151 | char *cicopyr(); |
|---|
| 1152 | #endif /* ANSI */ |
|---|
| 1153 | #endif /* CICPP */ |
|---|
| 1154 | #endif /* CIAPI */ |
|---|
| 1155 | /* global */ |
|---|
| 1156 | |
|---|
| 1157 | #if !CICPP /* Deslocados para classe CISIS */ |
|---|
| 1158 | extern DBXSTRU *vdbxp[]; /* pointers to the entries */ |
|---|
| 1159 | extern LONGX ndbxs; /* actual #entries */ |
|---|
| 1160 | extern LONGX maxndbx; /* runtime value */ |
|---|
| 1161 | #endif /* CICPP */ |
|---|
| 1162 | |
|---|
| 1163 | #if !CICPP |
|---|
| 1164 | extern int dbxtrace; /* dbxopen/dbxcipar trace */ |
|---|
| 1165 | |
|---|
| 1166 | extern int dbxopt_fatal; /* dbxopen() - fatal when file doesn't exist */ |
|---|
| 1167 | extern int dbxopt_errno; /* dbxopen() - dbname/errno msg before fatal */ |
|---|
| 1168 | |
|---|
| 1169 | extern int dbxopt_mflush; /* record() - flush lastrecread if != dbname */ |
|---|
| 1170 | extern int dbxopt_mclose; /* record() - close lastrecread if != dbname */ |
|---|
| 1171 | extern int dbxopt_iflush; /* term() - flush lasttrmread if != dbname */ |
|---|
| 1172 | |
|---|
| 1173 | extern int dbxopt_ordwr; /* dbxopen() - O_RDWR / O_RDONLY (LM/CD-ROM) */ |
|---|
| 1174 | extern int dbxordwr; /* dbxopen() - dbxopt_ordwr & O_RDWR */ |
|---|
| 1175 | |
|---|
| 1176 | extern off_t dbxfloff; /* dbxflock()/dbxulock() - offset */ |
|---|
| 1177 | extern LONGX dbxflsiz; /* dbxflock()/dbxulock() - length */ |
|---|
| 1178 | extern int dbxfloop; /* dbxflock() - #retries */ |
|---|
| 1179 | extern int dbxwloop; /* dbxwlock() - #retries */ |
|---|
| 1180 | extern int dbxiloop; /* dbxilock() - #retries */ |
|---|
| 1181 | extern int dbxuclos; /* dbxulock() - close/reopen */ |
|---|
| 1182 | extern int dbxewlrc; /* dbxflock()/dbxwlock() error action */ |
|---|
| 1183 | |
|---|
| 1184 | extern LONGX rec_maxmfrl; /* MAXMFRL/cipar maxmfrl entry */ |
|---|
| 1185 | extern LONGX rec_mstload; /* 28/03/97 */ |
|---|
| 1186 | extern LONGX trm_invload; /* 28/03/97 */ |
|---|
| 1187 | |
|---|
| 1188 | #if CNV_PCBINUM |
|---|
| 1189 | extern char cnv_pcbuff[]; /* PC data representation (swapped) */ |
|---|
| 1190 | #endif |
|---|
| 1191 | |
|---|
| 1192 | #if CNV_PCFILES |
|---|
| 1193 | extern UCHR nodeunibuff[]; /* area para ler pagina de .n01/.n02 */ |
|---|
| 1194 | #if ISISUNISYS |
|---|
| 1195 | #define LEAFCNV_PCFILES 0 |
|---|
| 1196 | #else |
|---|
| 1197 | #define LEAFCNV_PCFILES 1 |
|---|
| 1198 | #endif |
|---|
| 1199 | #if LEAFCNV_PCFILES |
|---|
| 1200 | extern UCHR leafunibuff[]; /* area para ler pagina de .l01/.l02 */ |
|---|
| 1201 | #endif |
|---|
| 1202 | #endif |
|---|
| 1203 | #endif /* CICPP */ |
|---|
| 1204 | |
|---|
| 1205 | #ifndef ON |
|---|
| 1206 | #define ON 1 |
|---|
| 1207 | #endif |
|---|
| 1208 | #ifndef OFF |
|---|
| 1209 | #define OFF 0 |
|---|
| 1210 | #endif |
|---|
| 1211 | #define BY8SHIFT 3 |
|---|
| 1212 | #define BY8RMASK 0x07 |
|---|
| 1213 | #if !CICPP |
|---|
| 1214 | extern unsigned char bitmask[]; /* 0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01 */ |
|---|
| 1215 | #endif /* CICPP */ |
|---|
| 1216 | |
|---|
| 1217 | #define FPCBSIZ 0x4000 /*16K*/ /* fpccreat()/fpcwrite()/fpcclose() */ |
|---|
| 1218 | #if !CICPP |
|---|
| 1219 | extern int fpc_fd; /* fpccreat()/fpcwrite()/fpcclose() */ |
|---|
| 1220 | extern FFI fpc_left; /* fpccreat()/fpcwrite()/fpcclose() */ |
|---|
| 1221 | extern char *fpc_buffer; /* fpccreat()/fpcwrite()/fpcclose() */ |
|---|
| 1222 | |
|---|
| 1223 | extern int vlex[]; /* use it */ |
|---|
| 1224 | extern int nxbsiz[]; /* use it */ |
|---|
| 1225 | extern int lxbsiz[]; /* use it */ |
|---|
| 1226 | |
|---|
| 1227 | extern char *mx1extp; /* mstsetup/recisis0 */ |
|---|
| 1228 | extern char *xx1extp; /* mstsetup/recisis0 */ |
|---|
| 1229 | |
|---|
| 1230 | extern char *cx1extp; /* invsetup/trmisis0 */ |
|---|
| 1231 | extern char *nx12extp[]; /* invsetup/trmisis0 */ |
|---|
| 1232 | extern char *lx12extp[]; /* invsetup/trmisis0 */ |
|---|
| 1233 | extern char *ix1extp; /* invsetup/trmisis0 */ |
|---|
| 1234 | #if CNLI |
|---|
| 1235 | extern char *iy0extp; /* All IF into one. To ALP, WL */ |
|---|
| 1236 | #endif |
|---|
| 1237 | |
|---|
| 1238 | #if MULTI |
|---|
| 1239 | extern int cipnetws; /* MULTI default operation */ |
|---|
| 1240 | #endif |
|---|
| 1241 | |
|---|
| 1242 | #if DBXMSTXL |
|---|
| 1243 | extern int cipmstxl; /* extended .mst capacity */ |
|---|
| 1244 | #endif |
|---|
| 1245 | #endif /* CICPP */ |
|---|
| 1246 | |
|---|
| 1247 | /* FATRAP Interface */ |
|---|
| 1248 | #define MAXFATML 80 /* for fatal_iomsg or equivalent */ |
|---|
| 1249 | #if FATRAP |
|---|
| 1250 | #if !CICPP /* Deslocados para a classe CISIS em cisis.hpp */ |
|---|
| 1251 | /* global */ |
|---|
| 1252 | extern int fatal_errcod; /* cisis fatal() error code */ |
|---|
| 1253 | extern char fatal_iomsg[]; /* cisis fatal() flag/msg */ |
|---|
| 1254 | extern jmp_buf fatal_jumper; /* cisis fatal() longjmp() */ |
|---|
| 1255 | #endif /* CICPP */ |
|---|
| 1256 | #endif |
|---|
| 1257 | |
|---|
| 1258 | #if !CICPP /* Deslocados para a classe DBXSTRU em cidbx.cpp */ |
|---|
| 1259 | /* CIPAR Interface */ |
|---|
| 1260 | #if ANSI |
|---|
| 1261 | int dbxciset(char *cipfile); |
|---|
| 1262 | char *dbxcipar(char *gidbnp, char argkey[], char argchar); |
|---|
| 1263 | #if GIPAR |
|---|
| 1264 | char *dbxgipar(char *gidbnp, char *gikeyp, int *namlenp, int *extlenp); |
|---|
| 1265 | #endif |
|---|
| 1266 | #else |
|---|
| 1267 | int dbxciset(); |
|---|
| 1268 | char *dbxcipar(); |
|---|
| 1269 | #if GIPAR |
|---|
| 1270 | int dbxgipar(); |
|---|
| 1271 | #endif |
|---|
| 1272 | #endif |
|---|
| 1273 | #endif /* CICPP */ |
|---|
| 1274 | |
|---|
| 1275 | /* global */ |
|---|
| 1276 | #if !CICPP |
|---|
| 1277 | extern FILE *dbxcipfp; /* dbxcipar() input parameter file pointer */ |
|---|
| 1278 | extern char *dbxcdcip; /* dbxcipar() input data */ |
|---|
| 1279 | extern char dbxcikey[]; /* dbxcipar() actual file name */ |
|---|
| 1280 | extern int dbxcipok; /* dbxcipar() found */ |
|---|
| 1281 | |
|---|
| 1282 | #if GIPAR |
|---|
| 1283 | extern char dbxgikey[]; /* dbxgipar() actual file name */ |
|---|
| 1284 | extern char *dbxgiext[]; /* dbxgipar() dbn.par .extensions */ |
|---|
| 1285 | extern int dbxgiexn[]; /* dbxgipar() dbn.par numbers */ |
|---|
| 1286 | #endif |
|---|
| 1287 | #endif /* CICPP */ |
|---|
| 1288 | |
|---|
| 1289 | |
|---|
| 1290 | /* ***************************************************** |
|---|
| 1291 | CIREC.H |
|---|
| 1292 | ***************************************************** */ |
|---|
| 1293 | |
|---|
| 1294 | typedef struct m0stru { |
|---|
| 1295 | LONGX m0ctlmfn PACKED;/* gdb ctlmfn */ |
|---|
| 1296 | LONGX m0nxtmfn PACKED;/* gdb nxtmfn */ |
|---|
| 1297 | LONGX m0nxtmfb PACKED;/* gdb nxtmfb */ |
|---|
| 1298 | UWORD m0nxtmfp PACKED;/* gdb nxtmfp - offset */ |
|---|
| 1299 | UWORD m0mftype PACKED;/* gdb mftype */ |
|---|
| 1300 | #if PCREADLINUX |
|---|
| 1301 | UWORD fillerXm0mftype; |
|---|
| 1302 | #endif /* PCREADLINUX */ |
|---|
| 1303 | LONGX m0reccnt PACKED;/* gdb reccnt */ |
|---|
| 1304 | LONGX m0mfcxx1 PACKED;/* gdb mfcxx1 */ |
|---|
| 1305 | LONGX m0mfcxx2 PACKED;/* gdb mfcxx2 - MULTI: Data entry lock */ |
|---|
| 1306 | LONGX m0mfcxx3 PACKED;/* gdb mfcxx3 - MULTI: Exclusive write lock */ |
|---|
| 1307 | } M0STRU; |
|---|
| 1308 | |
|---|
| 1309 | typedef struct dir_entry { |
|---|
| 1310 | UWORD tag PACKED;/* gdb dir.tag */ |
|---|
| 1311 | FFI pos PACKED;/* gdb dir.pos */ |
|---|
| 1312 | FFI len PACKED;/* gdb dir.len */ |
|---|
| 1313 | } DIRSTRU; |
|---|
| 1314 | |
|---|
| 1315 | #if CNV_PCFILES |
|---|
| 1316 | typedef struct m1stru { /* Conversion is done during I/O */ |
|---|
| 1317 | LONGX m1mfn; /* gdb mfn */ |
|---|
| 1318 | LONGX m1mfbwb; /* gdb mfbwb */ |
|---|
| 1319 | FFI m1mfrl; /* gdb mfrl - MULTI: record being updated */ |
|---|
| 1320 | UWORD m1mfbwp; /* gdb mfbwp - offset */ |
|---|
| 1321 | FFI m1base; /* gdb base */ |
|---|
| 1322 | UWORD m1nvf; /* gdb nvf */ |
|---|
| 1323 | UWORD m1status; /* gdb status */ |
|---|
| 1324 | DIRSTRU m1dir[1]; /* gdb dir_entries */ |
|---|
| 1325 | } M1STRU; |
|---|
| 1326 | #else |
|---|
| 1327 | typedef struct m1stru { |
|---|
| 1328 | /* PACKED CIFFI */ |
|---|
| 1329 | /* 4 */ LONGX m1mfn PACKED;/* gdb mfn */ |
|---|
| 1330 | /* 2 4 */ FFI m1mfrl PACKED;/* gdb mfrl - MULTI: record being updated */ |
|---|
| 1331 | #if PCREADLINUX |
|---|
| 1332 | UWORD fillerXm1mfrl; |
|---|
| 1333 | #endif /* PCREADLINUX */ |
|---|
| 1334 | /* 4 */ LONGX m1mfbwb PACKED;/* gdb mfbwb */ |
|---|
| 1335 | /* 2 */ UWORD m1mfbwp PACKED;/* gdb mfbwp - offset */ |
|---|
| 1336 | /* 2 4 */ FFI m1base PACKED;/* gdb base (MSNVSPLT) */ |
|---|
| 1337 | /* 14 18 */ |
|---|
| 1338 | /* ? 20 */ |
|---|
| 1339 | /* 2 */ UWORD m1nvf PACKED;/* gdb nvf */ |
|---|
| 1340 | /* 2 */ UWORD m1status PACKED;/* gdb status */ |
|---|
| 1341 | /* 18 22 */ |
|---|
| 1342 | /* 20 24 align4 */ |
|---|
| 1343 | /* 6 10 */ DIRSTRU m1dir[1] PACKED;/* gdb dir_entries */ |
|---|
| 1344 | /* ? ? align4 */ |
|---|
| 1345 | } M1STRU; |
|---|
| 1346 | #endif |
|---|
| 1347 | |
|---|
| 1348 | #if CIFFI || PCREADLINUX |
|---|
| 1349 | #if 0 |
|---|
| 1350 | #define LEADER 22 /* gdb */ |
|---|
| 1351 | #define MSNVSPLT 18 /* gdb .mst never split - 'til base */ |
|---|
| 1352 | #endif /* 0 */ |
|---|
| 1353 | #define LEADER (sizeof(M1STRU)-sizeof(DIRSTRU)) /* pc=18,hp=20;ff=22/24 */ |
|---|
| 1354 | #define MSNVSPLT (LEADER-sizeof(UWORD)-sizeof(UWORD)) /* pc=14,hp=16;ff=18/20 */ |
|---|
| 1355 | #else /* CIFFI */ |
|---|
| 1356 | #if ISPACKED || CNV_PCFILES /* PC || VAX || CNV_PCFILES */ |
|---|
| 1357 | #define LEADER 18 /* gdb */ |
|---|
| 1358 | #define MSNVSPLT 14 /* gdb .mst never split - 'til base */ |
|---|
| 1359 | #else /* ISPACKED || CNV_PCFILES */ |
|---|
| 1360 | #define LEADER 20 /* gdb */ |
|---|
| 1361 | #define MSNVSPLT 16 /* gdb .mst never split - 'til base */ |
|---|
| 1362 | #endif /* ISPACKED || CNV_PCFILES */ |
|---|
| 1363 | #endif /* CIFFI */ |
|---|
| 1364 | |
|---|
| 1365 | |
|---|
| 1366 | typedef union mfunion { |
|---|
| 1367 | M0STRU m0; |
|---|
| 1368 | M1STRU m1; |
|---|
| 1369 | char mx[1]; /* gdb flds */ |
|---|
| 1370 | } MFUNION; |
|---|
| 1371 | |
|---|
| 1372 | #if CIAPI |
|---|
| 1373 | typedef void RECSTRU; |
|---|
| 1374 | #else /* CIAPI */ |
|---|
| 1375 | #if CICPP |
|---|
| 1376 | class _YOURCLASS RECSTRU; /* Para substituir def da struct */ |
|---|
| 1377 | #endif /* CICPP */ |
|---|
| 1378 | |
|---|
| 1379 | #if !CICPP /* Declarada como classe em cirec.hpp */ |
|---|
| 1380 | typedef struct recstru { |
|---|
| 1381 | LONGX recnbytes; /* nbytes allocated (RECHSIZE not included) */ |
|---|
| 1382 | int rectype; /* layout indicator */ |
|---|
| 1383 | DBXSTRU *recdbxp; /* ptr dbx */ |
|---|
| 1384 | int recrc; /* record rc */ |
|---|
| 1385 | #if MULTI |
|---|
| 1386 | int reclock; /* mfr read/lock option */ |
|---|
| 1387 | int recwlock; /* mfr write/lock option */ |
|---|
| 1388 | #endif |
|---|
| 1389 | int recgdbl; /* mfr read/mfrl lock granted */ |
|---|
| 1390 | int recgdbw; /* mfr read/mfrl flag */ |
|---|
| 1391 | MFUNION recmf; /* master_recs and .mx unions */ |
|---|
| 1392 | } RECSTRU; |
|---|
| 1393 | |
|---|
| 1394 | #define RECHSIZE sizeof(RECSTRU)-sizeof(MFUNION) |
|---|
| 1395 | #endif /* CICPP */ |
|---|
| 1396 | |
|---|
| 1397 | #define RECnbytes recp->recnbytes |
|---|
| 1398 | #define RECtype recp->rectype |
|---|
| 1399 | |
|---|
| 1400 | #define RECdbxp recp->recdbxp |
|---|
| 1401 | |
|---|
| 1402 | #define RDBname recp->recdbxp->dbxname |
|---|
| 1403 | #define RDBxropn recp->recdbxp->dbxxropn |
|---|
| 1404 | #define RDBmsopn recp->recdbxp->dbxmsopn |
|---|
| 1405 | #define RDBxropw recp->recdbxp->dbxxropw |
|---|
| 1406 | #define RDBmsopw recp->recdbxp->dbxmsopw |
|---|
| 1407 | #define RDBmsopv recp->recdbxp->dbxmsopv |
|---|
| 1408 | #define RDBxribp recp->recdbxp->dbxxribp |
|---|
| 1409 | #define RDBmsibp recp->recdbxp->dbxmsibp |
|---|
| 1410 | #if GIPAR |
|---|
| 1411 | #define RDBgicip recp->recdbxp->dbxgicip |
|---|
| 1412 | #endif |
|---|
| 1413 | #if DBXMSTXL |
|---|
| 1414 | #define RDBmstxl recp->recdbxp->dbxmstxl |
|---|
| 1415 | #endif |
|---|
| 1416 | #define RDBmflush recp->recdbxp->dbxmflush |
|---|
| 1417 | #define RDBmclose recp->recdbxp->dbxmclose |
|---|
| 1418 | #if MULTI |
|---|
| 1419 | #define RDBnetws recp->recdbxp->dbxnetws |
|---|
| 1420 | #define RDBdelxx recp->recdbxp->dbxdelxx |
|---|
| 1421 | #define RDBewlxx recp->recdbxp->dbxewlxx |
|---|
| 1422 | #define RDBmxtmp recp->recdbxp->dbxmxtmp |
|---|
| 1423 | #endif |
|---|
| 1424 | #define RDBmsmfn recp->recdbxp->dbxmsmfn |
|---|
| 1425 | #define RDBifmap recp->recdbxp->dbxifmap |
|---|
| 1426 | #define RDBiflxx recp->recdbxp->dbxiflxx |
|---|
| 1427 | #define RDBxryyp recp->recdbxp->dbxxryyp |
|---|
| 1428 | #define RDBmsyyp recp->recdbxp->dbxmsyyp |
|---|
| 1429 | #if RECGIZM |
|---|
| 1430 | #define RDBvgzrp recp->recdbxp->dbxvgzrp |
|---|
| 1431 | #endif |
|---|
| 1432 | #if RECXPND |
|---|
| 1433 | #define RDBxpn01 recp->recdbxp->dbxxpn01 |
|---|
| 1434 | #define RDBxpn02 recp->recdbxp->dbxxpn02 |
|---|
| 1435 | #endif |
|---|
| 1436 | #if RECDECO |
|---|
| 1437 | #define RDBvderp recp->recdbxp->dbxvderp |
|---|
| 1438 | #endif |
|---|
| 1439 | |
|---|
| 1440 | #define RECrc recp->recrc |
|---|
| 1441 | #if MULTI |
|---|
| 1442 | #define REClock recp->reclock |
|---|
| 1443 | #define RECwlock recp->recwlock |
|---|
| 1444 | #endif |
|---|
| 1445 | #define RECgdbl recp->recgdbl |
|---|
| 1446 | #define RECgdbw recp->recgdbw |
|---|
| 1447 | |
|---|
| 1448 | #if CICPP |
|---|
| 1449 | #define MF0ctlmfn recp->recmfp->m0.m0ctlmfn |
|---|
| 1450 | #define MF0nxtmfn recp->recmfp->m0.m0nxtmfn |
|---|
| 1451 | #define MF0nxtmfb recp->recmfp->m0.m0nxtmfb |
|---|
| 1452 | #define MF0nxtmfp recp->recmfp->m0.m0nxtmfp |
|---|
| 1453 | #define MF0mftype recp->recmfp->m0.m0mftype |
|---|
| 1454 | #define MF0reccnt recp->recmfp->m0.m0reccnt |
|---|
| 1455 | #define MF0mfcxx1 recp->recmfp->m0.m0mfcxx1 |
|---|
| 1456 | #define MF0mfcxx2 recp->recmfp->m0.m0mfcxx2 |
|---|
| 1457 | #define MF0mfcxx3 recp->recmfp->m0.m0mfcxx3 |
|---|
| 1458 | |
|---|
| 1459 | #define MFRmfn recp->recmfp->m1.m1mfn |
|---|
| 1460 | #define MFRmfrl recp->recmfp->m1.m1mfrl |
|---|
| 1461 | #define MFRmfbwb recp->recmfp->m1.m1mfbwb |
|---|
| 1462 | #define MFRmfbwp recp->recmfp->m1.m1mfbwp |
|---|
| 1463 | #define MFRbase recp->recmfp->m1.m1base |
|---|
| 1464 | #define MFRnvf recp->recmfp->m1.m1nvf |
|---|
| 1465 | #define MFRstatus recp->recmfp->m1.m1status |
|---|
| 1466 | #define MFRdir recp->recmfp->m1.m1dir |
|---|
| 1467 | |
|---|
| 1468 | #define DIRtag(x) recp->recmfp->m1.m1dir[x].tag |
|---|
| 1469 | #define DIRpos(x) recp->recmfp->m1.m1dir[x].pos |
|---|
| 1470 | #define DIRlen(x) recp->recmfp->m1.m1dir[x].len |
|---|
| 1471 | |
|---|
| 1472 | #define MFX recp->recmfp->mx |
|---|
| 1473 | #else /* CICPP */ |
|---|
| 1474 | #define MF0ctlmfn recp->recmf.m0.m0ctlmfn |
|---|
| 1475 | #define MF0nxtmfn recp->recmf.m0.m0nxtmfn |
|---|
| 1476 | #define MF0nxtmfb recp->recmf.m0.m0nxtmfb |
|---|
| 1477 | #define MF0nxtmfp recp->recmf.m0.m0nxtmfp |
|---|
| 1478 | #define MF0mftype recp->recmf.m0.m0mftype |
|---|
| 1479 | #define MF0reccnt recp->recmf.m0.m0reccnt |
|---|
| 1480 | #define MF0mfcxx1 recp->recmf.m0.m0mfcxx1 |
|---|
| 1481 | #define MF0mfcxx2 recp->recmf.m0.m0mfcxx2 |
|---|
| 1482 | #define MF0mfcxx3 recp->recmf.m0.m0mfcxx3 |
|---|
| 1483 | |
|---|
| 1484 | #define MFRmfn recp->recmf.m1.m1mfn |
|---|
| 1485 | #define MFRmfrl recp->recmf.m1.m1mfrl |
|---|
| 1486 | #define MFRmfbwb recp->recmf.m1.m1mfbwb |
|---|
| 1487 | #define MFRmfbwp recp->recmf.m1.m1mfbwp |
|---|
| 1488 | #define MFRbase recp->recmf.m1.m1base |
|---|
| 1489 | #define MFRnvf recp->recmf.m1.m1nvf |
|---|
| 1490 | #define MFRstatus recp->recmf.m1.m1status |
|---|
| 1491 | #define MFRdir recp->recmf.m1.m1dir |
|---|
| 1492 | |
|---|
| 1493 | #define DIRtag(x) recp->recmf.m1.m1dir[x].tag |
|---|
| 1494 | #define DIRpos(x) recp->recmf.m1.m1dir[x].pos |
|---|
| 1495 | #define DIRlen(x) recp->recmf.m1.m1dir[x].len |
|---|
| 1496 | |
|---|
| 1497 | #define MFX recp->recmf.mx |
|---|
| 1498 | #endif /* CICPP */ |
|---|
| 1499 | |
|---|
| 1500 | #define VRECnbytes(r) vrecp[r]->recnbytes |
|---|
| 1501 | #define VRECtype(r) vrecp[r]->rectype |
|---|
| 1502 | |
|---|
| 1503 | #define VRECdbxp(r) vrecp[r]->recdbxp |
|---|
| 1504 | |
|---|
| 1505 | #define VRDBname(r) vrecp[r]->recdbxp->dbxname |
|---|
| 1506 | #define VRDBxropn(r) vrecp[r]->recdbxp->dbxxropn |
|---|
| 1507 | #define VRDBmsopn(r) vrecp[r]->recdbxp->dbxmsopn |
|---|
| 1508 | #define VRDBxropw(r) vrecp[r]->recdbxp->dbxxropw |
|---|
| 1509 | #define VRDBmsopw(r) vrecp[r]->recdbxp->dbxmsopw |
|---|
| 1510 | #define VRDBmsopv(r) vrecp[r]->recdbxp->dbxmsopv |
|---|
| 1511 | #define VRDBxribp(r) vrecp[r]->recdbxp->dbxxribp |
|---|
| 1512 | #define VRDBmsibp(r) vrecp[r]->recdbxp->dbxmsibp |
|---|
| 1513 | #if GIPAR |
|---|
| 1514 | #define VRDBgicip(r) vrecp[r]->recdbxp->dbxgicip |
|---|
| 1515 | #endif |
|---|
| 1516 | #if DBXMSTXL |
|---|
| 1517 | #define VRDBmstxl(r) vrecp[r]->recdbxp->dbxmstxl |
|---|
| 1518 | #endif |
|---|
| 1519 | #define VRDBmflush(r) vrecp[r]->recdbxp->dbxmflush |
|---|
| 1520 | #define VRDBmclose(r) vrecp[r]->recdbxp->dbxmclose |
|---|
| 1521 | #if MULTI |
|---|
| 1522 | #define VRDBnetws(r) vrecp[r]->recdbxp->dbxnetws |
|---|
| 1523 | #define VRDBdelxx(r) vrecp[r]->recdbxp->dbxdelxx |
|---|
| 1524 | #define VRDBewlxx(r) vrecp[r]->recdbxp->dbxewlxx |
|---|
| 1525 | #define VRDBmxtmp(r) vrecp[r]->recdbxp->dbxmxtmp |
|---|
| 1526 | #endif |
|---|
| 1527 | #define VRDBmsmfn(r) vrecp[r]->recdbxp->dbxmsmfn |
|---|
| 1528 | #define VRDBifmap(r) vrecp[r]->recdbxp->dbxifmap |
|---|
| 1529 | #define VRDBiflxx(r) vrecp[r]->recdbxp->dbxiflxx |
|---|
| 1530 | #define VRDBxryyp(r) vrecp[r]->recdbxp->dbxxryyp |
|---|
| 1531 | #define VRDBmsyyp(r) vrecp[r]->recdbxp->dbxmsyyp |
|---|
| 1532 | #if RECGIZM |
|---|
| 1533 | #define VRDBvgzrp(r) vrecp[r]->recdbxp->dbxvgzrp |
|---|
| 1534 | #endif |
|---|
| 1535 | #if RECXPND |
|---|
| 1536 | #define VRDBxpn01(r) vrecp[r]->recdbxp->dbxxpn01 |
|---|
| 1537 | #define VRDBxpn02(r) vrecp[r]->recdbxp->dbxxpn02 |
|---|
| 1538 | #endif |
|---|
| 1539 | #if RECDECO |
|---|
| 1540 | #define VRDBvderp(r) vrecp[r]->recdbxp->dbxvderp |
|---|
| 1541 | #endif |
|---|
| 1542 | |
|---|
| 1543 | #define VRECrc(r) vrecp[r]->recrc |
|---|
| 1544 | #if MULTI |
|---|
| 1545 | #define VREClock(r) vrecp[r]->reclock |
|---|
| 1546 | #define VRECwlock(r) vrecp[r]->recwlock |
|---|
| 1547 | #endif |
|---|
| 1548 | #define VRECgdbl(r) vrecp[r]->recgdbl |
|---|
| 1549 | #define VRECgdbw(r) vrecp[r]->recgdbw |
|---|
| 1550 | |
|---|
| 1551 | #if CICPP |
|---|
| 1552 | #define VMF0ctlmfn(r) vrecp[r]->recmfp->m0.m0ctlmfn |
|---|
| 1553 | #define VMF0nxtmfn(r) vrecp[r]->recmfp->m0.m0nxtmfn |
|---|
| 1554 | #define VMF0nxtmfb(r) vrecp[r]->recmfp->m0.m0nxtmfb |
|---|
| 1555 | #define VMF0nxtmfp(r) vrecp[r]->recmfp->m0.m0nxtmfp |
|---|
| 1556 | #define VMF0mftype(r) vrecp[r]->recmfp->m0.m0mftype |
|---|
| 1557 | #define VMF0reccnt(r) vrecp[r]->recmfp->m0.m0reccnt |
|---|
| 1558 | #define VMF0mfcxx1(r) vrecp[r]->recmfp->m0.m0mfcxx1 |
|---|
| 1559 | #define VMF0mfcxx2(r) vrecp[r]->recmfp->m0.m0mfcxx2 |
|---|
| 1560 | #define VMF0mfcxx3(r) vrecp[r]->recmfp->m0.m0mfcxx3 |
|---|
| 1561 | |
|---|
| 1562 | #define VMFRmfn(r) vrecp[r]->recmfp->m1.m1mfn |
|---|
| 1563 | #define VMFRmfrl(r) vrecp[r]->recmfp->m1.m1mfrl |
|---|
| 1564 | #define VMFRmfbwb(r) vrecp[r]->recmfp->m1.m1mfbwb |
|---|
| 1565 | #define VMFRmfbwp(r) vrecp[r]->recmfp->m1.m1mfbwp |
|---|
| 1566 | #define VMFRbase(r) vrecp[r]->recmfp->m1.m1base |
|---|
| 1567 | #define VMFRnvf(r) vrecp[r]->recmfp->m1.m1nvf |
|---|
| 1568 | #define VMFRstatus(r) vrecp[r]->recmfp->m1.m1status |
|---|
| 1569 | #define VMFRdir(r) vrecp[r]->recmfp->m1.m1dir |
|---|
| 1570 | |
|---|
| 1571 | #define VDIRtag(r,x) vrecp[r]->recmfp->m1.m1dir[x].tag |
|---|
| 1572 | #define VDIRpos(r,x) vrecp[r]->recmfp->m1.m1dir[x].pos |
|---|
| 1573 | #define VDIRlen(r,x) vrecp[r]->recmfp->m1.m1dir[x].len |
|---|
| 1574 | |
|---|
| 1575 | #define VMFX(r) vrecp[r]->recmfp->mx |
|---|
| 1576 | #else /* CICPP */ |
|---|
| 1577 | #define VMF0ctlmfn(r) vrecp[r]->recmf.m0.m0ctlmfn |
|---|
| 1578 | #define VMF0nxtmfn(r) vrecp[r]->recmf.m0.m0nxtmfn |
|---|
| 1579 | #define VMF0nxtmfb(r) vrecp[r]->recmf.m0.m0nxtmfb |
|---|
| 1580 | #define VMF0nxtmfp(r) vrecp[r]->recmf.m0.m0nxtmfp |
|---|
| 1581 | #define VMF0mftype(r) vrecp[r]->recmf.m0.m0mftype |
|---|
| 1582 | #define VMF0reccnt(r) vrecp[r]->recmf.m0.m0reccnt |
|---|
| 1583 | #define VMF0mfcxx1(r) vrecp[r]->recmf.m0.m0mfcxx1 |
|---|
| 1584 | #define VMF0mfcxx2(r) vrecp[r]->recmf.m0.m0mfcxx2 |
|---|
| 1585 | #define VMF0mfcxx3(r) vrecp[r]->recmf.m0.m0mfcxx3 |
|---|
| 1586 | |
|---|
| 1587 | #define VMFRmfn(r) vrecp[r]->recmf.m1.m1mfn |
|---|
| 1588 | #define VMFRmfrl(r) vrecp[r]->recmf.m1.m1mfrl |
|---|
| 1589 | #define VMFRmfbwb(r) vrecp[r]->recmf.m1.m1mfbwb |
|---|
| 1590 | #define VMFRmfbwp(r) vrecp[r]->recmf.m1.m1mfbwp |
|---|
| 1591 | #define VMFRbase(r) vrecp[r]->recmf.m1.m1base |
|---|
| 1592 | #define VMFRnvf(r) vrecp[r]->recmf.m1.m1nvf |
|---|
| 1593 | #define VMFRstatus(r) vrecp[r]->recmf.m1.m1status |
|---|
| 1594 | #define VMFRdir(r) vrecp[r]->recmf.m1.m1dir |
|---|
| 1595 | |
|---|
| 1596 | #define VDIRtag(r,x) vrecp[r]->recmf.m1.m1dir[x].tag |
|---|
| 1597 | #define VDIRpos(r,x) vrecp[r]->recmf.m1.m1dir[x].pos |
|---|
| 1598 | #define VDIRlen(r,x) vrecp[r]->recmf.m1.m1dir[x].len |
|---|
| 1599 | |
|---|
| 1600 | #define VMFX(r) vrecp[r]->recmf.mx |
|---|
| 1601 | #endif /* CICPP */ |
|---|
| 1602 | |
|---|
| 1603 | #define FIELDP(xdir) MFX+(MFRbase+DIRpos(xdir)) |
|---|
| 1604 | |
|---|
| 1605 | #define VFIELDP(irec,xdir) VMFX(irec)+(VMFRbase(irec)+VDIRpos(irec,xdir)) |
|---|
| 1606 | |
|---|
| 1607 | #endif /* CIAPI */ |
|---|
| 1608 | |
|---|
| 1609 | #define TYPEMF0 11 |
|---|
| 1610 | #define TYPEMFR 12 |
|---|
| 1611 | #define TYPEX 13 |
|---|
| 1612 | #define TYPEMFQ TYPEMFR /* 31 */ |
|---|
| 1613 | |
|---|
| 1614 | #if MULTI |
|---|
| 1615 | #define NOLOCK 0 /* recread() unlocked option */ |
|---|
| 1616 | #define RLOCK 1 /* recread() record lock */ |
|---|
| 1617 | #define DELOCK 2 /* recread() data entry lock */ |
|---|
| 1618 | #define RDELOCK 3 /* recread() record or data entry lock */ |
|---|
| 1619 | #define EWLOCK 4 /* recread() exclusive write lock */ |
|---|
| 1620 | #define FORCE 8 /* recunlck() force unlock */ |
|---|
| 1621 | #define WUNLOCK 1 /* recwrite() unlock */ |
|---|
| 1622 | #define WLOCK 2 /* recwrite() keep lock */ |
|---|
| 1623 | #define NEWREC 4 /* recwrite() new record mask */ |
|---|
| 1624 | #endif |
|---|
| 1625 | |
|---|
| 1626 | #define RCLOCK (-2) /* gdb - Lock refused */ |
|---|
| 1627 | #define RCEOF (-1) /* gdb */ |
|---|
| 1628 | #define RCNORMAL 0 /* gdb */ |
|---|
| 1629 | #define RCLDEL 1 /* gdb */ |
|---|
| 1630 | #define RCPDEL 2 /* gdb */ |
|---|
| 1631 | |
|---|
| 1632 | #define ACTIVE 0 /* gdb - mfr.leader.status */ |
|---|
| 1633 | #define DELETED 1 /* gdb - mfr.leader.status */ |
|---|
| 1634 | |
|---|
| 1635 | /* CIREC Interface */ |
|---|
| 1636 | #if !CICPP /* transferidas para a classe RECSTRU */ |
|---|
| 1637 | #if ANSI |
|---|
| 1638 | LONGX recallok(LONGX irec, LONGX nbytes); |
|---|
| 1639 | LONGX record(LONGX irec, char *dbnamp, LONGX mfn); |
|---|
| 1640 | int nocc(LONGX irec, int tag); |
|---|
| 1641 | int fieldx(LONGX irec, int tag, int occ); |
|---|
| 1642 | int fieldn(LONGX irec, int tag, int occ); |
|---|
| 1643 | int recread(RECSTRU *recp, LONGX mfn); |
|---|
| 1644 | int recxref(RECSTRU *recp, LONGX mfn, LONGX *comb, int *comp); |
|---|
| 1645 | void recinit(void); |
|---|
| 1646 | void mstsetup(char *dbnamp, LONGX loadxrf, LONGX loadmst); |
|---|
| 1647 | void mstflush(char *dbnamp); |
|---|
| 1648 | void mstclose(DBXSTRU *dbxp); |
|---|
| 1649 | #else |
|---|
| 1650 | LONGX recallok(); |
|---|
| 1651 | LONGX record(); |
|---|
| 1652 | int nocc(); |
|---|
| 1653 | int fieldx(); |
|---|
| 1654 | int fieldn(); |
|---|
| 1655 | int recread(); |
|---|
| 1656 | int recxref(); |
|---|
| 1657 | void recinit(); |
|---|
| 1658 | void mstsetup(); |
|---|
| 1659 | void mstflush(); |
|---|
| 1660 | void mstclose(); |
|---|
| 1661 | #endif |
|---|
| 1662 | #endif /* CICPP */ |
|---|
| 1663 | |
|---|
| 1664 | /* global */ |
|---|
| 1665 | #if !CICPP |
|---|
| 1666 | extern RECSTRU *vrecp[]; /* pointers to the entries */ |
|---|
| 1667 | extern LONGX nrecs; /* actual #entries */ |
|---|
| 1668 | extern LONGX maxnrec; /* runtime value */ |
|---|
| 1669 | #endif /* CICPP */ |
|---|
| 1670 | |
|---|
| 1671 | #if !CICPP |
|---|
| 1672 | extern int rectrace; /* rec RESTRACE runtime switch */ |
|---|
| 1673 | |
|---|
| 1674 | extern LONGX recxrefb; /* recxref() comb */ |
|---|
| 1675 | extern int recxrefp; /* recxref() comp */ |
|---|
| 1676 | extern int recxrefn; /* recxref() flagnew */ |
|---|
| 1677 | extern int recxrefm; /* recxref() flagmod */ |
|---|
| 1678 | extern FFI recreadl; /* force recread() mfrl */ |
|---|
| 1679 | #if IFUPDATE |
|---|
| 1680 | extern LONGX recreadb; /* force recread() comb = mfbwb */ |
|---|
| 1681 | extern int recreadp; /* force recread() comp = mfbwp */ |
|---|
| 1682 | #endif |
|---|
| 1683 | #endif /* CICPP */ |
|---|
| 1684 | |
|---|
| 1685 | |
|---|
| 1686 | |
|---|
| 1687 | /* ***************************************************** |
|---|
| 1688 | CIGIZ.H |
|---|
| 1689 | ***************************************************** */ |
|---|
| 1690 | |
|---|
| 1691 | #if RECGIZM |
|---|
| 1692 | #define GIZMTAG1 1 |
|---|
| 1693 | #define GIZMTAG2 2 |
|---|
| 1694 | #define GIZMTAG11 11 |
|---|
| 1695 | #define GIZMTAG21 21 |
|---|
| 1696 | |
|---|
| 1697 | #if !CIAPI |
|---|
| 1698 | |
|---|
| 1699 | /* CIGIZ Interface */ |
|---|
| 1700 | #if ANSI |
|---|
| 1701 | unsigned char *pattalloc(int n); |
|---|
| 1702 | GIZMSTRU *gizmalloc(int n); |
|---|
| 1703 | #if CICPP |
|---|
| 1704 | int gizmread(CISISX *cisisxp, char *gizdbnp, VGIZPSTRU **vgizmpp); |
|---|
| 1705 | LONGX recgizmo(CISISX *cisisxp, RECSTRU *recp, VGIZPSTRU *vgizmap); |
|---|
| 1706 | #else /* CICPP */ |
|---|
| 1707 | int gizmread(char *gizdbnp, VGIZPSTRU **vgizpp, LONGX irec); |
|---|
| 1708 | LONGX recgizmo(LONGX irec, VGIZPSTRU *vgizmap); |
|---|
| 1709 | #endif /* CICPP */ |
|---|
| 1710 | void gizflush(VGIZPSTRU *vgizmap); |
|---|
| 1711 | #else |
|---|
| 1712 | unsigned char *pattalloc(); |
|---|
| 1713 | GIZMSTRU *gizmalloc(); |
|---|
| 1714 | int gizmread(); |
|---|
| 1715 | LONGX recgizmo(); |
|---|
| 1716 | void gizflush(); |
|---|
| 1717 | #endif /* ANSI */ |
|---|
| 1718 | |
|---|
| 1719 | #endif /* !CIAPI */ |
|---|
| 1720 | |
|---|
| 1721 | |
|---|
| 1722 | #endif /* RECGIZM */ |
|---|
| 1723 | |
|---|
| 1724 | #if RECXPND |
|---|
| 1725 | #if ANSI |
|---|
| 1726 | #if CICPP |
|---|
| 1727 | LONGX recxpnmo(RECSTRU *recp); |
|---|
| 1728 | LONGX recxpn00 (RECSTRU *recp, int xpn01, int xpn02); |
|---|
| 1729 | #else /* CICPP */ |
|---|
| 1730 | LONGX recxpnmo(LONGX irec); |
|---|
| 1731 | LONGX recxpn00(LONGX irec, int xpn01, int xpn02); |
|---|
| 1732 | #endif /* CICPP */ |
|---|
| 1733 | #else |
|---|
| 1734 | LONGX recxpnmo(); |
|---|
| 1735 | LONGX recxpn00(); |
|---|
| 1736 | #endif /* ANSI */ |
|---|
| 1737 | #endif /* RECXPND */ |
|---|
| 1738 | |
|---|
| 1739 | |
|---|
| 1740 | #if RECDECO |
|---|
| 1741 | #define DECOTAG1 1 |
|---|
| 1742 | #define DECOTAG2 2 |
|---|
| 1743 | #define DECOTAG3 3 |
|---|
| 1744 | #define DECOTAG4 4 |
|---|
| 1745 | |
|---|
| 1746 | /* CIDEC Interface */ |
|---|
| 1747 | #if ANSI |
|---|
| 1748 | #if CICPP |
|---|
| 1749 | int recdecod(CISISX * cisisxp, RECSTRU *recp, char *decdbnp); |
|---|
| 1750 | LONGX recdecex (CISISX * cisisxp, RECSTRU *recp); |
|---|
| 1751 | #else /* CICPP */ |
|---|
| 1752 | int recdecod(LONGX irec, char *decdbnp, LONGX wrec); |
|---|
| 1753 | LONGX recdecex(LONGX irec); |
|---|
| 1754 | #endif /* CICPP */ |
|---|
| 1755 | void decflush(VDECPSTRU *vdecmap); |
|---|
| 1756 | #else |
|---|
| 1757 | int recdecod(); |
|---|
| 1758 | LONGX recdecex(); |
|---|
| 1759 | void decflush(); |
|---|
| 1760 | #endif /* ANSI */ |
|---|
| 1761 | #endif /* RECDECO */ |
|---|
| 1762 | |
|---|
| 1763 | /* global */ |
|---|
| 1764 | #if !CICPP |
|---|
| 1765 | extern int dectrace; /* decoread()/recdeco() runtime switch */ |
|---|
| 1766 | #endif /* CICPP */ |
|---|
| 1767 | |
|---|
| 1768 | |
|---|
| 1769 | |
|---|
| 1770 | /* ***************************************************** |
|---|
| 1771 | CITRM.H |
|---|
| 1772 | ***************************************************** */ |
|---|
| 1773 | |
|---|
| 1774 | |
|---|
| 1775 | typedef struct n1idxe { |
|---|
| 1776 | UCHR key[LE1] PACKED; /* gdb .n01 idx key */ |
|---|
| 1777 | PUNT punt PACKED; /* gdb .n01 idx punt */ |
|---|
| 1778 | } N1IDXE; |
|---|
| 1779 | |
|---|
| 1780 | typedef struct n2idxe { |
|---|
| 1781 | UCHR key[LE2] PACKED; /* gdb .n02 idx key */ |
|---|
| 1782 | PUNT punt PACKED; /* gdb .n02 idx punt */ |
|---|
| 1783 | } N2IDXE; |
|---|
| 1784 | |
|---|
| 1785 | typedef struct n1stru { |
|---|
| 1786 | PUNT pos PACKED; /* gdb .n01 pos */ |
|---|
| 1787 | UWORD ock PACKED; /* gdb .n01 ock */ |
|---|
| 1788 | UWORD it PACKED; /* gdb .n01 it */ |
|---|
| 1789 | N1IDXE idx[TWORDN] PACKED; /* gdb .n01 idx */ |
|---|
| 1790 | } N1STRU; |
|---|
| 1791 | |
|---|
| 1792 | typedef struct n2stru { |
|---|
| 1793 | PUNT pos PACKED; /* gdb .n02 pos */ |
|---|
| 1794 | UWORD ock PACKED; /* gdb .n02 ock */ |
|---|
| 1795 | UWORD it PACKED; /* gdb .n02 it */ |
|---|
| 1796 | N2IDXE idx[TWORDN] PACKED; /* gdb .n02 idx */ |
|---|
| 1797 | } N2STRU; |
|---|
| 1798 | |
|---|
| 1799 | |
|---|
| 1800 | typedef struct l1idxe { |
|---|
| 1801 | UCHR key[LE1] PACKED; /* gdb .l01 idx key */ |
|---|
| 1802 | #if ISISUNISYS |
|---|
| 1803 | UCHR keyalign[2] PACKED; /* see ISIS.PAS for UNISYS */ |
|---|
| 1804 | #endif |
|---|
| 1805 | INFX info1 PACKED; /* gdb .l01 idx info1 */ |
|---|
| 1806 | INFO info2 PACKED; /* gdb .l01 idx info2 */ |
|---|
| 1807 | #if LIND |
|---|
| 1808 | union { |
|---|
| 1809 | INFX info3 PACKED; /* tlc info3 - tot no of docs */ |
|---|
| 1810 | INFX info4 PACKED; /* tlc info4 - posting type and etc */ |
|---|
| 1811 | } info3info4; |
|---|
| 1812 | #endif |
|---|
| 1813 | } L1IDXE; |
|---|
| 1814 | |
|---|
| 1815 | typedef struct l2idxe { |
|---|
| 1816 | UCHR key[LE2] PACKED; /* gdb .l02 idx key */ |
|---|
| 1817 | #if ISISUNISYS |
|---|
| 1818 | UCHR keyalign[2] PACKED; /* see ISIS.PAS for UNISYS */ |
|---|
| 1819 | #endif |
|---|
| 1820 | INFX info1 PACKED; /* gdb .l02 idx info1 */ |
|---|
| 1821 | INFO info2 PACKED; /* gdb .l02 idx info2 */ |
|---|
| 1822 | #if LIND |
|---|
| 1823 | union { |
|---|
| 1824 | INFX info3 PACKED; /* tlc info3 - tot no of docs */ |
|---|
| 1825 | INFX info4 PACKED; /* tlc info4 - posting type and etc */ |
|---|
| 1826 | } info3info4; |
|---|
| 1827 | #endif |
|---|
| 1828 | } L2IDXE; |
|---|
| 1829 | |
|---|
| 1830 | typedef struct l1stru { |
|---|
| 1831 | PUNT pos PACKED; /* gdb .l01 pos */ |
|---|
| 1832 | UWORD ock PACKED; /* gdb .l01 ock */ |
|---|
| 1833 | UWORD it PACKED; /* gdb .l01 it */ |
|---|
| 1834 | PUNT ps PACKED; /* gdb .l01 ps */ |
|---|
| 1835 | #if LIND |
|---|
| 1836 | PUNT psb PACKED; /* tlc gdb .l0x ps backward */ |
|---|
| 1837 | #endif |
|---|
| 1838 | L1IDXE idx[TWORDF] PACKED; /* gdb .l01 idx */ |
|---|
| 1839 | } L1STRU; |
|---|
| 1840 | |
|---|
| 1841 | typedef struct l2stru { |
|---|
| 1842 | PUNT pos PACKED; /* gdb .l02 pos */ |
|---|
| 1843 | UWORD ock PACKED; /* gdb .l02 ock */ |
|---|
| 1844 | UWORD it PACKED; /* gdb .l02 it */ |
|---|
| 1845 | PUNT ps PACKED; /* gdb .l02 ps */ |
|---|
| 1846 | #if LIND |
|---|
| 1847 | PUNT psb PACKED; /* tlc gdb .l0x ps backward */ |
|---|
| 1848 | #endif |
|---|
| 1849 | L2IDXE idx[TWORDF] PACKED; /* gdb .l02 idx */ |
|---|
| 1850 | } L2STRU; |
|---|
| 1851 | |
|---|
| 1852 | |
|---|
| 1853 | #if SAMEL |
|---|
| 1854 | /* *** SAMEL *** */ |
|---|
| 1855 | typedef struct lxidxe { |
|---|
| 1856 | INFX info1; /* gdb .l0x idx info1 */ |
|---|
| 1857 | INFO info2; /* gdb .l0x idx info2 */ |
|---|
| 1858 | #if LIND |
|---|
| 1859 | union { |
|---|
| 1860 | INFX info3; /* tlc info3 - tot no of docs */ |
|---|
| 1861 | INFX info4; /* tlc info4 - posting type and etc */ |
|---|
| 1862 | } info3info4; |
|---|
| 1863 | #endif |
|---|
| 1864 | } LXIDXE; |
|---|
| 1865 | |
|---|
| 1866 | typedef struct lxl1stru { |
|---|
| 1867 | PUNT pos; /* gdb .l01 pos */ |
|---|
| 1868 | UWORD ock; /* gdb .l01 ock */ |
|---|
| 1869 | UWORD it; /* gdb .l01 it */ |
|---|
| 1870 | PUNT ps; /* gdb .l01 ps */ |
|---|
| 1871 | #if LIND |
|---|
| 1872 | PUNT psb; /* tlc gdb .l0x ps backward */ |
|---|
| 1873 | #endif |
|---|
| 1874 | UCHR key[TWORDF][LE1]; /* gdb .l01 idx key */ |
|---|
| 1875 | LXIDXE idx[1][TWORDF]; /* gdb .l01 idx - samel */ |
|---|
| 1876 | } LXL1STRU; |
|---|
| 1877 | |
|---|
| 1878 | typedef struct lxl2stru { |
|---|
| 1879 | PUNT pos; /* gdb .l02 pos */ |
|---|
| 1880 | UWORD ock; /* gdb .l02 ock */ |
|---|
| 1881 | UWORD it; /* gdb .l02 it */ |
|---|
| 1882 | PUNT ps; /* gdb .l02 ps */ |
|---|
| 1883 | #if LIND |
|---|
| 1884 | PUNT psb; /* tlc gdb .l0x ps backward */ |
|---|
| 1885 | #endif |
|---|
| 1886 | UCHR key[TWORDF][LE2]; /* gdb .l02 idx key */ |
|---|
| 1887 | LXIDXE idx[1][TWORDF]; /* gdb .l02 idx - samel */ |
|---|
| 1888 | } LXL2STRU; |
|---|
| 1889 | |
|---|
| 1890 | #endif /* SAMEL */ |
|---|
| 1891 | |
|---|
| 1892 | |
|---|
| 1893 | #if ZTREE |
|---|
| 1894 | |
|---|
| 1895 | #define LZKASZ1 (TWORDF*(2+LE1)) |
|---|
| 1896 | #define LZKASZ2 (TWORDF*(2+LE2)) |
|---|
| 1897 | |
|---|
| 1898 | typedef struct lzstru { |
|---|
| 1899 | PUNT pos PACKED; /* gdb .l0x pos */ |
|---|
| 1900 | UWORD ock PACKED; /* gdb .l0x ock */ |
|---|
| 1901 | UWORD it PACKED; /* gdb .l0x it */ |
|---|
| 1902 | PUNT ps PACKED; /* gdb .l0x ps */ |
|---|
| 1903 | #if LIND |
|---|
| 1904 | PUNT psb PACKED; /* tlc gdb .l0x ps backward */ |
|---|
| 1905 | #endif |
|---|
| 1906 | INFX info1[TWORDF] PACKED; /* tlc gdb .l0x idx info1 */ |
|---|
| 1907 | INFO info2[TWORDF] PACKED; /* tlc gdb .l0x idx info2 */ |
|---|
| 1908 | #if LIND |
|---|
| 1909 | INFX info3[TWORDF] PACKED; /* tlc gdb .l0x idx info3 */ |
|---|
| 1910 | #endif |
|---|
| 1911 | char keys[LZKASZ2] PACKED; /* compressed keys */ |
|---|
| 1912 | } LZSTRU; |
|---|
| 1913 | |
|---|
| 1914 | #define LZHSIZE (sizeof(LZSTRU)-LZKASZ2) |
|---|
| 1915 | |
|---|
| 1916 | #endif /* ZTREE */ |
|---|
| 1917 | |
|---|
| 1918 | #define MINLCHR ' ' |
|---|
| 1919 | |
|---|
| 1920 | #if LIND4 |
|---|
| 1921 | #define PMFNSIZ 4 /* gdb */ |
|---|
| 1922 | #else /* LIND4 */ |
|---|
| 1923 | #define PMFNSIZ 3 /* gdb */ |
|---|
| 1924 | #endif /* LIND4 */ |
|---|
| 1925 | |
|---|
| 1926 | #define PTAGSIZ 2 /* gdb */ |
|---|
| 1927 | #define POCCSIZ 1 /* gdb */ |
|---|
| 1928 | #define PCNTSIZ 2 /* gdb */ |
|---|
| 1929 | |
|---|
| 1930 | #if SWAPPED |
|---|
| 1931 | #if LIND4 |
|---|
| 1932 | #define M1 3 |
|---|
| 1933 | #define M2 2 |
|---|
| 1934 | #define M3 1 |
|---|
| 1935 | #define M4 0 |
|---|
| 1936 | #else /* LIND4 */ |
|---|
| 1937 | #define M1 2 |
|---|
| 1938 | #define M2 1 |
|---|
| 1939 | #define M3 0 |
|---|
| 1940 | #define M4 3 |
|---|
| 1941 | #endif /* LIND4 */ |
|---|
| 1942 | #define T1 1 |
|---|
| 1943 | #define T2 0 |
|---|
| 1944 | #define O1 0 |
|---|
| 1945 | #define O2 1 |
|---|
| 1946 | #define C1 1 |
|---|
| 1947 | #define C2 0 |
|---|
| 1948 | #else /* SWAPPED */ |
|---|
| 1949 | #if LIND4 |
|---|
| 1950 | #define M1 0 |
|---|
| 1951 | #define M2 1 |
|---|
| 1952 | #define M3 2 |
|---|
| 1953 | #define M4 3 |
|---|
| 1954 | #else /* LIND4 */ |
|---|
| 1955 | #define M1 1 |
|---|
| 1956 | #define M2 2 |
|---|
| 1957 | #define M3 3 |
|---|
| 1958 | #define M4 0 |
|---|
| 1959 | #endif /* LIND4 */ |
|---|
| 1960 | #define T1 0 |
|---|
| 1961 | #define T2 1 |
|---|
| 1962 | #define O1 1 |
|---|
| 1963 | #define O2 0 |
|---|
| 1964 | #define C1 0 |
|---|
| 1965 | #define C2 1 |
|---|
| 1966 | #endif /* SWAPPED */ |
|---|
| 1967 | |
|---|
| 1968 | #define BITSTRING (-1) /* xxxSTRING also used for CIB7HITLIST */ |
|---|
| 1969 | #define MFNSTRING 0 |
|---|
| 1970 | #define CNTSTRING 1 |
|---|
| 1971 | |
|---|
| 1972 | #if LIND |
|---|
| 1973 | typedef struct ifpstru { |
|---|
| 1974 | UCHR ifpx[IFBSIZ]; /* tlc .ifp data */ |
|---|
| 1975 | } IFPSTRU; |
|---|
| 1976 | #else |
|---|
| 1977 | typedef struct ifpstru { |
|---|
| 1978 | INFO ifpblk; /* gdb .ifp blk order */ |
|---|
| 1979 | INFO ifprec[IFMAXTIV]; /* gdb .ifp data */ |
|---|
| 1980 | } IFPSTRU; |
|---|
| 1981 | |
|---|
| 1982 | typedef struct ifpctrl { |
|---|
| 1983 | INFO ifpblk; /* gdb .ifp blk order */ |
|---|
| 1984 | INFO ifprec1; /* gdb .ifp ifprec(1) */ |
|---|
| 1985 | INFO ifprec2; /* gdb .ifp ifprec(2) */ |
|---|
| 1986 | } IFPCTRL; |
|---|
| 1987 | |
|---|
| 1988 | typedef struct ifphead { |
|---|
| 1989 | INFO ifpnxtb; /* gdb .ifp ifpnxtb */ |
|---|
| 1990 | INFO ifpnxtp; /* gdb .ifp ifpnxtp */ |
|---|
| 1991 | INFO ifptotp; /* gdb .ifp ifptotp */ |
|---|
| 1992 | INFO ifpsegp; /* gdb .ifp ifpsegp */ |
|---|
| 1993 | INFO ifpsegc; /* gdb .ifp ifpsegc */ |
|---|
| 1994 | } IFPHEAD; |
|---|
| 1995 | |
|---|
| 1996 | #define IFHDRSIZ sizeof(IFPHEAD) |
|---|
| 1997 | #endif |
|---|
| 1998 | |
|---|
| 1999 | typedef struct poststru { /* CIFST */ |
|---|
| 2000 | UCHR pmfn[PMFNSIZ]; /* gdb .ifp pmfn */ |
|---|
| 2001 | UCHR ptag[PTAGSIZ]; /* gdb .ifp ptag */ |
|---|
| 2002 | UCHR pocc[POCCSIZ]; /* gdb .ifp pocc */ |
|---|
| 2003 | UCHR pcnt[PCNTSIZ]; /* gdb .ifp pcnt */ |
|---|
| 2004 | } POSTSTRU; |
|---|
| 2005 | |
|---|
| 2006 | #define IFPSTSIZ sizeof(POSTSTRU) |
|---|
| 2007 | |
|---|
| 2008 | #define CNBSIZ sizeof(CNSTRU) |
|---|
| 2009 | #define N1BSIZ sizeof(N1STRU) |
|---|
| 2010 | #define N2BSIZ sizeof(N2STRU) |
|---|
| 2011 | #define L1BSIZ sizeof(L1STRU) |
|---|
| 2012 | #define L2BSIZ sizeof(L2STRU) |
|---|
| 2013 | |
|---|
| 2014 | #if CNV_PCFILES |
|---|
| 2015 | #if PC || GCC |
|---|
| 2016 | #define CNBUNI 0 |
|---|
| 2017 | #define N1BUNI 0 |
|---|
| 2018 | #define N2BUNI 0 |
|---|
| 2019 | #define L1BUNI 0 |
|---|
| 2020 | #define L2BUNI 0 |
|---|
| 2021 | #else |
|---|
| 2022 | #define CNBUNI 2 |
|---|
| 2023 | #define N1BUNI 2 |
|---|
| 2024 | #define N2BUNI 2 |
|---|
| 2025 | #define L1BUNI 2 |
|---|
| 2026 | #define L2BUNI 2 |
|---|
| 2027 | #endif |
|---|
| 2028 | #endif |
|---|
| 2029 | |
|---|
| 2030 | #if CIAPI |
|---|
| 2031 | typedef void TRMSTRU; |
|---|
| 2032 | #else /* CIAPI */ |
|---|
| 2033 | #if CICPP |
|---|
| 2034 | class _YOURCLASS TRMSTRU; /* Para substituir def da struct */ |
|---|
| 2035 | #endif /* CICPP */ |
|---|
| 2036 | |
|---|
| 2037 | #if !CICPP /* Declarada como classe em citrm.hpp */ |
|---|
| 2038 | typedef struct trmstru { |
|---|
| 2039 | LONGX trmnbytes; /* nbytes allocated */ |
|---|
| 2040 | int trmtype; /* layout indicator */ |
|---|
| 2041 | DBXSTRU *trmdbxp; |
|---|
| 2042 | int trmrc; /* term/nxterm rc */ |
|---|
| 2043 | UCHR trmkey[LE2+1]; /* key padded with blanks and null */ |
|---|
| 2044 | LONGX trmpost; /* current posting order */ |
|---|
| 2045 | LONGX trmpmfn; /* current posting pmfn */ |
|---|
| 2046 | UWORD trmptag; /* current posting ptag */ |
|---|
| 2047 | UWORD trmpocc; /* current posting pocc */ |
|---|
| 2048 | UWORD trmpcnt; /* current posting pcnt */ |
|---|
| 2049 | L1STRU trml1buf; /* .l01 input buffer */ |
|---|
| 2050 | UCHR trml1nul; /* .l01 input buffer idx delimiter */ |
|---|
| 2051 | L2STRU trml2buf; /* .l02 input buffer */ |
|---|
| 2052 | UCHR trml2nul; /* .l02 input buffer idx delimiter */ |
|---|
| 2053 | int trmlcase; /* last term/nxterm tree used */ |
|---|
| 2054 | int trmrcase; /* trmread() treecase+1 selection */ |
|---|
| 2055 | off_t trmrseek[2]; /* last term/nxterm leafread() lseek addr */ |
|---|
| 2056 | int trmrsize[2]; /* last term/nxterm leafread() read size */ |
|---|
| 2057 | int trmliock[2]; /* last trmread() ock */ |
|---|
| 2058 | UCHR *trmlidxp[2]; /* last term/nxterm idxchars ptr */ |
|---|
| 2059 | LONGX trmpleft; /* postings left in segment */ |
|---|
| 2060 | UCHR *trmpcurr; /* trmpchar not yet incremented */ |
|---|
| 2061 | UCHR *trmpchar; /* ptr to next posting in trmifbuf */ |
|---|
| 2062 | #if LIND |
|---|
| 2063 | INFX trmyaddr; /* byte address */ |
|---|
| 2064 | INFO trmypsts; /* total no of psts */ |
|---|
| 2065 | int trmycase; /* postings type */ |
|---|
| 2066 | int trmysize; /* postings length */ |
|---|
| 2067 | INFO trmydocs; /* total no of docs */ |
|---|
| 2068 | INFX trmydisk; /* total no of bytes */ |
|---|
| 2069 | INFX trmyread; /* total no of bytes already read */ |
|---|
| 2070 | INFX trmyleft; /* total no of bytes left on ifbuf */ |
|---|
| 2071 | #else |
|---|
| 2072 | INFO trmpcblk; /* info1 for next posting() */ |
|---|
| 2073 | INFO trmpcpos; /* info2 for next posting() */ |
|---|
| 2074 | IFPHEAD trmifseg; /* .ifp current segm header */ |
|---|
| 2075 | IFPHEAD trmifhdr; /* .ifp 1st segm header - total psts here */ |
|---|
| 2076 | #endif |
|---|
| 2077 | UCHR trmifbuf[1]; /* .ifp input buffer */ |
|---|
| 2078 | } TRMSTRU; |
|---|
| 2079 | #endif /* CICPP */ |
|---|
| 2080 | |
|---|
| 2081 | #if LIND |
|---|
| 2082 | #define TRMxytotp TRMypsts |
|---|
| 2083 | #else |
|---|
| 2084 | #define TRMxytotp TRMifhdr.ifptotp |
|---|
| 2085 | #endif |
|---|
| 2086 | |
|---|
| 2087 | #if !CICPP |
|---|
| 2088 | #define TRMHSIZE sizeof(TRMSTRU) /* one byte more */ |
|---|
| 2089 | #endif /* CICPP */ |
|---|
| 2090 | |
|---|
| 2091 | #define TRMnbytes trmp->trmnbytes |
|---|
| 2092 | #define TRMtype trmp->trmtype |
|---|
| 2093 | |
|---|
| 2094 | #define TRMdbxp trmp->trmdbxp |
|---|
| 2095 | |
|---|
| 2096 | #define TDBname trmp->trmdbxp->dbxname |
|---|
| 2097 | #define TDBifmap trmp->trmdbxp->dbxifmap |
|---|
| 2098 | #define TDBiflxx trmp->trmdbxp->dbxiflxx |
|---|
| 2099 | #define TDBiflush trmp->trmdbxp->dbxiflush |
|---|
| 2100 | |
|---|
| 2101 | #define TRMrc trmp->trmrc |
|---|
| 2102 | #define TRMkey trmp->trmkey |
|---|
| 2103 | |
|---|
| 2104 | #define TRMpost trmp->trmpost |
|---|
| 2105 | #define TRMpmfn trmp->trmpmfn |
|---|
| 2106 | #define TRMptag trmp->trmptag |
|---|
| 2107 | #define TRMpocc trmp->trmpocc |
|---|
| 2108 | #define TRMpcnt trmp->trmpcnt |
|---|
| 2109 | |
|---|
| 2110 | #define TRMl1buf trmp->trml1buf |
|---|
| 2111 | #define TRMl2buf trmp->trml2buf |
|---|
| 2112 | #define TRMlcase trmp->trmlcase |
|---|
| 2113 | #define TRMrcase trmp->trmrcase |
|---|
| 2114 | #define TRMrseek(i) trmp->trmrseek[i] |
|---|
| 2115 | #define TRMrsize(i) trmp->trmrsize[i] |
|---|
| 2116 | #define TRMliock(i) trmp->trmliock[i] |
|---|
| 2117 | #define TRMlidxp(i) trmp->trmlidxp[i] |
|---|
| 2118 | |
|---|
| 2119 | #define TRMpleft trmp->trmpleft |
|---|
| 2120 | #define TRMpcurr trmp->trmpcurr |
|---|
| 2121 | #define TRMpchar trmp->trmpchar |
|---|
| 2122 | |
|---|
| 2123 | #if LIND |
|---|
| 2124 | #define TRMyaddr trmp->trmyaddr |
|---|
| 2125 | #define TRMypsts trmp->trmypsts |
|---|
| 2126 | #define TRMycase trmp->trmycase |
|---|
| 2127 | #define TRMysize trmp->trmysize |
|---|
| 2128 | #define TRMydocs trmp->trmydocs |
|---|
| 2129 | #define TRMydisk trmp->trmydisk |
|---|
| 2130 | #define TRMyread trmp->trmyread |
|---|
| 2131 | #define TRMyleft trmp->trmyleft |
|---|
| 2132 | #else |
|---|
| 2133 | #define TRMpcblk trmp->trmpcblk |
|---|
| 2134 | #define TRMpcpos trmp->trmpcpos |
|---|
| 2135 | #define TRMifseg trmp->trmifseg |
|---|
| 2136 | #define TRMifhdr trmp->trmifhdr |
|---|
| 2137 | #endif |
|---|
| 2138 | |
|---|
| 2139 | #define TRMifbuf trmp->trmifbuf |
|---|
| 2140 | |
|---|
| 2141 | #define VTRMnbytes(r) vtrmp[r]->trmnbytes |
|---|
| 2142 | #define VTRMtype(r) vtrmp[r]->trmtype |
|---|
| 2143 | |
|---|
| 2144 | #define VTRMdbxp(r) vtrmp[r]->trmdbxp |
|---|
| 2145 | |
|---|
| 2146 | #define VTDBname(r) vtrmp[r]->trmdbxp->dbxname |
|---|
| 2147 | #define VTDBifmap(r) vtrmp[r]->trmdbxp->dbxifmap |
|---|
| 2148 | #define VTDBiflxx(r) vtrmp[r]->trmdbxp->dbxiflxx |
|---|
| 2149 | #define VTDBiflush(r) vtrmp[r]->trmdbxp->dbxiflush |
|---|
| 2150 | |
|---|
| 2151 | #define VTRMrc(r) vtrmp[r]->trmrc |
|---|
| 2152 | #define VTRMkey(r) vtrmp[r]->trmkey |
|---|
| 2153 | |
|---|
| 2154 | #define VTRMpost(r) vtrmp[r]->trmpost |
|---|
| 2155 | #define VTRMpmfn(r) vtrmp[r]->trmpmfn |
|---|
| 2156 | #define VTRMptag(r) vtrmp[r]->trmptag |
|---|
| 2157 | #define VTRMpocc(r) vtrmp[r]->trmpocc |
|---|
| 2158 | #define VTRMpcnt(r) vtrmp[r]->trmpcnt |
|---|
| 2159 | |
|---|
| 2160 | #define VTRMl1buf(r) vtrmp[r]->trml1buf |
|---|
| 2161 | #define VTRMl2buf(r) vtrmp[r]->trml2buf |
|---|
| 2162 | #define VTRMlcase(r) vtrmp[r]->trmlcase |
|---|
| 2163 | #define VTRMrcase(r) vtrmp[r]->trmrcase |
|---|
| 2164 | #define VTRMrseek(r,i) vtrmp[r]->trmrseek[i] |
|---|
| 2165 | #define VTRMrsize(r,i) vtrmp[r]->trmrsize[i] |
|---|
| 2166 | #define VTRMliock(r,i) vtrmp[r]->trmliock[i] |
|---|
| 2167 | #define VTRMlidxp(r,i) vtrmp[r]->trmlidxp[i] |
|---|
| 2168 | |
|---|
| 2169 | #define VTRMpleft(r) vtrmp[r]->trmpleft |
|---|
| 2170 | #define VTRMpcurr(r) vtrmp[r]->trmpcurr |
|---|
| 2171 | #define VTRMpchar(r) vtrmp[r]->trmpchar |
|---|
| 2172 | |
|---|
| 2173 | #if LIND |
|---|
| 2174 | #define VTRMyaddr(r) vtrmp[r]->trmyaddr |
|---|
| 2175 | #define VTRMypsts(r) vtrmp[r]->trmypsts |
|---|
| 2176 | #define VTRMycase(r) vtrmp[r]->trmycase |
|---|
| 2177 | #define VTRMysize(r) vtrmp[r]->trmysize |
|---|
| 2178 | #define VTRMydocs(r) vtrmp[r]->trmydocs |
|---|
| 2179 | #define VTRMydisk(r) vtrmp[r]->trmydisk |
|---|
| 2180 | #define VTRMyread(r) vtrmp[r]->trmyread |
|---|
| 2181 | #define VTRMyleft(r) vtrmp[r]->trmyleft |
|---|
| 2182 | #else |
|---|
| 2183 | #define VTRMpcblk(r) vtrmp[r]->trmpcblk |
|---|
| 2184 | #define VTRMpcpos(r) vtrmp[r]->trmpcpos |
|---|
| 2185 | #define VTRMifseg(r) vtrmp[r]->trmifseg |
|---|
| 2186 | #define VTRMifhdr(r) vtrmp[r]->trmifhdr |
|---|
| 2187 | #endif |
|---|
| 2188 | |
|---|
| 2189 | #if LIND |
|---|
| 2190 | #define VTRMxytotp(r) vtrmp[r]->trmypsts |
|---|
| 2191 | #else |
|---|
| 2192 | #define VTRMxytotp(r) vtrmp[r]->trmifhdr.ifptotp |
|---|
| 2193 | #endif |
|---|
| 2194 | |
|---|
| 2195 | #define VTRMifbuf(r) vtrmp[r]->trmifbuf |
|---|
| 2196 | |
|---|
| 2197 | #endif /* CIAPI */ |
|---|
| 2198 | |
|---|
| 2199 | #define TYPETRM 21 |
|---|
| 2200 | |
|---|
| 2201 | #define RCEOF (-1) /* */ |
|---|
| 2202 | #define RCNORMAL 0 /* */ |
|---|
| 2203 | #define RCNEXT 1 /* */ |
|---|
| 2204 | |
|---|
| 2205 | #define ABNORMAL 0 /* gdb */ |
|---|
| 2206 | |
|---|
| 2207 | /* CITRM Interface */ |
|---|
| 2208 | #if !CIAPI |
|---|
| 2209 | #if !CICPP /* transferidas para a classe TRMSTRU */ |
|---|
| 2210 | #if ANSI |
|---|
| 2211 | LONGX trmalloc(LONGX itrm, LONGX nbytes); |
|---|
| 2212 | LONGX term(LONGX itrm, UCHR *dbnamp, UCHR *keyp); |
|---|
| 2213 | LONGX nxterm(LONGX itrm); |
|---|
| 2214 | LONGX posting(LONGX itrm, LONGX n); |
|---|
| 2215 | int trmread(TRMSTRU *trmp, int treecase, UCHR **retkeyp); |
|---|
| 2216 | N0STRU *noderead(INVMAP *invp, int treecase, int level, PUNT punt); |
|---|
| 2217 | L0STRU *leafread(UCHR *lbufp, INVMAP *invp, int treecase, PUNT punt, int lxx); |
|---|
| 2218 | #if !LIND |
|---|
| 2219 | IFPSTRU *postread(UCHR *xbufp, INVMAP *invp, PUNT xblk, int lxx); |
|---|
| 2220 | #else |
|---|
| 2221 | IFPSTRU *postread(UCHR *xbufp, INVMAP *invp, off_t addr, unsigned int toread, |
|---|
| 2222 | int lxx); |
|---|
| 2223 | #endif |
|---|
| 2224 | int cntread(DBXSTRU *dbxp, int *ifpopen, char *ifpname, int *firstcnli); |
|---|
| 2225 | void invsetup(UCHR *dbnamp, LONGX loadn0x,LONGX loadl0x,LONGX loadpst); |
|---|
| 2226 | void posthdr1(TRMSTRU *trmp); |
|---|
| 2227 | void postpost(TRMSTRU *trmp); |
|---|
| 2228 | void trminit(void); |
|---|
| 2229 | void invflush(char *dbnamp); |
|---|
| 2230 | INVMAP *dbxinvmp(DBXSTRU *dbxp); |
|---|
| 2231 | void invclose(DBXSTRU *dbxp); |
|---|
| 2232 | #else |
|---|
| 2233 | LONGX trmalloc(); |
|---|
| 2234 | LONGX term(); |
|---|
| 2235 | LONGX nxterm(); |
|---|
| 2236 | LONGX posting(); |
|---|
| 2237 | int trmread(); |
|---|
| 2238 | N0STRU *noderead(); |
|---|
| 2239 | L0STRU *leafread(); |
|---|
| 2240 | IFPSTRU *postread(); |
|---|
| 2241 | int cntread(); |
|---|
| 2242 | void invsetup(); |
|---|
| 2243 | void posthdr1(); |
|---|
| 2244 | void postpost(); |
|---|
| 2245 | void trminit(); |
|---|
| 2246 | void invflush(); |
|---|
| 2247 | INVMAP *dbxinvmp(); |
|---|
| 2248 | void invclose(); |
|---|
| 2249 | #endif |
|---|
| 2250 | #endif /* CICPP */ |
|---|
| 2251 | #endif /* CIAPI */ |
|---|
| 2252 | |
|---|
| 2253 | /* global */ |
|---|
| 2254 | #if !CIAPI |
|---|
| 2255 | #if !CICPP |
|---|
| 2256 | extern TRMSTRU *vtrmp[]; /* pointers to the entries */ |
|---|
| 2257 | extern LONGX ntrms; /* actual #entries */ |
|---|
| 2258 | extern LONGX maxntrm; /* runtime value */ |
|---|
| 2259 | #endif /* CICPP */ |
|---|
| 2260 | #endif /* CIAPI */ |
|---|
| 2261 | |
|---|
| 2262 | #if !CICPP |
|---|
| 2263 | extern int trmtrace; /* trm TRSTRACE runtime switch */ |
|---|
| 2264 | extern int trmifupd; /* trm IFUPDATE operation */ |
|---|
| 2265 | extern unsigned char highv[]; /* trm high values */ |
|---|
| 2266 | #endif /* CICPP */ |
|---|
| 2267 | |
|---|
| 2268 | |
|---|
| 2269 | |
|---|
| 2270 | /* ***************************************************** |
|---|
| 2271 | CIUPD.H |
|---|
| 2272 | ***************************************************** */ |
|---|
| 2273 | |
|---|
| 2274 | #if 1 /* MULTI */ |
|---|
| 2275 | #define MONONETS 0 /* single user (non network version) */ |
|---|
| 2276 | #define FULLNETS 1 /* full network version */ |
|---|
| 2277 | #define MASTNETS 2 /* restricted network support */ |
|---|
| 2278 | #endif |
|---|
| 2279 | |
|---|
| 2280 | #define BUFFUPL (MAXMFRL+MAXMFRL) |
|---|
| 2281 | |
|---|
| 2282 | #define MS0ctlmfn ms0p->m0ctlmfn |
|---|
| 2283 | #define MS0nxtmfn ms0p->m0nxtmfn |
|---|
| 2284 | #define MS0nxtmfb ms0p->m0nxtmfb |
|---|
| 2285 | #define MS0nxtmfp ms0p->m0nxtmfp |
|---|
| 2286 | #define MS0mftype ms0p->m0mftype |
|---|
| 2287 | #define MS0reccnt ms0p->m0reccnt |
|---|
| 2288 | #define MS0mfcxx1 ms0p->m0mfcxx1 |
|---|
| 2289 | #define MS0mfcxx2 ms0p->m0mfcxx2 |
|---|
| 2290 | #define MS0mfcxx3 ms0p->m0mfcxx3 |
|---|
| 2291 | |
|---|
| 2292 | #define MSHmfn mshp->m1mfn |
|---|
| 2293 | #define MSHmfrl mshp->m1mfrl |
|---|
| 2294 | #define MSHmfbwb mshp->m1mfbwb |
|---|
| 2295 | #define MSHmfbwp mshp->m1mfbwp |
|---|
| 2296 | #define MSHbase mshp->m1base |
|---|
| 2297 | #define MSHnvf mshp->m1nvf |
|---|
| 2298 | #define MSHstatus mshp->m1status |
|---|
| 2299 | |
|---|
| 2300 | #define MS1mfn ms1p->m1mfn |
|---|
| 2301 | #define MS1mfrl ms1p->m1mfrl |
|---|
| 2302 | #define MS1mfbwb ms1p->m1mfbwb |
|---|
| 2303 | #define MS1mfbwp ms1p->m1mfbwp |
|---|
| 2304 | #define MS1base ms1p->m1base |
|---|
| 2305 | #define MS1nvf ms1p->m1nvf |
|---|
| 2306 | #define MS1status ms1p->m1status |
|---|
| 2307 | #define MS1dir ms1p->m1dir |
|---|
| 2308 | |
|---|
| 2309 | #define MSDtag(x) ms1p->m1dir[x].tag |
|---|
| 2310 | #define MSDpos(x) ms1p->m1dir[x].pos |
|---|
| 2311 | #define MSDlen(x) ms1p->m1dir[x].len |
|---|
| 2312 | |
|---|
| 2313 | |
|---|
| 2314 | /* CIUPD Interface */ |
|---|
| 2315 | #if !CICPP /* transferidas para a classe RECSTRU */ |
|---|
| 2316 | #if ANSI |
|---|
| 2317 | #if MULTI |
|---|
| 2318 | int recunlck(LONGX irec, int option); |
|---|
| 2319 | #endif |
|---|
| 2320 | int recisis0(char *dbnamp); |
|---|
| 2321 | int recupdat(LONGX crec, LONGX irec); |
|---|
| 2322 | int recwrite(RECSTRU *crecp, RECSTRU *recp); |
|---|
| 2323 | int recwmast(RECSTRU *crecp, RECSTRU *recp, LONGX b, int p, int nblk, FFI wlen); |
|---|
| 2324 | int recwxref(RECSTRU *recp, XRPTR pointer, LONGX lastmfn); |
|---|
| 2325 | char *fldupdat(LONGX irec, char *batchp); |
|---|
| 2326 | void recreset(char *dbnamp, LONGX mfn1, LONGX mfn2, LONGX xrec, LONGX parmtell); |
|---|
| 2327 | #else |
|---|
| 2328 | #if MULTI |
|---|
| 2329 | int recunlck(); |
|---|
| 2330 | #endif |
|---|
| 2331 | int recisis0(); |
|---|
| 2332 | int recupdat(); |
|---|
| 2333 | int recwrite(); |
|---|
| 2334 | int recwmast(); |
|---|
| 2335 | int recwxref(); |
|---|
| 2336 | char *fldupdat(); |
|---|
| 2337 | void recreset(); |
|---|
| 2338 | #endif |
|---|
| 2339 | #endif /* CICPP */ |
|---|
| 2340 | |
|---|
| 2341 | /* global */ |
|---|
| 2342 | #if !CICPP |
|---|
| 2343 | extern int multrace; /* upd MULTRACE runtime switch */ |
|---|
| 2344 | extern int recisis0_m; /* recisis0() init .mst */ |
|---|
| 2345 | #endif /* CICPP */ |
|---|
| 2346 | |
|---|
| 2347 | |
|---|
| 2348 | /* ***************************************************** |
|---|
| 2349 | CIUPI.H |
|---|
| 2350 | ***************************************************** */ |
|---|
| 2351 | /* CIUPI Interface */ |
|---|
| 2352 | #if ANSI |
|---|
| 2353 | #if CICPP |
|---|
| 2354 | int trmisis0(CISISX *cisisxp,char *dbnamp); |
|---|
| 2355 | #else |
|---|
| 2356 | int trmisis0(char *dbnamp); |
|---|
| 2357 | #endif /* CICPP */ |
|---|
| 2358 | int cntwrit(DBXSTRU *dbxp); |
|---|
| 2359 | int nodewrit(DBXSTRU *dbxp,N0STRU *n0p,int level,int isroot); |
|---|
| 2360 | int leafwrit(DBXSTRU *dbxp,L0STRU *l0p); |
|---|
| 2361 | #if CNV_PCBINUM |
|---|
| 2362 | int ifpwrit(DBXSTRU *dbxp, char *buffer, LONGX nbytes, INFO hdblk[], INFO hdoff[], int hdn); |
|---|
| 2363 | #else /* CNV_PCBINUM */ |
|---|
| 2364 | int ifpwrit(DBXSTRU *dbxp,char *buffer,LONGX nbytes); |
|---|
| 2365 | #endif /* CNV_PCBINUM */ |
|---|
| 2366 | #else |
|---|
| 2367 | int trmisis0(); |
|---|
| 2368 | int cntwrit(); |
|---|
| 2369 | int nodewrit(); |
|---|
| 2370 | int leafwrit(); |
|---|
| 2371 | int ifpwrit(); |
|---|
| 2372 | #endif |
|---|
| 2373 | |
|---|
| 2374 | |
|---|
| 2375 | /* ***************************************************** |
|---|
| 2376 | CIUTL.H |
|---|
| 2377 | ***************************************************** */ |
|---|
| 2378 | |
|---|
| 2379 | #define SFLDCHR '^' |
|---|
| 2380 | |
|---|
| 2381 | #if PC || MPE |
|---|
| 2382 | #define OPENFCHR '�' |
|---|
| 2383 | #define CLOSFCHR '�' |
|---|
| 2384 | #endif |
|---|
| 2385 | #if VAX |
|---|
| 2386 | #define OPENFCHR '"' |
|---|
| 2387 | #define CLOSFCHR '"' |
|---|
| 2388 | #endif |
|---|
| 2389 | #if UNIX |
|---|
| 2390 | #define OPENFCHR '"' |
|---|
| 2391 | #define CLOSFCHR '"' |
|---|
| 2392 | #endif |
|---|
| 2393 | |
|---|
| 2394 | /* CIUTL Interface */ |
|---|
| 2395 | #if !CIAPI |
|---|
| 2396 | #if CICPP |
|---|
| 2397 | UBYTE *subfldp(UBYTE *fldp, UBYTE dlm, FFI *lenp); |
|---|
| 2398 | FFI subfldn(UBYTE *sfldp, FFI len); |
|---|
| 2399 | FFI subfield(UBYTE *fldp, FFI fldl, UBYTE dlm, UBYTE *areap); |
|---|
| 2400 | char *loadfile(char *gidbnp, char at, char *atp, char *areap, LONGX asize, char lf2x); |
|---|
| 2401 | char *loadstw(char *gidbnp, char *atp,char *areap,LONGX asize,int *nstws); |
|---|
| 2402 | char *loaductb(char *gidbnp, char *uctbp, char *ucfilp); |
|---|
| 2403 | char *loadactb(char *gidbnp, char *actbp, char *acfilp); |
|---|
| 2404 | void decodepst(POSTSTRU *pstp, LONGX *mfnp, unsigned short *tagp, |
|---|
| 2405 | unsigned short *occp, unsigned short *cntp); |
|---|
| 2406 | void encodepst(POSTSTRU *pstp, LONGX mfn, unsigned short tag, |
|---|
| 2407 | unsigned short occ, unsigned short cnt ); |
|---|
| 2408 | FFI bobkey(char *keyp,FFI klen,char *areap,FFI maxlen,int l,int m,int t); |
|---|
| 2409 | #if CIAPI_SOURCE |
|---|
| 2410 | LONGX prtifcnt (TRMSTRU *trmp, char dbname[]); |
|---|
| 2411 | LONGX prtcontrol(RECSTRU *recp, char dbname[]); |
|---|
| 2412 | LONGX prtleader(RECSTRU *recp, LONGX mfn); |
|---|
| 2413 | LONGX prtfields(RECSTRU *recp, LONGX mfn); |
|---|
| 2414 | LONGX prtxref(CISISX *cisisxp, RECSTRU *recp, LONGX mfn); |
|---|
| 2415 | LONGX prtdir(RECSTRU *recp, LONGX mfn); |
|---|
| 2416 | int recfgets(CISISX *cisisxp, RECSTRU *crec, RECSTRU *irec, char line[], FFI linsiz, FILE *fpconv); |
|---|
| 2417 | int reccopy(CISISX *cisisxp, RECSTRU *upirec,RECSTRU *upcrec,RECSTRU *recp,LONGX mfn); |
|---|
| 2418 | unsigned LONGX showcore(char *msg); |
|---|
| 2419 | char *recfield(CISISX *cisisxp, char *areap, RECSTRU *recp, int tag, int iocc, char *defaultp); |
|---|
| 2420 | int fldocc(CISISX *cisisxp, RECSTRU *recp, int diridx); |
|---|
| 2421 | #endif /* CIAPI_SOURCE */ |
|---|
| 2422 | #else /* CICPP */ |
|---|
| 2423 | #if ANSI |
|---|
| 2424 | UBYTE *subfldp(UBYTE *fldp, UBYTE dlm, FFI *lenp); |
|---|
| 2425 | FFI subfldn(UBYTE *sfldp, FFI len); |
|---|
| 2426 | FFI subfield(UBYTE *fldp, FFI fldl, UBYTE dlm, UBYTE *areap); |
|---|
| 2427 | LONGX prtifcnt (TRMSTRU *trmp, char dbname[]); |
|---|
| 2428 | LONGX prtcontrol(RECSTRU *recp, char dbname[]); |
|---|
| 2429 | LONGX prtleader(RECSTRU *recp, LONGX mfn); |
|---|
| 2430 | LONGX prtfields(RECSTRU *recp, LONGX mfn); |
|---|
| 2431 | LONGX prtxref(RECSTRU *recp, LONGX mfn); |
|---|
| 2432 | LONGX prtdir(RECSTRU *recp, LONGX mfn); |
|---|
| 2433 | int recfgets(LONGX crec, LONGX irec, char line[], FFI linsiz, FILE *fpconv); |
|---|
| 2434 | int reccopy(LONGX upirec, LONGX upcrec, RECSTRU *recp, LONGX mfn); |
|---|
| 2435 | unsigned LONGX showcore(char *msg); |
|---|
| 2436 | char *recfield(char *areap, LONGX ridx, int tag, int iocc, char *defaultp); |
|---|
| 2437 | int fldocc(LONGX irec, int diridx); |
|---|
| 2438 | char *loadfile(char *gidbnp, char at, char *atp, char *areap, LONGX asize, char lf2x); |
|---|
| 2439 | char *loadstw(char *gidbnp, char *atp,char *areap,LONGX asize,int *nstws); |
|---|
| 2440 | char *loaductb(char *gidbnp, char *uctbp, char *ucfilp); |
|---|
| 2441 | char *loadactb(char *gidbnp, char *actbp, char *acfilp); |
|---|
| 2442 | void decodepst(POSTSTRU *pstp, LONGX *mfnp, unsigned short *tagp, |
|---|
| 2443 | unsigned short *occp, unsigned short *cntp); |
|---|
| 2444 | void encodepst(POSTSTRU *pstp, LONGX mfn, unsigned short tag, |
|---|
| 2445 | unsigned short occ, unsigned short cnt ); |
|---|
| 2446 | FFI bobkey(char *keyp,FFI klen,char *areap,FFI maxlen,int l,int m,int t); |
|---|
| 2447 | #else |
|---|
| 2448 | UBYTE *subfldp(); |
|---|
| 2449 | FFI subfldn(); |
|---|
| 2450 | FFI subfield(); |
|---|
| 2451 | LONGX prtcontrol(); |
|---|
| 2452 | LONGX prtleader(); |
|---|
| 2453 | LONGX prtfields(); |
|---|
| 2454 | LONGX prtxref(); |
|---|
| 2455 | LONGX prtdir(); |
|---|
| 2456 | int recfgets(); |
|---|
| 2457 | int reccopy(); |
|---|
| 2458 | unsigned LONGX showcore(); |
|---|
| 2459 | char *recfield(); |
|---|
| 2460 | int fldocc(); |
|---|
| 2461 | char *loadfile(); |
|---|
| 2462 | char *loadstw(); |
|---|
| 2463 | char *loaductb(); |
|---|
| 2464 | char *loadactb(); |
|---|
| 2465 | void decodepst(); |
|---|
| 2466 | void encodepst(); |
|---|
| 2467 | FFI bobkey(); |
|---|
| 2468 | #endif |
|---|
| 2469 | #endif /* CICPP */ |
|---|
| 2470 | #endif /* CIAPI */ |
|---|
| 2471 | |
|---|
| 2472 | |
|---|
| 2473 | |
|---|
| 2474 | /* ***************************************************** |
|---|
| 2475 | CIISO.H |
|---|
| 2476 | ***************************************************** */ |
|---|
| 2477 | |
|---|
| 2478 | #define ISOBSIZ 99999L /* wrn: is LONGX */ /* AOT, 06/06/2005 - length[5] */ |
|---|
| 2479 | |
|---|
| 2480 | #define ISOLLEF 4 |
|---|
| 2481 | #define ISOLSCP 5 |
|---|
| 2482 | #define ISOXFS '#' /* 0x1E = 30 para Minisis */ |
|---|
| 2483 | #define ISOXGS '#' /* 0x1D = 29 para Minisis */ |
|---|
| 2484 | #define ISOXFSMARC 0x1E /* 0x1E = 30 para Minisis and Marc */ /* AOT, 10/06/2005 */ |
|---|
| 2485 | #define ISOXGSMARC 0x1D /* 0x1D = 29 para Minisis and Marc */ /* AOT, 10/06/2005 */ |
|---|
| 2486 | #define ISOXXSMARC 0x23 /* subfield para Minisis and Marc */ /* AOT, 10/06/2005 */ |
|---|
| 2487 | |
|---|
| 2488 | #if CICPP |
|---|
| 2489 | class _YOURCLASS ISO_2709; /* Para substituir def da struct */ |
|---|
| 2490 | #endif /* CICPP */ |
|---|
| 2491 | |
|---|
| 2492 | typedef struct isohstru { |
|---|
| 2493 | unsigned char length[5]; |
|---|
| 2494 | unsigned char status[1]; |
|---|
| 2495 | unsigned char icodes[4]; |
|---|
| 2496 | unsigned char indlen[1]; |
|---|
| 2497 | unsigned char sublen[1]; |
|---|
| 2498 | unsigned char basead[5]; |
|---|
| 2499 | unsigned char forusr[3]; |
|---|
| 2500 | unsigned char lenlef[1]; |
|---|
| 2501 | unsigned char lenscp[1]; |
|---|
| 2502 | unsigned char forfut[2]; |
|---|
| 2503 | } ISOHSTRU; |
|---|
| 2504 | |
|---|
| 2505 | typedef struct isodstru { |
|---|
| 2506 | unsigned char tagfld[3]; |
|---|
| 2507 | unsigned char lenfld[ISOLLEF]; |
|---|
| 2508 | unsigned char locfld[ISOLSCP]; |
|---|
| 2509 | } ISODSTRU; |
|---|
| 2510 | |
|---|
| 2511 | #define ISOHSIZE sizeof(ISOHSTRU) |
|---|
| 2512 | #define ISODSIZE sizeof(ISODSTRU) |
|---|
| 2513 | |
|---|
| 2514 | #if !CICPP |
|---|
| 2515 | extern int iso_ismarc; |
|---|
| 2516 | #endif /* CICPP */ |
|---|
| 2517 | |
|---|
| 2518 | /* CIISO Interface */ |
|---|
| 2519 | #if !CICPP |
|---|
| 2520 | #if ANSI |
|---|
| 2521 | int iso_open(char *gidbnp, unsigned char filnam[], int lrecb, int lrfix, int isfix); |
|---|
| 2522 | int iso_read(LONGX crec, LONGX irec, unsigned int ldrtag); |
|---|
| 2523 | int iso_creat(char *gidbnp, unsigned char filnam[], int lrecb, int lrfox, int isfox); |
|---|
| 2524 | int iso_write(RECSTRU *recp, unsigned char isoxfs, unsigned char isoxgs, unsigned int ldrtag); |
|---|
| 2525 | int iso_close(void); |
|---|
| 2526 | int iso_rclos(void); |
|---|
| 2527 | #else |
|---|
| 2528 | int iso_open(); |
|---|
| 2529 | int iso_read(); |
|---|
| 2530 | int iso_creat(); |
|---|
| 2531 | int iso_write(); |
|---|
| 2532 | int iso_close(); |
|---|
| 2533 | int iso_rclos(); |
|---|
| 2534 | #endif |
|---|
| 2535 | #endif /* CICPP */ |
|---|
| 2536 | |
|---|
| 2537 | |
|---|
| 2538 | |
|---|
| 2539 | /* ***************************************************** |
|---|
| 2540 | CIB7.H |
|---|
| 2541 | ***************************************************** */ |
|---|
| 2542 | |
|---|
| 2543 | #if CIB71 |
|---|
| 2544 | |
|---|
| 2545 | #ifndef CIB7HITLIST |
|---|
| 2546 | #define CIB7HITLIST 1 |
|---|
| 2547 | #endif |
|---|
| 2548 | #ifndef CIB7TMPNULL |
|---|
| 2549 | #define CIB7TMPNULL 1 |
|---|
| 2550 | #endif |
|---|
| 2551 | |
|---|
| 2552 | #if BEFORE20020127 |
|---|
| 2553 | #define MAXVOPR 512 |
|---|
| 2554 | #else /* 16K for MeSH/Drug category */ |
|---|
| 2555 | #define MAXVOPR 16384 /* 16K */ /* AOT, 29/01/2002 */ |
|---|
| 2556 | #endif /* 16K x sizeof(char)+sizeof(char)+sizeof(char*) */ |
|---|
| 2557 | #define MAXQUAL 20 |
|---|
| 2558 | #define MAXPDLS 32 |
|---|
| 2559 | #define MAXERRL 60 |
|---|
| 2560 | |
|---|
| 2561 | #define ZORX '+' |
|---|
| 2562 | #define ZAND '*' |
|---|
| 2563 | #define ZANN '^' |
|---|
| 2564 | #if !LIND |
|---|
| 2565 | #define ZANG 'G' |
|---|
| 2566 | #define ZANF 'F' |
|---|
| 2567 | #define ZANP '.' |
|---|
| 2568 | #define ZANE '$' |
|---|
| 2569 | #endif |
|---|
| 2570 | #define ZASS '=' |
|---|
| 2571 | #define ZLDV '_' |
|---|
| 2572 | #define ZPFX '[' |
|---|
| 2573 | #define ZQUA '/' |
|---|
| 2574 | |
|---|
| 2575 | #define TOKNULL 0 |
|---|
| 2576 | #define TOKDELIM 1 |
|---|
| 2577 | #define TOKTERM 2 |
|---|
| 2578 | |
|---|
| 2579 | #define TBOOL 1 |
|---|
| 2580 | |
|---|
| 2581 | #define MFQTDBN0 11 |
|---|
| 2582 | #define MFQTQRY0 12 |
|---|
| 2583 | #define MFQTOBJ0 13 |
|---|
| 2584 | |
|---|
| 2585 | #define MFQTXCTS 20 |
|---|
| 2586 | |
|---|
| 2587 | #define MFQSWTIM 't' |
|---|
| 2588 | #define MFQSWDBN 'd' |
|---|
| 2589 | #define MFQSWQTY 'q' |
|---|
| 2590 | |
|---|
| 2591 | #define MFQTASET 21 |
|---|
| 2592 | #define MFQTALCC 22 |
|---|
| 2593 | |
|---|
| 2594 | #define MFQTHITS 31 |
|---|
| 2595 | #define MFQTHCUR 32 |
|---|
| 2596 | #define MFQTHMFN 33 |
|---|
| 2597 | #define MFQTHSIZ 34 |
|---|
| 2598 | #define MFQTHMEM 35 |
|---|
| 2599 | |
|---|
| 2600 | #define OPRNULL 0x01 |
|---|
| 2601 | #define OPRXEND 0x02 |
|---|
| 2602 | #define PSTLEVEL 0x03 |
|---|
| 2603 | #define ACCLEVEL 0x04 |
|---|
| 2604 | |
|---|
| 2605 | #define B7UPLEN 9 /* length for b40 numeric fields */ |
|---|
| 2606 | #define B7DELADD "D%dA%d|%09ld|" /* sprintf format for dir/field */ |
|---|
| 2607 | #define B7EDIT1 "%09ld" /* sprintf format for field edit */ |
|---|
| 2608 | |
|---|
| 2609 | #define MFQTXTAG 101 /* inverted files prefixes */ |
|---|
| 2610 | |
|---|
| 2611 | #define B7RE_X2 1 |
|---|
| 2612 | #define B7RE_X3 2 |
|---|
| 2613 | #define B7RE_X1 3 |
|---|
| 2614 | #define B7RE_53 4 |
|---|
| 2615 | #define B7RE_1 5 |
|---|
| 2616 | #define B7RE_2 6 |
|---|
| 2617 | #define B7RE_3 7 |
|---|
| 2618 | #define B7RE_4 8 |
|---|
| 2619 | #define B7RE_10 9 |
|---|
| 2620 | #define B7RE_18 10 |
|---|
| 2621 | #define B7RE_28 11 |
|---|
| 2622 | #define B7RE_PFX 12 |
|---|
| 2623 | #define B7RE_SET 13 |
|---|
| 2624 | |
|---|
| 2625 | #define B7EE_X2 2 |
|---|
| 2626 | #define B7EE_PFX 11 |
|---|
| 2627 | |
|---|
| 2628 | |
|---|
| 2629 | /* estructura de la pila de ejecuci�/ |
|---|
| 2630 | typedef struct pdlstru { |
|---|
| 2631 | UCHR *pdllvel; /* bitstring, contiene la informacion de los postings. */ |
|---|
| 2632 | LONGX pdlleft; /* cuanto queda del lvel */ |
|---|
| 2633 | LONGX pdldocs; /* cantidad de documentos almacenados */ |
|---|
| 2634 | LONGX pdllmfn; /* valor del �o MFN de la BD */ |
|---|
| 2635 | LONGX pdlsize; /* tama�ctual de lvel */ |
|---|
| 2636 | LONGX pdlisiz; /* tama�nicial de lvel, also growing step */ |
|---|
| 2637 | short int pdlplen; /* tama�e los postings */ |
|---|
| 2638 | char *pdlnxtp; /* proximo slot libre en lvel */ |
|---|
| 2639 | } PDLSTRU; |
|---|
| 2640 | /* |
|---|
| 2641 | si plen == 0 |
|---|
| 2642 | se usa un bit per MFN. * + ^ |
|---|
| 2643 | sino |
|---|
| 2644 | 3 bytes para MFN |
|---|
| 2645 | 2 bytes para TAG ==> 5 oper (G) |
|---|
| 2646 | 1 byte para OCC ==> 6 oper (F) |
|---|
| 2647 | 2 bytes para CNT ==> 8 oper . $ |
|---|
| 2648 | |
|---|
| 2649 | */ |
|---|
| 2650 | |
|---|
| 2651 | |
|---|
| 2652 | #if CIB7HITLIST /* AOT 15/01/2002 */ |
|---|
| 2653 | |
|---|
| 2654 | #define B7HITLISTLONG 1 |
|---|
| 2655 | #define B7HITLISTSHORT 2 |
|---|
| 2656 | |
|---|
| 2657 | typedef struct b7hitbuf { |
|---|
| 2658 | LONGX setno; /* query number */ |
|---|
| 2659 | LONGX bufsiz; /* buffer size */ |
|---|
| 2660 | LONGX ndocs; /* number of docs */ |
|---|
| 2661 | int hcase; /* BITSTRING or MFNSTRING (4 bytes) */ |
|---|
| 2662 | int htype; /* list of LONGX or unsigned short mfn's */ |
|---|
| 2663 | LONGX align4; /* 4-byte alignment */ |
|---|
| 2664 | UBYTE area[1]; /* buffer - via ALLOC() */ |
|---|
| 2665 | } B7HITBUF; |
|---|
| 2666 | |
|---|
| 2667 | typedef struct b7hitlist { |
|---|
| 2668 | LONGX mfnlist[1]; /* array of mfn */ |
|---|
| 2669 | } B7HITLIST; |
|---|
| 2670 | |
|---|
| 2671 | typedef struct b7hitlistshort { |
|---|
| 2672 | unsigned short int mfnlist[1]; /* array of mfn - short */ |
|---|
| 2673 | } B7HITLISTSH; |
|---|
| 2674 | |
|---|
| 2675 | #else /* CIB7HITLIST */ |
|---|
| 2676 | |
|---|
| 2677 | typedef struct b7hitbuf { |
|---|
| 2678 | LONGX setno; /* query number */ |
|---|
| 2679 | #if BEFORE20010607 |
|---|
| 2680 | LONGX block; /* block number */ |
|---|
| 2681 | #endif |
|---|
| 2682 | LONGX bufsiz; /* buffer size */ |
|---|
| 2683 | UBYTE area[1]; /* buffer - via ALLOC() */ |
|---|
| 2684 | } B7HITBUF; |
|---|
| 2685 | #endif /* CIB7HITLIST */ |
|---|
| 2686 | |
|---|
| 2687 | |
|---|
| 2688 | typedef struct |
|---|
| 2689 | { |
|---|
| 2690 | /*variables globales ... */ |
|---|
| 2691 | |
|---|
| 2692 | /*cib71.c */ |
|---|
| 2693 | #if BOLTRACE |
|---|
| 2694 | #define DISTRACE 1 |
|---|
| 2695 | char *b7objp; |
|---|
| 2696 | #endif |
|---|
| 2697 | |
|---|
| 2698 | int and2gf; |
|---|
| 2699 | char *subst_and; |
|---|
| 2700 | LONGX b7setno1; |
|---|
| 2701 | LONGX b7setno; |
|---|
| 2702 | char *b7batchp; /* fldupdat */ |
|---|
| 2703 | RECSTRU *b7recp; /* current recp */ |
|---|
| 2704 | |
|---|
| 2705 | #if FATRAP |
|---|
| 2706 | /* error */ |
|---|
| 2707 | jmp_buf b71jumper; |
|---|
| 2708 | #endif |
|---|
| 2709 | |
|---|
| 2710 | int b71error; |
|---|
| 2711 | char b7errxy[MAXERRL+1]; /* static */ |
|---|
| 2712 | |
|---|
| 2713 | /* gettoken */ |
|---|
| 2714 | char *tokbackp; |
|---|
| 2715 | char *toknextp; |
|---|
| 2716 | char *token; |
|---|
| 2717 | char toktyp; |
|---|
| 2718 | char tokopr; |
|---|
| 2719 | int tokqty; |
|---|
| 2720 | int toklen; |
|---|
| 2721 | |
|---|
| 2722 | char *tokqualp; /* qualifiers */ |
|---|
| 2723 | int tokquall; /* length */ |
|---|
| 2724 | int tokqualn; /* no of elements in the list */ |
|---|
| 2725 | |
|---|
| 2726 | char *tokmassp; /* toknextp after b7_massp() */ |
|---|
| 2727 | |
|---|
| 2728 | /* expressoes */ |
|---|
| 2729 | int nb7oprs; |
|---|
| 2730 | |
|---|
| 2731 | /*cib72 */ |
|---|
| 2732 | unsigned char mask; |
|---|
| 2733 | char *b7_gidbnp; |
|---|
| 2734 | PDLSTRU *vpdlp[MAXPDLS]; |
|---|
| 2735 | int npdls; |
|---|
| 2736 | LONGX b7tell; |
|---|
| 2737 | LONGX b7itrm; |
|---|
| 2738 | int b7fd; |
|---|
| 2739 | int b7error; |
|---|
| 2740 | B7HITBUF *b7bufferp; |
|---|
| 2741 | |
|---|
| 2742 | char b7_pfxdbn[CIMPL+1]; |
|---|
| 2743 | char b7_pfxopx[LE2+LE2+1]; |
|---|
| 2744 | FFI b7_pfxlen; |
|---|
| 2745 | char b7_pfxmsg[LE2+1]; |
|---|
| 2746 | char b7_pfxtwx[CIMPL+1]; |
|---|
| 2747 | FFI b7_pfxmdl; |
|---|
| 2748 | |
|---|
| 2749 | #if FIXTRACE |
|---|
| 2750 | int xtrac; |
|---|
| 2751 | #endif |
|---|
| 2752 | |
|---|
| 2753 | char vetopr[MAXVOPR],vetcas[MAXVOPR],*vetopp[MAXVOPR]; |
|---|
| 2754 | int nop; |
|---|
| 2755 | |
|---|
| 2756 | #if !TLS |
|---|
| 2757 | void *ciapip; |
|---|
| 2758 | #endif |
|---|
| 2759 | LONGX smfn; |
|---|
| 2760 | LONGX sirec; |
|---|
| 2761 | |
|---|
| 2762 | short unsigned int nqualts,vqualt[MAXQUAL],*qualtp; |
|---|
| 2763 | |
|---|
| 2764 | int b7rootmsg; |
|---|
| 2765 | |
|---|
| 2766 | int b7tw2mh; |
|---|
| 2767 | |
|---|
| 2768 | } b7_CIB7; |
|---|
| 2769 | |
|---|
| 2770 | #if !CIAPI && !CIAPI_SOURCE |
|---|
| 2771 | extern int b70trace; /* b70 RUXTRACE runtime switch */ |
|---|
| 2772 | #endif /* !CIAPI && !CIAPI_SOURCE */ |
|---|
| 2773 | |
|---|
| 2774 | |
|---|
| 2775 | /* --------------------- cib70.h --------------------- */ |
|---|
| 2776 | |
|---|
| 2777 | /* CIB71 Interface */ |
|---|
| 2778 | #if ANSI |
|---|
| 2779 | char *b7_exp(b7_CIB7 *cib7p, LONGX irec, char *dbnamp, char *qryp, |
|---|
| 2780 | char *buffup, char *qrydbnp, LONGX crec, int *errnop); |
|---|
| 2781 | char *b7_run(b7_CIB7 *cib7p, LONGX irec,char *dbnamp,char *buffup, int buffuplen, |
|---|
| 2782 | LONGX tell,unsigned char uctab[],char *btch0p, |
|---|
| 2783 | LONGX tlirecp,LONGX crec,int *errnop); |
|---|
| 2784 | LONGX b7_hit(b7_CIB7 *cib7p, LONGX irec, LONGX nord, LONGX setno); |
|---|
| 2785 | int b7_hballoc(b7_CIB7 *cib7p, LONGX bufsiz, B7HITBUF **bufferpp); |
|---|
| 2786 | int b7_hbinit(b7_CIB7 *cib7p, LONGX setno, B7HITBUF *bufferp); |
|---|
| 2787 | int b7_hbfree(b7_CIB7 *cib7p, B7HITBUF **bufferpp); |
|---|
| 2788 | #else /* ANSI */ |
|---|
| 2789 | char *b7_exp(); |
|---|
| 2790 | char *b7_run(); |
|---|
| 2791 | LONGX b7_hit(); |
|---|
| 2792 | int b7_hballoc(); |
|---|
| 2793 | int b7_hbinit(); |
|---|
| 2794 | int b7_hbfree(); |
|---|
| 2795 | #endif /* ANSI */ |
|---|
| 2796 | #else /* CIB71 */ |
|---|
| 2797 | |
|---|
| 2798 | |
|---|
| 2799 | /* ***************************************************** |
|---|
| 2800 | CIB40.H |
|---|
| 2801 | ***************************************************** */ |
|---|
| 2802 | |
|---|
| 2803 | #if !LIND && !CIB64 |
|---|
| 2804 | |
|---|
| 2805 | #define BX0CDROM 1 /* Bx0 is a bit more user friendly */ |
|---|
| 2806 | #define SHOWCORE 1 /* 1 to show coreleft if b40trace is on */ |
|---|
| 2807 | |
|---|
| 2808 | #define MAXVOPR 512 |
|---|
| 2809 | #define MAXQUAL 20 |
|---|
| 2810 | #define MAXPDLS 32 |
|---|
| 2811 | #define MAXERRL 60 |
|---|
| 2812 | |
|---|
| 2813 | #define ZORX '+' |
|---|
| 2814 | #define ZAND '*' |
|---|
| 2815 | #define ZANN '^' |
|---|
| 2816 | #if !LIND |
|---|
| 2817 | #define ZANG 'G' |
|---|
| 2818 | #define ZANF 'F' |
|---|
| 2819 | #endif |
|---|
| 2820 | #define ZANP '.' |
|---|
| 2821 | #define ZANE '$' |
|---|
| 2822 | #define ZASS '=' |
|---|
| 2823 | #define ZLDV '_' |
|---|
| 2824 | #define ZQUA '/' |
|---|
| 2825 | |
|---|
| 2826 | #define TOKNULL 0 |
|---|
| 2827 | #define TOKDELIM 1 |
|---|
| 2828 | #define TOKTERM 2 |
|---|
| 2829 | |
|---|
| 2830 | #define TBOOL 1 |
|---|
| 2831 | |
|---|
| 2832 | #define OPRNULL 0x01 |
|---|
| 2833 | #define OPRXEND 0x02 |
|---|
| 2834 | #define PSTLEVEL 0x03 |
|---|
| 2835 | #define ACCLEVEL 0x04 |
|---|
| 2836 | |
|---|
| 2837 | #define MFQTDBN0 11 |
|---|
| 2838 | #define MFQTQRY0 12 |
|---|
| 2839 | #define MFQTOBJ0 13 |
|---|
| 2840 | |
|---|
| 2841 | #define MFQTXCTS 20 |
|---|
| 2842 | |
|---|
| 2843 | #define MFQSWTIM 't' |
|---|
| 2844 | #define MFQSWDBN 'd' |
|---|
| 2845 | #define MFQSWQTY 'q' |
|---|
| 2846 | |
|---|
| 2847 | #define MFQTASET 21 |
|---|
| 2848 | #define MFQTALCC 22 |
|---|
| 2849 | |
|---|
| 2850 | #define MFQTHITS 31 |
|---|
| 2851 | #define MFQTHCUR 32 |
|---|
| 2852 | #define MFQTHMFN 33 |
|---|
| 2853 | #define MFQTHSIZ 34 |
|---|
| 2854 | #define MFQTHMEM 35 |
|---|
| 2855 | |
|---|
| 2856 | #define MFQXHMFNx 'C' |
|---|
| 2857 | #define MFQXHTAGx 'A' |
|---|
| 2858 | #define MFQXHOCCx 'S' |
|---|
| 2859 | #define MFQXHCNTx 'E' |
|---|
| 2860 | |
|---|
| 2861 | |
|---|
| 2862 | #define B4UPLEN 6 /* length for b40 numeric fields */ |
|---|
| 2863 | #define B4DELADD "D%dA%d|%06ld|" /* sprintf format for dir/field */ |
|---|
| 2864 | #define B4EDIT1 "%06ld" /* sprintf format for field edit */ |
|---|
| 2865 | |
|---|
| 2866 | #define MFQTXTAG 101 /* inverted files prefixes */ |
|---|
| 2867 | |
|---|
| 2868 | typedef struct irxstru { |
|---|
| 2869 | LONGX irxbytes; /* irx bytes */ |
|---|
| 2870 | LONGX irxhits; |
|---|
| 2871 | char irxarea[1]; /* irx area */ |
|---|
| 2872 | } IRXSTRU; |
|---|
| 2873 | |
|---|
| 2874 | |
|---|
| 2875 | /* CIB40 Interface */ |
|---|
| 2876 | #if ANSI |
|---|
| 2877 | char *b4_exp(LONGX irec, char *dbnamp, char *qryp,char *qrydbnp, int *errnop); |
|---|
| 2878 | char *b4_run(LONGX irec, char *dbnamp, LONGX nbytes1, LONGX nbytes2, LONGX tell, |
|---|
| 2879 | unsigned char uctab[], LONGX tlirec, int *errnop); |
|---|
| 2880 | LONGX b4_hit(LONGX irec, LONGX nhit); |
|---|
| 2881 | int b4_msg(int tline, char *msg, LONGX psts, LONGX docs, int tmsg); |
|---|
| 2882 | int b4_kbh(); |
|---|
| 2883 | char *b4_massp(char *tken, int tklen, |
|---|
| 2884 | char *tkqualp, int tkquall, char *tknextp); |
|---|
| 2885 | char *b4_xlkey(char *opx, char *bufp, unsigned char uctab[], char *xlfilp, |
|---|
| 2886 | int *opxlp); |
|---|
| 2887 | #else |
|---|
| 2888 | char *b4_exp(); |
|---|
| 2889 | char *b4_run(); |
|---|
| 2890 | LONGX b4_hit(); |
|---|
| 2891 | int b4_msg(); |
|---|
| 2892 | int b4_kbh(); |
|---|
| 2893 | char *b4_massp(); |
|---|
| 2894 | char *b4_xlkey(); |
|---|
| 2895 | #endif |
|---|
| 2896 | |
|---|
| 2897 | /* global */ |
|---|
| 2898 | #if !CICPP |
|---|
| 2899 | extern int b40trace; |
|---|
| 2900 | extern char b4_tmpnam[]; |
|---|
| 2901 | extern LONGX b4setno; |
|---|
| 2902 | /* extern ...; */ |
|---|
| 2903 | #endif /* CICPP */ |
|---|
| 2904 | |
|---|
| 2905 | #endif /* CIB40 */ |
|---|
| 2906 | |
|---|
| 2907 | |
|---|
| 2908 | /* ***************************************************** |
|---|
| 2909 | CIB50.H |
|---|
| 2910 | ***************************************************** */ |
|---|
| 2911 | |
|---|
| 2912 | #if LIND || CIB64 |
|---|
| 2913 | |
|---|
| 2914 | #define ERRTRACE 0 |
|---|
| 2915 | #define BX0CDROM 1 /* Bx0 is a bit more user friendly */ |
|---|
| 2916 | #if CICPP |
|---|
| 2917 | #define SHOWCORE 0 /* 1 to show coreleft if b50trace is on */ |
|---|
| 2918 | #else /* CICPP */ |
|---|
| 2919 | #define SHOWCORE 1 /* 1 to show coreleft if b50trace is on */ |
|---|
| 2920 | #endif /* CICPP */ |
|---|
| 2921 | #define MAXPDLS 32 |
|---|
| 2922 | #define MAXERRL 81 |
|---|
| 2923 | |
|---|
| 2924 | #define ZORX '+' |
|---|
| 2925 | #define ZAND '*' |
|---|
| 2926 | #define ZANN '^' |
|---|
| 2927 | #define ZLDV '_' |
|---|
| 2928 | #define ZPFX '[' |
|---|
| 2929 | #define ZPDL '{' |
|---|
| 2930 | |
|---|
| 2931 | #define TOKNULL 0 |
|---|
| 2932 | #define TOKDELIM 1 |
|---|
| 2933 | #define TOKTERM 2 |
|---|
| 2934 | |
|---|
| 2935 | #define TBOOL 1 |
|---|
| 2936 | |
|---|
| 2937 | #define OPRNULL 0x01 |
|---|
| 2938 | #define OPRXEND 0x02 |
|---|
| 2939 | #define PSTLEVEL '1' |
|---|
| 2940 | #define ACCLEVEL '1' |
|---|
| 2941 | #define FLDUPXB5 0x05 |
|---|
| 2942 | |
|---|
| 2943 | #define MFQTDBN0 11 |
|---|
| 2944 | #define MFQTQRY0 12 |
|---|
| 2945 | #define MFQTOBJ0 13 |
|---|
| 2946 | |
|---|
| 2947 | #define MFQTXCTS 20 |
|---|
| 2948 | |
|---|
| 2949 | #define MFQSWTIM 't' |
|---|
| 2950 | #define MFQSWDBN 'd' |
|---|
| 2951 | #define MFQSWQTY 'q' |
|---|
| 2952 | |
|---|
| 2953 | #define MFQTASET 21 |
|---|
| 2954 | #define MFQTALCC 22 |
|---|
| 2955 | |
|---|
| 2956 | #define MFQTHITS 31 |
|---|
| 2957 | #define MFQTHCUR 32 |
|---|
| 2958 | #define MFQTHMFN 33 |
|---|
| 2959 | #define MFQTHSIZ 34 |
|---|
| 2960 | #define MFQTHMEM 35 |
|---|
| 2961 | |
|---|
| 2962 | #define MFQTSNAM 36 |
|---|
| 2963 | |
|---|
| 2964 | #define MFQTHITX 41 /* CDUSP */ |
|---|
| 2965 | |
|---|
| 2966 | #define B5UPLEN 8 /* length for b50 numeric fields */ |
|---|
| 2967 | #define B5DELADD "D%dA%d|%08ld|" /* sprintf format for dir/field */ |
|---|
| 2968 | #define B5EDIT1 "%08ld" /* sprintf format for field edit */ |
|---|
| 2969 | |
|---|
| 2970 | #define MFQTXTAG 101 /* inverted files prefixes */ |
|---|
| 2971 | |
|---|
| 2972 | #define B5RE_X2 1 |
|---|
| 2973 | #define B5RE_X3 2 |
|---|
| 2974 | #define B5RE_X1 3 |
|---|
| 2975 | #define B5RE_53 4 |
|---|
| 2976 | #define B5RE_1 5 |
|---|
| 2977 | #define B5RE_2 6 |
|---|
| 2978 | #define B5RE_3 7 |
|---|
| 2979 | #define B5RE_4 8 |
|---|
| 2980 | #define B5RE_10 9 |
|---|
| 2981 | #define B5RE_18 10 |
|---|
| 2982 | #define B5RE_28 11 |
|---|
| 2983 | #define B5RE_PFX 12 |
|---|
| 2984 | #define B5RE_SET 13 |
|---|
| 2985 | |
|---|
| 2986 | #if ! CICPP |
|---|
| 2987 | #if BIGREC |
|---|
| 2988 | #else /* BIGREC */ |
|---|
| 2989 | typedef struct b6hitbuf { |
|---|
| 2990 | LONGX setno; /* query number */ |
|---|
| 2991 | LONGX block; /* block number */ |
|---|
| 2992 | LONGX bufsiz; /* buffer size */ |
|---|
| 2993 | UBYTE area[1]; /* buffer - via ALLOC() */ |
|---|
| 2994 | } B6HITBUF; |
|---|
| 2995 | #endif /* BIGREC */ |
|---|
| 2996 | #endif /* CICPP */ |
|---|
| 2997 | |
|---|
| 2998 | /* CIB50 Interface */ |
|---|
| 2999 | #if !CICPP |
|---|
| 3000 | #if ANSI |
|---|
| 3001 | char *b5_exp(LONGX irec, char *dbnamp, char *qryp, |
|---|
| 3002 | char *buffup, char *qrydbnp, LONGX crec, int *errnop); |
|---|
| 3003 | #if BIGREC |
|---|
| 3004 | char *b5_run(LONGX irec, char *dbnamp, |
|---|
| 3005 | char *buffup, LONGX nbytes1, LONGX tell, |
|---|
| 3006 | unsigned char uctab[], char *btch0p, LONGX tlirec, LONGX crec, |
|---|
| 3007 | int *errnop); |
|---|
| 3008 | LONGX b5_hit(LONGX irec, LONGX nhit, char *buffup); |
|---|
| 3009 | #else /* BIGREC */ |
|---|
| 3010 | char *b6_run(LONGX irec, char *dbnamp, |
|---|
| 3011 | char *buffup, int buffuplen, LONGX nbytes1, LONGX tell, |
|---|
| 3012 | unsigned char uctab[], char *btch0p, LONGX tlirec, |
|---|
| 3013 | LONGX crec, int *errnop); |
|---|
| 3014 | LONGX b6_hit(LONGX irec, LONGX nhit, LONGX setno, B6HITBUF *bufferp); |
|---|
| 3015 | int b6_hballoc(LONGX bufsiz, B6HITBUF **bufferpp); |
|---|
| 3016 | int b6_hbinit(LONGX setno, B6HITBUF *bufferp); |
|---|
| 3017 | int b6_hbfree(B6HITBUF **bufferpp); |
|---|
| 3018 | #endif /* BIGREC */ |
|---|
| 3019 | int b5_msg(int tline, char *msg, LONGX docs, int tmsg); |
|---|
| 3020 | int b5_kbh(void); |
|---|
| 3021 | char *b5_massp(char *tken, int tklen, int b5ee_pfx); |
|---|
| 3022 | void b5_experr(int error, char *errp, int errl); |
|---|
| 3023 | int b50read(DBXSTRU *dbxp,LONGX mfn,int tag,int occ,char *areap,LONGX *areasizp); |
|---|
| 3024 | int b5_pfx(LONGX irec, UWORD invxtag, char *dp, char *op, int b5re_pfx); |
|---|
| 3025 | int b5_nxtoken(void); /* now return toktype */ |
|---|
| 3026 | #else /* ANSI */ |
|---|
| 3027 | char *b5_exp(); |
|---|
| 3028 | #if BIGREC |
|---|
| 3029 | char *b5_run(); |
|---|
| 3030 | LONGX b5_hit(); |
|---|
| 3031 | #else /* BIGREC */ |
|---|
| 3032 | char *b6_run(); |
|---|
| 3033 | LONGX b6_hit(); |
|---|
| 3034 | int b6_hballoc(); |
|---|
| 3035 | int b6_hbinit(); |
|---|
| 3036 | int b6_hbfree(); |
|---|
| 3037 | #endif /* BIGREC */ |
|---|
| 3038 | int b5_msg(); |
|---|
| 3039 | int b5_kbh(); |
|---|
| 3040 | char *b5_massp(); |
|---|
| 3041 | void b5_experr(); |
|---|
| 3042 | int b50read(); |
|---|
| 3043 | int b5_pfx(); |
|---|
| 3044 | int b5_nxtoken(); |
|---|
| 3045 | #endif /* ANSI */ |
|---|
| 3046 | #endif /* CICPP */ |
|---|
| 3047 | |
|---|
| 3048 | /* global */ |
|---|
| 3049 | #if !CICPP |
|---|
| 3050 | extern char *toknextp; /* b5_nxtoken input data */ |
|---|
| 3051 | extern int toklen; /* token length */ |
|---|
| 3052 | #if BEFORE970507 |
|---|
| 3053 | extern char *token; /* token addr */ |
|---|
| 3054 | extern int toktyp; /* token type - return by b5_nxtoken() */ |
|---|
| 3055 | #endif |
|---|
| 3056 | |
|---|
| 3057 | extern LONGX b5setno; /* query set number */ |
|---|
| 3058 | extern char b53_tmpnam[]; /* tmp file name for b5_run() */ |
|---|
| 3059 | extern int b50trace; /* b50 RUXTRACE runtime switch */ |
|---|
| 3060 | extern DBXSTRU *b5_savdbxp; /* '@' processing for b5_run() */ |
|---|
| 3061 | extern LONGX b5_isn1; /* query #0 lower limit */ |
|---|
| 3062 | extern LONGX b5_isn2; /* query #0 upper limit */ |
|---|
| 3063 | |
|---|
| 3064 | #if BIGREC |
|---|
| 3065 | #else /* BIGREC */ |
|---|
| 3066 | extern B6HITBUF *b6bufferp; /* b6_run() processing buffer */ |
|---|
| 3067 | #endif /* BIGREC */ |
|---|
| 3068 | |
|---|
| 3069 | #endif /* CIB50 */ |
|---|
| 3070 | #endif /* CICPP */ |
|---|
| 3071 | |
|---|
| 3072 | #endif /* CIB71 */ |
|---|
| 3073 | |
|---|
| 3074 | |
|---|
| 3075 | /* ***************************************************** |
|---|
| 3076 | Current master file record & inverted file term |
|---|
| 3077 | ***************************************************** */ |
|---|
| 3078 | |
|---|
| 3079 | /* CIAOT Definitions */ |
|---|
| 3080 | |
|---|
| 3081 | /* Current master file record */ |
|---|
| 3082 | |
|---|
| 3083 | #if !CIAPI |
|---|
| 3084 | #if !CICPP /* nao existe mais prateleira de registros */ |
|---|
| 3085 | #define RECORD(irec,dbn,mfn) recp=vrecp[(unsigned)record(irec,dbn,mfn)] |
|---|
| 3086 | #define RECALLOC(irec,n) recp=vrecp[(unsigned)recallok(irec,n)] |
|---|
| 3087 | #endif /* CICPP */ |
|---|
| 3088 | #endif /* CIAPI */ |
|---|
| 3089 | |
|---|
| 3090 | /* Current inverted file term (and postings) */ |
|---|
| 3091 | |
|---|
| 3092 | #if !CIAPI |
|---|
| 3093 | #if !CICPP /* nao existe mais prateleira de termos */ |
|---|
| 3094 | #define TERM(itrm,dbn,key) trmp=vtrmp[(unsigned)term(itrm,dbn,key)] |
|---|
| 3095 | #define NXTERM(itrm) trmp=vtrmp[(unsigned)nxterm(itrm)] |
|---|
| 3096 | #define TRMALLOC(itrm,n) trmp=vtrmp[(unsigned)trmalloc(itrm,n)] |
|---|
| 3097 | #endif /* CICPP */ |
|---|
| 3098 | #endif /* CIAPI */ |
|---|
| 3099 | |
|---|
| 3100 | |
|---|
| 3101 | |
|---|
| 3102 | /* ***************************************************** |
|---|
| 3103 | CIFMT.H |
|---|
| 3104 | ***************************************************** */ |
|---|
| 3105 | |
|---|
| 3106 | /* CDS/ISIS Formatting Language interface */ |
|---|
| 3107 | |
|---|
| 3108 | #if !EXCFMXML |
|---|
| 3109 | #ifndef CI_XMLELEM |
|---|
| 3110 | #define CI_XMLELEM 0 //1 v5.2 - AOT, 28/12/2005 |
|---|
| 3111 | #endif |
|---|
| 3112 | #endif |
|---|
| 3113 | |
|---|
| 3114 | typedef enum ins { |
|---|
| 3115 | dummy, jumpf, jumpt, jump, pre_cond, pre_r_lit, pre_r_lit_plus, |
|---|
| 3116 | suf_cond, suf_cond_null, suf_r_lit, suf_r_lit_plus, |
|---|
| 3117 | set_true_rep, set_false_rep, test_rep, begin, end, |
|---|
| 3118 | |
|---|
| 3119 | beg_init_not_rep, |
|---|
| 3120 | end_init_not_rep, |
|---|
| 3121 | beg_init_rep, |
|---|
| 3122 | end_init_rep, |
|---|
| 3123 | |
|---|
| 3124 | begin_rep_gr, end_rep_gr, test_occ, print_field, d_dummy, n_dummy, |
|---|
| 3125 | load_field_all, load_field_occ, load_number, load_string, |
|---|
| 3126 | x_spac, c_spac, slash_spac, n_sigx_spac, n_sign_spac, percent_spac, |
|---|
| 3127 | mpl_par, mpu_par, mhl_par, mhu_par, mdl_par, mdu_par, |
|---|
| 3128 | escape_seq, u_cond, print_mfn, load_mfn, absent, present, contains, |
|---|
| 3129 | neq_op, lss_op, gtr_op, leq_op, geq_op, eql_op, or_op, and_op, not_op, |
|---|
| 3130 | plus_op, minus_op, times_op, divide_op, |
|---|
| 3131 | init_if, end_then, end_else, fi, val_beg, val_end, |
|---|
| 3132 | print_core, print_maxmfn, load_core, load_maxmfn, |
|---|
| 3133 | rupx_beg, rupx_end, rupd_beg, rupd_end, syst_beg, syst_end, |
|---|
| 3134 | date_mktime_beg, date_mktime_end, /* AOT */ |
|---|
| 3135 | rsum_beg, rsum_end, rmax_beg, rmax_end, |
|---|
| 3136 | rmin_beg, rmin_end, ravr_beg, ravr_end, |
|---|
| 3137 | l_beg, l_end, s_beg, s_end, fmt_beg, fmt_end, f_beg, f_end, str_cat, |
|---|
| 3138 | getenv_beg, getenv_end, |
|---|
| 3139 | putenv_beg, putenv_end, |
|---|
| 3140 | prt_str_f, |
|---|
| 3141 | ref_beg, ref_end, |
|---|
| 3142 | refu_beg,refu_end, /* Ref aparecendo com funcao */ |
|---|
| 3143 | read_mfn, |
|---|
| 3144 | update_fld, input_fld, lw_beg, lw_end, |
|---|
| 3145 | dbname_beg, dbname_end,load_float, |
|---|
| 3146 | noccins, |
|---|
| 3147 | np_beg,np_end, |
|---|
| 3148 | ioccins, |
|---|
| 3149 | continueins,breakins, |
|---|
| 3150 | size_beg, size_end, |
|---|
| 3151 | type_beg, type_end, |
|---|
| 3152 | load_mstnam, /* print_mstnam, */ |
|---|
| 3153 | load_date, /* print_date, */ |
|---|
| 3154 | duptop, /* duplicar topo pilha */ |
|---|
| 3155 | end_select, |
|---|
| 3156 | datex_beg,datex_end, /* AOT */ |
|---|
| 3157 | instr_beg, instr_end, |
|---|
| 3158 | left_beg,left_end, |
|---|
| 3159 | right_beg,right_end, |
|---|
| 3160 | mid_beg,mid_end, |
|---|
| 3161 | cat_beg, cat_end, |
|---|
| 3162 | replac_beg,replac_end, |
|---|
| 3163 | #if CI_XMLELEM |
|---|
| 3164 | xmlelem_beg,xmlelem_end, |
|---|
| 3165 | #endif |
|---|
| 3166 | nl_beg,nl_end, |
|---|
| 3167 | ign_cond, /*12-03-99 ignore conditional lits without field selector */ |
|---|
| 3168 | while_beg,while_end, |
|---|
| 3169 | occins, |
|---|
| 3170 | eattrib_beg,eattrib_end,sattrib_beg,sattrib_end, |
|---|
| 3171 | intvvalue,strvvalue, |
|---|
| 3172 | ss_beg,ss_end, |
|---|
| 3173 | citype_beg,citype_end, |
|---|
| 3174 | zzzzzz |
|---|
| 3175 | } instruction_code; |
|---|
| 3176 | |
|---|
| 3177 | typedef int label; |
|---|
| 3178 | |
|---|
| 3179 | typedef struct intermediate_code { |
|---|
| 3180 | label lab; |
|---|
| 3181 | instruction_code instr; |
|---|
| 3182 | LONGX add; |
|---|
| 3183 | } pgm_node; |
|---|
| 3184 | |
|---|
| 3185 | #if CICPP |
|---|
| 3186 | class _YOURCLASS FMTSTRU; /* Para substituir def da struct */ |
|---|
| 3187 | #endif /* CICPP */ |
|---|
| 3188 | |
|---|
| 3189 | #if CIAPI |
|---|
| 3190 | typedef void FMT_CODE; |
|---|
| 3191 | #else /* CIAPI */ |
|---|
| 3192 | typedef struct lista { |
|---|
| 3193 | pgm_node info; |
|---|
| 3194 | LONGX m_add; |
|---|
| 3195 | LONGX next; |
|---|
| 3196 | } FMT_CODE; |
|---|
| 3197 | #endif /* CIAPI */ |
|---|
| 3198 | |
|---|
| 3199 | |
|---|
| 3200 | /* CIFMT Interface */ |
|---|
| 3201 | |
|---|
| 3202 | #if !CIAPI |
|---|
| 3203 | |
|---|
| 3204 | #if CIAPI_SOURCE |
|---|
| 3205 | LONGX recfmt( RECSTRU* recp, LONGX lw, char *fmt, char *area, LONGX asize); |
|---|
| 3206 | LONGX recfmtcmp(RECSTRU* recp, LONGX lw, char *fmt, char *area, LONGX asize, |
|---|
| 3207 | FMTSTRU **ptpgm, int flagfree); |
|---|
| 3208 | #endif /* CIAPI_SOURCE */ |
|---|
| 3209 | |
|---|
| 3210 | #if !CICPP |
|---|
| 3211 | #if ANSI |
|---|
| 3212 | LONGX recfmt( LONGX irec, LONGX lw, char *fmtp, char *areap, LONGX asize); |
|---|
| 3213 | LONGX recfmtcmp(LONGX irec, LONGX lw, char *fmtp, char *areap, LONGX asize, |
|---|
| 3214 | FMT_CODE **pgmpp, int flagfree); |
|---|
| 3215 | LONGX fmt_gener(FMT_CODE **pgmpp, char *fmtp); |
|---|
| 3216 | LONGX fmt_inter(FMT_CODE *pgmp, LONGX irec, LONGX lw, char *areap, LONGX asize); |
|---|
| 3217 | void fmt_free( FMT_CODE *pgmp); |
|---|
| 3218 | #else |
|---|
| 3219 | LONGX recfmt(); |
|---|
| 3220 | LONGX recfmtcmp(); |
|---|
| 3221 | LONGX fmt_gener(); |
|---|
| 3222 | LONGX fmt_inter(); |
|---|
| 3223 | void fmt_free(); |
|---|
| 3224 | #endif |
|---|
| 3225 | #endif /* CICPP */ |
|---|
| 3226 | |
|---|
| 3227 | /* global */ |
|---|
| 3228 | #if !CICPP |
|---|
| 3229 | extern int fmttrace; |
|---|
| 3230 | extern LONGX fmt_error; /* error - code */ |
|---|
| 3231 | extern LONGX fmt_errof; /* error - fmt spec offset to error */ |
|---|
| 3232 | extern LONGX fmt_fsiz; /* fmt_inter() - to set max field length */ |
|---|
| 3233 | #endif /* CICPP */ |
|---|
| 3234 | |
|---|
| 3235 | #endif /* !CIAPI */ |
|---|
| 3236 | |
|---|
| 3237 | |
|---|
| 3238 | /* ***************************************************** |
|---|
| 3239 | CIFST.H |
|---|
| 3240 | ***************************************************** */ |
|---|
| 3241 | |
|---|
| 3242 | #if CICPP |
|---|
| 3243 | #if USE_GDBFMT |
|---|
| 3244 | #define FMT_CODX char |
|---|
| 3245 | #else /* USE_GDBFMT */ |
|---|
| 3246 | #define FMT_CODX char /*FMTSTRU */ |
|---|
| 3247 | #endif /* USE_GDBFMT */ |
|---|
| 3248 | #else |
|---|
| 3249 | #define FMT_CODX FMT_CODE |
|---|
| 3250 | #endif /* CICPP */ |
|---|
| 3251 | |
|---|
| 3252 | #if CICPP |
|---|
| 3253 | class _YOURCLASS FSTSTRU; /* Para substituir def da struct */ |
|---|
| 3254 | #endif /* CICPP */ |
|---|
| 3255 | |
|---|
| 3256 | typedef struct fst_code { |
|---|
| 3257 | UWORD tag; |
|---|
| 3258 | int it; |
|---|
| 3259 | FMT_CODX *fmtp; |
|---|
| 3260 | struct fst_code *nextp; |
|---|
| 3261 | } FST_CODE; |
|---|
| 3262 | |
|---|
| 3263 | typedef struct link1 { |
|---|
| 3264 | UCHR key[LE1]; |
|---|
| 3265 | POSTSTRU post; |
|---|
| 3266 | } LINK1; |
|---|
| 3267 | |
|---|
| 3268 | typedef struct link2 { |
|---|
| 3269 | UCHR key[LE2]; |
|---|
| 3270 | POSTSTRU post; |
|---|
| 3271 | } LINK2; |
|---|
| 3272 | |
|---|
| 3273 | #define FSTERR1 1 |
|---|
| 3274 | #define FSTERR2 2 |
|---|
| 3275 | #define FSTERR3 3 |
|---|
| 3276 | #define FSTERRF 4 |
|---|
| 3277 | |
|---|
| 3278 | /* CIFST Interface */ |
|---|
| 3279 | |
|---|
| 3280 | #if !CICPP |
|---|
| 3281 | #if ANSI |
|---|
| 3282 | LONGX recfst( LONGX irec, char *fstspecp, |
|---|
| 3283 | char *area1p, LONGX max1, |
|---|
| 3284 | char *area2p, LONGX max2, |
|---|
| 3285 | LONGX *qty1, LONGX *qty2); |
|---|
| 3286 | LONGX recfstcmp(LONGX irec, char *fstspecp, |
|---|
| 3287 | char *area1p, LONGX max1, char *area2p, |
|---|
| 3288 | LONGX max2, LONGX *qty1, LONGX *qty2, |
|---|
| 3289 | FST_CODE **pgmpp, int flagfree); |
|---|
| 3290 | LONGX fst_gener(FST_CODE **pgmpp, char *fstspecp); |
|---|
| 3291 | LONGX fst_inter(FST_CODE *pgmp, LONGX irec, char *stwp, |
|---|
| 3292 | char **area1pp, LONGX max1, |
|---|
| 3293 | char **area2pp, LONGX max2, |
|---|
| 3294 | LONGX *qty1p, LONGX *qty2p); |
|---|
| 3295 | void fst_free( FST_CODE *pgmp); |
|---|
| 3296 | int fst_link(char *pfxp, int plen, char *keyp, int klen, |
|---|
| 3297 | LONGX mfn, UWORD tag, UWORD occ, UWORD cnt, |
|---|
| 3298 | char *link1, char *link2, LONGX *lft1, LONGX *lft2); |
|---|
| 3299 | int fst_writ(int treecase, LONGX mfn, UWORD tag, UWORD occ, UWORD cnt, |
|---|
| 3300 | char *kp, int kl, UCHR *uctabp); |
|---|
| 3301 | int fst_open(char *gidbnp, char *filnamp, int treecase); |
|---|
| 3302 | int fst_clos(int treecase); |
|---|
| 3303 | void pstdecod(POSTSTRU *pst, LONGX *mfn, UWORD *tag, UWORD *occ, UWORD *cnt); |
|---|
| 3304 | void prtlink(char *sp, LONGX mfn, UWORD tag,UWORD occ,UWORD cnt, UCHR *keyp, int len); |
|---|
| 3305 | #else |
|---|
| 3306 | LONGX recfst(); |
|---|
| 3307 | LONGX recfstcmp(); |
|---|
| 3308 | LONGX fst_gener(); |
|---|
| 3309 | LONGX fst_inter(); |
|---|
| 3310 | void fst_free(); |
|---|
| 3311 | int fst_link(); |
|---|
| 3312 | int fst_writ(); |
|---|
| 3313 | int fst_open(); |
|---|
| 3314 | int fst_clos(); |
|---|
| 3315 | void pstdecod(); |
|---|
| 3316 | void prtlink(); |
|---|
| 3317 | #endif |
|---|
| 3318 | |
|---|
| 3319 | #endif /* CICPP */ |
|---|
| 3320 | |
|---|
| 3321 | /* global */ |
|---|
| 3322 | #if !CICPP |
|---|
| 3323 | extern int fsttrace; /* fst FSSTRACE runtime switch */ |
|---|
| 3324 | #endif /* CICPP */ |
|---|
| 3325 | #if !CICPP |
|---|
| 3326 | extern LONGX fst_error; /* gener - fst spec error */ |
|---|
| 3327 | extern LONGX fst_errl; /* gener - fst spec line where error occured */ |
|---|
| 3328 | extern char *fst_errp; /* gener - fst spec ptr where error occured */ |
|---|
| 3329 | extern char *fst_fmtap; /* inter - static format area */ |
|---|
| 3330 | extern LONGX fst_fmtby; /* inter - bytes for dynamic format area */ |
|---|
| 3331 | extern char fst_rdlm; /* inter - new occ delimiter */ |
|---|
| 3332 | extern int fst_fd[]; /* inter - file descriptor for .ln1/.ln2 */ |
|---|
| 3333 | extern LONGX fst_fx[]; /* inter - output records to .ln1/.ln2 */ |
|---|
| 3334 | extern int cifstfix; /* inter - key %8ld %5d %4d %4d */ |
|---|
| 3335 | extern int cifstfim; /* inter - key %8ld w/ cifstfix */ |
|---|
| 3336 | extern char *fst_batchup; /* inter - batchp for fldupdat() area */ |
|---|
| 3337 | extern char *fst_batchp;/* inter - batchp for fldupdat() commands */ |
|---|
| 3338 | extern int fst_batch0; /* inter - batchp ^mmfn^oocc^ccnt^l1/2 option */ |
|---|
| 3339 | extern char *fst_hdrp; /* inter - hit file headers - area */ |
|---|
| 3340 | extern int fst_hdrx; /* inter - hit file headers - #bytes allocated */ |
|---|
| 3341 | extern int fst_hdru; /* inter - hit file headers - #bytes stored */ |
|---|
| 3342 | extern int fst_hdrt; /* inter - hit file headers - for area+^m^t^o^c */ |
|---|
| 3343 | extern char *fst_wlupifnp; /* inter - word lookup I/F for TW processing */ |
|---|
| 3344 | extern TRMSTRU *fst_wluptrmp; /* inter - word lookup I/F for TW processing */ |
|---|
| 3345 | extern LONGX fst_wlupitrm; /* inter - word lookup I/F for TW processing */ |
|---|
| 3346 | #endif /* CICPP */ |
|---|
| 3347 | |
|---|
| 3348 | |
|---|
| 3349 | /* ***************************************************** |
|---|
| 3350 | CIIFx.H |
|---|
| 3351 | ***************************************************** */ |
|---|
| 3352 | |
|---|
| 3353 | #if IFUPDATE |
|---|
| 3354 | #define IFUPDICT 0 |
|---|
| 3355 | #define IFUPISIS 1 |
|---|
| 3356 | |
|---|
| 3357 | #define IFUPCORE 0 |
|---|
| 3358 | #define IFUPWRIT 1 |
|---|
| 3359 | #define IFUPCLOS 2 |
|---|
| 3360 | |
|---|
| 3361 | #define IFUPDXUP 1 |
|---|
| 3362 | #define IFUPDXLD 2 |
|---|
| 3363 | |
|---|
| 3364 | #define MAXIFMRG 1024 /* svdifmerg() */ /* AOT 22/06/2001 */ |
|---|
| 3365 | #endif |
|---|
| 3366 | |
|---|
| 3367 | /* CIIFx Interface */ |
|---|
| 3368 | |
|---|
| 3369 | #if CICPP |
|---|
| 3370 | class _YOURCLASS CIIFU; /* Para substituir def da struct */ |
|---|
| 3371 | class CIIFL; /* Para substituir def da struct */ |
|---|
| 3372 | #endif /* CICPP */ |
|---|
| 3373 | |
|---|
| 3374 | #if !CICPP |
|---|
| 3375 | #if ANSI |
|---|
| 3376 | #if BEFORE20000926 |
|---|
| 3377 | int upif_end(int pstflag); |
|---|
| 3378 | #else /* BEFORE20000926 */ |
|---|
| 3379 | int upif_end(char *dbnp, int pstflag); |
|---|
| 3380 | void upif_save(char *dbnp); |
|---|
| 3381 | void upif_restore(char *dbnp); |
|---|
| 3382 | #endif /* BEFORE20000926 */ |
|---|
| 3383 | void upif_init(char *dbnp); |
|---|
| 3384 | #if LIND |
|---|
| 3385 | LONGX svdiflind(char *dbnp,char *filekeys_1,char *filekeys_2, |
|---|
| 3386 | LONGX maxmfn,char *logp, |
|---|
| 3387 | int pstflag,LONGX tell); |
|---|
| 3388 | #else |
|---|
| 3389 | LONGX svdifload(char *dbnp,char *filekeys_1,char *filekeys_2, |
|---|
| 3390 | int pstflag,LONGX tell); |
|---|
| 3391 | #endif |
|---|
| 3392 | LONGX svdifmerg(char *dbnp,char *vifnamp[],LONGX vifmfns[], |
|---|
| 3393 | LONGX parmxmfn,char *parmlogp,int pstflag,LONGX tell); |
|---|
| 3394 | int ifupdat(char *mdbnp,LONGX mfn1,LONGX mfn2,char *idbnp,FST_CODE *fstp, |
|---|
| 3395 | char *stwp,LONGX maxlk1,LONGX maxlk2,int pstflag,int endup); |
|---|
| 3396 | void svdifupd(char *lnk1p,LONGX qtylk1,char *lnk2p,LONGX qtylk2, |
|---|
| 3397 | char *olnk1p,LONGX oqtylk1,char *olnk2p,LONGX oqtylk2, |
|---|
| 3398 | int pstflag,LONGX tell); |
|---|
| 3399 | #else |
|---|
| 3400 | int upif_end(); |
|---|
| 3401 | void upif_init(); |
|---|
| 3402 | #if LIND |
|---|
| 3403 | LONGX svdiflind(); |
|---|
| 3404 | #else |
|---|
| 3405 | LONGX svdifload(); |
|---|
| 3406 | #endif |
|---|
| 3407 | LONGX svdifmerg(); |
|---|
| 3408 | void svdifupd(); |
|---|
| 3409 | int ifupdat(); |
|---|
| 3410 | #endif /* ANSI */ |
|---|
| 3411 | #endif /* CICPP */ |
|---|
| 3412 | |
|---|
| 3413 | /* global */ |
|---|
| 3414 | #define CIIFLFIX 1 |
|---|
| 3415 | #if !CICPP |
|---|
| 3416 | #if CIIFLFIX |
|---|
| 3417 | extern int ciiflfix; /* svdifload/lind() - key %8ld %5d %4d %4d */ |
|---|
| 3418 | extern int ciiflfim; /* svdifload/lind() - key %8ld w/ ciiflfix */ |
|---|
| 3419 | #endif |
|---|
| 3420 | |
|---|
| 3421 | extern int ifupd_reset; /* ifupdat() reset IfUpdPend flags */ |
|---|
| 3422 | extern int ifupd_wrnmsg; /* ifupdat() warning messages */ |
|---|
| 3423 | #endif /* CICPP */ |
|---|
| 3424 | |
|---|
| 3425 | /* see DBXi.... */ |
|---|
| 3426 | |
|---|
| 3427 | |
|---|
| 3428 | |
|---|
| 3429 | /* ***************************************************** |
|---|
| 3430 | ISISUCTAB & others |
|---|
| 3431 | ***************************************************** */ |
|---|
| 3432 | |
|---|
| 3433 | #if CICPP |
|---|
| 3434 | #else /* CICPP */ |
|---|
| 3435 | #if CIAPI |
|---|
| 3436 | #else /* CIAPI */ |
|---|
| 3437 | /* tabelas de mxaot.c |
|---|
| 3438 | */ |
|---|
| 3439 | extern unsigned char isisuctab[]; |
|---|
| 3440 | extern int isiswctot; |
|---|
| 3441 | extern unsigned char isiswctab[]; |
|---|
| 3442 | extern unsigned char isisactab[]; |
|---|
| 3443 | extern unsigned char ansimctab[]; /* convert=ansi */ /* asc2ansi */ |
|---|
| 3444 | extern unsigned char arabmctab[]; /* convert=arab */ /* 708_1256 */ |
|---|
| 3445 | extern unsigned char ansiuctab[]; |
|---|
| 3446 | extern unsigned char ansiactab[]; |
|---|
| 3447 | |
|---|
| 3448 | extern int NXPAGES[]; /* AOT, 21/02/2001 */ |
|---|
| 3449 | #endif /* CIAPI */ |
|---|
| 3450 | #endif /* CICPP */ |
|---|
| 3451 | |
|---|
| 3452 | |
|---|
| 3453 | |
|---|
| 3454 | /* ***************************************************** |
|---|
| 3455 | MXAOT & others utilities |
|---|
| 3456 | ***************************************************** */ |
|---|
| 3457 | #if 1 /* !CIAPI_SOURCE */ |
|---|
| 3458 | #ifndef ISIS_DLL |
|---|
| 3459 | #ifndef MXFUN |
|---|
| 3460 | #define MXFUN 1 /* AOT, 21/02/2001 */ |
|---|
| 3461 | #endif |
|---|
| 3462 | #ifndef IFLOADFUN |
|---|
| 3463 | #define IFLOADFUN 1 /* AOT, 21/02/2001 */ |
|---|
| 3464 | #endif |
|---|
| 3465 | #endif /* ISIS_DLL */ |
|---|
| 3466 | #if PC |
|---|
| 3467 | #ifndef MYSFUN |
|---|
| 3468 | #define MYSFUN 1 /* AOT, 21/05/2001 */ |
|---|
| 3469 | #endif |
|---|
| 3470 | #else |
|---|
| 3471 | #ifndef MYSFUN |
|---|
| 3472 | #define MYSFUN 0 /* */ |
|---|
| 3473 | #endif |
|---|
| 3474 | #endif |
|---|
| 3475 | #endif /* !CIAPI_SOURCE */ |
|---|
| 3476 | |
|---|
| 3477 | /* MXAOT Interface */ |
|---|
| 3478 | int mxexec(int argc,char *argv[]); |
|---|
| 3479 | #if MXFUN |
|---|
| 3480 | int cisis_mx(char *stringp); |
|---|
| 3481 | #endif /* MXFUN */ |
|---|
| 3482 | |
|---|
| 3483 | /* IFLOADAOT Interface */ |
|---|
| 3484 | int ifloadexec(int argc,char *argv[]); |
|---|
| 3485 | #if IFLOADFUN |
|---|
| 3486 | int cisis_ifload(char *stringp); |
|---|
| 3487 | #endif /* MXFUN */ |
|---|
| 3488 | |
|---|
| 3489 | |
|---|
| 3490 | /* MYSAOT Interface */ |
|---|
| 3491 | #if MYSFUN |
|---|
| 3492 | int cisis_mysfunc(char *gidbnp, int parmlen, char *parmin, char *parmout, LONGX parmtell); |
|---|
| 3493 | #endif /* MYSFUN */ |
|---|
| 3494 | |
|---|
| 3495 | |
|---|
| 3496 | /* ***************************************************** |
|---|
| 3497 | Funzioni di Conversione |
|---|
| 3498 | Original code by Beppe Romano (quadri.nis.garr.it) |
|---|
| 3499 | ***************************************************** */ |
|---|
| 3500 | |
|---|
| 3501 | #if CNV_PCBINUM |
|---|
| 3502 | #if ANSI |
|---|
| 3503 | int ConvertMST_CTLSTRUCT(char *buffer); |
|---|
| 3504 | |
|---|
| 3505 | int ConvertMST_LEADER(char *buffer, int skipval, int breakval); |
|---|
| 3506 | int ConvertMST_DIR(char *buffer, int nvf); |
|---|
| 3507 | |
|---|
| 3508 | int ConvertXRF_REC(char *buffer); |
|---|
| 3509 | int ConvertXRF_PTR(char *buffer); |
|---|
| 3510 | |
|---|
| 3511 | int ConvertCNT_REC(char *buffer); /* changed (1 .cnt rec) */ |
|---|
| 3512 | int ConvertN01_REC(char *buffer); |
|---|
| 3513 | int ConvertN02_REC(char *buffer); |
|---|
| 3514 | int ConvertL01_REC(char *buffer); |
|---|
| 3515 | int ConvertL02_REC(char *buffer); |
|---|
| 3516 | int ConvertIFP_BLKCTL(char *buffer, int blk1); |
|---|
| 3517 | int ConvertIFP_PSTHDR(char *buffer); |
|---|
| 3518 | int ConvertBuffer(char *buffer, int fieldlength); |
|---|
| 3519 | #else |
|---|
| 3520 | int ConvertL02_REC(); |
|---|
| 3521 | int ConvertN02_REC(); |
|---|
| 3522 | int ConvertL01_REC(); |
|---|
| 3523 | int ConvertN01_REC(); |
|---|
| 3524 | int ConvertMST_CTLSTRUCT(); |
|---|
| 3525 | int ConvertMST_LEADER(); |
|---|
| 3526 | int ConvertMST_DIR(); |
|---|
| 3527 | int ConvertCNT_REC(); |
|---|
| 3528 | int ConvertXRF_PTR(); |
|---|
| 3529 | int ConvertXRF_REC(); |
|---|
| 3530 | int ConvertIFP_BLKCTL(); |
|---|
| 3531 | int ConvertIFP_PSTHDR(); |
|---|
| 3532 | int ConvertBuffer(); |
|---|
| 3533 | #endif |
|---|
| 3534 | #endif /* CNV_PCBINUM */ |
|---|
| 3535 | |
|---|
| 3536 | |
|---|
| 3537 | #if CICGI |
|---|
| 3538 | |
|---|
| 3539 | #if PC |
|---|
| 3540 | #define CICGI_VALSIZE (MAXMFRL/8) |
|---|
| 3541 | #define CICGI_NAMESIZE (MAXMFRL/8) |
|---|
| 3542 | #define CICGI_MAXENTRIES 256 /* 64 */ |
|---|
| 3543 | #define CICGI_WORDSIZE (MAXMFRL/8) |
|---|
| 3544 | #else |
|---|
| 3545 | #define CICGI_VALSIZE MAXMFRL |
|---|
| 3546 | #define CICGI_NAMESIZE MAXMFRL |
|---|
| 3547 | #define CICGI_MAXENTRIES 4096 /* 1024 */ |
|---|
| 3548 | #define CICGI_WORDSIZE MAXMFRL |
|---|
| 3549 | #endif |
|---|
| 3550 | |
|---|
| 3551 | typedef struct { |
|---|
| 3552 | char *namp; |
|---|
| 3553 | char *valp; |
|---|
| 3554 | } CICGI_ENTRY; |
|---|
| 3555 | |
|---|
| 3556 | #if CICPP |
|---|
| 3557 | class _YOURCLASS CGIClass; /* Para substituir def da struct */ |
|---|
| 3558 | #endif /* CICPP */ |
|---|
| 3559 | |
|---|
| 3560 | #if !CICPP |
|---|
| 3561 | #if ANSI |
|---|
| 3562 | int cicgi0(int *argc, char *argv[], char **wwwp, UWORD taghxsub, char *taghpfxp); |
|---|
| 3563 | int cicgi1(int *argc, char *argv[], CICGI_ENTRY entries[], int nentries, char *cicgi_p); |
|---|
| 3564 | #else |
|---|
| 3565 | int cicgi0(); |
|---|
| 3566 | int cicgi1(); |
|---|
| 3567 | #endif |
|---|
| 3568 | |
|---|
| 3569 | extern int cgitrace; /* extern */ |
|---|
| 3570 | #endif /* CICPP */ |
|---|
| 3571 | |
|---|
| 3572 | #endif /* CICGI */ |
|---|
| 3573 | |
|---|
| 3574 | |
|---|
| 3575 | |
|---|
| 3576 | #include "cihsh.h" /* CISIS Interface hashing & binary table search */ |
|---|
| 3577 | #if CIWTF /* WTFUN support */ |
|---|
| 3578 | /* header files */ |
|---|
| 3579 | #include <math.h> |
|---|
| 3580 | #include <time.h> |
|---|
| 3581 | //#include "cihsh.h" /* CISIS Interface hashing & binary table search */ |
|---|
| 3582 | #include "wt.h" /* //MAXNREC; typedef VECTEL; typedef LISTA */ |
|---|
| 3583 | #include "wtfun.h" /* //typedef WTFUN_XWT / WTFUN_ARRAY */ |
|---|
| 3584 | /* global */ |
|---|
| 3585 | extern WTFUN_ARRAY *ciawtfp; /* //global WTFUN_ARRAY */ |
|---|
| 3586 | extern char *ciahcgi; /* //global H2000 cgi data */ |
|---|
| 3587 | #endif /* CIWTF */ |
|---|
| 3588 | |
|---|
| 3589 | #if GCC |
|---|
| 3590 | #define PGCC 1 |
|---|
| 3591 | #include <sys/socket.h> |
|---|
| 3592 | #include <netinet/in.h> |
|---|
| 3593 | #include <netdb.h> |
|---|
| 3594 | #include <arpa/inet.h> /* inet_ntoa */ |
|---|
| 3595 | #else |
|---|
| 3596 | #define uint16_t unsigned short |
|---|
| 3597 | // #include <wsksock.h> |
|---|
| 3598 | #endif |
|---|
| 3599 | |
|---|
| 3600 | /* ciupdsocy.c / ciupdsocx.c prototypes */ |
|---|
| 3601 | int mainfile (int cmd, char *filnamp, int parm0, int parm1, char *buffer, int buffersize); // in ciupdsocy.c |
|---|
| 3602 | int mainclient (int cmd, char *protocol, char *serverhost, uint16_t port, char *message, char *buffer, int buffersize, int maxrds); // in ciupdsocx.c |
|---|
| 3603 | |
|---|
| 3604 | |
|---|
| 3605 | |
|---|
| 3606 | /* ***************************************************** |
|---|
| 3607 | CISIS/C++ extern "C" |
|---|
| 3608 | ***************************************************** */ |
|---|
| 3609 | #if CICPP |
|---|
| 3610 | #ifdef __cplusplus |
|---|
| 3611 | } |
|---|
| 3612 | #endif |
|---|
| 3613 | #endif /* CICPP */ |
|---|
| 3614 | |
|---|
| 3615 | #endif /* CISIS_H */ |
|---|