home *** CD-ROM | disk | FTP | other *** search
- /*
- * File Creation Application 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) 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"
- #include "ctoptn.h"
- #include "ctstrc.h"
- #include "cterrc.h"
- #include "ctcomm.h"
-
- extern COUNT uerr_cod,ct_mxfil;
- extern CTFILE *ct_key;
- extern TEXT *ct_apxdat;
-
- COUNT ctapxe();
-
- COUNT CREDAT(datno,filnam,datlen,xtdsiz,filmod)
- COUNT datno;
- TEXT *filnam;
- UCOUNT datlen,xtdsiz;
- COUNT filmod;
- {
- FAST CTFILE *ctnum;
- FAST TEXT *tp;
- COUNT i;
- FILEPARM fpm;
-
- ctnum = ct_key + datno;
- if (datno < 0 || ct_mxfil <= datno)
- return(uerr_cod = FNUM_ERR);
- else if (ctnum->chnacs != 'n')
- return(uerr_cod = FUSE_ERR);
-
- if (cpyfpm(filnam,&fpm))
- return(uerr_cod);
- fpm.fplen = datlen;
- fpm.fpxtd = xtdsiz;
- fpm.fpmod = filmod;
- if (ctapxe(datno,FN_CREDAT,0L,&fpm))
- return(uerr_cod);
- cpybuf(ctnum,tp = ct_apxdat,HDRSIZ);
- strcpy(ctnum->flname,filnam);
- ctnum->filnum = datno;
- ctnum->chnacs = 'y';
- return(uerr_cod = NO_ERROR);
- }
-
- COUNT CREIDX(keyno,filnam,keylen,keytyp,keydup,nomemb,xtdsiz,filmod)
- COUNT keyno;
- TEXT *filnam;
- COUNT keylen,keytyp,keydup,nomemb;
- UCOUNT xtdsiz;
- COUNT filmod;
- {
- FAST CTFILE *ctnum;
- FAST TEXT *tp;
- COUNT i;
- FILEPARM fpm;
-
- if (keyno < 0 || ct_mxfil <= (keyno + nomemb))
- return(uerr_cod = FNUM_ERR);
- for (ctnum = ct_key + keyno, i = 0; i <= nomemb; i++, ctnum++)
- if (ctnum->chnacs != 'n')
- return(uerr(FUSE_ERR));
-
- if (cpyfpm(filnam,&fpm))
- return(uerr_cod);
- fpm.fplen = keylen;
- fpm.fptyp = keytyp;
- fpm.fpdup = keydup;
- fpm.fpmem = nomemb;
- fpm.fpxtd = xtdsiz;
- fpm.fpmod = filmod;
- if (ctapxe(keyno,FN_CREIDX,0L,&fpm))
- return(uerr_cod);
- cpybuf(ctnum = ct_key + keyno,tp = ct_apxdat,HDRSIZ);
- strcpy(ctnum->flname,filnam);
- ctnum->filnum = keyno;
- ctnum->chnacs = 'y';
- for (i = 1, ++ctnum; i <= nomemb; i++, ctnum++)
- ctnum->chnacs = 'm';
- return(uerr_cod = NO_ERROR);
- }
-
- COUNT CREMEM(keyno,keylen,keytyp,keydup,membno)
- COUNT keyno;
- COUNT keylen,keytyp,keydup,membno;
- {
- FAST CTFILE *ctnum;
- FAST TEXT *tp;
- COUNT i;
- FILEPARM fpm;
-
- fpm.fplen = keylen;
- fpm.fptyp = keytyp;
- fpm.fpdup = keydup;
- fpm.fpmem = membno;
- if (ctapxe(keyno,FN_CREMEM,0L,&fpm))
- return(uerr_cod);
- ctnum = ct_key + keyno + membno;
- cpybuf(ctnum,tp = ct_apxdat,HDRSIZ);
- ctnum->filnum = keyno + membno;
- ctnum->chnacs = 'y';
- return(uerr_cod = NO_ERROR);
- }
-
- /* end of ctapx3.c */
-