www.pudn.com > MPEG2systemsrc.rar > Utilities.H
#include "Events.H"
extern "C"
{
#include
void exit (int);
}
// useful things
typedef int Boolean;
#define FALSE 0
#define TRUE 1
// globals
extern int PRINTFLAG;
extern EventManager* EM;
// system functions
void sys_error (char*);
void sys_halt (char*);
void sys_message (char*);
/* @(#)assert.h 1.7 88/02/07 SMI; from UCB 4.2 85/01/21 */
# ifndef NDEBUG
# define _assert(ex) {if (!(ex)){(void)fprintf(stderr,"Assertion
(ex) failed: file \"%s\", line %d\n", __FILE__, __LINE__);sys_halt("Bad Assertion");}}
# define assert(ex) _assert(ex)
# else
# define _assert(ex)
# define assert(ex)
# endif
/*
DOCUMENTATION
Three system print messages are supported:
void sys_error (char*);
void sys_halt (char*);
void sys_message (char*);
sys_error and sys_halt will terminate the program, sys_message
will print a message.
PRINTFLAG controls the printing of sys_messages and sys_errors. If
PRINTFLAG is FALSE, then messages are suppressed. The default is TRUE.
EM can be set to the EventManager. If it is set then a Termination
event is triggered before sys_halt terminated the application.
assert is used in a few places to test assertions.
*/