Function CDM_Debug


Definition:#include <CDM.h>
Prototype:void CDM_Debug(const char *format, ...);
Arguments:

format: A format string, describing the arguments in the same way as the first argument of the C library function "printf" (char *)
...: A variable set of arguments. These arguments should correspond to the arguments declared through the format string (various)

C/C++ API Sections
Tcl API Sections
Description
Return Value
Notes
See Also
Index

Description:

This function can be used in order to display debugging information under all supported platforms. "CDM_Debug" works in the same way and accepts the same arguments as the standart C library function "printf". The only difference is that the message is not displayed to the "stdout" or "stderr" files of the program. The output is instead displayed using the "puts" Tcl command, thus offering the ability to Tcl scripts to redirect the output by renaming the "puts" command, or see the displayed information under windows in a console, as both "stdout" and "stderr" files are not available under windows. The actual Tcl file that the message will be redirected is controled by the value of the C or Tcl variable "CDM_DebugStdout": if this variable contains a true value (!= 0), the message will be displayed to the "stdout" Tcl channel. Atherwise, the "stderr" Tcl channel will be used. Although the user can call this function directly, it is recommented that the C/C++ macro "CDM_DEBUG" should be used instead. The greater advantage of using the macro is that the message will be displayed only if the code is compiled with debugging enabled (i.e. with the symbol "DEBUG" defined). If the symbol "DEBUG" is not enabled, calls to "CDM_DEBUG" will have no effect. The "CDM_DEBUG" macro can be used in all the places "CDM_Debug" can be used, as it accepts the same arguments.

Return Value:

This function does not return anything, even if an error occurs.

Notes:

Note that "CDM_Debug" places a limit to the length of the displayed message, as its length cannot exceed the 4047 single-byte characters. If the message (after all the substitutions described by the format argument have been made) exceeds the length of 4047 characters, it will be truncuated to this length.

Also note that it is preferable to use the macro "CDM_DEBUG", instead of calling "CDM_Debug" directly. Such use will enable the activation/deactivaion of debugging information during compilation, according whether the symbol "DEBUG" is defined or not.

See Also:

CDM_DebugStdout, puts, printf, CDM.h


Generated by: petasis@aias on Wed Aug 16 10:31:57 PM EEST 2006.