From ef18d8daab4aad16f833fe17fe8be97671eebe71 Mon Sep 17 00:00:00 2001 From: mescalinum Date: Mon, 28 Nov 2011 23:59:13 +0000 Subject: Fix pd_bind crash in [bitmap] (bug #3429577). This commit causes [bitmap] to break further, because there are now two string representations of a t_pd*: 1. the one provided by SWIG, unaccessible by tclpd; 2. the tclpd synthetic one In order to be fixed, hashtable must become a bidirectional hashmap, so that a reverse lookup in the object_table is possible (needed in order to make a %typemap(out) t_pd *). svn path=/trunk/externals/loaders/tclpd/; revision=15801 --- tclpd.i | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tclpd.i') diff --git a/tclpd.i b/tclpd.i index a072f5b..4d889d0 100644 --- a/tclpd.i +++ b/tclpd.i @@ -88,6 +88,7 @@ void name_setitem(type *ary, int index, type value) const char *str = Tcl_GetStringFromObj($input, NULL); $1 = object_table_get(str); SWIG_contract_assert($1, "not a t_pd * instance") {}; + // XXX: %typemap(out) missing!!! } %typemap(in) t_text * { @@ -107,6 +108,13 @@ void name_setitem(type *ary, int index, type value) $1 = &x->o; } +%typemap(in) struct _class * { + const char *str = Tcl_GetStringFromObj($input, NULL); + t_class *c = class_table_get(str); + SWIG_contract_assert(c, "invalid class name") {}; + $1 = c; +} + /* functions that are in m_pd.h but don't exist in modern versions of pd */ %ignore pd_getfilename; %ignore pd_getdirname; -- cgit v1.2.1