Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Rishabh Gupta
purr-data
Commits
c3b1ffa0
Commit
c3b1ffa0
authored
Aug 04, 2014
by
Mathieu L Bouchard
Browse files
print tcl error messages in terminal, with their statement, in bright colours
parent
115569ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/t_tkcmd.c
View file @
c3b1ffa0
...
...
@@ -553,17 +553,19 @@ static int pdCmd(ClientData cd, Tcl_Interp *interp, int argc, char **argv)
/*********** "c" level access to tk functions. ******************/
#define DEBUG_TCL
void
tcl_mess
(
char
*
s
)
{
int
result
;
// PRODUCTION VERSION
#ifdef DEBUG_TCL
char
catch_s
[
strlen
(
s
)];
sprintf
(
catch_s
,
"%s"
,
s
);
#else
char
catch_s
[
strlen
(
s
)
+
10
];
sprintf
(
catch_s
,
"catch { %s }"
,
s
);
// DEBUGGING VERSION
//char catch_s[strlen(s)];
//sprintf(catch_s, "%s", s);
#endif
Tcl_Obj
*
messageObjPtr
=
Tcl_NewStringObj
(
catch_s
,
-
1
);
Tcl_IncrRefCount
(
messageObjPtr
);
...
...
@@ -571,7 +573,9 @@ void tcl_mess(char *s)
Tcl_DecrRefCount
(
messageObjPtr
);
if
(
result
!=
TCL_OK
)
{
if
(
tk_pdinterp
)
printf
(
"%s
\n
"
,
Tcl_GetStringResult
(
tk_pdinterp
));
if
(
tk_pdinterp
)
printf
(
"in sys_gui \e[0;1;36m%s\e[31m%s\e[0m
\n
"
,
s
,
Tcl_GetStringResult
(
tk_pdinterp
));
else
printf
(
"no error
\n
"
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment