home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume13 / modemcap / merror.c < prev    next >
Encoding:
C/C++ Source or Header  |  1988-01-31  |  591 b   |  32 lines

  1. #include <stdio.h>
  2.  
  3. int    merrno;
  4.  
  5. char    *_merr_list[] = {
  6.     "No error",
  7.     "Interrupt occurred",
  8.     "Dialer Hung",
  9.     "No answer",
  10.     "Illegal baud rate",
  11.     "ACU Problem",
  12.     "Line Problem",
  13.     "Can't open LDEVS file",
  14.     "Requested device not available",
  15.     "Requested device not known",
  16.     "No device available at requested baud",
  17.     "No device known at requested baud"
  18. };
  19.  
  20. int    _msys_nerr = (sizeof (_merr_list) / sizeof (char *));
  21.  
  22. merror (s)
  23. char    *s;
  24. {
  25.     int    i = - merrno;
  26.  
  27.     if (0 <= i && i < _msys_nerr)
  28.         fprintf (stderr, "%s: %s\n", s, _merr_list[i]);
  29.     else
  30.         fprintf (stderr, "%s: Error %d\n", s, merrno);
  31. }
  32.