/****************************************************************************
- * Copyright (c) 1998-2002,2003 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
/****************************************************************************
* Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1992,1995 *
* and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ * and: Thomas E. Dickey 1996-on *
****************************************************************************/
/*
* lib_trace.c - Tracing/Debugging routines
+ *
+ * The _tracef() function is originally from pcurses (by Pavel Curtis) in 1982.
+ * pcurses allowed one to enable/disable tracing using traceon() and traceoff()
+ * functions. ncurses provides a trace() function which allows one to
+ * selectively enable or disable several tracing features.
*/
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_trace.c,v 1.53 2003/11/23 00:39:30 tom Exp $")
+MODULE_ID("$Id: lib_trace.c,v 1.59 2006/08/19 12:05:25 tom Exp $")
-NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
+NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */
#ifdef TRACE
NCURSES_EXPORT_VAR(const char *) _nc_tputs_trace = "";
va_list ap;
bool before = FALSE;
bool after = FALSE;
- int doit = _nc_tracing;
+ unsigned doit = _nc_tracing;
int save_err = errno;
if (strlen(fmt) >= sizeof(Called) - 1) {
return code;
}
+/* Trace 'const char*' return-values */
+NCURSES_EXPORT(const char *)
+_nc_retrace_cptr(const char *code)
+{
+ T((T_RETURN("%s"), _nc_visbuf(code)));
+ return code;
+}
+
+/* Trace 'NCURSES_CONST void*' return-values */
+NCURSES_EXPORT(NCURSES_CONST void *)
+_nc_retrace_cvoid_ptr(NCURSES_CONST void *code)
+{
+ T((T_RETURN("%p"), code));
+ return code;
+}
+
+/* Trace 'void*' return-values */
+NCURSES_EXPORT(void *)
+_nc_retrace_void_ptr(void *code)
+{
+ T((T_RETURN("%p"), code));
+ return code;
+}
+
/* Trace 'SCREEN *' return-values */
NCURSES_EXPORT(SCREEN *)
-_nc_retrace_sp(SCREEN * code)
+_nc_retrace_sp(SCREEN *code)
{
T((T_RETURN("%p"), code));
return code;