7 * Written by Keith Marshall <keithmarshall@users.sourceforge.net>
8 * Copyright (C) 2009, 2010, 2011, 2012 MinGW.org Project
11 * This header file provides the public API declarations for the
12 * diagnostic message handling subsystem.
15 * This is free software. Permission is granted to copy, modify and
16 * redistribute this software, under the provisions of the GNU General
17 * Public License, Version 3, (or, at your option, any later version),
18 * as published by the Free Software Foundation; see the file COPYING
19 * for licensing details.
21 * Note, in particular, that this software is provided "as is", in the
22 * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not
23 * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY
24 * PARTICULAR PURPOSE. Under no circumstances will the author, or the
25 * MinGW Project, accept liability for any damages, however caused,
26 * arising from the use of this software.
38 # define EXTERN_C extern "C"
46 DMH_SUBSYSTEM_TTY = 0,
59 EXTERN_C void dmh_init( const dmh_class, const char* );
60 EXTERN_C int dmh_notify( const dmh_severity, const char *fmt, ... );
61 EXTERN_C int dmh_printf( const char *fmt, ... );
63 #define DMH_COMPILE_DIGEST (uint16_t)(0x0100U)
64 #define DMH_DISPATCH_DIGEST (uint16_t)(0x0200U)
66 #define DMH_DIGEST_MASK (DMH_COMPILE_DIGEST | DMH_DISPATCH_DIGEST)
67 #define DMH_BEGIN_DIGEST (DMH_COMPILE_DIGEST), ~(DMH_DIGEST_MASK)
68 #define DMH_END_DIGEST (DMH_DISPATCH_DIGEST), ~(DMH_DIGEST_MASK)
70 #define DMH_GET_CONTROL_STATE (uint16_t)(0x0000U), (uint16_t)(0xFFFFU)
72 #define DMH_SEVERITY_MASK (DMH_INFO | DMH_WARNING | DMH_ERROR | DMH_FATAL)
74 EXTERN_C uint16_t dmh_control( const uint16_t, const uint16_t );
77 class dmh_exception : public std::exception
79 /* Limited purpose exception class; can only accept messages
80 * that are const char, because lifetime is assumed infinite,
81 * and storage is not freed. Used to handle fatal errors,
82 * which otherwise would force a direct call to exit(). By
83 * using this class, we can ensure that last rites are
84 * performed before exiting.
87 dmh_exception() throw();
88 dmh_exception( const char* ) throw();
89 virtual ~dmh_exception() throw();
90 virtual const char* what() const throw();
95 #endif /* __cplusplus */
97 #endif /* DMH_H: $RCSfile$: end of file */