From ba069019909c54f3c90b7fec51c145f88cf99e3e Mon Sep 17 00:00:00 2001 From: mescalinum Date: Sat, 29 Aug 2009 18:48:03 +0000 Subject: add proxy inlet. still some unresolved TypeError, will continue the work tomorrow svn path=/trunk/externals/tclpd/; revision=12134 --- tcl_setup.cxx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tcl_setup.cxx') diff --git a/tcl_setup.cxx b/tcl_setup.cxx index 28d6778..15eb3c3 100644 --- a/tcl_setup.cxx +++ b/tcl_setup.cxx @@ -15,6 +15,8 @@ void tclpd_setup(void) { post("Tcl loader v0.1.1 - 08.2009"); + proxyinlet_setup(); + tcl_for_pd = Tcl_CreateInterp(); Tcl_Init(tcl_for_pd); Tclpd_SafeInit(tcl_for_pd); @@ -51,3 +53,18 @@ void tclpd_setup(void) { sys_register_loader(tclpd_do_load_lib); } + +void tclpd_interp_error(int result) { + post("Tcl error: %s", Tcl_GetStringResult(tcl_for_pd)); + post(" (see stderr for details)"); + + fprintf(stderr, "------------------- Tcl error: -------------------\n"); + Tcl_Obj* dict = Tcl_GetReturnOptions(tcl_for_pd, result); + Tcl_Obj* errorInfo = NULL; + Tcl_Obj* errorInfoK = Tcl_NewStringObj("-errorinfo", -1); + Tcl_IncrRefCount(errorInfoK); + Tcl_DictObjGet(tcl_for_pd, dict, errorInfoK, &errorInfo); + Tcl_DecrRefCount(errorInfoK); + fprintf(stderr, "%s\n", Tcl_GetStringFromObj(errorInfo, 0)); + fprintf(stderr, "--------------------------------------------------\n"); +} -- cgit v1.2.1