1: /* $Header$ */
   2: 
   3: /*
   4:  * Author: Peter J. Nicklin
   5:  */
   6: 
   7: /*
   8:  * errpdb() prints the error message in pdbp->err, or ERRPDB if pdbp is
   9:  * null. Clears error message and returns 1.
  10:  */
  11: #include <stdio.h>
  12: #include "path.h"
  13: #include "pdb.h"
  14: 
  15: errpdb(pdbp)
  16:     PDB *pdbp;          /* database stream */
  17: {
  18:     extern char PDBERR[];       /* database error message buffer */
  19:     extern char *PGN;       /* program name */
  20: 
  21:     if (pdbp == NULL)
  22:         {
  23:         if (*PDBERR != '\0')
  24:             {
  25:             fprintf(stderr, "%s: %s\n", PGN, PDBERR);
  26:             *PDBERR = '\0';
  27:             }
  28:         }
  29:     else    {
  30:         if (*pdbp->perr != '\0')
  31:             {
  32:             fprintf(stderr, "%s: %s\n", PGN, pdbp->perr);
  33:             *pdbp->perr = '\0';
  34:             }
  35:         }
  36:     return(1);
  37: }

Defined functions

Last modified: 1985-07-03
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 589
Valid CSS Valid XHTML 1.0 Strict