home *** CD-ROM | disk | FTP | other *** search
/ CD-ROM Aktief 1995 #6 / CDA_6.iso / shell / utils / disked29.arj / SOURCE.ZIP / ERROR.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-02-19  |  1.6 KB  |  54 lines

  1. /***
  2. *error.h - disked definitions/declarations for errno/perror() like error
  3. *          handling.
  4. *
  5. *Copyright (c) 1991-1995, Gregg Jennings.  All wrongs reserved.
  6. *   P O Box 200, Falmouth, MA 02541-0200
  7. *
  8. *Purpose:
  9. *   Error messages.
  10. *
  11. *Notice:
  12. *   This progam may be freely used and distributed.  Any distrubution
  13. *   with modifications must retain the above copyright statement and
  14. *   modifications noted.
  15. *   No pulp-publication, in whole or in part, permitted without
  16. *   permission (magazines or books).
  17. *******************************************************************************/
  18.  
  19. /* errno-like error information */
  20.  
  21. struct error_t {
  22.    const char *mod;                 /* module name */
  23.    const char *func;                /* function name */
  24.    const char *msg;                 /* error message */
  25.    const char *arg;                 /* error argument */
  26.    const char *info;                /* error or OS information */
  27.    int  num;                        /* error number */
  28. };
  29.  
  30. /* global (or shared) error conditions */
  31.  
  32. enum ERROR_MSG {
  33.    REQ_DOS_3,                       /* files.c */
  34.    NO_MEM,
  35.    FAT_PHASE,
  36.    INV_CLUS,
  37.    INV_ST_CLUS,
  38.    NUM_FILES,
  39.    ALLOC_ZERO,                      /* alloc.c */
  40.    FREE_NULL,
  41.    HEAP_ERROR,
  42.    ALLOC_FAIL,
  43.    NUM_ERR_MSG
  44. };
  45.  
  46. extern struct error_t error;
  47. extern const char *err_msg[NUM_ERR_MSG];
  48.  
  49. extern void printerror(int ext);
  50. extern void set_error(const char *msg, const char *mod, int err, const char *func);
  51. extern void set_err_num(int error);
  52. extern void set_err_arg(const char *fmt, ...);
  53. extern void set_err_info(const char *fmt, ...);
  54.