root/tags/5.52/ciifu.hpp

Revision 4, 6.1 kB (checked in by heitor.barbieri, 2 years ago)

Versão 5.52 do cisis (28/04/2010)

Line 
1#ifndef CIIFU_HPP
2#define CIIFU_HPP
3
4#include <cisisx.hpp>
5#include <cifst.hpp>
6
7class _YOURCLASS CIIFU //: public CISIS
8{
9 public:
10
11  CISISX *cisisxp;
12
13  int ifupd_reset;
14  int ifupd_wrnmsg;
15
16  UCHR key[LE2+1],*keyp;
17  INVMAP *invp;
18  DBXSTRU *dbxp;
19
20#if TRACEUPIF
21  UCHR tkey[LE2+1]; /* AOT 11/09/2000 */
22#endif /* TRACEUPIF */
23
24  TREE_PATH lfpath;
25  PUNT puntlf;
26
27#if LINDLUX /* 2 */
28  int luxtree,luxn;
29  LONGX luxpunt,luxpos,luxx,luxaddr;
30  L0STRU *luxpagp;
31  L1STRU *luxp1;
32  L2STRU *luxp2;
33  char *luxp;
34/* <============================ */
35#else /* LINDLUX 2 */
36#if !LIND /* 8x2 */
37  typedef struct ifpkeydata {
38        BOOLEAN  st;            /* record modified */
39        IFPSTRU  reg;
40  } IFPKEYDATA;
41
42#define  UNDEFINED   -1
43#define  CURR_INP    0
44#define  SEGH        1
45#define  FIRST       2
46#define  CURR_OUT    3
47#define  PREG(x)     (IFPSTRU *)&(v[x].reg)
48#define  BLKX(x)     BLK( (PREG(x)) )
49#define  STATUS(x)   v[x].st
50
51  IFPKEYDATA v[4];
52  int idx_curr_inp,idx_segh,idx_first,idx_curr_out;
53  BOOLEAN dupl_msg,ja_inseriu;
54  POSTSTRU *pinitpst,initpst;
55  UCHR buf[IFBSIZ],*pbuf;
56  IFPAVAILPOS pn;
57  INFO totp_inp,nxtb_inp,nxtp_inp,segp_inp,segc_inp,
58            accurate_totp,nxtb_out,nxtp_out,npst_read_in_seg,
59            off_fh_inp,off_ch_inp,blk_inp,off_inp,
60            idxpst_inp,idxpst_out;
61  IFPSTRU *pcur_blk,*pcur_blk_out;
62#endif /* !LIND 8x2 */
63#endif /* LINDLUX 2 */
64  LONGX nlidos;
65
66#if CNV_PCBINUM
67  int hdn;       /* numero headers de um ifp */
68  INFO hdblk[IFLmaxhd];
69  INFO hdoff[IFLmaxhd];
70#endif /*CNV_PCBINUM */
71
72  CIIFU(CISISX *parm_cisisxp);
73
74#if TRACEUPIF
75  void upif_print_lfitem(int   treecase,
76                         UCHR *lfitem);
77#endif
78  void upif_print_msg(POSTSTRU *pst,
79                      UCHR     *msg);
80
81#if !LIND /* 3 */
82  void verif_grava_rec(DBXSTRU *dbxp,
83                       int      idx);
84
85  void update_frst_curr_headers(INFO nelem);
86  void read_ifpcntrl();
87#endif
88
89#if BEFORE20000926
90  int upif_end(int pstflag);
91#else /* BEFORE20000926 */
92  int upif_end(char *dbnp,
93               int pstflag);
94#endif /* BEFORE20000926 */
95  void upif_init(char *dbnp);
96
97#if !LIND /* 7 */
98  void update_ifpcntrl(INFO nxtb,
99                       INFO nxtp);
100#endif /* !LIND 7 */
101
102  void print_post(POSTSTRU *pstp);
103
104#if !LIND /* 8 */
105  void next_output_blk();
106  void next_input_blk();
107  void next_input_seg();
108  void next_input_element();
109  void next_output_element();
110
111  void copia_posting(POSTSTRU *ppst,
112                     int      *ja_inseriu);
113
114  void insere_posting(int idx_ifprec,
115                      int idx,
116                      POSTSTRU *ppst);
117
118  void gethead_counters(IFPSTRU *p,
119                      INFO   off,
120                      INFO  *nxtb,
121                      INFO  *nxtp,
122                      INFO  *totp,
123                      INFO  *segp,
124                      INFO  *segc);
125
126  void update_header(IFPSTRU *pifp,
127                     INFO off,
128                     INFO  nxtb,
129                     INFO  nxtp,
130                     INFO  totp,
131                     INFO  segp,
132                     INFO  segc);
133
134  void create_new_segment(INFO segp,
135                          INFO segc);
136
137  void posiciona_inicio_seg();
138
139  void upif_split_segment(POSTSTRU *ppst);
140  void upif_find_segment(POSTSTRU *ppst);
141  void upif_insert_into_seg(POSTSTRU *ppst);
142
143  void upif_process_posting(POSTSTRU *ppst,
144                            INFO blk,
145                            INFO off,
146                            UCHR operation);
147
148  void upif_process_new_key(POSTSTRU *ppst,
149                            INFO     *blk,
150                            INFO     *off);
151#endif /* !LIND 8 */
152
153  void trace_records(LONGX tell);
154
155  void optlnk2(char *lnk2p,
156               LONGX qtylk2,
157               char *olnk2p,
158               LONGX oqtylk2);
159
160  void optlnk1(char *lnk1p,
161               LONGX  qtylk1,
162               char *olnk1p,
163               LONGX oqtylk1);
164
165  void svdifupd(char *lnk1p,
166                LONGX qtylk1,
167                char *lnk2p,
168                LONGX qtylk2,
169                char *olnk1p,
170                LONGX oqtylk1,
171                char *olnk2p,
172                LONGX oqtylk2,
173                int  pstflag,
174                LONGX tell);
175
176#if !LIND /* 9 */
177  void upif_delete_elem();
178  void upif_delete_posting(POSTSTRU *ppst);
179#endif /* !LIND 9 */
180
181#if !INPUTFILE
182#if USE_GDBFMT
183  int ifupdat(FSTSTRU *fst,
184              LONGX mfn1,
185              LONGX mfn2,
186              int pstflag,
187              int endup);
188#else
189   int ifupdat(
190        char *mdbnp,
191        LONGX mfn1,
192        LONGX mfn2,
193        char *idbnp,
194        FSTSTRU *fst,
195        int pstflag = IFUPISIS,
196        int endup = IFUPWRIT);
197#endif /* USE_GDBFMT */
198#endif /* INPUTFILE */
199
200  BOOLEAN upif_find_key_node(N0STRU *np,
201                             UCHR   *key,
202                             int     treecase,
203                             int    *pos);
204
205  BOOLEAN upif_find_key_leaf(L0STRU *lp,
206                            UCHR   *key,
207                            int     treecase,
208                            int    *pos);
209
210  PUNT  upif_create_root(DBXSTRU *dbxp,
211                         PUNT     esq,
212                         UCHR    *key,
213                         PUNT     dir,
214                         int      treecase,
215                         BOOLEAN  first);
216
217  BOOLEAN upif_insert_index (DBXSTRU *dbxp,
218                             PUNT  punt,
219                             int   treecase,
220                             int   level,
221                             int   isroot,
222                             UCHR *b_key,
223                             PUNT  b_punt,
224                             UCHR *p_key,
225                             PUNT *p_punt);
226
227  void upif_branqueia(UCHR *str,
228                      int   size);
229
230  BOOLEAN upif_insert_leaf(DBXSTRU *dbxp,
231                           L0STRU  *lp,
232                           UCHR    *key,
233                           int      treecase,
234                           UCHR    *p_b_key,
235                           PUNT    *p_b_punt,
236                           int      pos,
237                           INFO     TSTblk,
238                           INFO     TSToff);
239
240  PUNT upif_init_index(DBXSTRU *dbxp,
241                       int treecase,
242                       UCHR *key,
243                       INFO TSTblk,
244                       INFO TSToff);
245
246  PUNT upif_search_btree(INVMAP *invp,
247                         int     treecase,
248                         UCHR   *key);
249
250  void upif_fnd_pifp(DBXSTRU  *dbxp,
251                     UCHR     *key,
252                     int       treecase,
253                     POSTSTRU *pst,
254                     UCHR      oper,
255                     int       pstflag);
256};
257#endif // CIIFU_HPP
Note: See TracBrowser for help on using the browser.