SEXP dotTcl(SEXP args) { SEXP ans; const char *cmd; Tcl_Obj *val; const void *vmax = vmaxget(); if(!isValidString(CADR(args))) error(_("invalid argument")); cmd = translateChar(STRING_ELT(CADR(args), 0)); val = tk_eval(cmd); ans = makeRTclObject(val); vmaxset(vmax); return ans; }
pure_expr *tk(const char *s) { char *result = NULL; if (tk_start(&result)) { bool res; /* Make sure that we don't pull the rug under ourselves. */ Tcl_Interp* _interp = interp; Tcl_Preserve(_interp); res = tk_eval(s, &result); Tcl_Release(_interp); if (res) return (result&&*result)?pure_string(result):pure_tuplel(0); else return tk_error(result); } else return tk_error(result); }