cctw  0.2.1
cctwtclutils.cpp
Go to the documentation of this file.
1 /*
2  * cctwtclutils.cpp
3  *
4  * Created on: Nov 18, 2013
5  * Author: wozniak
6  */
7 
8 #include "cctwtclutils.h"
9 
10 #define TCL_CONDITION_MSG_MAX 1024
11 
12 void tcl_condition_failed(Tcl_Interp* interp, Tcl_Obj* command,
13  const char* format, ...)
14 {
15  va_list va;
16  va_start(va,format);
17  char buffer[TCL_CONDITION_MSG_MAX];
18  char* commandname = Tcl_GetStringFromObj(command, NULL);
19  char* p = &buffer[0];
20  p += sprintf(p, "\n");
21  p += sprintf(p, "error: ");
22  p += sprintf(p, "%s: ", commandname);
23  p += vsprintf(p, format, va);
24  p += sprintf(p, "\n\n");
25  va_end(va);
26  Tcl_AddErrorInfo(interp, buffer);
27 }
#define TCL_CONDITION_MSG_MAX
void tcl_condition_failed(Tcl_Interp *interp, Tcl_Obj *command, const char *format,...)