Posted to tcl by apw at Tue Aug 07 19:47:40 GMT 2007view raw
- int
- _Tcl_GetCallFrameInfo(
- Tcl_Interp *interp, /* Interpreter in which to look for */
- Tcl_CallFrame *framePtr, /* if NULL use framePtr from interp */
- Tcl_CallFrameInfo *infoPtr) /* Where to store information */
- {
- CallFrame *myFramePtr = (CallFrame *)framePtr;
- if (infoPtr == NULL) {
- return TCL_ERROR;
- }
- if (myFramePtr == NULL) {
- if (interp == NULL) {
- return TCL_ERROR;
- }
- myFramePtr = ((Interp *)interp)->varFramePtr;
- }
- infoPtr->nsPtr = (Tcl_Namespace *)myFramePtr->nsPtr;
- infoPtr->flags = myFramePtr->isProcCallFrame;
- infoPtr->objc = myFramePtr->objc;
- infoPtr->objv = myFramePtr->objv;
- infoPtr->callerPtr = (Tcl_CallFrame *)myFramePtr->callerPtr;
- infoPtr->callerVarPtr = (Tcl_CallFrame *)myFramePtr->callerVarPtr;
- infoPtr->level = myFramePtr->level;
- infoPtr->procPtr = (Tcl_Proc)myFramePtr->procPtr;
- infoPtr->clientData = myFramePtr->clientData;
- #ifdef ARNULF_FOR_ITCL_CODE
- infoPtr->resolvePtr = myFramePtr->resolvePtr;
- #endif
- return TCL_OK;
- }
- int
- _Tcl_SetCallFrameInfo(
- Tcl_Interp *interp, /* Interpreter in which to look for */
- Tcl_CallFrame *framePtr, /* if NULL use framePtr from interp */
- CONST Tcl_CallFrameInfo *infoPtr) /* Where to find information */
- {
- CallFrame *myFramePtr = (CallFrame *)framePtr;
- if (infoPtr == NULL) {
- return TCL_ERROR;
- }
- if (myFramePtr == NULL) {
- if (interp == NULL) {
- return TCL_ERROR;
- }
- myFramePtr = ((Interp *)interp)->varFramePtr;
- }
- myFramePtr->nsPtr = (Namespace *)infoPtr->nsPtr;
- myFramePtr->isProcCallFrame = infoPtr->flags;
- myFramePtr->objc = infoPtr->objc;
- myFramePtr->objv = infoPtr->objv ;
- myFramePtr->procPtr = (Proc *)infoPtr->procPtr;
- myFramePtr->clientData = infoPtr->clientData;
- #ifdef ARNULF_FOR_ITCL_CODE
- myFramePtr->resolvePtr = infoPtr->resolvePtr;
- #endif
- return TCL_OK;
- }
Comments
Posted by apw at Tue Aug 07 20:02:14 GMT 2007 [text] [code]
sorry, forgot to add the struct: typedef struct Tcl_CallFrameInfo { Tcl_Namespace *nsPtr; int flags; int objc; Tcl_Obj *CONST *objv; Tcl_CallFrame CONST *callerPtr; Tcl_CallFrame CONST *callerVarPtr; int level; Tcl_Proc procPtr; ClientData clientData; #ifdef ARNULF_FOR_ITCL_CODE Tcl_Resolve *resolvePtr; #endif } Tcl_CallFrameInfo;