1994-12-28 11:01:33 +00:00
|
|
|
#ifndef __CHECKS_H
|
|
|
|
#define __CHECKS_H
|
2003-04-16 15:49:59 +00:00
|
|
|
|
1998-03-05 13:54:51 +00:00
|
|
|
#ifndef __STDTYPES_H
|
|
|
|
#include <stdtypes.h>
|
|
|
|
#endif
|
2003-04-16 15:49:59 +00:00
|
|
|
|
1994-12-28 11:01:33 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
1998-05-04 08:54:51 +00:00
|
|
|
bool message_box(const char* fmt, ...);
|
|
|
|
bool warning_box(const char* fmt, ...);
|
|
|
|
bool sorry_box(const char* fmt, ...);
|
|
|
|
bool error_box(const char* fmt, ...);
|
|
|
|
bool fatal_box(const char* fmt, ...);
|
|
|
|
bool noyes_box(const char* fmt, ...);
|
|
|
|
bool yesno_box(const char* fmt, ...);
|
1994-12-28 11:01:33 +00:00
|
|
|
int yesnocancel_box(const char* fmt, ...);
|
1998-03-05 13:54:51 +00:00
|
|
|
bool yesnofatal_box(const char* fmt, ...);
|
|
|
|
bool __trace(const char* fmt, ...);
|
1998-08-10 10:08:03 +00:00
|
|
|
bool __tracemem(const char* fmt);
|
1994-12-28 11:01:33 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1995-05-26 10:16:03 +00:00
|
|
|
// Utilizzate in fase di debug (definire il simbolo DBG in compilazione)
|
|
|
|
|
|
|
|
// @doc EXTERNAL
|
1994-12-28 11:01:33 +00:00
|
|
|
|
|
|
|
#ifdef DBG
|
1995-05-26 10:16:03 +00:00
|
|
|
// @msg CHECK | Macro che richiama una <m fatal_box> per stampare messaggi a video
|
1994-12-28 11:01:33 +00:00
|
|
|
#define CHECK(p, m) ( (p) ? (void)0 : (void) fatal_box( \
|
|
|
|
"Check failed in %s, line %d:\n\r%s", \
|
|
|
|
__FILE__, __LINE__, m) )
|
1995-05-26 10:16:03 +00:00
|
|
|
// @parm | p | Condizione per la stampa del messaggio (stampa se FALSE)
|
|
|
|
// @parm | m | Messaggio da stampare
|
|
|
|
//
|
|
|
|
// @comm Viene richiamata se <p p> e' FALSE.
|
|
|
|
// <nl>Utilizzata in fase di debug (definire il simbolo DBG in compilazione).
|
|
|
|
//
|
|
|
|
// @xref <m CHECKS> <m CHECKD>
|
1996-02-05 19:00:53 +00:00
|
|
|
|
|
|
|
// @doc EXTERNAL
|
1995-05-26 10:16:03 +00:00
|
|
|
|
1996-02-05 19:00:53 +00:00
|
|
|
// @msg CHECKS | Macro che richiama una <m fatal_box> per stampare messaggi a video
|
1994-12-28 11:01:33 +00:00
|
|
|
#define CHECKS(p, m, s0) ( (p) ? (void)0 : (void) fatal_box( \
|
|
|
|
"Check failed in %s, line %d:\n\r%s%s", \
|
|
|
|
__FILE__, __LINE__, m, s0) )
|
1995-05-26 10:16:03 +00:00
|
|
|
// @parm | p | Condizione per la stampa del messaggio (stampa se FALSE)
|
|
|
|
// @parm | m | Messaggio da stampare
|
|
|
|
// @parm | s0 | Stringa aggiuntiva da stampare
|
|
|
|
//
|
1996-09-10 10:43:17 +00:00
|
|
|
// @comm Viene richiamata se <p p> e' FALSE. Oltre al messaggio passato in <p m>
|
1995-05-26 10:16:03 +00:00
|
|
|
// stampa anche una strina aggiuntiva passata in <p s0>.
|
|
|
|
// <nl>Utilizzata in fase di debug (definire il simbolo DBG in compilazione).
|
|
|
|
//
|
|
|
|
// @xref <m CHECK> <m CHECKD>
|
1996-02-05 19:00:53 +00:00
|
|
|
|
|
|
|
// @doc EXTERNAL
|
1995-05-26 10:16:03 +00:00
|
|
|
|
1996-02-05 19:00:53 +00:00
|
|
|
// @msg CHECKD | Macro che richiama una <m fatal_box> per stampare messaggi a video
|
1994-12-28 11:01:33 +00:00
|
|
|
#define CHECKD(p, m, d0) ( (p) ? (void)0 : (void) fatal_box( \
|
1995-12-13 15:13:51 +00:00
|
|
|
"Check failed in %s, line %d:\n%s%d", \
|
1994-12-28 11:01:33 +00:00
|
|
|
__FILE__, __LINE__, m, d0) )
|
1995-05-26 10:16:03 +00:00
|
|
|
// @parm | p | Condizione per la stampa del messaggio (stampa se FALSE)
|
|
|
|
// @parm | m | Messaggio da stampare
|
|
|
|
// @parm | d0 | Stringa aggiuntiva da stampare
|
|
|
|
//
|
1996-09-10 10:43:17 +00:00
|
|
|
// @comm Viene richiamata se <p p> e' FALSE. Oltre al messaggio passato in <p m>
|
1995-05-26 10:16:03 +00:00
|
|
|
// stampa anche un numero passato in <p d0>.
|
|
|
|
// <nl>Utilizzata in fase di debug (definire il simbolo DBG in compilazione).
|
|
|
|
//
|
|
|
|
// @xref <m CHECKS> <m CHECK>
|
|
|
|
|
1996-05-08 11:09:13 +00:00
|
|
|
// @doc EXTERNAL
|
|
|
|
|
|
|
|
// @msg CHECKD | Macro che richiama una <m yesnofatal_box> per stampare messaggi d'errore a video
|
|
|
|
#define NFCHECK yesnofatal_box
|
|
|
|
|
|
|
|
// @xref <m CHECKS> <m CHECK>
|
|
|
|
|
1994-12-28 11:01:33 +00:00
|
|
|
#else
|
|
|
|
|
|
|
|
#define CHECK(p, m)
|
|
|
|
#define CHECKS(p, m, s)
|
1996-05-08 11:09:13 +00:00
|
|
|
#define CHECKD(p, m, d)
|
|
|
|
#define NFCHECK 1 ? 0 : yesnofatal_box
|
1994-12-28 11:01:33 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
1995-05-26 10:16:03 +00:00
|
|
|
// Utilizzata in fase di debug (definire il simbolo TRC in compilazione)
|
1994-12-28 11:01:33 +00:00
|
|
|
|
|
|
|
#ifdef TRC
|
1996-02-05 19:00:53 +00:00
|
|
|
// @doc EXTERNAL
|
|
|
|
|
1995-05-26 10:16:03 +00:00
|
|
|
// @msg TRACE | Macro che richiama la funzione <m __trace>
|
1994-12-28 11:01:33 +00:00
|
|
|
#define TRACE __trace
|
1998-08-10 10:08:03 +00:00
|
|
|
#define TRACEMEM(msg) __tracemem(msg)
|
1994-12-28 11:01:33 +00:00
|
|
|
#else
|
|
|
|
#define TRACE 1 ? 0 : __trace
|
1998-08-10 10:08:03 +00:00
|
|
|
#define TRACEMEM(msg) 0
|
1994-12-28 11:01:33 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // __CHECKS_H
|