home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Programming / Python2 / Python20_source / Python / strerror.c < prev    next >
Encoding:
C/C++ Source or Header  |  2000-10-25  |  446 b   |  24 lines

  1.  
  2. /* PD implementation of strerror() for systems that don't have it.
  3.    Author: Guido van Rossum, CWI Amsterdam, Oct. 1990, <guido@cwi.nl>. */
  4.  
  5. #include <stdio.h>
  6.  
  7. extern int sys_nerr;
  8. extern char *sys_errlist[];
  9.  
  10. char *
  11. strerror(int err)
  12. {
  13.     static char buf[20];
  14.     if (err >= 0 && err < sys_nerr)
  15.         return sys_errlist[err];
  16.     sprintf(buf, "Unknown errno %d", err);
  17.     return buf;
  18. }
  19.  
  20. #ifdef macintosh
  21. int sys_nerr = 0;
  22. char *sys_errlist[1] = 0;
  23. #endif
  24.