X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftrace%2Flib_trace.c;h=7f78122179997aaca583a003d900323e72db3d94;hp=8a5d7e6a650a04c4b9363849103f206bd00c3ddc;hb=027ae42953e3186daed8f3882da73de48291b606;hpb=a8987e73ec254703634802b4f7ee30d3a485524d diff --git a/ncurses/trace/lib_trace.c b/ncurses/trace/lib_trace.c index 8a5d7e6a..7f781221 100644 --- a/ncurses/trace/lib_trace.c +++ b/ncurses/trace/lib_trace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * 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 * @@ -29,10 +29,16 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * 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 @@ -40,9 +46,9 @@ #include -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 = ""; @@ -108,7 +114,7 @@ _tracef(const char *fmt,...) 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) { @@ -179,9 +185,33 @@ _nc_retrace_ptr(char *code) 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;