root/tags/5.4.pre05/ciifl.hpp

Revision 1, 5.2 kB (checked in by heitor.barbieri, 4 years ago)

Criação do svn para Cisis.

Line 
1#ifndef CIIFL_HPP
2#define CIIFL_HPP
3
4#include <cisisx.hpp>
5//#include <cifst.hpp>
6
7class CIIFL
8//class _YOURCLASS CIIFL
9{
10 public:
11
12  CISISX *cisisxp;
13
14  char *ifllk_gidbnp;           /* dbn.par */
15
16  typedef struct tree_nodes {
17   int top;
18   N2STRU  idx_node[MAX_TREE_LEVEL];
19  } TREE_NODES;
20
21
22  TREE_NODES load_idx[2];
23  PUNT last_root;  /* Guarda a raiz atual antes de criar uma nova raiz*/
24  L0STRU *l0p;
25  L1STRU *l1p, l1node;
26  L2STRU *l2p, l2node;
27  L1IDXE init_leaf_el1;
28  L2IDXE init_leaf_el2;
29  N1IDXE init_node_el1;
30  N2IDXE init_node_el2;
31  LONGX  print_step;
32#if TRACELOAD
33  UCHR tkey[LE2+1], *ptkey; /* AOT 23/10/93 */
34  int  ti;
35#endif
36  POSTSTRU pst,pst_ant;
37  UCHR  *keyp;
38  LONGX  nlido;
39  PUNT p_b_punt,
40             key_punt;
41  INVMAP *invp;
42  DBXSTRU *dbxp;
43  N0STRU *n0p;
44  UWORD isroot,i;
45  UCHR  *p_b_key,
46              a_p_b_key[LE2+1];
47  BOOLEAN promoted;
48  int topo,
49      level,
50      keysize,
51      treecase,
52      treecase_ant;
53  UCHR key_ant[LE2+1],
54       key[LE2+1];
55  IFPBUFFER *ifpbuff; /* AOT - 16/09/93 */
56#if !LIND
57  INFO key_blk,
58       key_pos;
59 /*  int tag,occ,cnt; */   /* AOT - 26/10/93 */
60  IFPAVAILPOS pn;
61  IFPSTRU  *pf,
62           *ph,
63           *pb;
64  INFO next_blk,
65       next_pos;
66  INFO totp,
67       nxtb,
68       nxtp,
69       segp,
70       segc;
71  INFO off_f,
72       off_h,
73       npst;
74  int gbuf;
75  IFPSTRU current_seghead,
76          first_seghead;
77  IFPHEAD *currenthead,
78          *firsthead;
79  BOOLEAN flag_first_seghead,
80          flag_current_seghead;
81  UWORD idxpst;
82#endif /* !LIND */
83#if LIND
84#include "ciiflh.c"
85#endif /* LIND */
86#if LKXONLY
87  int lkxonly;    /* AOT - 14/05/98 */
88#endif
89
90/*25/07/97*/
91/* Variaveis para guardar a localizacao ds headers de um segmento */
92/* 128/(5+2) */
93#define IFLmaxhd  IFPmaxhd*MAXIFPMEM + 1   /* headers em memoria */
94#if CNV_PCBINUM
95 int hdn=-1;       /* numero headers de um ifp */
96 INFO hdblk[IFLmaxhd];
97 INFO hdoff[IFLmaxhd];
98#endif
99
100#if LIND
101 LONGX tlcpaddr;  /* info1 */
102#if MY
103 LONGX tlcppsts;  /* info2 */
104#endif
105 LONGX tlcpdocs;  /* info3 */
106 LONGX tlcinfo3;  /* info3 for ciifl.c */
107 UBYTE *areabits=NULL;
108 LONGX threshold;
109 LONGX tlcmxmfn;  /* current */
110 FILE *fplog = NULL;
111 char *iyp_buff=NULL;
112 unsigned int iyp_left;
113#define IYPBSIZ 8192L /* ou INT_MAX */
114
115 UBYTE mask;
116 UBYTE *bp;
117 LONGX tlputby;
118 int tlcpcase;
119 LONGX tlcloop,tlcmfn;
120 UBYTE *tlcp,*tlcq,tlcqmfn[PMFNSIZ];
121 int tlcloop2;
122#define XFD 0
123#if XFD
124 int xfd;
125#endif
126
127#endif /* LIND */
128/* -----------------------------------------------------------------------*/
129
130  CIIFL(CISISX *parm_cisisxp);
131  void lifp_init_counters(void);
132  void lifp_init_leaf(L0STRU *lp,int treecase);
133  void lifp_init_node(N0STRU *n0p,int treecase);
134  BOOLEAN lifp_insert_leaf(DBXSTRU *dbxp,char *key,char *p_b_key,
135                         PUNT *p_b_punt, int treecase,INFO info1,
136                         INFO  info2);
137  BOOLEAN lifp_insert_node (DBXSTRU *dbxp,N0STRU *n0p,int treecase,
138                          int level,
139                          int isroot,UCHR *b_key,PUNT b_punt,
140                          UCHR *p_key,PUNT *p_punt);
141  void lifp_create_root(INVMAP *invp,N0STRU *n0p,PUNT esq,char *key,
142                      PUNT dir,int treecase,BOOLEAN first);
143
144  void determina_nova_qtda(int ordem,int a,int b,int *n_a,int *n_b);
145  void init_invp_roots_nodes_leaves(INVMAP *invp);
146  void balance_nodes(DBXSTRU *dbxp,INVMAP *invp,int treecase,
147                 int level,PUNT idxpenultimo,PUNT idxultimo,N0STRU *np);
148  void balance_btree(DBXSTRU *dbxp,INVMAP *invp,
149                          int level,PUNT punt,int treecase);
150  void balance_leaves(DBXSTRU *dbxp,INVMAP *invp,int treecase,
151                           PUNT idxpenultimo,PUNT idxultimo,N0STRU *np);
152  void lifp_store_btree(UCHR *key,INFO blk,INFO off,int treecase);
153  IFPBUFFER *lifp_init(INVMAP *invp); /* antes de LKXONLY: (void) */
154  void lifp_close_tree(void);
155#if !LIND
156  void lifp_grava_ifp(void);
157  void lifp_storepst(void);
158  void lifp_init_buff(IFPBUFFER  *p,INFO blk);
159  void write_buffers(BOOLEAN keep_head,BOOLEAN reestrut_buff);
160  void get_room_for (int qt,BOOLEAN opt_keep_head);
161  void lifp_upd_pst_header(IFPSTRU *p,INFO offset,INFO nxtb,INFO nxtp,
162                         INFO totp,INFO segp,INFO segc);
163/* void lifp_upd_first_rec(IFPAVAILPOS *pn,INFO next_blk,UWORD idxpst); */
164  void lifp_upd_first_rec(IFPAVAILPOS *pn,INFO next_blk,INFO next_post);
165 /*19-02-95*/
166  void lifp_init_ifprec(IFPSTRU *p,INFO blk);
167#endif /* !LIND */
168  int lifp_trans_key(UCHR *keyp, int len, int *treecase);
169
170#if LIND
171  LONGX svdiflind(char *dbnp,char *filekeys_1,char *filekeys_2,LONGX parmxmfn,char *parmlogp,int pstflag,LONGX tell);
172#else
173  LONGX svdifload(char *dbnp,char *filekeys_1,char *filekeys_2,int pstflag,LONGX tell);
174#endif /* LIND */
175
176#if LIND
177  LONGX tlputifp(char *areap, LONGX nbytes);
178  void iyp_storinit(LONGX parmxmfn, char *parmlogp);
179  void iyp_storlast(int storcond, char *storkeyp, int pstflag);
180  void iyp_storthis(LONGX mfn,LONGX parmxmfn,
181                        char *keyp,LONGX count,int tag,int occ,int cnt);
182  void iyp_storclos(void);
183#endif /* LIND */
184};
185
186#endif // CIIFL_HPP
Note: See TracBrowser for help on using the browser.