Main Page   Compound List   File List   Compound Members   File Members  

TclXPCOMStubs.cpp File Reference

#include "TclXPCOMPrivate.h"

Go to the source code of this file.

Compounds

struct  CurrentStubInfo

Defines

#define STUBS_BUFFERSIZE   16

Typedefs

typedef CurrentStubInfo CurrentStubInfo

Functions

void TclXPCOM_GetCurrentComponentContext (nsIInterfaceInfo **interfaceinfo, nsISupports **isupports)
int TclXPCOM_SetReturnCode (nsresult res)
void CleanupOutParameters (void **params, nsXPTParamInfo *paraminfos, PRUint8 paramcount, nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex)
Tcl_Obj * NewOutParam (int stubid, int paramindex)
void CleanupTclOutVariables (int stubid, Tcl_Interp *interp, nsXPTParamInfo *paraminfos, PRUint8 paramcount, PRUint16 *tclparams)
void AddObjErrorInfoForBinding (Tcl_Interp *interp, nsISupports *isupports, nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex, Tcl_Obj *script)
nsresult TclXPCOM_CallMethod (Tcl_Interp *interp, nsXPTCMiniVariant *variants, nsISupports *isupports, nsIInterfaceInfo *interfaceinfo, PRUint16 methodindex, Tcl_Obj *script)

Variables

Tcl_ThreadDataKey currentStubKey


Detailed Description

Contains functions for stub invocation on Tcl components.

Definition in file TclXPCOMStubs.cpp.


Define Documentation

#define STUBS_BUFFERSIZE   16
 

Definition at line 43 of file TclXPCOMStubs.cpp.

Referenced by TclXPCOM_CallMethod.


Typedef Documentation

typedef struct CurrentStubInfo CurrentStubInfo
 

Structure holding the current Tcl component stub being invoked in a particular thread. If no stub is being invoked, 'currentstub' and 'interfaceinfo' will be NULL.


Function Documentation

void TclXPCOM_GetCurrentComponentContext nsIInterfaceInfo **    interfaceinfo,
nsISupports **    isupports
 

Retrieves the Tcl Component stub that has a binding being evaluated in this thread. If no component binding is being evaluated, 'isupports' and 'interfaceinfo' will be set to NULL.

Parameters:
interfaceinfo  (out) address to store the interfaceinfo pointer
isupports  (out) address to store the interface pointer

Definition at line 70 of file TclXPCOMStubs.cpp.

References CurrentStubInfo::currentstub, currentStubKey, and CurrentStubInfo::interfaceinfo.

int TclXPCOM_SetReturnCode nsresult    res
 

Sets the return code for the current stub invocation.

Return values:
1  - if successful
0  - if not in a stub invocation context
Parameters:
res  (in) value to set

Definition at line 92 of file TclXPCOMStubs.cpp.

References CurrentStubInfo::currentstub, currentStubKey, and CurrentStubInfo::returnCode.

void CleanupOutParameters void **    params,
nsXPTParamInfo *    paraminfos,
PRUint8    paramcount,
nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex
 

Performs cleanup on all the out and in/out parameters for a given method.

Parameters:
params  (in) array of parameter values for method
paraminfos  (in) array of parameter info
paramcount  (in) number of parameters
interfaceinfo  (in) interface info for method
methodindex  (in) index of method into interface

Definition at line 116 of file TclXPCOMStubs.cpp.

References CleanupParam.

Referenced by TclXPCOM_CallMethod.

Tcl_Obj* NewOutParam int    stubid,
int    paramindex
 

Produces a unique Tcl out variable name corresponding to the given parameter index.

Returns:
a Tcl object containing a unique variable name
Parameters:
stubid  (in) id of this stub invocation
paramindex  (in) parameter index

Definition at line 153 of file TclXPCOMStubs.cpp.

Referenced by CleanupTclOutVariables, and TclXPCOM_CallMethod.

void CleanupTclOutVariables int    stubid,
Tcl_Interp *    interp,
nsXPTParamInfo *    paraminfos,
PRUint8    paramcount,
PRUint16 *    tclparams
 

Cleans up all the Tcl out variables associated with a stub invocation.

Parameters:
stubid  (in) id of this stub invocation
interp  (in) component's interpreter
paraminfos  (in) array of parameter info
paramcount  (in) number of parameters
tclparams  (in) array of tcl parameter info

Definition at line 169 of file TclXPCOMStubs.cpp.

References NewOutParam, and PARAM_IS_SKIPPED.

Referenced by TclXPCOM_CallMethod.

void AddObjErrorInfoForBinding Tcl_Interp *    interp,
nsISupports *    isupports,
nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex,
Tcl_Obj *    script
 

Appends a standard error message for a Tcl component binding to the given interpreter.

Parameters:
interp  (in) component's interpreter
isupports  (in) stub pointer
interfaceinfo  (in) interfaceinfo for stub
methodindex  (in) index into interface for method
script  (in) binding that generated an error

Definition at line 203 of file TclXPCOMStubs.cpp.

References TclXPCOM_NewISupportsObj.

Referenced by TclXPCOM_CallMethod.

nsresult TclXPCOM_CallMethod Tcl_Interp *    interp,
nsXPTCMiniVariant *    variants,
nsISupports *    isupports,
nsIInterfaceInfo *    interfaceinfo,
PRUint16    methodindex,
Tcl_Obj *    script
 

Evaluates a Tcl Component binding for a given method.

Returns:
an XPCOM result code
Parameters:
interp  (in) component's interpreter
variants  (in) parameters to method
isupports  (in) interface pointer of stub being invoked
interfaceinfo  (in) interfaceinfo of stub being invoked
methodindex  (in) index into interface for method
script  (in) binding for this method

Definition at line 260 of file TclXPCOMStubs.cpp.

References AddObjErrorInfoForBinding, CleanupOutParameters, CleanupTclOutVariables, CurrentStubInfo::currentstub, currentStubKey, GetMethodInfo, CurrentStubInfo::interfaceinfo, Native2Tcl, CurrentStubInfo::nestlevel, NewOutParam, PARAM_INDEX_MASK, PARAM_IS_RETVAL, PARAM_IS_SHARED_OUT, PARAM_IS_SKIPPED, MethodInfo::paramcount, MethodInfo::paraminfos, CurrentStubInfo::returnCode, STUBS_BUFFERSIZE, Tcl2Native, MethodInfo::tclparams, TclXPCOM_BackgroundError, and TclXPCOM_GetErrorCode.

Referenced by TclXPCOMStub::CallMethod, and TclXPCOMStub::QueryInterface.


Variable Documentation

Tcl_ThreadDataKey currentStubKey [static]
 

Key for retrieving the CurrentStubInfo data for a particular thread.

Definition at line 61 of file TclXPCOMStubs.cpp.

Referenced by TclXPCOM_CallMethod, TclXPCOM_GetCurrentComponentContext, and TclXPCOM_SetReturnCode.


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