1: /* $Header$ */
   2: 
   3: /*
   4:  * Author: Peter J. Nicklin
   5:  */
   6: 
   7: /*
   8:  * _closepdb() closes a database without updating. Returns 0 normally, 1
   9:  * if database error.
  10:  */
  11: #include <stdio.h>
  12: #include "path.h"
  13: #include "pdb.h"
  14: 
  15: _closepdb(pdbp)
  16:     PDB *pdbp;          /* database description pointer	*/
  17: {
  18:     int errpdb();           /* print database error message */
  19:     int errstat = 0;        /* database error status */
  20: 
  21:     fclose(pdbp->fp);
  22:     if ((pdbp->flag&_PACCESS) == (_PREAD|_PWRITE))
  23:         {
  24:         fclose(pdbp->tfp);
  25:         unlink(pdbp->tpath);
  26:         }
  27:     else if ((pdbp->flag&(_PWRITE|_PAPPEND)) != 0)
  28:         unlink(pdbp->tpath);
  29:     if ((pdbp->flag&_PERR) != 0)
  30:         {
  31:         errpdb(pdbp);
  32:         errstat = 1;
  33:         }
  34:     free((char *) pdbp);
  35:     return(errstat);
  36: }

Defined functions

_closepdb defined in line 15; never used
Last modified: 1985-07-03
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 355
Valid CSS Valid XHTML 1.0 Strict