Main Page   Compound List   File List   Compound Members   File Members  

TclXPCOMError.cpp File Reference

#include "TclXPCOMPrivate.h"

Go to the source code of this file.

Functions

void TclXPCOM_SetErrorCode (Tcl_Interp *interp, nsresult res)
int TclXPCOM_GetErrorCode (Tcl_Interp *interp, nsresult *res)
void TclXPCOM_SetErrorMessage (Tcl_Interp *interp, nsresult res)
void TclXPCOM_SetError (Tcl_Interp *interp, nsresult res)
void TclXPCOM_BackgroundError (Tcl_Interp *interp)


Detailed Description

Contains functions for handling XPCOM result codes in Tcl.

Definition in file TclXPCOMError.cpp.


Function Documentation

void TclXPCOM_SetErrorCode Tcl_Interp *    interp,
nsresult    res
 

Sets an interpreter's 'errorCode' variable to contain an XPCOM result code. The format consists of a list whose first element is the string 'XPCOM' and whose second element is the result code.

Parameters:
interp  (in) interpreter in which to set 'errorCode'
res  (in) XPCOM result code

Definition at line 50 of file TclXPCOMError.cpp.

int TclXPCOM_GetErrorCode Tcl_Interp *    interp,
nsresult *    res
 

Attempts to retrieve an XPCOM result code from an interpreter's 'errorCode' variable.

Return values:
1  - if the interp's errorCode contains an XPCOM result code
0  - if it doesn't
Parameters:
interp  (in) interpreter to search
res  (out) pointer to where the acquired result code should be stored, if found

Definition at line 74 of file TclXPCOMError.cpp.

void TclXPCOM_SetErrorMessage Tcl_Interp *    interp,
nsresult    res
 

Sets an interpreter's result to an error message corresponding to the given XPCOM result code.

Parameters:
interp  (in) interpreter to set result
res  (in) XPCOM result code

Definition at line 111 of file TclXPCOMError.cpp.

References TCLXPCOM_ERRORMSGPROC.

void TclXPCOM_SetError Tcl_Interp *    interp,
nsresult    res
 

Convenience function that sets an interpreter's 'errorCode' variable and result for a given XPCOM result code.

Parameters:
interp  (in) interpreter to set result and 'errorCode'
res  (in) XPCOM result code

Definition at line 151 of file TclXPCOMError.cpp.

References TclXPCOM_SetErrorCode, and TclXPCOM_SetErrorMessage.

void TclXPCOM_BackgroundError Tcl_Interp *    interp
 

Handles background errors caused by Tcl Component bindings. If the 'xpcom::bgerror' procedure is defined in the given interpreter, it will be called with the error message in the interpreter's result. If there is no 'xpcom::bgerror' procedure defined, or an error occurs while executing the procedure, normal background error processing will occur.

Note:
Unlike Tcl_BackgroundError, which invokes 'bgerror' as an idle event, this function invokes 'xpcom::bgerror' immediately.
Parameters:
interp  (in) interpreter in which the error occured

Definition at line 175 of file TclXPCOMError.cpp.

References TCLXPCOM_BGERRORPROC.


Generated on Fri Jun 14 23:25:51 2002 for TclXPCOM by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002