home *** CD-ROM | disk | FTP | other *** search
- /*
- * c-tree Low Level I/O Interface
- *
- * This program is the CONFIDENTIAL and PROPRIETARY property
- * of FairCom(R) Corporation. Any unauthorized use, reproduction or
- * transfer of this program is strictly prohibited.
- *
- * Copyright (c) 1985, 1986, 1987, 1988, 1989 FairCom Corporation
- * (Subject to limited distribution and
- * restricted disclosure only.)
- * *** ALL RIGHTS RESERVED ***
- *
- * 4006 West Broadway
- * Columbia, MO 65203
- *
- *
- * c-tree(R) Version 4.3
- * Release C
- * February 7, 1989 17:30
- *
- */
-
- #include "ctstdr.h" /* standard i/o header */
- #undef EXTERN
- #define EXTERN /* */
- #include "ctoptn.h" /* c-tree configuration options */
- #include "cterrc.h" /* c-tree error codes */
- #include "ctstrc.h" /* c-tree data structures */
- #include "ctgvar.h" /* c-tree global variables */
- #include "ctcomm.h"
-
- #include <types.h>
- #include <file.h>
- #define O_BINARY 0
- #include <stat.h>
-
- COUNT ctseek(),uerr();
-
- RNDFILE mbopen(ctnum,opmode)
- PFAST CTFILE *ctnum;
- COUNT opmode;
- {
- RNDFILE retval;
-
- COUNT vtclose();
-
- ctnum->sekpos = DRNZERO;
- if (!(opmode & PERMANENT) && ct_numvfil >= MAXVFIL)
- vtclose();
-
- if ((retval = open(ctnum->flname,O_RDWR)) < 0)
- if (vtclose() == YES)
- retval = open(ctnum->flname,O_RDWR);
-
- if (!(opmode & PERMANENT) && retval >= 0)
- ct_numvfil++;
-
- return(retval);
- }
-
- /* ------------------------------------------------------------ */
-
- RNDFILE mbcrat(ctnum)
- PFAST CTFILE *ctnum;
- {
- RNDFILE retval;
-
- COUNT vtclose();
-
- ctnum->sekpos = DRNZERO;
- if (!(ctnum->flmode & PERMANENT) && ct_numvfil >= MAXVFIL)
- vtclose();
-
- if ((retval = creat(ctnum->flname,BCREATE)) < 0)
- if (vtclose() == YES)
- retval = creat(ctnum->flname,BCREATE);
-
- if (!(ctnum->flmode & PERMANENT) && retval >= 0)
- ct_numvfil++;
-
- return(retval);
- }
-
- /* ------------------------------------------------------------ */
-
- COUNT mbsave( ctnum)
- PFAST CTFILE *ctnum;
- {
- COUNT mbclos();
- RNDFILE mbopen();
-
- if (mbclos(ctnum,ctnum->flmode))
- return(uerr(FSAV_ERR));
- else if ((ctnum->fd = mbopen(ctnum,ctnum->flmode)) < 0)
- return(uerr(FSAV_ERR));
- else
- return(NO_ERROR);
- }
-
- VOID flushdos(datno)
- COUNT datno;
- {
- }
-
- #ifndef CTSERVER
-
- /* --------------------------------------------------------------------
- LOCK index node
- */
-
- COUNT LOCK(node,knum) /* node == 0 => header */
- LONG node;
- PFAST KEYFILE *knum;
- {
-
- return(NO_ERROR);
-
- }
-
- /* --------------------------------------------------------------------
- UNLOCK index file node
- */
-
- COUNT UNLOCK(node,knum)
- LONG node;
- PFAST KEYFILE *knum;
- {
-
- return(NO_ERROR);
-
- }
-
-
- /* --------------------------------------------------------------------
- LOCK data record
- */
-
- COUNT DLOCK(recbyt,dnum) /* recbyt == 0 => header record */
- POINTER recbyt;
- PFAST DATFILE *dnum;
- {
-
- return(NO_ERROR);
-
- }
-
- COUNT RLOCK(recbyt,dnum)
- POINTER recbyt;
- PFAST DATFILE *dnum;
- {
- return(NO_ERROR); /* read locks not supported */
- }
-
- /* --------------------------------------------------------------------
- UNLOCK data record
- */
-
- COUNT UDLOCK(recbyt,dnum)
- POINTER recbyt;
- PFAST DATFILE *dnum;
- {
-
- return(NO_ERROR);
-
- }
-
- #endif
-
- /* end of ctclib.vms */
-