home *** CD-ROM | disk | FTP | other *** search
- /* ==( io/src/icisam.c )== */
-
- /* ----------------------------------------------- */
- /* Pro-C Copyright (C) 1988 - 1990 Vestronix Inc. */
- /* Modification to this source is not supported */
- /* by Vestronix Inc. */
- /* All Rights Reserved */
- /* ----------------------------------------------- */
- /* Written NA 24-Feb-88 */
- /* Modified VvA 25-Jun-90 See comments below */
- /* ----------------------------------------------- */
- /* %W% (%H% %T%) */
-
- /*
- * Modifications
- *
- * 01-Aug-90 VvA - IONONEXT and EOF reseek adjustments
- * 25-Jun-90 VvA - distinct type for long int dates
- * 28-Mar-90 VvA - adjustments for locking modes, transactions
- * 01-Feb-90 VvA - openmode enabled, some bug fixes
- * 14-Dec-89 VvA - V.2 modifications
- * 01-Aug-89 VvA - Modified for generic I/O interface
- * 01-Sep-88 VvA - Numerical & segmented keys added
- */
-
- /* C-ISAM specific I/O calls via general IOGEN.C interface */
-
-
- # include <stdio.h>
- # include <bench.h>
- # include <isam.h>
- # include <iodef.h>
- # include <iomsg.h>
- # include <proc.io>
- # include <iosup.h>
-
- #define ENOFILE 2 /* C-ISAM */
-
-
- /* C-ISAM prototypes */
- PROTO (double lddbl, (char *));
- PROTO (double ldfloat, (char *));
- PROTO (int isaddindex, (int, struct keydesc *));
- PROTO (int isbegin, (void));
- PROTO (int isbuild, (char *, int, struct keydesc *, int));
- PROTO (int isclose, (int));
- PROTO (int iscommit, (void));
- PROTO (int isdelcurr, (int));
- PROTO (int iserase, (char *));
- PROTO (int isflush, (int));
- PROTO (int isindexinfo, (int, struct keydesc *, int));
- PROTO (int islogclose, (void));
- PROTO (int islogopen, (char *));
- PROTO (int isopen, (char *, int));
- PROTO (int isread, (int, char *, int));
- PROTO (int isrelease, (int));
- PROTO (int isrewcurr, (int, char *));
- PROTO (int isrollback, (void));
- PROTO (int isstart, (int, struct keydesc *, int, char *, int));
- PROTO (int iswrcurr, (int, char *));
- PROTO (int ldchar, (char *, int, char *));
- PROTO (int stchar, (char *, char *, int));
- PROTO (int stdbl, (double, char *));
- PROTO (int stfloat, (float, char *));
- PROTO (int stlong, (long, char *));
- PROTO (long ldlong, (char *));
-
- /* Function prototypes */
- static PROTO (int create_file, (int));
- static PROTO (int i_addrec, (int, char *));
- static PROTO (int i_close_file, (int, char *));
- static PROTO (int i_commit, (int, char *));
- static PROTO (int i_delrec, (int, char *));
- static PROTO (int i_filename, (int, char *));
- static PROTO (int i_findkey, (int, char *));
- static PROTO (int i_firstkey, (int, char *));
- static PROTO (int i_init_file, (int, char *));
- static PROTO (int i_lastkey, (int, char *));
- static PROTO (int i_lockrec, (int, char *));
- static PROTO (int i_login, (int, char *));
- static PROTO (int i_logoff, (int, char *));
- static PROTO (int i_nextrec, (int, char *));
- static PROTO (int i_open_file, (int, char *));
- static PROTO (int i_prevrec, (int, char *));
- static PROTO (int i_rereadrec, (int, char *));
- static PROTO (int i_rollback, (int, char *));
- static PROTO (int i_selectinx, (int, char *));
- static PROTO (int i_transact, (int, char *));
- static PROTO (int i_unlock_rec, (int, char *));
- static PROTO (int i_updrec, (int, char *));
- static PROTO (int io_xlate, (int, int, char *));
- static PROTO (int load_keys, (int));
- static PROTO (int start_translog, (void));
- static PROTO (void buf2isam, (int, char *, char *));
- static PROTO (void close_translog, (void));
- static PROTO (void isam2buf, (int, char *, char *));
-
-
- static int IS_OPENMODE;
- static int IS_LOCKMODE;
- static int IS_TRANSACT = 0;
- static int logisopen = FALSE;
- static int prev_move[MAX_FILES];
- static struct keydesc fkey[MAX_FILES][MAX_KEYS]; /* keydescs for each file */
- static char storbuff[MAX_RECLEN]; /* for C-ISAM copy of data record */
-
-
- /*
- *
- * Interface Functions
- *
- */
-
- /*
- * Sets up File Name extension.
- */
- static int i_filename(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- char *tptr;
-
- if ((tptr = strrchr(buffer, '.')) != NULL)
- *tptr = '\0';
-
- return(IOGOOD);
- }
-
- /*
- * Initialize file
- */
- static int i_init_file(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- return(IOGOOD);
- }
-
-
- /*
- * File open function
- */
- static int i_open_file(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- int iostat;
- struct dictinfo ch;
- struct fd_def *fptr = &fd[fd_sys];
-
- if (fptr->openmode & OUTPUT_FLAG)
- iserase(fptr->filname); /* for OUTPUT, delete existing files */
-
- if (fptr->openmode & UPDATE_FLAG)
- IS_OPENMODE = ISINOUT;
- else if (fptr->openmode & INPUT_FLAG)
- IS_OPENMODE = ISINPUT;
- else
- IS_OPENMODE = ISOUTPUT; /* either OUTPUT or APPEND */
-
- if (fptr->openmode & P_TRANSACT)
- {
- IS_TRANSACT = ISTRANS;
- if (start_translog())
- return(IOERROR);
- }
-
- if ((iostat = isopen(fptr->filname, ISMANULOCK+IS_OPENMODE+IS_TRANSACT)) < SUCCESS)
- { /* try to create the file */
- if (fptr->openmode & INPUT_FLAG)
- {
- iostat = io_xlate(fd_sys, iserrno, "CISM OPEN1");
- close_translog();
- return(iostat);
- }
-
- if ((iostat = create_file(fd_sys)) <= IOERROR)
- {
- close_translog();
- return(IOERROR);
- }
- }
- else /* at this point, the file is successfully opened */
- {
- isindexinfo(iostat, (struct keydesc *)&ch, 0); /* iostat contains fd */
-
- if(ch.di_recsize != fptr->rec_len+1) /* not same reclen as expected */
- {
- errmsg(FileRecLenChg_s, fptr->filname);
- fptr->fd_num = iostat; /* ensure closing the correct file */
- i_close_file(fd_sys, "");
- return(IOERROR);
- }
-
- load_keys(fd_sys);
- }
-
- fptr->fd_num = iostat; /* retain the file descriptor */
- return(IOGOOD);
- }
-
-
- /*
- * Initialize and open C-ISAM transaction log file
- * - end users should delete the recovery.log file periodically as
- * it can become very large with an active database
- */
- static int start_translog()
- {
- if (logisopen)
- return(TRUE);
-
- if (access("recovery.log", 00) < 0)
- {
- if (creat("recovery.log", S_IWRITE) == -1)
- {
- errmsg(FileTrnsLogCreate);
- return(IOERROR);
- }
- }
- if (islogopen("recovery.log") == -1)
- {
- errmsg(FileTrnsLogOpen);
- return(IOERROR);
- }
- logisopen = TRUE;
- return(IOGOOD);
- }
-
-
- /*
- * C-ISAM create file function
- * - file has to be created in exclusive mode to set up indexes; it is
- * then closed and reopened in shared mode; stat is file descriptor
- */
- static int create_file(fd_sys)
- int fd_sys;
- {
- int iostat, j, nkeys;
- char fname[FILENAME_LEN];
- struct fd_def *fptr = &fd[fd_sys];
-
- strcpy(fname, fptr->filname);
- strcat(fname, ".dat");
- if (access(fname, 00) == 0) /* file already exists, do not clobber */
- { /* iserrno here will be from isopen() */
- errmsg(DataFileXist_s, fptr->filname);
- return(io_xlate(fd_sys, iserrno, "CISM OPEN2"));
- }
-
- nkeys = load_keys(fd_sys);
-
- if (isbuild(fptr->filname, fptr->rec_len+1, &fkey[fd_sys][0], ISINOUT+ISEXCLLOCK+IS_TRANSACT) < SUCCESS)
- return(io_xlate(fd_sys, iserrno, "CISM CRT1"));
-
- if ((iostat = isopen(fptr->filname, ISINOUT+ISEXCLLOCK+IS_TRANSACT)) < SUCCESS)
- return(io_xlate(fd_sys, iserrno, "CISM CRT2"));
-
- for (j = 1; j < nkeys; j++) /* create remaining indexes */
- if (isaddindex(iostat, &fkey[fd_sys][j]))
- return(io_xlate(fd_sys, iserrno, "CISM IXCRT"));
-
- if (isclose(iostat))
- return(io_xlate(fd_sys, iserrno, "CISM CRT3"));
-
- if ((iostat = isopen(fptr->filname, ISMANULOCK+IS_OPENMODE+IS_TRANSACT)) < SUCCESS)
- return(io_xlate(fd_sys, iserrno, "CISM CRT4"));
-
- return(iostat);
- }
-
-
- /*
- * C-ISAM key load function
- * - loads into C-ISAM key descriptor structure
- */
- static int load_keys(fd_sys)
- int fd_sys;
- {
- int fx, m, n = 0;
- struct fd_def *fptr = &fd[fd_sys];
-
- while (fptr->keys[n].segcount != -1)
- {
- for (m = 0; m < fptr->keys[n].segcount; m++)
- {
- fkey[fd_sys][n].k_part[m].kp_start = fptr->keys[n].segstart[m];
- fkey[fd_sys][n].k_part[m].kp_leng = fptr->keys[n].seglen[m];
-
- fx = fptr->keys[n].fldindex[m];
- switch(fptr->flds[fx].fldtype) /* data type of key segment */
- {
- case CHRTYP :
- case DATTYP :
- fkey[fd_sys][n].k_part[m].kp_type = CHARTYPE;
- break;
- case INTTYP :
- fkey[fd_sys][n].k_part[m].kp_leng = INTSIZE;
- fkey[fd_sys][n].k_part[m].kp_type = INTTYPE;
- break;
- case LNGTYP :
- case TIMTYP :
- fkey[fd_sys][n].k_part[m].kp_leng = LONGSIZE;
- fkey[fd_sys][n].k_part[m].kp_type = LONGTYPE;
- break;
- case FLTTYP :
- fkey[fd_sys][n].k_part[m].kp_type = FLOATTYPE;
- fkey[fd_sys][n].k_part[m].kp_leng = FLOATSIZE;
- break;
- case DBLTYP :
- fkey[fd_sys][n].k_part[m].kp_type = DOUBLETYPE;
- fkey[fd_sys][n].k_part[m].kp_leng = DOUBLESIZE;
- break;
- }
- }
- fkey[fd_sys][n].k_nparts = m; /* segment count for this key */
-
- if (fptr->keys[n].keytype == KEY_DUPLICATE)
- fkey[fd_sys][n].k_flags = ISDUPS;
- else
- fkey[fd_sys][n].k_flags = ISNODUPS;
-
- n++; /* increment total key count */
- }
- return(n);
- }
-
-
- /*
- * File close function
- */
- static int i_close_file(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- struct fd_def *fptr = &fd[fd_sys];
-
- if (isclose(fptr->fd_num))
- return(io_xlate(fd_sys, iserrno, "CISM CLOSE"));
-
- fptr->active = NO;
- close_translog();
- return(IOGOOD);
- }
-
-
- /*
- * Close recovery.log file, if used
- */
- static void close_translog()
- {
- int n;
-
- if (logisopen)
- {
- for (n = 0; n < MAX_FILES; n++) /* all files closed yet? */
- if (fd[n].active)
- return;
-
- islogclose();
- logisopen = FALSE;
- }
- }
-
-
- /*
- * Select an index to perform processing on - already done in IOGEN.C
- * - also sets C-ISAM's own lock modes for subsequent read
- */
- static int i_selectinx(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- if (fd[fd_sys].lockmode == NOLOCK)
- IS_LOCKMODE = NOLOCK;
- else
- IS_LOCKMODE = ISLOCK; /* C-ISAM's own lock flag */
- return(IOGOOD);
- }
-
- /*
- * Find a record by key value
- */
- static int i_findkey(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- int ck, IS_MD;
- struct fd_def *fptr = &fd[fd_sys];
-
- buf2isam(fd_sys, buffer, storbuff);
- ck = fptr->cur_key;
- IS_MD = (fptr->exact ? ISEQUAL : ISGTEQ);
-
- if(isstart(fptr->fd_num, &fkey[fd_sys][ck], 0, storbuff, IS_MD) < SUCCESS)
- return(io_xlate(fd_sys, iserrno, "CISM FIND 1"));
-
- if(isread(fptr->fd_num, storbuff, IS_MD + IS_LOCKMODE) < SUCCESS)
- return(io_xlate(fd_sys, iserrno, "CISM FIND 2"));
-
- isam2buf(fd_sys, buffer, storbuff);
- return(IOGOOD);
- }
-
- /*
- * Find first record in the file
- */
- static int i_firstkey(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- int ck;
- struct fd_def *fptr = &fd[fd_sys];
-
- ck = fptr->cur_key;
-
- if(isstart(fptr->fd_num, &fkey[fd_sys][ck], 0, storbuff, ISFIRST) < SUCCESS)
- return(io_xlate(fd_sys, iserrno, "CISM FRST 1"));
-
- if (isread(fptr->fd_num, storbuff, ISNEXT + IS_LOCKMODE) < SUCCESS)
- return(io_xlate(fd_sys, iserrno, "CISM FRST 2"));
-
- isam2buf(fd_sys, buffer, storbuff);
- return(IOGOOD);
- }
-
- /*
- * Find last physical record in the file
- */
- static int i_lastkey(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- int ck;
- struct fd_def *fptr = &fd[fd_sys];
-
- ck = fptr->cur_key;
-
- if(isstart(fptr->fd_num, &fkey[fd_sys][ck], 0, storbuff, ISLAST) < SUCCESS)
- return((iserrno == EENDFILE) ? IOEOF : io_xlate(fd_sys, iserrno, "CISM LAST 1"));
-
- if(isread(fptr->fd_num, storbuff, ISPREV + IS_LOCKMODE) < SUCCESS)
- return((iserrno == EENDFILE) ? IOEOF : io_xlate(fd_sys, iserrno, "CISM LAST 2"));
-
- isam2buf(fd_sys, buffer, storbuff);
- return(IOGOOD);
- }
-
- /*
- * Find next record in the file
- */
- static int i_nextrec(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- struct fd_def *fptr = &fd[fd_sys];
-
- buf2isam(fd_sys, buffer, storbuff);
-
- if (isread(fptr->fd_num, storbuff, ISNEXT + IS_LOCKMODE) < SUCCESS)
- {
- if (iserrno == EENDFILE)
- {
- i_lastkey(fd_sys, buffer);
- return(IOEOF);
- }
- return(io_xlate(fd_sys, iserrno, "CISM NEXT"));
- }
-
- prev_move[fd_sys] = NEXT;
- isam2buf(fd_sys, buffer, storbuff);
- return(IOGOOD);
- }
-
- /*
- * Find previous record in the file
- */
- static int i_prevrec(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- struct fd_def *fptr = &fd[fd_sys];
-
- buf2isam(fd_sys, buffer, storbuff);
-
- if (isread(fptr->fd_num, storbuff, ISPREV + IS_LOCKMODE) < SUCCESS)
- {
- if (iserrno == EENDFILE)
- {
- i_firstkey(fd_sys, buffer);
- return(IOTOF);
- }
- else
- return(io_xlate(fd_sys, iserrno, "CISM PREV"));
- }
-
- prev_move[fd_sys] = PREV;
- isam2buf(fd_sys, buffer, storbuff);
- return(IOGOOD);
- }
-
- /*
- * Re-read/reposition record pointer function
- * - uses physical order index and global record number
- */
- static int i_rereadrec(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- if (prev_move[fd_sys] == NEXT)
- return(i_prevrec(fd_sys, buffer));
- else
- return(i_nextrec(fd_sys, buffer));
- }
-
-
- /*
- * Add a new record.
- */
- static int i_addrec(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- struct fd_def *fptr = &fd[fd_sys];
-
- buf2isam(fd_sys, buffer, storbuff);
-
- if (iswrcurr(fptr->fd_num, storbuff) < SUCCESS)
- return(io_xlate(fd_sys, iserrno, "CISM ADD"));
-
- isflush(fptr->fd_num);
- return(IOGOOD);
- }
-
- /*
- * Update the current record.
- */
- static int i_updrec(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- struct fd_def *fptr = &fd[fd_sys];
-
- buf2isam(fd_sys, buffer, storbuff);
-
- if (isrewcurr(fptr->fd_num, storbuff) < SUCCESS)
- return(io_xlate(fd_sys, iserrno, "CISM UPD"));
-
- isflush(fptr->fd_num);
- return(IOGOOD);
- }
-
- /*
- * Delete the current record.
- */
- static int i_delrec(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- struct fd_def *fptr = &fd[fd_sys];
-
- if (isdelcurr(fd[fd_sys].fd_num))
- return io_xlate(fd_sys, iserrno, "CISM DEL");
-
- isflush(fptr->fd_num);
- return(IOGOOD);
- }
-
- /*
- * Lock Record - rereads current record into storbuff to lock
- * - to preserve edits, storbuff is NOT converted to PRO-C buffer
- */
- static int i_lockrec(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- struct fd_def *fptr = &fd[fd_sys];
-
- if (isread(fptr->fd_num, storbuff, ISCURR + IS_LOCKMODE) < SUCCESS)
- {
- if (iserrno == EENDFILE) /* bypass retry count if EOF/TOF */
- return(IOGOOD);
- return(io_xlate(fd_sys, iserrno, "CISM LOCK"));
- }
-
- return(IOGOOD);
- }
-
- /*
- * Unlock Record
- */
- static int i_unlock_rec(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- if (isrelease(fd[fd_sys].fd_num))
- return(io_xlate(fd_sys, iserrno, "CISM ULCK"));
-
- return(IOGOOD);
- }
-
- /*
- * Login
- */
- static int i_login(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- return(IOGOOD);
- }
-
- /*
- * Logoff
- */
- static int i_logoff(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- return(IOGOOD);
- }
-
- /*
- * End (Commit) transaction - releases any outstanding locks
- */
- static int i_commit(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- if (!IS_TRANSACT)
- return(IOGOOD);
-
- if (iscommit())
- {
- errmsg(FileTrnsCommit);
- return(io_xlate(fd_sys, iserrno, "CISM ETRN"));
- }
- return(IOGOOD);
- }
-
- /*
- * Rollback transaction
- */
- static int i_rollback(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- if (!IS_TRANSACT)
- return(IOGOOD);
-
- if (isrollback())
- {
- errmsg(FileTrnsRlback);
- return(io_xlate(fd_sys, iserrno, "CISM ATRN"));
- }
- return(IOGOOD);
- }
-
- /*
- * Start transaction
- */
- static int i_transact(fd_sys, buffer)
- int fd_sys;
- char *buffer;
- {
- if (!IS_TRANSACT)
- return(IOGOOD);
-
- if (isbegin())
- {
- errmsg(FileTrnsBegin);
- return(io_xlate(fd_sys, iserrno, "CISM BTRN"));
- }
- return(IOGOOD);
- }
-
-
- /*
- * Convert record to C-ISAM form from PRO-C buffer format before storing
- */
- static void buf2isam(fd_sys, P_buff, CI_buff)
- int fd_sys;
- char *P_buff, *CI_buff;
- {
- short itmp;
- long ltmp;
- float ftmp;
- double dtmp;
- int x = 0, foff, flen;
- struct fd_def *fptr = &fd[fd_sys];
-
- zerorec(CI_buff, fptr->rec_len+1);
-
- while (fptr->flds[x].fldname) /* NULL fieldname terminates list */
- {
- foff = fptr->flds[x].fldstart;
- flen = fptr->flds[x].fldlen;
- switch(fptr->flds[x].fldtype)
- {
- case LOGTYP :
- case MEMTYP :
- case CHRTYP :
- case DATTYP :
- stchar(&P_buff[foff], &CI_buff[foff], flen);
- break;
- case INTTYP :
- bytecpy(&itmp, &P_buff[foff], flen);
- stint(itmp, &CI_buff[foff]);
- break;
- case LNGTYP :
- case TIMTYP :
- bytecpy(<mp, &P_buff[foff], flen);
- stlong(ltmp, &CI_buff[foff]);
- break;
- case FLTTYP :
- bytecpy(&ftmp, &P_buff[foff], flen);
- /* stfloat(ftmp, &CI_buff[foff]); (C-ISAM bug) */
- break;
- case DBLTYP :
- bytecpy(&dtmp, &P_buff[foff], flen);
- stdbl(dtmp, &CI_buff[foff]);
- break;
- }
- x++;
- }
- }
-
- /*
- * Convert record to PRO-C buffer format from C-ISAM form before returning
- */
- static void isam2buf(fd_sys, P_buff, CI_buff)
- int fd_sys;
- char *P_buff, *CI_buff;
- {
- short itmp;
- long ltmp;
- float ftmp;
- double dtmp;
- int x = 0, foff, flen;
- char tbuff[MAX_FLDLEN]; /* dummy buffer for char field extraction */
- struct fd_def *fptr = &fd[fd_sys];
-
- zerorec(P_buff, fptr->rec_len);
-
- while (fptr->flds[x].fldname) /* NULL fieldname terminates list */
- {
- foff = fptr->flds[x].fldstart;
- flen = fptr->flds[x].fldlen;
- switch(fptr->flds[x].fldtype)
- {
- case LOGTYP :
- case MEMTYP :
- case DATTYP :
- case CHRTYP :
- zerorec(tbuff, MAX_FLDLEN);
- ldchar(&CI_buff[foff], flen, tbuff);
- bytecpy(&P_buff[foff], tbuff, flen);
- break;
- case INTTYP :
- itmp = ldint(&CI_buff[foff]);
- bytecpy(&P_buff[foff], &itmp, flen);
- break;
- case LNGTYP :
- case TIMTYP :
- ltmp = ldlong(&CI_buff[foff]);
- bytecpy(&P_buff[foff], <mp, flen);
- break;
- case FLTTYP :
- /* dtmp = ldfloat(&CI_buff[foff]); (C-ISAM bug!) */
- ftmp = 0; /* for now ... (float)dtmp; */
- bytecpy(&P_buff[foff], &ftmp, flen);
- break;
- case DBLTYP :
- dtmp = lddbl(&CI_buff[foff]);
- bytecpy(&P_buff[foff], &dtmp, flen);
- break;
- }
- x++;
- }
- }
-
-
- /*
- * This routine translates C-ISAM Error codes into PRO-C error codes.
- * If no PRO-C equivalent, displays the error number.
- */
- static int io_xlate(fd_sys, ernum, rtnname)
- int fd_sys;
- int ernum;
- char *rtnname;
- {
- switch(ernum)
- {
- case EDUPL :
- return(IODUP);
- case ENOTOPEN :
- return(IOBADOPEN);
- case ENOFILE :
- return(IONOFILE);
- case EENDFILE :
- case ENOREC :
- case ENOCURR :
- return(IONOKEY);
- case ELOCKED :
- case EFLOCKED :
- return(IOLOCKED);
- case ELOGWRIT :
- case ENOTRANS :
- case ENOBEGIN :
- return(IONOTRANS);
- }
-
- if (fd_sys >= 0)
- errmsg(FileDbgError_sdss, "C-ISAM", ernum, fd[fd_sys].filname, rtnname);
- else /* if routines called from generated apps without valid fd_sys */
- errmsg(FileDbgError_sds, "C-ISAM", ernum, rtnname);
- return(IOERROR);
- }
-
-
- /*
- * Assign section
- */
- void assign_IO_CI(dbnum)
- int dbnum;
- {
- Fntab[dbnum - 1][0] = (int(*)())0; /* Empty */
- Fntab[dbnum - 1][1] = i_init_file;
- Fntab[dbnum - 1][2] = i_open_file;
- Fntab[dbnum - 1][3] = i_close_file;
- Fntab[dbnum - 1][4] = i_addrec;
- Fntab[dbnum - 1][5] = i_delrec;
- Fntab[dbnum - 1][6] = i_findkey;
- Fntab[dbnum - 1][7] = i_firstkey;
- Fntab[dbnum - 1][8] = i_lastkey;
- Fntab[dbnum - 1][9] = i_lockrec;
- Fntab[dbnum - 1][10] = i_nextrec;
- Fntab[dbnum - 1][11] = i_prevrec;
- Fntab[dbnum - 1][12] = i_unlock_rec;
- Fntab[dbnum - 1][13] = i_updrec;
- Fntab[dbnum - 1][14] = i_commit;
- Fntab[dbnum - 1][15] = i_login;
- Fntab[dbnum - 1][16] = i_logoff;
- Fntab[dbnum - 1][17] = i_rollback;
- Fntab[dbnum - 1][18] = i_transact;
- Fntab[dbnum - 1][19] = i_selectinx;
- Fntab[dbnum - 1][20] = i_rereadrec;
- Fntab[dbnum - 1][21] = i_filename;
- }
-
-