cctw  0.2.1
Macros | Functions
cctwtclutils.cpp File Reference
#include "cctwtclutils.h"
Include dependency graph for cctwtclutils.cpp:

Go to the source code of this file.

Macros

#define TCL_CONDITION_MSG_MAX   1024
 

Functions

void tcl_condition_failed (Tcl_Interp *interp, Tcl_Obj *command, const char *format,...)
 

Macro Definition Documentation

#define TCL_CONDITION_MSG_MAX   1024

Definition at line 10 of file cctwtclutils.cpp.

Referenced by tcl_condition_failed().

Function Documentation

void tcl_condition_failed ( Tcl_Interp *  interp,
Tcl_Obj *  command,
const char *  format,
  ... 
)

Definition at line 12 of file cctwtclutils.cpp.

References TCL_CONDITION_MSG_MAX.

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