blob: 00e7bd63165f1fe908d07f2bf2cf143e80ffef6f [file] [log] [blame]
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05301.\"***************************************************************************
Steve Kondikae271bc2015-11-15 02:50:53 +01002.\" Copyright (c) 2000-2010,2015 Free Software Foundation, Inc. *
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +05303.\" *
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.\"
Steve Kondikae271bc2015-11-15 02:50:53 +010029.\" $Id: curs_trace.3x,v 1.13 2015/07/20 22:54:44 tom Exp $
30.de bP
31.IP \(bu 4
32..
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053033.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,
Steve Kondikae271bc2015-11-15 02:50:53 +010042\fB_tracecchar_t\fR,
43\fB_tracecchar_t2\fR,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053044\fB_tracechar\fR,
45\fB_tracechtype\fR,
46\fB_tracechtype2\fR,
47\fB_tracemouse\fR,
Steve Kondikae271bc2015-11-15 02:50:53 +010048\fBtrace\fR \- \fBcurses\fR debugging routines
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053049.ad
50.hy
51.SH SYNOPSIS
52\fB#include <curses.h>\fR
53.sp
Steve Kondikae271bc2015-11-15 02:50:53 +010054\fBvoid _tracef(const char *\fP\fIformat\fP\fB, ...);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053055.br
Steve Kondikae271bc2015-11-15 02:50:53 +010056\fBvoid _tracedump(const char *\fP\fIlabel\fP\fB, WINDOW *\fP\fIwin\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053057.br
Steve Kondikae271bc2015-11-15 02:50:53 +010058\fBchar *_traceattr(attr_t \fP\fIattr\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053059.br
Steve Kondikae271bc2015-11-15 02:50:53 +010060\fBchar *_traceattr2(int \fP\fIbuffer\fP\fB, chtype \fP\fIch\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053061.br
62\fBchar *_nc_tracebits(void);\fR
63.br
Steve Kondikae271bc2015-11-15 02:50:53 +010064\fBchar * _tracecchar_t(const cchar_t *\fP\fIstring\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053065.br
Steve Kondikae271bc2015-11-15 02:50:53 +010066\fBchar * _tracecchar_t2(int \fP\fIbuffer\fP\fB, const cchar_t *\fP\fIstring\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053067.br
Steve Kondikae271bc2015-11-15 02:50:53 +010068\fBchar *_tracechar(int \fP\fIch\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053069.br
Steve Kondikae271bc2015-11-15 02:50:53 +010070\fBchar *_tracechtype(chtype \fP\fIch\fP\fB);\fR
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053071.br
Steve Kondikae271bc2015-11-15 02:50:53 +010072\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
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053077.SH DESCRIPTION
78The \fBtrace\fR routines are used for debugging the ncurses libraries,
79as well as applications which use the ncurses libraries.
80These functions are normally available only with the debugging library
Steve Kondikae271bc2015-11-15 02:50:53 +010081e.g., \fIlibncurses_g.a\fR, but may be compiled into any model (shared, static,
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053082profile) by defining the symbol \fBTRACE\fR.
Steve Kondikae271bc2015-11-15 02:50:53 +010083Additionally, some functions are only available with the wide-character
84configuration of the libraries.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053085.PP
Steve Kondikae271bc2015-11-15 02:50:53 +010086The 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.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053091.PP
92Calling \fBtrace\fR with a nonzero parameter opens the file \fBtrace\fR
Steve Kondikae271bc2015-11-15 02:50:53 +010093in the current directory for output.
94The parameter is formed by OR'ing
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053095values from the list of \fBTRACE_\fP\fIxxx\fR definitions in \fB<curses.h>\fR.
96These include:
97.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +010098.B TRACE_DISABLE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +053099turn off tracing.
100.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100101.B TRACE_TIMES
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530102trace user and system times of updates.
103.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100104.B TRACE_TPUTS
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530105trace tputs calls.
106.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100107.B TRACE_UPDATE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530108trace update actions, old & new screens.
109.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100110.B TRACE_MOVE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530111trace cursor movement and scrolling.
112.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100113.B TRACE_CHARPUT
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530114trace all character outputs.
115.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100116.B TRACE_ORDINARY
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530117trace all update actions.
118The old and new screen contents are written to the trace file
119for each refresh.
120.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100121.B TRACE_CALLS
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530122trace all curses calls.
123The parameters for each call are traced, as well as return values.
124.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100125.B TRACE_VIRTPUT
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530126trace virtual character puts, i.e., calls to \fBaddch\fR.
127.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100128.B TRACE_IEVENT
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530129trace low-level input processing, including timeouts.
130.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100131.B TRACE_BITS
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530132trace state of TTY control bits.
133.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100134.B TRACE_ICALLS
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530135trace internal/nested calls.
136.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100137.B TRACE_CCALLS
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530138trace per-character calls.
139.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100140.B TRACE_DATABASE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530141trace read/write of terminfo/termcap data.
142.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100143.B TRACE_ATTRS
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530144trace changes to video attributes and colors.
145.TP 5
Steve Kondikae271bc2015-11-15 02:50:53 +0100146.B TRACE_MAXIMUM
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530147maximum trace level, enables all of the separate trace features.
148.PP
149Some tracing features are enabled whenever the \fBtrace\fR parameter
Steve Kondikae271bc2015-11-15 02:50:53 +0100150is nonzero.
151Some features overlap.
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530152The specific names are used as a guideline.
Steve Kondikae271bc2015-11-15 02:50:53 +0100153.PP
154The other functions either return a pointer to a string-area
155(allocated by the corresponding function),
156or return no value (such as \fB_tracedump\fP, which implements the
157screen dump for \fBTRACE_UPDATE\fP).
158The caller should not free these
159strings, since the allocation is reused on successive calls.
160To work around the problem of a single string-area per function,
161some use a buffer-number parameter, telling the library to allocate
162additional string-areas.
163.PP
164These functions check the \fBNCURSES_TRACE\fP environment variable,
165to set the tracing feature as if \fBtrace\fP was called:
166.RS
167.PP
168.na
169filter,
170initscr,
171new_prescr,
172newterm,
173nofilter,
174restartterm,
175ripoffline,
176setupterm,
177slk_init,
178tgetent,
179use_env,
180use_extended_names,
181use_tioctl
182.ad
183.RE
Amit Daniel Kachhape6a01f52011-07-20 11:45:59 +0530184.SH RETURN VALUE
185Routines which return a value are designed to be used as parameters
186to the \fB_tracef\fR routine.
187.SH PORTABILITY
188These functions are not part of the XSI interface.
189Some other curses implementations are known to
190have similar, undocumented features,
191but they are not compatible with ncurses.
192.SH SEE ALSO
193\fBcurses\fR(3X).