]> ncurses.scripts.mit.edu Git - ncurses.git/blob - man/curs_trace.3x
ncurses 6.0 - patch 20161008
[ncurses.git] / man / curs_trace.3x
1 .\"***************************************************************************
2 .\" Copyright (c) 2000-2010,2015 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.13 2015/07/20 22:54:44 tom Exp $
30 .de bP
31 .IP \(bu 4
32 ..
33 .TH curs_trace 3X ""
34 .na
35 .hy 0
36 .SH NAME
37 \fB_tracef\fR,
38 \fB_tracedump\fR,
39 \fB_traceattr\fR,
40 \fB_traceattr2\fR,
41 \fB_nc_tracebits\fR,
42 \fB_tracecchar_t\fR,
43 \fB_tracecchar_t2\fR,
44 \fB_tracechar\fR,
45 \fB_tracechtype\fR,
46 \fB_tracechtype2\fR,
47 \fB_tracemouse\fR,
48 \fBtrace\fR \- \fBcurses\fR debugging routines
49 .ad
50 .hy
51 .SH SYNOPSIS
52 \fB#include <curses.h>\fR
53 .sp
54 \fBvoid _tracef(const char *\fP\fIformat\fP\fB, ...);\fR
55 .br
56 \fBvoid _tracedump(const char *\fP\fIlabel\fP\fB, WINDOW *\fP\fIwin\fP\fB);\fR
57 .br
58 \fBchar *_traceattr(attr_t \fP\fIattr\fP\fB);\fR
59 .br
60 \fBchar *_traceattr2(int \fP\fIbuffer\fP\fB, chtype \fP\fIch\fP\fB);\fR
61 .br
62 \fBchar *_nc_tracebits(void);\fR
63 .br
64 \fBchar * _tracecchar_t(const cchar_t *\fP\fIstring\fP\fB);\fR
65 .br
66 \fBchar * _tracecchar_t2(int \fP\fIbuffer\fP\fB, const cchar_t *\fP\fIstring\fP\fB);\fR
67 .br
68 \fBchar *_tracechar(int \fP\fIch\fP\fB);\fR
69 .br
70 \fBchar *_tracechtype(chtype \fP\fIch\fP\fB);\fR
71 .br
72 \fBchar *_tracechtype2(int \fP\fIbuffer\fP\fB, chtype \fP\fIch\fP\fB);\fR
73 .br
74 \fBchar *_tracemouse(const MEVENT *\fP\fIevent\fP\fB);\fR
75 .br
76 \fBvoid trace(const unsigned int \fP\fIparam\fP\fB);\fR
77 .SH DESCRIPTION
78 The \fBtrace\fR routines are used for debugging the ncurses libraries,
79 as well as applications which use the ncurses libraries.
80 These functions are normally available only with the debugging library
81 e.g., \fIlibncurses_g.a\fR, but may be compiled into any model (shared, static,
82 profile) by defining the symbol \fBTRACE\fR.
83 Additionally, some functions are only available with the wide-character
84 configuration of the libraries.
85 .PP
86 The principal parts of this interface are
87 .bP
88 \fBtrace\fR, which selectively enables different tracing features, and
89 .bP
90 \fB_tracef\fR, which writes formatted data to the \fItrace\fR file.
91 .PP
92 Calling \fBtrace\fR with a nonzero parameter opens the file \fBtrace\fR
93 in the current directory for output.
94 The parameter is formed by OR'ing
95 values from the list of \fBTRACE_\fP\fIxxx\fR definitions in \fB<curses.h>\fR.
96 These include:
97 .TP 5
98 .B TRACE_DISABLE
99 turn off tracing.
100 .TP 5
101 .B TRACE_TIMES
102 trace user and system times of updates.
103 .TP 5
104 .B TRACE_TPUTS
105 trace tputs calls.
106 .TP 5
107 .B TRACE_UPDATE
108 trace update actions, old & new screens.
109 .TP 5
110 .B TRACE_MOVE
111 trace cursor movement and scrolling.
112 .TP 5
113 .B TRACE_CHARPUT
114 trace all character outputs.
115 .TP 5
116 .B TRACE_ORDINARY
117 trace all update actions.
118 The old and new screen contents are written to the trace file
119 for each refresh.
120 .TP 5
121 .B TRACE_CALLS
122 trace all curses calls.
123 The parameters for each call are traced, as well as return values.
124 .TP 5
125 .B TRACE_VIRTPUT
126 trace virtual character puts, i.e., calls to \fBaddch\fR.
127 .TP 5
128 .B TRACE_IEVENT
129 trace low-level input processing, including timeouts.
130 .TP 5
131 .B TRACE_BITS
132 trace state of TTY control bits.
133 .TP 5
134 .B TRACE_ICALLS
135 trace internal/nested calls.
136 .TP 5
137 .B TRACE_CCALLS
138 trace per-character calls.
139 .TP 5
140 .B TRACE_DATABASE
141 trace read/write of terminfo/termcap data.
142 .TP 5
143 .B TRACE_ATTRS
144 trace changes to video attributes and colors.
145 .TP 5
146 .B TRACE_MAXIMUM
147 maximum trace level, enables all of the separate trace features.
148 .PP
149 Some tracing features are enabled whenever the \fBtrace\fR parameter
150 is nonzero.
151 Some features overlap.
152 The specific names are used as a guideline.
153 .PP
154 The other functions either return a pointer to a string-area
155 (allocated by the corresponding function),
156 or return no value (such as \fB_tracedump\fP, which implements the
157 screen dump for \fBTRACE_UPDATE\fP).
158 The caller should not free these
159 strings, since the allocation is reused on successive calls.
160 To work around the problem of a single string-area per function,
161 some use a buffer-number parameter, telling the library to allocate
162 additional string-areas.
163 .PP
164 These functions check the \fBNCURSES_TRACE\fP environment variable,
165 to set the tracing feature as if \fBtrace\fP was called:
166 .RS
167 .PP
168 .na
169 filter,
170 initscr,
171 new_prescr,
172 newterm,
173 nofilter,
174 restartterm,
175 ripoffline,
176 setupterm,
177 slk_init,
178 tgetent,
179 use_env,
180 use_extended_names,
181 use_tioctl
182 .ad
183 .RE
184 .SH RETURN VALUE
185 Routines which return a value are designed to be used as parameters
186 to the \fB_tracef\fR routine.
187 .SH PORTABILITY
188 These functions are not part of the XSI interface.
189 Some other curses implementations are known to
190 have similar, undocumented features,
191 but they are not compatible with ncurses.
192 .SH SEE ALSO
193 \fBcurses\fR(3X).