-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcisis.h.save
3223 lines (2792 loc) · 92 KB
/
cisis.h.save
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* ***********************************************************
CISIS.H
CISIS application programs and functions include CISIS.H
as their main header file.
CISIS application programs include CIRUN.H, providing
the CISIS Interface run time pointers, control variables
and other CISIS application mandatory areas.
Please replace ciaot.h to cirun.h in include statements
of existing CISIS Interface applications.
AOT, August 19, 1992.
CISIS Interface v3.20 supports MicroISIS dbn.par file.
It might be necessary to change existing CISIS applications
to add a data base name parameter - to get a dbn.par file -
in the following functions: dbxopen(), dbxcipar(),
loadfile() and loadstw().
AOT, March 6, 1996.
*********************************************************** */
#ifndef CISIS_H
#define CISIS_H
#define UTF8 1
/* *****************************************************
CISIS environment
***************************************************** */
#define GCC 01
#if GCC
#ifndef PACKED
#define PACKED __attribute__ ((aligned(2)))
#endif
#endif
#define PC 0
#define DOS32BITS 0
#define MSC 0
#define VAX 0
#define MPE 0
#define UNIX 01
#define SUN 0
#define UNISYS 0
#define UNISYSGDB 0
#define UNISYSCPU 0
#define INTELCPU 1
#define BRME 0
#define BRMXCPU 0
#define CDCS4320 0
#define CNV_PCFILES 0 /* Standard MicroISIS PC format conversion */
#define CNV_PCBINUM 0 /* PC data representation (swapped) conversion */
#define PCREADLINUX 0 /* Read Linux's M/F in PC */
#ifdef CIAPI_SOURCE
#define CICPP 1 /* CISIS CPP preprocessor */
#endif
#ifdef ISIS_DLL
#define CICPP 1 /* CISIS CPP preprocessor */
#endif
#ifdef CI_WINISIS
#define CICPP 1 /* CISIS CPP preprocessor */
#endif
#ifndef CICPP
#define CICPP 0 /* CISIS CPP preprocessor */
#endif
#if CICPP
#ifndef USE_GDBFMT
#ifdef CI_WINISIS
#define USE_GDBFMT 1 /* CICPP/FST+IFU with GDB New FORMAT Release 2 */
#else
#define USE_GDBFMT 0 /* CICPP/FST+IFU with CISIS FORMAT */
#endif
#endif
#endif /* CICPP */
#if CICPP
#ifndef MAXNDBX
#if BEFORE990318
#define MAXNDBX 256L /* maximum #entries in vdbxp[] */
#else
#define MAXNDBX 2048L /* maximum #entries in vdbxp[] */
#endif /* BEFORE990318 */
#endif
#endif /* CICPP */
#if UNISYS || UNISYSCPU
#define ISISUNISYS 1
#endif
#if PC || VAX || GCC || (UNISYS && !UNISYSGDB)
#define ANSI 1
#endif
#if PC /* || VAX */
#define CRLF 1
#else
#define CRLF 0
#endif
#if PC || VAX || UNISYSCPU || INTELCPU || SUN
#define SWAPPED 1
#endif
#ifdef PACKED
#define ISPACKED 1
#else
#if SWAPPED
#if !UNIX /*#if PC || VAX*/
#define ISPACKED 1
#endif /* !UNIX */
#endif
#define PACKED
#endif
#if MPE || VAX || UNIX
#define O_BINARY 0
#define O_DENYNONE 0
#endif
#if SUN
#define SUNBUG_UNSIGNED 1 /* cannot test if link records have sorted postings */
#if GCC
#define SUNBUG_GCC1 1 /* cannot access node just read in noderead() */
#endif
#endif /* SUN */
/* *****************************************************
CISIS configuration
***************************************************** */
#define UC_EXTENSION ISISUNISYS /* ISIS/UNISYS upper case .extension */
#define LINK_7544KEY ISISUNISYS /* ISIS/UNISYS fixed-length link */
#define MST0FILL0XFF ISISUNISYS /* ISIS/UNISYS .mst 1st block filler */
#if !CICPP
#ifndef CIAPI
#define CIAPI 0 /* para compilar aplicacoes em C que usem CIAPI */
#endif
#if CIAPI
#ifndef TLS
#define TLS 0 /* setar 1 para compilar zserver em windows-95 */
#endif
#endif
#endif
#ifndef CIB71
#define CIB71 1 /* CISIS Rosnier Mijares Valdes' search function */
#endif
#ifndef CIB64
#define CIB64 0 /* cib62 using ISIS I/F */
#endif
#ifndef CDMDL
#define CDMDL 0 /* BRM CD-ROM Retrieval Interface */
#endif
#ifndef WWWISIS
#define WWWISIS 00
#endif /* WWWISIS */
#define BIGREC 0 /* BRM CD-ROM Retrieval Interface */
#ifndef LINDLUX
#define LINDLUX 0 /* ifupd2 */
#endif
#define DBXMSTXL 1 /* extended .mst capacity */
#if !EXCFMCGI
#define CICGI 1 /* cicgi0/cicgi1 */
#endif
#if CICPP
#define FATRAP 0 /* fatal() trapping */
#else /* CICPP */
#define FATRAP 1 /* fatal() trapping */
#endif /* CICPP */
#ifndef CIFFI
#define CIFFI 0 /* size-t mfrl/base/pos/len */
#endif
#ifndef CIWTF
#if !CICPP
#if !CIAPI
#if GCC
#if CIFFI
#define CIWTF 1 /* WTFUN support */
#else
#define CIWTF 0 /* WTFUN support */
#endif
#endif /* GCC */
#endif /* CIAPI */
#endif /* CICPP */
#endif
#if !CDMDL
#ifndef LIND
#if CIFFI
#define LIND 1 /* MY: must be off */
#else
#define LIND 0 /* MY: must be off */
#endif
#endif
#ifndef ISISXL
#if CIFFI || LIND
#define ISISXL 1 /* Large keys - standard for CIFFI */
#else
#define ISISXL 00 /* Large keys */
#endif
#endif
#ifndef ISISXL512
#define ISISXL512 00 /* very Large keys */
#endif
#ifndef CNLI
#define CNLI 1 /* MY: must be off */
#endif
#define ZTREE 1 /* MY: must be off */
#define SAMEL 0 /* MY: must be off */
#ifndef CI_WINISIS
#define RECGIZM 1 /* CIGIZ */
#define RECXPND 0 /* MX: putdir/getdir */
#define RECDECO 1 /* DEC */
#endif
#define GEN_ISI 1 /* enable iso_open()/iso_read() */
#define GEN_UTL 1 /* enable except loaductb() */
#define INVXBOOL (LIND || CIB64 || CIB71) /* 0 */ /* Bx0 use several inverted files */
#define TW_BOOL 0 /* Bx0 multiple ifp's for text word */
#define CIPAR 1 /* dbxcipfp & dbxcdcip processing */
#define CIPARIC 0 /* CIPAR ignore case */
#ifdef ISIS_DLL
#define GIPAR 1 /* dbn.par & dbxgicip processing */
#endif
#ifdef CI_WINISIS
#define GIPAR 1 /* dbn.par & dbxgicip processing */
#endif
#ifndef GIPAR
#define GIPAR 0 /* dbn.par & dbxgicip processing */
#endif
#define MULTI 1 /* Multi-user operation */
#define IFUPDATE 1 /* Inverted file update */
#define MFUPDATE 1 /* Master file update */
#else /* CDMDL */
#define ISISXL 1 /* Large keys */
#define LIND 1 /* MY: must be off */
#define CNLI 1 /* MY: must be off */
#define ZTREE 1 /* MY: must be off */
#define SAMEL 0 /* MY: must be off */
#define RECGIZM 1 /* CIGIZ */
#define RECXPND 0 /* MX: putdir/getdir */
#define RECDECO 1 /* DEC */
#define GEN_ISI 1 /* enable iso_open()/iso_read() */
#define GEN_UTL 1 /* enable except loaductb() */
#define INVXBOOL 1 /* Bx0 use several inverted files */
#define TW_BOOL 0 /* Bx0 multiple ifp's for text word */
#define CIPAR 1 /* dbxcipfp & dbxcdcip processing */
#define CIPARIC 0 /* CIPAR ignore case */
#define GIPAR 0 /* dbn.par & dbxgicip processing */
#define MULTI 01 /* Multi-user operation */
#define IFUPDATE 01 /* Inverted file update */
#define MFUPDATE 1 /* Master file update */
#endif /* CDMDL */
#if _LARGEFILE64_SOURCE
#if (_FILE_OFFSET_BITS != 64)
#error "_FILE_OFFSET_BITS != 64"
#endif
#define LSEEK64 lseek64
#define P_OFF_T "lld"
#define LONG_LONG long long
#else /* _LARGEFILE64_SOURCE */
#if (_FILE_OFFSET_BITS == 64)
#error "_FILE_OFFSET_BITS == 64"
#endif
#define LSEEK64 lseek
#define P_OFF_T "ld"
#define LONG_LONG long
#endif /* _LARGEFILE64_SOURCE */
/* *****************************************************
CISIS/C++ DLL export
***************************************************** */
#if CICPP
/* DLL export */
#if defined (BUILDING_YOUR_DLL)
#define _YOURCLASS _export
#else
#if defined (USING_YOUR_DLL)
#define _YOURCLASS _import
#else
#define _YOURCLASS
#endif /* USING_YOUR_DLL */
#endif /* BUILDING_YOUR_DLL */
#endif /* CICPP */
/*
Required CISIS.H header files
*/
#include <stdio.h> /* FILE */
/*
Compiler dependent header files
*/
#if PC
#include <fcntl.h>
#include <process.h>
#include <io.h>
#include <stdlib.h>
#include <limits.h>
#include <dos.h>
#include <sys/types.h>
#endif
#if VAX
#include <file.h>
#include <stdlib.h>
#endif
#if MPE
#include <fcntl.h>
#include <stdlib.h>
#include <limits.h>
#endif
#if UNIX
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <stdlib.h>
#include <limits.h>
#include <errno.h>
#endif
#ifndef SIXTY_FOUR
#define SIXTY_FOUR 0
#endif /* SIXTY_FOUR */
#if SIXTY_FOUR
#define LONGX int
#define LONGX_MAX INT_MAX
#define _LD_ "d"
#else /* SIXTY_FOUR */
#define LONGX long
#define LONGX_MAX LONG_MAX
#define _LD_ "ld"
#endif /* SIXTY_FOUR */
#define UBYTE unsigned char /* UCHR */
#define UWORD unsigned short /* INT */
#if BEFOREWINDEFH
#define ULONG unsigned LONGX /* */
#endif
#if BEFOREWINNTH
#define CHAR UBYTE
#else
#define UCHR UBYTE
#endif
#if BEFOREWINDEFH
#define INT UWORD
#endif
#if CIFFI
#define FFI unsigned int /* size_t = bug no linux - RP, 27/05/2003 */
#define MFRL_MAX INT_MAX
#else
#define FFI UWORD /* UWORD = UWORD unsigned short */
#define MFRL_MAX SHRT_MAX
#endif
/*
Memory allocation
*/
#if CICPP /* alloc substituido por new */
#ifndef CINEWCPP
#define CINEWCPP 1 // AOT,HB 31/07/2002 */
#endif
#if MSC || !CINEWCPP /* HB, 27/05/2002 */
#define BAD_ALLOC ... /* catch qualquer coisa */
#else /* MSC || !CINEWCPP */
#if 0 /* catch especifico */
#define BAD_ALLOC xalloc
#include <except.h>
#else /* 0 */
#include <new>
#define BAD_ALLOC std::bad_alloc
#endif /* 0 */
#endif /* MSC || !CINEWCPP */
#define ALLOMAXV 64000U /* <==== RPIVA VAI MUDAR 20010214*/
#define ALLOPARM unsigned int
#define ALLONULL NULL
//#define CORELEFT() 640000
#else /* CICPP */
#if PC
#if MSC
#include <malloc.h>
#define ALLOMAXV 64000U
#define ALLOC malloc
#define ALLOPARM unsigned int
#define ALLONULL NULL
#define FREE free
#define CORELEFT coreleft
#else /* MSC */
#if DOS32BITS /* 20000518 */
#include <alloc.h>
#if BEFORE20010105
#define ALLOMAXV UINT_MAX /* 640000L */ /* AOT/RP, 27/03/2001 */
#else
#define ALLOMAXV INT_MAX /* 640000L */ /* AOT/RP, 27/03/2001 */
#endif
#define ALLOC malloc
#define ALLOPARM size_t
#define ALLONULL NULL
#define FREE free
#define CORELEFT coreleft
#else /* DOS32BITS 20000518 */
#include <alloc.h>
#define ALLOMAXV 64000L
#define ALLOC farmalloc
#define ALLOPARM unsigned LONGX
#define ALLONULL NULL
#define FREE farfree
#define CORELEFT farcoreleft
#endif /* DOS32BITS 20000518 */
#endif
#endif /* PC */
#if VAX
#define ALLOC malloc
#define ALLOPARM size_t
#define ALLOMAXV 640000L
#define ALLONULL NULL
#define FREE free
#define CORELEFT coreleft
#endif
#if MPE
#include <malloc.h>
#define ALLOC malloc
#define ALLOPARM unsigned int
#define ALLOMAXV 64000000L
#define ALLONULL NULL
#define FREE free
#define CORELEFT coreleft
#endif
#if UNIX
#include <malloc.h>
#define ALLOC malloc
#define ALLOPARM unsigned
#define ALLOMAXV INT_MAX /* 64000000L */ /* 64000L*/ /* 128000000L*/ /* UINT_MAX */
#define ALLONULL NULL
#define FREE free
#define CORELEFT coreleft
#if !GCC
#define size_t int
#endif
#endif
#endif /* CICPP */
/*
MAX PATH NAME
*/
#if PC
#if DOS32BITS
#define CIMPL 512
#else /* DOS32BITS */
#define CIMPL (128+4)
#endif /* DOS32BITS */
#else
#define CIMPL 512
#endif /* PC */
/*
Unbuffered low level I/O
*/
#if CICPP
#define PERMIS 0644
#define CREAT creat
#define OPEN open
#define CLOSE close
#define CIREAD read
#define CIWRITE write
#else /* CICPP */
#if PC
#if MSC
#define PERMIS 0644
#define CREAT creat
#if MULTI
#define OPEN sopen
#else
#define OPEN open
#endif
#define CLOSE close
#define CIREAD read
#define CIWRITE write
#else /* MSC */
#define PERMIS 0000
#if DOS32BITS /* UINT_MAX -1 */
#define CREAT _rtl_creat
#define OPEN _rtl_open
#define CLOSE _rtl_close
#define CIREAD _rtl_read
#define CIWRITE _rtl_write
#else /* DOS32BITS */
#define CREAT _creat
#define OPEN _open
#define CLOSE _close
#define CIREAD _read
#define CIWRITE _write
#endif /* DOS32BITS */
#endif /* MSC */
#else
#if VAX
#define PERMIS 0644
#endif
#if MPE
#define PERMIS 0644
#endif
#if UNIX
/*#define PERMIS 0644*/
#define PERMIS 0664 /* Requested by Chico in apr 2012 */
#endif
#define CREAT creat
#define OPEN open
#define CLOSE close
#define CIREAD read
#define CIWRITE write
#endif
#endif /* CICPP */
/*
Standard Library extensions
*/
#define GEN_CORELEFT MSC || MPE || VAX || UNIX || DOS32BITS /* 20000518 */
#define GEN_LABS MPE || VAX || (UNIX && !UNISYS)
#define GEN_STRSTR MPE || VAX || (UNIX && !UNISYSGDB && !SUN && !BRME && !GCC)
#define GEN_STRUPR MPE || VAX || UNIX
#define GEN_STRREV MPE || VAX || UNIX
#define GEN_MEMICMP /* CIPARIC && */ (MPE || VAX || (UNIX && !BRME))
#if CDCS4320 || MPE || (GCC && !CICPP) || BRME
#define CONST /* not supported */
#else
#define CONST const
#endif
#if GEN_CORELEFT
#if ANSI
unsigned LONGX coreleft(void);
#else
unsigned LONGX coreleft();
#endif
#endif
#if GEN_LABS
#if ANSI
long labs(long x);
#else
long labs();
#endif
#endif
#if GEN_STRSTR
#if ANSI
char *strstr(CONST char *s1, CONST char *s2);
#else
char *strstr();
#endif
#endif
#if GEN_STRUPR
#if ANSI
char *strupr(char *p);
#else
char *strupr();
#endif
#endif
#if GEN_STRREV
#if ANSI
char *strrev(char *p);
#else
char *strrev();
#endif
#endif
#if GEN_MEMICMP
#if ANSI
int memicmp(CONST void *s1, CONST void *s2, size_t n);
#else
int memicmp();
#endif
#endif
#if CICPP
class _YOURCLASS CISISX;
#endif /* CICPP */
/*
FATRAP support
*/
#if FATRAP
#include <setjmp.h>
#endif
/* *****************************************************
CISIS/C++ extern "C"
***************************************************** */
#if CICPP
#ifdef __cplusplus
extern "C" {
#endif
#endif /* CICPP */
/* *****************************************************
CIDBX.H
***************************************************** */
#if MAXMFRL==0
#if CIFFI
#define MAXMFRL 1048576L /* 1024*1024 ! */
#else /* CIFFI */
#if UNIX || WWWISIS || USE_CIREC || DOS32BITS
#if BEFORE20010109
#define MAXMFRL 30000L /* */
#else
#if MULTI
#define MAXMFRL 32767L /* */
#else /* MULTI */
#define MAXMFRL 63002L /* */
#endif /* MULTI */
#endif
#else /* UNIX || WWWISIS || USE_CIREC || DOS32BITS */
#define MAXMFRL 8192L /* gdb */
#endif /* UNIX || WWWISIS || USE_CIREC || DOS32BITS */
#endif /* CIFFI */
#endif /* MAXMFRL */
#if ISISXL
#define LE1 16 /* gdb ISISXL */
#if SUPERISIS
#define LE2 256
#else
#if ISISXL512
#define LE2 512 /* gdb ISISXL */
#else
#define LE2 60 /* gdb ISISXL */
#endif
#endif /* SUPERISIS */
#else /* ISISXL */
#define LE1 10 /* gdb */
#define LE2 30 /* gdb */
#endif /* ISISXL */
#define XRBSIZ 512 /* gdb */
#define XRSHIFT 9 /* */
#define XRMAXTIV 127 /* gdb */
#define XRMAXTV1 126 /* */
#define MSBSIZ 512 /* gdb */
#define MSBSHIFT 9 /* */
#define XRXDIVIDE 2048 /* gdb */
#define XRXSHIFT 11 /* */
#define XRXMASK 0x000001FF /* gdb no IF pending */
#define XRXMASKN 0x00000400 /* gdb ++ IF pending */
#define XRXMASKU 0x00000200 /* gdb ++ IF pending */
#if LIND
#ifndef LIND4
#define LIND4 1 /*0*/
#endif /* LIND4 */
#endif /* LIND */
#if LIND4
#define MAXUPDMFN 0x7FFFFFFFL /* gdb posting */
#else /* LIND4 */
#define MAXUPDMFN 0x00FFFFFFL /* gdb posting */
#endif /* LIND4 */
#define MSMFTUSR 0 /* gdb non system */
#define MSMFTMSG 1 /* gdb msg data base */
#define XRPOS LONGX
#define XRPTR /*off_t*/ LONGX
#define XRPOSSIZ sizeof(XRPOS)
#define XRPTRSIZ sizeof(XRPTR)
typedef struct xrstru {
XRPOS xrxrpos; /* gdb .xrf blk order */
XRPTR xrmfptr[XRMAXTIV]; /* gdb mfr ptrs */
} XRSTRU;
typedef struct msstru {
char msbuff[MSBSIZ]; /* gdb .mst blk */
LONGX msbufn; /* gdb .mst blk order - simulated */
} MSSTRU;
#define IFBSIZ 512 /* gdb */
#define IFSHIFT 9 /* */
#define IFMAXTIV 127 /* gdb */
#define PUNT LONGX /* gdb paho 1988 */
#define INFO LONGX /* gdb */
#if LIND
#ifndef INFO8
#define INFO8 1 /* 8-byte ptr and size (info1/info3) in .ly1/.ly2 IDXE - AOT/HB 14/03/2008 */
#endif /* INFO8 */
#if INFO8
#if _LARGEFILE64_SOURCE
#define INFX off_t
#else /* LARGEFILE64_SOURCE */
#define INFX LONGX /* gdb */
#endif /* LARGEFILE64_SOURCE */
#else /* INFO8 */
#define INFX LONGX /* gdb */
#endif /* INFO8 */
#else /* LIND */
#define INFX LONGX /* gdb */
#endif /* LIND */
#define INFOSIZE sizeof(INFO)
#define IFHDRINFOS 5 /* check in trminit() */
#define IFPSTINFOS 2 /* */
#define IFNVSPLT 28 /* gdb .ifp never split - header+posting */
#define MAXLIV 8 /* INVMAP.nx */
#define NEGLIV (-1) /* INVMAP.cn[treecase].liv - gdb */
#define ORDN 5 /* gdb */
#define TWORDN 10 /* */
#define ORDF 5 /* gdb */
#define TWORDF 10 /* */
#define CNTN 15 /* gdb */
#define CNTK 5 /* gdb */
#if SAMEL
#define MAXSAMEL 8 /* max no. of .ifp on same leaf */
#endif
typedef struct cnstru {
UWORD idtype PACKED;/* gdb .cnt idtype */
UWORD ordn PACKED;/* gdb .cnt ordn */
UWORD ordf PACKED;/* gdb .cnt ordf */
UWORD n PACKED;/* gdb .cnt n */
UWORD k PACKED;/* gdb .cnt k */
short liv PACKED;/* gdb .cnt liv = no of index levels */
/* 6*2=12 */
PUNT posrx PACKED;/* gdb .cnt posrx = pos of root node */
PUNT nmaxpos PACKED;/* gdb .cnt nmaxpos */
PUNT fmaxpos PACKED;/* gdb .cnt fmaxpos */
UWORD abnormal PACKED;/* gdb .cnt abnormal */
/* CNBUNI +2 */
} CNSTRU;
typedef struct n0stru {
PUNT pos PACKED;/* gdb .n0x pos */
UWORD ock PACKED;/* gdb .n0x ock */
UWORD it PACKED;/* gdb .n0x it */
char idxchars[1] PACKED;/* gdb .n01 and .n02 idx */
} N0STRU;
typedef struct l0stru {
PUNT pos PACKED;/* gdb .l0x pos */
UWORD ock PACKED;/* gdb .l0x ock */
UWORD it PACKED;/* gdb .l0x it */
PUNT ps PACKED;/* gdb .l0x ps */
#if LIND
PUNT psb PACKED;/* tlc gdb .l0x ps backward */
#endif
char idxchars[1] PACKED;/* gdb .l01 and .l02 idx */
} L0STRU;
typedef struct nxstru {
int pages; /* no of memo buffers alloced */
int left; /* no of memo buffers still free */
char *basep; /* area addr */
} NXSTRU;
#define NTREE 2
#define LTXPAGES 128L
#define LUXPAGES 1024L
#define LVXPAGES 1024L /* lvxmxmfn/8+1 */
#define LVXIYPBS 8192L /* ou INT_MAX */
typedef struct invmap {
#if LINDLUX
LONGX ltxthresh;
LONGX ltxpages[NTREE];
N0STRU *ltxvpagp[NTREE][1+LTXPAGES];
LONGX luxthresh;
LONGX luxpages[NTREE];
L0STRU *luxvpagp[NTREE][1+LUXPAGES];
int lvxiflind;
LONGX lvxmaxmfn;
LONGX lvxpages;
char *lvxvpagp[1+LVXPAGES];
FILE *lvxfplog;
#endif /* LINDLUX */
char *ifl1p; /* .l01 block */
char *ifl2p; /* .l02 block */
#if SAMEL
int iflxn; /* #total */
#endif
#if ZTREE
int iflzx; /* ztree */
#endif
#if 1 /* IFUPDATE */
int cnopn; /* =dbxopen(.cnt) */
#endif
int n1opn; /* =dbxopen(.n01) */
int n2opn; /* =dbxopen(.n02) */
int l1opn; /* =dbxopen(.l01) */
int l2opn; /* =dbxopen(.l02) */
#if SAMEL
int ifopn[MAXSAMEL]; /* =dbxopen(.ifp) */
#else
int ifopn; /* =dbxopen(.ifp) */
#endif
#if 1 /* IFUPDATE */
int cnopw; /* dbxopenw/w(.cnt) */
#endif
int n1opw; /* dbxopenw/w(.n01) */
int n2opw; /* dbxopenw/w(.n02) */
int l1opw; /* dbxopenw/w(.l01) */
int l2opw; /* dbxopenw/w(.l02) */
int ifopw; /* dbxopenw/w(.ifp) */
int ifopv; /* dbxflock/dbxulock(.ifp) */
CNSTRU cn[2]; /* .cnt recs */
NXSTRU nx[2][MAXLIV]; /* .n01 and .n02 pages */
char *nybasep[2]; /* all .n01 and .n02 pages */
char *lybasep[2]; /* all .l01 and .l02 pages */
char *iybasep; /* all .ifp blocks */
off_t cc_offset; /* .cnt SEEK_SET offset */
#if CNLI
off_t cn_offset[2]; /* .n0x SEEK_SET offset */
off_t cl_offset[2]; /* .l0x SEEK_SET offset */
off_t ci_offset; /* .ifp SEEK_SET offset */
#endif
} INVMAP;
#if RECGIZM
typedef struct gizmstru {
short isize;
short osize;
unsigned char *ipatt;
unsigned char *opatt;
LONGX nused;
struct gizmstru *nextp;
} GIZMSTRU;
#define MAXGIZR 16
typedef struct vgizpstru {
GIZMSTRU *ghdrp[256];
int grngs;
UWORD grng1[MAXGIZR];
UWORD grng2[MAXGIZR];
unsigned char *gdbnp;
struct vgizpstru *nextp;
} VGIZPSTRU;
#endif
#if RECDECO
#define MAXDECR 16
#define MAXDECX 16
typedef struct vdecpstru {
unsigned char *ddbnp;
int drngs;
UWORD drng1[MAXDECR];
UWORD drng2[MAXDECR];
unsigned char drdlm;
int dsflds;
unsigned char dsfld[MAXDECX];
unsigned char dsfldx[MAXDECX];
LONGX dsfldv[MAXDECX];
struct vdecpstru *nextp;
} VDECPSTRU;
#endif
#if CIAPI
typedef void DBXSTRU;
#else /* CIAPI */
#if CICPP
class _YOURCLASS DBXSTRU; /* Para substituir def da struct */
#else
typedef struct dbxstru {
char dbxname[CIMPL+1]; /* dbname + .ext + NULL */
int dbxxropn; /* =dbxopen(.xrf) */
int dbxmsopn; /* =dbxopen(.mst) */
int dbxxropw; /* dbxopenw/w(.xrf) */
int dbxmsopw; /* dbxopenw/w(.mst) */
int dbxmsopv; /* dbxflock/dbxulock(.mst) */
XRSTRU *dbxxribp; /* ptr .xrf ibuf */
MSSTRU *dbxmsibp; /* ptr .mst ibuf */
#if GIPAR
char *dbxgicip; /* extended .mst capacity */
#endif
#if DBXMSTXL
int dbxmstxl; /* extended .mst capacity */
#endif
int dbxmflush; /* mstflush() flag */
int dbxmclose; /* mstclose() flag */
int dbxiflush; /* invflush() flag */
#if MULTI
int dbxnetws; /* type of network support */
int dbxdelxx; /* flag data entry lock */
int dbxewlxx; /* flag exclusive write lock */
int dbxmxtmp; /* mx() tmpseq master file */
#endif
LONGX dbxmsmfn; /* mstsetup() .mst nxtmfn */
INVMAP *dbxifmap; /* .cnt, .n0x, .l0x, .ifp */
#if 1 /* SAMEL */
int dbxiflxx; /* dbx samel */
#endif
char *dbxxryyp; /* all .xrf blocks */
char *dbxmsyyp; /* all .mst blocks */
#if RECGIZM
VGIZPSTRU *dbxvgzrp; /* gizmo processing */
#endif
#if RECXPND
int dbxxpn01; /* expand processing */
int dbxxpn02; /* expand processing */
#endif
#if RECDECO
VDECPSTRU *dbxvderp; /* decod processing */
#endif
#if IFUPDATE
int dbxiinit; /* ifupdat() init */
int dbxitrac; /* ifupdat() trace parameter */
LONGX dbxitell; /* ifupdat() tell parameter */
LONGX dbxirang; /* ifupdat() tell parameter */
LONGX dbxirecs; /* ifupdat() records updated */
LONGX dbxipadd[2]; /* ifupdat() added lk1/lk2 posts */
LONGX dbxipdel[2]; /* ifupdat() deleted lk1/lk2 posts */
#endif
} DBXSTRU;
#endif /* CICPP */
#define DBXname dbxp->dbxname
#define DBXxropn dbxp->dbxxropn
#define DBXmsopn dbxp->dbxmsopn
#define DBXxropw dbxp->dbxxropw
#define DBXmsopw dbxp->dbxmsopw
#define DBXmsopv dbxp->dbxmsopv
#define DBXxribp dbxp->dbxxribp
#define DBXmsibp dbxp->dbxmsibp
#if GIPAR
#define DBXgicip dbxp->dbxgicip
#endif
#if DBXMSTXL
#define DBXmstxl dbxp->dbxmstxl
#endif
#define DBXmflush dbxp->dbxmflush