1#define Tcl_Interp_numLevels(interp)       ((Interp *)interp)->numLevels
2#define Tcl_Interp_framePtr(interp)        ((Tcl_CallFrame *)((Interp *)interp)->framePtr)
3#define Tcl_Interp_varFramePtr(interp)     (((Interp *)interp)->varFramePtr)
4#define Tcl_Interp_globalNsPtr(interp)     ((Tcl_Namespace *)((Interp *)interp)->globalNsPtr)
5#define Tcl_Interp_flags(interp)           ((Interp *)interp)->flags
6#if DISPATCH_TRACE
7#define Tcl_Interp_returnCode(interp)      ((Interp *)interp)->returnCode
8#endif
9#define Tcl_Interp_threadId(interp)        ((Interp *)interp)->threadId
10
11#define Tcl_CallFrame_callerPtr(cf)       ((Tcl_CallFrame*)((CallFrame *)cf)->callerPtr)
12#define Tcl_CallFrame_procPtr(cf)         ((CallFrame *)cf)->procPtr
13#define Tcl_CallFrame_varTablePtr(cf)     ((CallFrame *)cf)->varTablePtr
14#define Tcl_CallFrame_level(cf)           ((CallFrame *)cf)->level
15#define Tcl_CallFrame_isProcCallFrame(cf) ((CallFrame *)cf)->isProcCallFrame
16#define Tcl_CallFrame_compiledLocals(cf)  ((CallFrame *)cf)->compiledLocals
17#define Tcl_CallFrame_callerVarPtr(cf)    ((Tcl_CallFrame*)((CallFrame *)cf)->callerVarPtr)
18#define Tcl_CallFrame_objc(cf)            ((CallFrame *)cf)->objc
19#define Tcl_CallFrame_objv(cf)            ((CallFrame *)cf)->objv
20
21#define Tcl_Namespace_cmdTable(nsPtr)    &((Namespace *)nsPtr)->cmdTable
22#define Tcl_Namespace_varTable(nsPtr)    &((Namespace *)nsPtr)->varTable
23#define Tcl_Namespace_childTable(nsPtr)  &((Namespace *)nsPtr)->childTable
24#define Tcl_Namespace_activationCount(nsPtr) ((Namespace *)nsPtr)->activationCount
25#define Tcl_Namespace_deleteProc(nsPtr)  ((Namespace *)nsPtr)->deleteProc
26
27
28
29#define Tcl_Command_refCount(cmd)      ((Command *)cmd)->refCount
30#define Tcl_Command_cmdEpoch(cmd)      ((Command *)cmd)->cmdEpoch
31/* the following items could be obtained from
32   Tcl_GetCommandInfoFromToken(cmd, infoPtr) */
33#define Tcl_Command_nsPtr(cmd)         ((Tcl_Namespace*)(((Command *)cmd)->nsPtr))
34#define Tcl_Command_objProc(cmd)       ((Command *)cmd)->objProc
35#define Tcl_Command_objClientData(cmd) ((Command *)cmd)->objClientData
36#define Tcl_Command_proc(cmd)          ((Command *)cmd)->proc
37#define Tcl_Command_clientData(cmd)    ((Command *)cmd)->clientData
38#define Tcl_Command_deleteProc(cmd)    ((Command *)cmd)->deleteProc
39
40/*
41 * Conversion from CmdPtr to Class / Object
42 */
43
44static XOTCLINLINE ClientData
45XOTclGetCDFromCmdPtr(Tcl_Command cmd) {
46  assert(cmd);
47  if (Tcl_Command_objProc(cmd) == XOTclObjDispatch && !Tcl_Command_cmdEpoch(cmd))
48    return Tcl_Command_objClientData(cmd);
49  else
50    return NULL;
51}
52
53static XOTCLINLINE XOTclClass*
54XOTclGetClassFromCmdPtr(Tcl_Command cmd) {
55  ClientData cd = XOTclGetCDFromCmdPtr(cmd);
56  if (cd)
57    return XOTclObjectToClass(cd);
58  else
59    return 0;
60}
61
62static XOTCLINLINE XOTclObject*
63XOTclGetObjectFromCmdPtr(Tcl_Command cmd) {
64  return (XOTclObject*) XOTclGetCDFromCmdPtr(cmd);
65}
66