forked from rogercgui/cisis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcidbx.hpp
253 lines (201 loc) · 6.27 KB
/
cidbx.hpp
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
#ifndef CIDBX_HPP
#define CIDBX_HPP
//#include <cisis.hpp>
#include <cisisx.hpp>
#include <string.h>
#ifndef ErrorCode
#define ErrorCode long
#endif // ErrorCode
#ifndef TRUE
# define TRUE 1
#endif // TRUE
#ifndef FALSE
# define FALSE 0
#endif // FALSE
#define ERRMESLEN 256 // Error message lenght.
class Fatal // Exception handling.
{
public:
ErrorCode Fa_ECode; // Error code.
LONGX Fa_Abort; // Abort the execution. (yes=1, no=0)
char Fa_EMess[ERRMESLEN]; // Error message.
char Fa_AuxEMess[ERRMESLEN]; // Auxiliary error message.
Fatal (void)
{
Fa_ECode = Fa_Abort = 0;
*Fa_EMess='\0';
*Fa_AuxEMess='\0';
}
LONGX Fa_Fill (ErrorCode ecode,
char *emess,
LONGX abort = FALSE,
char *auxemess = "")
{
if (!auxemess || *auxemess == '\0')
strcpy (Fa_EMess, emess);
else
{
sprintf (Fa_AuxEMess, " ->\n%s", auxemess);
strcpy (Fa_EMess, emess);
strcat (Fa_EMess, Fa_AuxEMess);
}
Fa_Abort = abort;
*Fa_AuxEMess = '\0';
return (Fa_ECode = ecode);
}
};
/* bode da dll_utl.hpp ... */
class _YOURCLASS DBXSTRU //: public CISIS
{
public:
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; /* .par contents */
#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 */
void *dbxifupp; /* CIIFU_PROCX_SOURCE */
#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
CISISX *cisisxp;
DBXSTRU(CISISX *parm_cisixp);
#if MULTI
//int xdbxcinet(char *dbnamp);
int xdbxflock(DBXSTRU *dbxp,
char *typ);
int xdbxulock(DBXSTRU *dbxp,
char *typ);
/* int xdbxilock(DBXSTRU *dbxp,
char *mdbnp,
char *typ);
*/
int xdbxwlock(DBXSTRU *dbxp,
char *m0p,
int times);
#endif
//void xdbxinit(void);
//DBXSTRU *xdbxstorp(char *dbnamp);
//DBXSTRU *xdbxsrchp(char *dbnamp);
//int xdbxopen(char *gidbnp,
// char *dbname,
// char *extp);
//int xdbxopenw(char *gidbnp,
// char *dbname,
// char *extp,
// int *opnp,
// int *opwp,
// char *errmsgp);
//char *xdbxopenc(char *gidbnp,
// char *filnamp,
// int *opnp,
// int *opwp,
// char *errmsgp, int xcreate, int xappend);
// static void xfatal(char *msg);
void xdbxflush(char *dbnamp);
void xmstflush(char *dbnamp);
void xmstclose(DBXSTRU *dbxp);
//#if RECGIZM
// void xgizflush(VGIZPSTRU *vgizmap);
//#endif
//#if RECDECO
// void xdecflush(VDECPSTRU *vdecmap);
//#endif
INVMAP *xdbxinvmp(DBXSTRU *dbxp);
void xinvclose(DBXSTRU *dbxp);
void xinvflush(char *dbnamp);
//char *xloadfile(char *gidbnp,
// char at,
// char *atp,
// char *areap,
// LONGX asize,
// char lf2x);
//char *xloadstw(char *gidbnp,
// char *atp,
// char *areap,
// LONGX asize,
// int *nstws);
//void xdbxciset(void);
//char *xdbxcipar(char *gidbnp,
// char *argkey,
// char argchar);
//#if GIPAR
//char *xdbxgipar(char *gidbnp,
// char *gikeyp,
// int *namlenp,
// int *extlenp);
//#endif
#if GEN_CORELEFT
unsigned LONGX xcoreleft(void);
#endif
#if GEN_LABS
static long xlabs(long x);
#endif
#if GEN_STRSTR
static char *xstrstr (CONST char *p1,
CONST char *p2);
#endif
#if GEN_STRUPR
static char *xstrupr (char* p);
#endif
#if GEN_STRREV
static char *xstrrev (char *p);
#endif
#if GEN_MEMICMP
static int xmemicmp(CONST void *s1,
CONST void *s2,
size_t n);
#endif
int xfpccreat(char *gidbnp,
char *namp,
char *extp,
int lrecl);
void xfpcwrite(char *recbufp,
FFI reclen);
void xfpcclose(void);
//char *xdbxtmpnm(char *dirtmp,
// int strip,
// char *filnamp);
char *xcicopyr(char *namep);
};
#endif //CIDBX_HPP