59 memcpy ((
void *)cvbnodetmp, (
void *)&psvbptr->
sdictnode,
102 while (
svbfile[iindexhandle].pslockhead) {
117 for (iloop = 0; iloop <
MAXSUBS; iloop++) {
134 for (iloop = 0; iloop <
MAXSUBS; iloop++) {
154 int iloop, iresult, iresult2 = 0;
191 if (!psvbptr || psvbptr->
iisopen) {
225 struct dictinfo sdict;
232 if (!psvbptr || psvbptr->
iisopen) {
237 if (ikeynumber < 0 || ikeynumber > psvbptr->
inkeys) {
242 memcpy (pskeydesc, psvbptr->
pskeydesc[ikeynumber - 1],
243 sizeof (
struct keydesc));
251 sdict.di_nkeys = psvbptr->
inkeys;
253 pctemp = (
char *)&sdict.di_nkeys;
261 sdict.di_nrecords = 0;
263 memcpy (pskeydesc, &sdict,
sizeof (
struct dictinfo));
270 isopen (
const char *pcfilename,
int imode)
274 struct keydesc *pkptr;
277 int ihandle, iindexnumber = 0, iindexpart;
278 int ikeydesclength, ilengthused, iloop, iresult;
287 iflags = imode & 0x03;
293 if (strlen (pcfilename) >
sizeof(tmpfname) - 5) {
306 if (psvbptr && psvbptr->
iisopen != 0) {
307 if (!strcmp (psvbptr->
cfilename, pcfilename)) {
309 sprintf (tmpfname,
"%s.idx", pcfilename);
312 sprintf (tmpfname,
"%s.dat", pcfilename);
315 if (imode & ISEXCLLOCK) {
331 for (ihandle = 0; ; ihandle++) {
350 psvbptr->
cfilename = strdup (pcfilename);
362 sprintf (tmpfname,
"%s.dat", pcfilename);
363 if (stat (tmpfname, &sstat)) {
367 sprintf (tmpfname,
"%s.idx", pcfilename);
368 if (stat (tmpfname, &sstat)) {
376 sprintf (tmpfname,
"%s.dat", pcfilename);
404 if (imode & ISVARLEN) {
412 if (!(imode & ISVARLEN)) {
416 if (imode & ISVARLEN) {
424 while (tnodenumber) {
425 iresult =
ivbblockread (ihandle, 1, tnodenumber, cvbnodetmp);
431 if (*(cvbnodetmp + psvbptr->
inodesize - 3) != -1
432 || *(cvbnodetmp + psvbptr->
inodesize - 2) != 0x7e) {
439 ilengthused -= (INTSIZE +
QUADSIZE);
440 while (ilengthused > 0) {
446 ilengthused -= ikeydesclength;
449 pkptr = psvbptr->
pskeydesc[iindexnumber];
461 pkptr->k_flags = (*pctemp) * 2;
463 ikeydesclength -= (
QUADSIZE + INTSIZE + 1);
465 if (*pctemp & 0x80) {
466 pkptr->k_flags |= ISDUPS;
469 while (ikeydesclength > 0) {
471 pkptr->k_part[iindexpart].kp_leng =
inl_ldint (pctemp);
472 pkptr->k_len += pkptr->k_part[iindexpart].kp_leng;
474 pkptr->k_part[iindexpart].kp_start =
inl_ldint (pctemp);
476 pkptr->k_part[iindexpart].kp_type = *pctemp;
478 ikeydesclength -= ((INTSIZE * 2) + 1);
480 if (ikeydesclength < 0) {
487 if (ilengthused < 0) {
491 if (imode & ISEXCLLOCK) {
515 if (psvbptr !=
NULL) {
516 for (iloop = 0; iloop <
MAXSUBS; iloop++) {
540 int issetcollate (
const int ihandle,
const unsigned char *collating_sequence)
549 if (!psvbptr || psvbptr->
iisopen) {
int ivbopen(const char *pcfilename, const int iflags, const mode_t tmode)
int ivbclose2(const int ihandle)
struct VBFILE svbfile[128 *3]
static int inl_ldint(void *pclocation)
int isindexinfo(const int ihandle, void *pskeydesc, const int ikeynumber)
int ivbtransclose(const int ihandle, const char *pcfilename)
int isfullclose(const int ihandle)
struct VBLOCK * pslocktail
unsigned char iindexchanged
int ivbblockread(const int ihandle, const int iisindex, const off_t tblocknumber, char *cbuffer)
int ivbenter(const int ihandle, const unsigned int imodifying, const unsigned int ispecial)
struct VBLOCK * pslockhead
const unsigned char * collating_sequence
int isstart(const int ihandle, struct keydesc *pskeydesc, int ilength, char *pcrow, int imode)
int issetcollate(const int ihandle, const unsigned char *collating_sequence)
void vvblockfree(struct VBLOCK *pslock)
unsigned char iisdictlocked
int isopen(const char *pcfilename, int imode)
EC ARGUMENT EC EC BOUND EC BOUND EC BOUND EC BOUND TABLE EC DATA EC DATA EC DATA PTR NULL
void ivbclose3(const int ihandle)
struct VBKEY * pskeycurr[32]
struct DICTNODE sdictnode
void * pvvbmalloc(const size_t size)
int ivbfileopenlock(const int ihandle, const int imode)
int ivbforceexit(const int ihandle)
struct DICTINFO * psvbfile[128+1]
int ivbclose(const int ihandle)
int ivbexit(const int ihandle)
int ivbblockwrite(const int ihandle, const int iisindex, const off_t tblocknumber, const char *cbuffer)
int isclose(const int ihandle)
void vvbtreeallfree(const int ihandle, const int ikeynumber, struct VBTREE *pstree)
#define MAX_RESERVED_LENGTH
struct VBTREE * pstree[32]
struct keydesc * pskeydesc[32]
static off_t inl_ldquad(void *pclocation)
int isrelease(const int ihandle)
int ivbtransopen(const int ihandle, const char *pcfilename)
void vvbkeyunmalloc(const int ihandle, const int ikeynumber)