home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 125.img / PRO-C4.ZIP / BENCH1.ZIP / BENCH / IOTRAN.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-28  |  2.3 KB  |  73 lines

  1. /* ==( bench/iotran.c )== */
  2.  
  3. /* ----------------------------------------------- */
  4. /* Pro-C - Copyright (C) 1988, 1990 Vestronix Inc. */
  5. /* Modification to this source is not supported    */
  6. /* by Vestronix Inc.                               */
  7. /*            All Rights Reserved                  */
  8. /* ----------------------------------------------- */
  9.  
  10. #include <proc.io>
  11.  
  12.  
  13. /*
  14. ** Convert error codes into readable strings
  15. */
  16. char *
  17. io_tran(stat)
  18.    int stat;
  19. {
  20.    char *msg;
  21.    static char foobie[20];
  22.  
  23.    switch (stat)
  24.    {
  25.    case IOGOOD:            msg = "IOGOOD";            break;
  26.    case IOERROR:        msg = "IOERROR";        break;
  27.    case IONOFILE:        msg = "IONOFILE";        break;
  28.    case IOBADOPEN:        msg = "IOBADOPEN";        break;
  29.    case IOINDEXPOSN:        msg = "IOINDEXPOSN";        break;
  30.    case IONOKEY:        msg = "IONOKEY";        break;
  31.    case IODUP:            msg = "IODUP";            break;
  32.    case IOTOF:            msg = "IOTOF";            break;
  33.    case IOEOF:            msg = "IOEOF";            break;
  34.    case IOLOCKED:        msg = "IOLOCKED";        break;
  35.    case IONOLOCK:        msg = "IONOLOCK";        break;
  36.    case IONONEXT:        msg = "IONONEXT";        break;
  37.    case IONOLOGON:        msg = "IONOLOGON";        break;
  38.    case IO_NO_ADMIN:        msg = "IO_NO_ADMIN";        break;
  39.    case IOADD:            msg = "IOADD";            break;
  40.  
  41. #ifdef IODATSEEK
  42.    case IODATSEEK:        msg = "IODATSEEK";        break;
  43.    case IOIDXSEEK:        msg = "IOIDXSEEK";        break;
  44.    case IODATWRITE:        msg = "IODATWRITE";        break;
  45.    case IOIDXWRITE:        msg = "IOIDXWRITE";        break;
  46.    case IODATREAD:        msg = "IODATREAD";        break;
  47.    case IOIDXREAD:        msg = "IOIDXREAD";        break;
  48.    case IOOLDVER:        msg = "IOOLDVER";        break;
  49.    case IONEWVER:        msg = "IONEWVER";        break;
  50.    case IODATOPEN:        msg = "IODATOPEN";        break;
  51.    case IOIDXOPEN:        msg = "IOIDXOPEN";        break;
  52.    case IOFLDDEF:        msg = "IOFLDDEF";        break;
  53.    case IOKEYDEF:        msg = "IOKEYDEF";        break;
  54.    case IOFLDPERM:        msg = "IOFLDPERM";        break;
  55.    case IOIDXPERM:        msg = "IOIDXPERM";        break;
  56.    case IODATPERM:        msg = "IODATPERM";        break;
  57.    case IOFILLOCK:        msg = "IOFILLOCK";        break;
  58.    case IONOSERVER:        msg = "IONOSERVER";        break;
  59.    case IOCONFIG:        msg = "IOCONFIG";        break;
  60.    case IOFTABLE:        msg = "IOFTABLE";        break;
  61.    case IOILOCKED:        msg = "IOILOCKED";        break;
  62.    case IOINOLOCK:        msg = "IOINOLOCK";        break;
  63. #endif
  64.  
  65.    default:
  66.       msg = foobie;
  67.       sprintf(msg, "<stat=%d>", stat);
  68.       break;
  69.    }
  70.  
  71.    return(msg);
  72. }
  73.