root/tags/5.4.pre05/cib60.hpp

Revision 1, 6.3 kB (checked in by heitor.barbieri, 2 years ago)

Criação do svn para Cisis.

Line 
1#ifndef CIB60_HPP
2#define CIB60_HPP
3
4#include <cisisx.hpp>
5
6class _YOURCLASS CIB60
7{
8 public:
9
10 CISISX * cisisxp;
11
12//---------------------- cib51.c ------------------------------------
13  /* b5_() global */
14  LONGX b5setno;                   /* current query set no */
15  char *b5batchp;                 /* fldupdat */
16  RECSTRU *b5recp;                /* current recp */
17
18#if FATRAP
19#if !WWWISIS
20  jmp_buf b51jumper;
21#endif /* !WWWISIS */
22#endif /* FATRAP */
23  int b51error;
24  char b51errxy[MAXERRL+1];       /*  */
25
26  /* gettoken */
27  char *toknextp;
28  char *token;
29  int toktyp;
30  char tokopr;
31  int tokqty;
32  int toklen;
33
34  char *tokmassp;                 /* toknextp after b5_massp() */
35
36  /* expressoes */
37  int nb5oprs;
38  int b5highnow;
39  int b5highmax;
40
41//---------------------- cib62.c ------------------------------------
42  int b6tw2mh;        /* SOING */
43  char *b6_gidbnp;      /* dbn.par */
44
45  typedef struct b6hitbuf {
46    LONGX setno;                         /* query number */
47    LONGX block;                         /* block number */
48    LONGX bufsiz;                        /* buffer size */
49    UBYTE area[1];                      /* buffer - via ALLOC() */
50  } B6HITBUF;
51
52  typedef struct pdlstru {
53    LONGX         pdlirx1;       /* offset - not used */
54    LONGX         pdlirxi;       /* index - not used */
55    LONGX         pdlirxs;       /* b53_seek or EOF */
56    LONGX         pdlleft;       /* bytes still free - not used */
57    char         pdlirxa[1];    /* tmp area for working storage */
58  } PDLSTRU;
59#define PDLirx1         pdlp->pdlirx1
60#define PDLirxi         pdlp->pdlirxi
61#define PDLirxs         pdlp->pdlirxs
62#define PDLirxa         pdlp->pdlirxa
63#define PDLleft         pdlp->pdlleft
64#define VPDLirx1(i)     vpdlp[i]->pdlirx1
65#define VPDLirxi(i)     vpdlp[i]->pdlirxi
66#define VPDLirxs(i)     vpdlp[i]->pdlirxs
67#define VPDLirxa(i)     vpdlp[i]->pdlirxa
68#define VPDLleft(i)     vpdlp[i]->pdlleft
69
70  /* pilha de execucao */
71  char *irx0p;                    /* result addr */
72  PDLSTRU *vpdlp[MAXPDLS];        /* ptr pilha de execucao */
73  int npdls;                      /* no entrs */
74
75  TRMSTRU *b5trmp;
76
77  /* temporary storage */
78  LONGX b5irxbytes;                /* parm nbytes1 */
79  LONGX b5maxbyts;                 /* max bytes in bitstring */
80  LONGX b5maxbyts0;                /* max bytes in bitstring - to override */
81  int b5prodtag;                  /* product tag on qrydbnp - via btch0p */
82  char *b5prodp;                  /* product's name */
83  char b53_tmpnam[CIMPL+1];           /* file name for temporary storage */
84  int b53_fd;                     /* open() */
85  LONGX b53_seek;                 /* before b53_yopen() */
86  DBXSTRU *b5_savdbxp;            /* '@' processing */
87  int b6fd;                       /* open() - 06/03/95 */
88  /* b5_msg call */
89  LONGX b5tell;
90  int b5rootf;
91  int b5rootmsg;
92  /* error */
93#if FATRAP
94#if !WWWISIS
95  jmp_buf b52jumper;
96#endif /* !WWWISIS */
97#endif /* FATRAP */
98  int b52error;
99  char b52errxy[MAXERRL+1];       /*  */
100#if BIGREC
101#else /* BIGREC */
102  B6HITBUF *b6bufferp;            /* b6_run() processing buffer */
103#endif /* BIGREC */
104  LONGX b5_isn1;                          /* query #0 lower limit */
105  LONGX b5_isn2;                          /* query #0 upper limit */
106  LONGX keepndbx;
107  unsigned char b5_pfxdbn[CIMPL+1];
108  unsigned char b5_pfxopx[LE2+LE2+1];
109  FFI b5_pfxlen;
110  unsigned char b5_pfxmsg[LE2+1];
111  unsigned char b5_pfxtwx[CIMPL+1];
112  FFI b5_pfxmdl;
113
114//---------------------- member functions ----------------------------
115
116  void cib51_init();
117  void cib62_init();
118
119  CIB60(CISISX *parm_cisisxp);
120  ~CIB60(void);
121
122//---------------------- cib50m.c ------------------------------------
123  char *b5_massp(char *token,
124                 int   tokenlen,
125                 int   b5ee_pfx);
126
127//---------------------- cib50r.c ------------------------------------
128  int b50read(DBXSTRU *dbxp,
129              LONGX     mfn,
130              int      tag,
131              int      occ,
132              char    *areap,
133              LONGX    *areasizp);
134
135//---------------------- cib51.c ------------------------------------
136  char *b5_exp(RECSTRU *irecp,
137               char *dbnamp,
138               char *qryp,
139               char *buffup,
140               char *qrydbnp,
141               RECSTRU *crecp,
142               int *errnop);
143
144  void statement(LONGX *result);
145
146  char expression(LONGX *result);
147
148  char conjunction(LONGX *result);
149
150  char primitive(LONGX *result);
151
152  void semaction(int   type,
153                 char  op,
154                 int   opl,
155                 LONGX *r,
156                 LONGX *h);
157
158  int b5_nxtoken();
159
160  void gettoken();
161
162  void b5_experr(int   error,
163                 char *errp,
164                 int   errl);
165
166  void display(char *s);
167
168//---------------------- cib50t.c -----------------------------------
169
170  int b5_msg(int tline,
171             char *msg,
172             LONGX docs,
173             int tmsg);
174
175  int b5_kbh(void);
176
177//---------------------- cib62.c ------------------------------------
178
179  void b5_keepdbx(void);
180
181  int b5_deltmp(int   fd,
182                char *tmpnamp);
183
184  void b5_runerr(int   error,
185                 char *errp,
186                 int   errl);
187
188  void b5_free(TRMSTRU *trmp);
189
190  int b5_ipdl(int ipdl);
191
192  void b53_yopen();
193
194  int b53_writx(PDLSTRU     *pdlp,
195                char        *buff,
196                unsigned int nw);
197
198  int b53_readx(int          ipdl,
199                LONGX         offset,
200                unsigned int nr);
201
202  int b5_savpdl(int ipdl);
203
204  int b5_pfx(RECSTRU *irecp,
205             UWORD invxtag,
206             char *dp,
207             char *op,
208             int b5re_pfx);
209
210  char *b6_run(RECSTRU *irecp,
211               char *dbnamp,
212               char *buffup,
213               int buffuplen,
214               LONGX nbytes1,
215               LONGX tell,
216               unsigned char uctab[],
217               char *btch0p,
218               RECSTRU *tlirecp,
219               RECSTRU *crecp,
220               int *errnop);
221
222  LONGX b5_hsizh(char *irxp,
223                LONGX nbytes,
224                LONGX *hsizp,
225                LONGX *basep);
226
227  int b6_hballoc(LONGX       bufsiz,
228                 B6HITBUF **bufferpp);
229
230  int b6_hbinit(LONGX      setno,
231                B6HITBUF *bufferp);
232
233  int b6_hbfree(B6HITBUF **bufferpp);
234
235  LONGX b6_hit(RECSTRU *irecp,
236              LONGX nord,
237              LONGX setno,
238              B6HITBUF *bufferp);
239};
240
241#endif // CIB60_HLL
Note: See TracBrowser for help on using the browser.