summaryrefslogtreecommitdiffstats
path: root/generic/tclOO.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2021-08-01 11:47:23 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2021-08-01 11:47:23 (GMT)
commit36dbbdbb723b994c072318068ca9c78aac8a2bcf (patch)
tree3ef46d84fc83d53f05ae6a3b492ac02d64935dce /generic/tclOO.c
parentf107311e0a841c8971f748594a6e0bd179a2e436 (diff)
downloadtcl-36dbbdbb723b994c072318068ca9c78aac8a2bcf.zip
tcl-36dbbdbb723b994c072318068ca9c78aac8a2bcf.tar.gz
tcl-36dbbdbb723b994c072318068ca9c78aac8a2bcf.tar.bz2
Turn code snippets in TIP into a branch.
Diffstat (limited to 'generic/tclOO.c')
-rw-r--r--generic/tclOO.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c
index 405d5d0..bdceec4 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -3144,6 +3144,26 @@ Tcl_ObjectSetMethodNameMapper(
{
((Object *) object)->mapMethodNameProc = mapMethodNameProc;
}
+
+Tcl_Class
+Tcl_GetClassOfObject(
+ Tcl_Object object)
+{
+ return (Tcl_Class) ((Object *) object)->selfCls;
+}
+
+Tcl_Obj *
+Tcl_GetObjectClassName(
+ Tcl_Interp *interp,
+ Tcl_Object object)
+{
+ Tcl_Object classObj = (Tcl_Object) (((Object *) object)->selfCls)->thisPtr;
+
+ if (classObj == NULL) {
+ return NULL;
+ }
+ return Tcl_GetObjectName(interp, classObj);
+}
/*
* Local Variables: