campo-sirio/include/checks.h
bonazzi 24ed90d54e Patch level : 10.0 274
Files correlati     :  ca2.exe 
Ricompilazione Demo : [ ]
Commento            :

Corretto comportamento dei sorted_cursor per le maschere. Ora la ricerca viene fatta sulla chiave di sort.
Aggiunta modalità batch delle transazioni. Viene generato un log e  l'esecuzione non viene interrotta da segnalazioni ( Da collaudare meglio alla prima occasione).
Resa possibile la visualizzazione di record bloccati da un altro utente.
Queste funzionalità sono presenti nelle relapp dall patch 274 e successive.


git-svn-id: svn://10.65.10.50/branches/R_10_00@23210 c028cbd2-c16b-5b4b-a496-9718f37d4682
2016-07-18 20:06:53 +00:00

118 lines
4.2 KiB
C++
Executable File

#ifndef __CHECKS_H
#define __CHECKS_H
#ifndef __STDTYPES_H
#include <stdtypes.h>
#endif
class TString_array;
#ifdef __cplusplus
extern "C" {
#endif
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, ...);
int noyesall_box(const char* fmt, ...);
bool yesno_box(const char* fmt, ...);
int yesnoall_box(const char* fmt, ...);
int yesnocancel_box(const char* fmt, ...);
bool yesnofatal_box(const char* fmt, ...);
bool delete_box(const char* fmt, ...);
bool cantread_box(const char* filename);
bool cantwrite_box(const char* filename);
bool cantaccess_box(const char* filename);
bool __trace(const char* fmt, ...);
bool __tracemem(const char* fmt);
void batch(bool on = true);
bool is_batch();
TString_array & errors();
TString_array & warnings();
#ifdef __cplusplus
}
#endif
// Utilizzate in fase di debug (definire il simbolo DBG in compilazione)
// @doc EXTERNAL
#ifdef DBG
// @msg CHECK | Macro che richiama una <m fatal_box> per stampare messaggi a video
#define CHECK(p, m) ( (p) ? (void)0 : (void) fatal_box( \
"Check failed in %s, line %d:\n\r%s", \
__FILE__, __LINE__, m) )
// @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>
// @doc EXTERNAL
// @msg CHECKS | Macro che richiama una <m fatal_box> per stampare messaggi a video
#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) )
// @parm | p | Condizione per la stampa del messaggio (stampa se FALSE)
// @parm | m | Messaggio da stampare
// @parm | s0 | Stringa aggiuntiva da stampare
//
// @comm Viene richiamata se <p p> e' FALSE. Oltre al messaggio passato in <p m>
// 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>
// @doc EXTERNAL
// @msg CHECKD | Macro che richiama una <m fatal_box> per stampare messaggi a video
#define CHECKD(p, m, d0) ( (p) ? (void)0 : (void) fatal_box( \
"Check failed in %s, line %d:\n%s: %d", \
__FILE__, __LINE__, m, d0) )
// @parm | p | Condizione per la stampa del messaggio (stampa se FALSE)
// @parm | m | Messaggio da stampare
// @parm | d0 | Stringa aggiuntiva da stampare
//
// @comm Viene richiamata se <p p> e' FALSE. Oltre al messaggio passato in <p m>
// 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>
// @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>
#else
#define CHECK(p, m)
#define CHECKS(p, m, s)
#define CHECKD(p, m, d)
#define NFCHECK 1 ? 0 : yesnofatal_box
#endif
// Utilizzata in fase di debug (definire il simbolo TRC in compilazione)
#ifdef TRC
// @doc EXTERNAL
// @msg TRACE | Macro che richiama la funzione <m __trace>
#define TRACE __trace
#define TRACEMEM(msg) __tracemem(msg)
#else
#define TRACE 1 ? 0 : __trace
#define TRACEMEM(msg) 0
#endif
#endif // __CHECKS_H