diff options
author | mescalinum <mescalinum@users.sourceforge.net> | 2011-11-16 11:02:02 +0000 |
---|---|---|
committer | mescalinum <mescalinum@users.sourceforge.net> | 2011-11-16 11:02:02 +0000 |
commit | bb3429c7e76130165328180dd65451c64e7df9a1 (patch) | |
tree | c0b23e96fefd4f7ecb71eb8c457f51429189ae81 | |
parent | 166834e24345a3866b67e536232b4c19ea7d89c6 (diff) |
add a obj-instance -> class-name mapping facility
svn path=/trunk/externals/loaders/tclpd/; revision=15754
-rw-r--r-- | tcl_class.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tcl_class.c b/tcl_class.c index 46aec27..0ce39d2 100644 --- a/tcl_class.c +++ b/tcl_class.c @@ -127,6 +127,11 @@ t_tcl * tclpd_new(t_symbol *classsym, int ac, t_atom *at) { snprintf(sd, 64, "::%s::dispatcher", name); x->dispatcher = Tcl_NewStringObj(sd, -1); + // obj instance -> classname mapping + char addmapcmd[256]; + snprintf(addmapcmd, 256, "array set ::pd::classname {{%s} {%s}}", so, name); + Tcl_Eval(tclpd_interp, addmapcmd); + // the lifetime of x->{classname,self,dispatcher} is greater than this // function, hence they get an extra Tcl_IncrRefCount here: // (see tclpd_free()) |