8
#include <util/psi3/libpsio/psio.h>
9
#include <util/psi3/libpsio/psifiles.h>
17
** PSIO_ERROR(): Print out an error message for libpsio.
19
** \param unit = file number
20
** \param errval = error code (defined symbolically, PSIO_ERROR_XXX)
23
void psio_error(unsigned int unit, unsigned int errval)
27
fprintf(stderr, "PSIO_ERROR: unit = %d\n", unit);
28
/* Try to save the TOCs for all open units */
29
/* psio_tocwrite() does not call psio_error() so this is OK */
30
for(i=0; i < PSIO_MAXUNIT; i++) psio_tocwrite(i);
34
fprintf(stderr, "PSIO_ERROR: %d (I/O inititalization failed)\n",
38
fprintf(stderr, "PSIO_ERROR: %d (I/O cleanup failed)\n",
41
case PSIO_ERROR_MAXVOL:
42
fprintf(stderr, "PSIO_ERROR: %d (maximum number of volumes exceeded)\n",
45
case PSIO_ERROR_NOVOLPATH:
46
fprintf(stderr, "PSIO_ERROR: %d (no volume path given)\n",
47
PSIO_ERROR_NOVOLPATH);
49
case PSIO_ERROR_IDENTVOLPATH:
50
fprintf(stderr, "PSIO_ERROR: %d (two identical volume paths)\n",
51
PSIO_ERROR_IDENTVOLPATH);
54
fprintf(stderr, "PSIO_ERROR: %d (file not open or open call failed)\n",
57
case PSIO_ERROR_REOPEN:
58
fprintf(stderr, "PSIO_ERROR: %d (file is already open)\n",
61
case PSIO_ERROR_CLOSE:
62
fprintf(stderr, "PSIO_ERROR: %d (file close failed)\n",
65
case PSIO_ERROR_RECLOSE:
66
fprintf(stderr, "PSIO_ERROR: %d (file is already closed)\n",
69
case PSIO_ERROR_OSTAT:
70
fprintf(stderr, "PSIO_ERROR: %d (invalid status flag for file open)\n",
73
case PSIO_ERROR_LSEEK:
74
fprintf(stderr, "PSIO_ERROR: %d (lseek failed)\n",
77
case PSIO_ERROR_NOTOCENT:
78
fprintf(stderr, "PSIO_ERROR: %d (no such TOC entry)\n",
81
case PSIO_ERROR_TOCENTSZ:
82
fprintf(stderr, "PSIO_ERROR: %d (TOC entry size mismatch)\n",
85
case PSIO_ERROR_KEYLEN:
86
fprintf(stderr, "PSIO_ERROR: %d (TOC key too long)\n",
89
case PSIO_ERROR_BLKSIZ:
90
fprintf(stderr, "PSIO_ERROR: %d (Requested blocksize invalid)\n",
93
case PSIO_ERROR_BLKSTART:
94
fprintf(stderr, "PSIO_ERROR: %d (Incorrect block start address)\n",
97
case PSIO_ERROR_BLKEND:
98
fprintf(stderr, "PSIO_ERROR: %d (Incorrect block end address)\n",
102
exit(PSI_RETURN_FAILURE);
b'\\ No newline at end of file'