Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RwDebug
[Error & Debug Handling]


Typedefs

typedef void(*  RwDebugHandler )(RwDebugType type, const RwChar *string)

Enumerations

enum   RwDebugType {
  rwNADEBUGTYPE = 0, rwDEBUGASSERT, rwDEBUGERROR, rwDEBUGMESSAGE,
  rwDEBUGTRACE, rwDEBUGTYPEFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}

Functions

void  RwDebugSetTraceState (RwBool state)
RwDebugHandler  RwDebugSetHandler (RwDebugHandler handler)
void  RwDebugSendMessage (RwDebugType type, const RwChar *funcName, const RwChar *message)

Detailed Description

Debug handling

RwDebug Overview

(DEBUG BUILD ONLY.)

Requirements

Overview

This object represents a debug handler and stream. Error messages can be sent to this object and it will pass them onto the currently registered debug handler. A default handler is registered by default. This handler sends messages to a file called 'rwdebug.log'.

Developers should note that this API may degrade performance if too many messages are being sent to the handler.


Typedef Documentation

typedef void(* RwDebugHandler)(RwDebugType type, const RwChar * string)
 

RwDebugHandler This type represents the function called from RwDebugSendMessage for sending a message to the RenderWare debug stream.

Parameters:
type  Type of debug message (assert, error, etc.).
string  Pointer to a string containing the error message.
See also:
RwDebugSetHandler

Enumeration Type Documentation

enum RwDebugType
 

RwDebugType This type represents the different types of debug and trace messages that can be sent to the currently installed debug handler (see API function RwDebugSendMessage)

Enumeration values:
rwNADEBUGTYPE  Invalid
rwDEBUGASSERT  Send an assert message
rwDEBUGERROR  Send an error message
rwDEBUGMESSAGE  Send an informational message
rwDEBUGTRACE  Send a trace message

Function Documentation

void RwDebugSendMessage RwDebugType    type,
const RwChar   funcName,
const RwChar   message
 

RwDebugSendMessage is used to send a message to the currently installed debug handler.

This function is only meaningful when used in conjunction with the debug version of the RenderWare libraries.

Parameters:
type  An RwDebugType value equal to the message type:
  • rwDEBUGASSERT - Send an assert message.
  • rwDEBUGERROR - Send an error message.
  • rwDEBUGMESSAGE - Send an informational message.
  • rwDEBUGTRACE - Send a trace message.
funcName  A pointer to a string containing the name of the function the message originated from.
message  A pointer to a string containing the text of the message.
Returns:
None.
See also:
RwDebugSetHandler , RwDebugSetTraceState , RwErrorGet
RwDebugHandler RwDebugSetHandler RwDebugHandler    handler
 

RwDebugSetHandler is used to register a new handler for the debug stream. A default system error handler is initially defined. The default handler writes all debug messages to the file "rwdebug.log" in the current directory. However, when a new handler is registered the previous output file is closed, so it’s necessary for the handler to open its own output file the first time it is called.

Note it is possible to return to the default message handler by specifying NULL for the handler pointer.

This function is only meaningful when used in conjunction with the debug version of the RenderWare libraries.

Parameters:
handler  A pointer to the new debug message handler. Set to NULL to return to the default handler.
Returns:
Returns a pointer to the previously registered debug message handler if successful or NULL if there is an error.
See also:
RwDebugSendMessage , RwDebugSetTraceState , RwErrorGet
void RwDebugSetTraceState RwBool    state
 

RwDebugSetTraceState is used to enable or disable the reporting of debug trace messages. Initially, the trace state is set to FALSE.

This function is only meaningful when used in conjunction with the debug version of the RenderWare libraries.

Parameters:
state  An RwBool value equal to the new message reporting state:
  • TRUE - Enable debug trace message reporting.
  • FALSE - Disable debug trace message reporting.
Returns:
None.
See also:
RwDebugSendMessage , RwDebugSetHandler , RwErrorGet

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:14 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)