root/tags/5.52/cibx.hpp

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

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

Line 
1#ifndef CIBX_HPP
2#define CIBX_HPP
3
4#include <cisisx.hpp>
5
6class _YOURCLASS CIBX
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  CIBX(CISISX *parm_cisisxp);
120
121//---------------------- cib50m.c ------------------------------------
122  char *b5_massp(char *token,
123                 int   tokenlen,
124                 int   b5ee_pfx);
125
126//---------------------- cib50r.c ------------------------------------
127  int b50read(DBXSTRU *dbxp,
128              LONGX     mfn,
129              int      tag,
130              int      occ,
131              char    *areap,
132              LONGX    *areasizp);
133
134//---------------------- cib51.c ------------------------------------
135  char *b5_exp(RECSTRU *irecp,
136               char *dbnamp,
137               char *qryp,
138               char *buffup,
139               char *qrydbnp,
140               RECSTRU *crecp,
141               int *errnop);
142
143  void statement(LONGX *result);
144
145  char expression(LONGX *result);
146
147  char conjunction(LONGX *result);
148
149  char primitive(LONGX *result);
150
151  void semaction(int   type,
152                 char  op,
153                 int   opl,
154                 LONGX *r,
155                 LONGX *h);
156
157  int b5_nxtoken();
158
159  void gettoken();
160
161  void b5_experr(int   error,
162                 char *errp,
163                 int   errl);
164
165  void display(char *s);
166
167//---------------------- cib50t.c -----------------------------------
168
169  int b5_msg(int tline,
170             char *msg,
171             LONGX docs,
172             int tmsg);
173
174  int b5_kbh(void);
175
176//---------------------- cib62.c ------------------------------------
177
178  void b5_keepdbx(void);
179
180  int b5_deltmp(int   fd,
181                char *tmpnamp);
182
183  void b5_runerr(int   error,
184                 char *errp,
185                 int   errl);
186
187  void b5_free(TRMSTRU *trmp);
188
189  int b5_ipdl(int ipdl);
190
191  void b53_yopen();
192
193  int b53_writx(PDLSTRU     *pdlp,
194                char        *buff,
195                unsigned int nw);
196
197  int b53_readx(int          ipdl,
198                LONGX         offset,
199                unsigned int nr);
200
201  int b5_savpdl(int ipdl);
202
203  int b5_pfx(RECSTRU *irecp,
204             UWORD invxtag,
205             char *dp,
206             char *op,
207             int b5re_pfx);
208
209  char *b6_run(RECSTRU *irecp,
210               char *dbnamp,
211               char *buffup,
212               int buffuplen,
213               LONGX nbytes1,
214               LONGX tell,
215               unsigned char uctab[],
216               char *btch0p,
217               RECSTRU *tlirecp,
218               RECSTRU *crecp,
219               int *errnop);
220
221  LONGX b5_hsizh(char *irxp,
222                LONGX nbytes,
223                LONGX *hsizp,
224                LONGX *basep);
225
226  int b6_hballoc(LONGX       bufsiz,
227                 B6HITBUF **bufferpp);
228
229  int b6_hbinit(LONGX      setno,
230                B6HITBUF *bufferp);
231
232  int b6_hbfree(B6HITBUF **bufferpp);
233
234  LONGX b6_hit(RECSTRU *irecp,
235              LONGX nord,
236              LONGX setno,
237              B6HITBUF *bufferp);
238};
239
240#endif // CIBX_HLL
Note: See TracBrowser for help on using the browser.