]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_trace.3x
ncurses 5.9 - patch 20140201
[ncurses.git] / man / curs_trace.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 2000-2009,2010 Free Software Foundation, Inc.              *
3 .\"                                                                          *
4 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
5 .\" copy of this software and associated documentation files (the            *
6 .\" "Software"), to deal in the Software without restriction, including      *
7 .\" without limitation the rights to use, copy, modify, merge, publish,      *
8 .\" distribute, distribute with modifications, sublicense, and/or sell       *
9 .\" copies of the Software, and to permit persons to whom the Software is    *
10 .\" furnished to do so, subject to the following conditions:                 *
11 .\"                                                                          *
12 .\" The above copyright notice and this permission notice shall be included  *
13 .\" in all copies or substantial portions of the Software.                   *
14 .\"                                                                          *
15 .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
16 .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
17 .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
18 .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
19 .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
20 .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
21 .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
22 .\"                                                                          *
23 .\" Except as contained in this notice, the name(s) of the above copyright   *
24 .\" holders shall not be used in advertising or otherwise to promote the     *
25 .\" sale, use or other dealings in this Software without prior written       *
26 .\" authorization.                                                           *
27 .\"***************************************************************************
28 .\"
29 .\" $Id: curs_trace.3x,v 1.12 2010/12/04 18:40:45 tom Exp $
30 .TH curs_trace 3X ""
31 .na
32 .hy 0
33 .SH NAME
34 \fB_tracef\fR,
35 \fB_tracedump\fR,
36 \fB_traceattr\fR,
37 \fB_traceattr2\fR,
38 \fB_nc_tracebits\fR,
39 \fB_tracecchar_t\fR,
40 \fB_tracecchar_t2\fR,
41 \fB_tracechar\fR,
42 \fB_tracechtype\fR,
43 \fB_tracechtype2\fR,
44 \fB_tracemouse\fR,
45 \fBtrace\fR \- \fBcurses\fR debugging routines
46 .ad
47 .hy
48 .SH SYNOPSIS
49 \fB#include <curses.h>\fR
50 .sp
51 \fBvoid _tracef(const char *format, ...);\fR
52 .br
53 \fBvoid _tracedump(const char *label, WINDOW *win);\fR
54 .br
55 \fBchar *_traceattr(attr_t attr);\fR
56 .br
57 \fBchar *_traceattr2(int buffer, chtype ch);\fR
58 .br
59 \fBchar *_nc_tracebits(void);\fR
60 .br
61 \fBchar * _tracecchar_t(const cchar_t *string);\fR
62 .br
63 \fBchar * _tracecchar_t2(int buffer, const cchar_t *string);\fR
64 .br
65 \fBchar *_tracechar(int ch);\fR
66 .br
67 \fBchar *_tracechtype(chtype ch);\fR
68 .br
69 \fBchar *_tracechtype2(int buffer, chtype ch);\fR
70 .br
71 \fBchar *_tracemouse(const MEVENT *event);\fR
72 .br
73 \fBvoid trace(const unsigned int param);\fR
74 .SH DESCRIPTION
75 The \fBtrace\fR routines are used for debugging the ncurses libraries,
76 as well as applications which use the ncurses libraries.
77 These functions are normally available only with the debugging library
78 \fIlibncurses_g.a\fR, but may be compiled into any model (shared, static,
79 profile) by defining the symbol \fBTRACE\fR.
80 Additionally, some functions are only available with the wide-character
81 configuration of the libraries.
82 .PP
83 The principal parts of this interface are the \fBtrace\fR routine which
84 selectively enables different tracing features, and the \fB_tracef\fR
85 routine which writes formatted data to the \fItrace\fR file.
86 .PP
87 Calling \fBtrace\fR with a nonzero parameter opens the file \fBtrace\fR
88 in the current directory for output.  The parameter is formed by OR'ing
89 values from the list of \fBTRACE_\fP\fIxxx\fR definitions in \fB<curses.h>\fR.
90 These include:
91 .TP 5
92 TRACE_DISABLE
93 turn off tracing.
94 .TP 5
95 TRACE_TIMES
96 trace user and system times of updates.
97 .TP 5
98 TRACE_TPUTS
99 trace tputs calls.
100 .TP 5
101 TRACE_UPDATE
102 trace update actions, old & new screens.
103 .TP 5
104 TRACE_MOVE
105 trace cursor movement and scrolling.
106 .TP 5
107 TRACE_CHARPUT
108 trace all character outputs.
109 .TP 5
110 TRACE_ORDINARY
111 trace all update actions.
112 The old and new screen contents are written to the trace file
113 for each refresh.
114 .TP 5
115 TRACE_CALLS
116 trace all curses calls.
117 The parameters for each call are traced, as well as return values.
118 .TP 5
119 TRACE_VIRTPUT
120 trace virtual character puts, i.e., calls to \fBaddch\fR.
121 .TP 5
122 TRACE_IEVENT
123 trace low-level input processing, including timeouts.
124 .TP 5
125 TRACE_BITS
126 trace state of TTY control bits.
127 .TP 5
128 TRACE_ICALLS
129 trace internal/nested calls.
130 .TP 5
131 TRACE_CCALLS
132 trace per-character calls.
133 .TP 5
134 TRACE_DATABASE
135 trace read/write of terminfo/termcap data.
136 .TP 5
137 TRACE_ATTRS
138 trace changes to video attributes and colors.
139 .TP 5
140 TRACE_MAXIMUM
141 maximum trace level, enables all of the separate trace features.
142 .PP
143 Some tracing features are enabled whenever the \fBtrace\fR parameter
144 is nonzero.  Some features overlap.
145 The specific names are used as a guideline.
146 .PP
147 These functions check the \fBNCURSES_TRACE\fP environment variable,
148 to set the tracing feature as if \fBtrace\fP was called:
149 .RS
150 filter,
151 initscr,
152 new_prescr,
153 newterm,
154 nofilter,
155 ripoffline,
156 setupterm,
157 slk_init,
158 tgetent
159 .RE
160
161 .SH RETURN VALUE
162 Routines which return a value are designed to be used as parameters
163 to the \fB_tracef\fR routine.
164 .SH PORTABILITY
165 These functions are not part of the XSI interface.
166 Some other curses implementations are known to
167 have similar, undocumented features,
168 but they are not compatible with ncurses.
169 .SH SEE ALSO
170 \fBcurses\fR(3X).