home *** CD-ROM | disk | FTP | other *** search
/ ftp.update.uu.se / ftp.update.uu.se.2014.03.zip / ftp.update.uu.se / pub / rainbow / msdos / misc / make.lzh / DOSERROR.C next >
Text File  |  1986-01-19  |  2KB  |  49 lines

  1. /*
  2.  * DOSERROR.C
  3.  *
  4.  *    Copyright (C) 1984 by Larry Campbell, 73 Concord St., Maynard Mass.
  5.  *
  6.  *    This software may be freely copied and disseminated for
  7.  *    noncommercial purposes, if and only if this entire copyright
  8.  *    statement and notice is included intact.  This software, and
  9.  *    the information contained herein, may not be used for commercial
  10.  *    purposes without my prior written permission.
  11.  *
  12.  * char *dos_error (error_num)
  13.  *
  14.  *    Return address of string describing an MS-DOS error code
  15.  *    (useful only for Xenix-style calls, CP/M-style calls have
  16.  *    different error codes)
  17.  */
  18.  
  19. static char
  20.     ebuf[40];
  21.  
  22. char *dos_error (error_num)
  23. int error_num;
  24. {
  25. switch (error_num)
  26.     {
  27.     case  1: return ("invalid function");
  28.     case  2: return ("file not found");
  29.     case  3: return ("path not found");
  30.     case  4: return ("too many open files");
  31.     case  5: return ("access denied");
  32.     case  6: return ("invalid handle");
  33.     case  7: return ("arena trashed");
  34.     case  8: return ("not enough memory");
  35.     case  9: return ("invalid block");
  36.     case 10: return ("bad environment");
  37.     case 11: return ("bad format for EXE file");
  38.     case 12: return ("invalid access");
  39.     case 13: return ("invalid data");
  40.     case 15: return ("invalid drive");
  41.     case 16: return ("can't remove current directory");
  42.     case 17: return ("can't rename across devices");
  43.     case 18: return ("no more files");
  44.     default:
  45.     sprintf (ebuf, "unknown error code %d", error_num);
  46.     return (ebuf);
  47.     };
  48. }
  49.