Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | .\"*************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 2 | .\" Copyright (c) 2000-2010,2015 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 | .\" |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 29 | .\" $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 Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 42 | \fB_tracecchar_t\fR, |
| 43 | \fB_tracecchar_t2\fR, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 44 | \fB_tracechar\fR, |
| 45 | \fB_tracechtype\fR, |
| 46 | \fB_tracechtype2\fR, |
| 47 | \fB_tracemouse\fR, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 48 | \fBtrace\fR \- \fBcurses\fR debugging routines |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 49 | .ad |
| 50 | .hy |
| 51 | .SH SYNOPSIS |
| 52 | \fB#include <curses.h>\fR |
| 53 | .sp |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 54 | \fBvoid _tracef(const char *\fP\fIformat\fP\fB, ...);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 55 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 56 | \fBvoid _tracedump(const char *\fP\fIlabel\fP\fB, WINDOW *\fP\fIwin\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 57 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 58 | \fBchar *_traceattr(attr_t \fP\fIattr\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 59 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 60 | \fBchar *_traceattr2(int \fP\fIbuffer\fP\fB, chtype \fP\fIch\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 61 | .br |
| 62 | \fBchar *_nc_tracebits(void);\fR |
| 63 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 64 | \fBchar * _tracecchar_t(const cchar_t *\fP\fIstring\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 65 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 66 | \fBchar * _tracecchar_t2(int \fP\fIbuffer\fP\fB, const cchar_t *\fP\fIstring\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 67 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 68 | \fBchar *_tracechar(int \fP\fIch\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 69 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 70 | \fBchar *_tracechtype(chtype \fP\fIch\fP\fB);\fR |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 71 | .br |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 81 | e.g., \fIlibncurses_g.a\fR, but may be compiled into any model (shared, static, |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 82 | profile) by defining the symbol \fBTRACE\fR. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 83 | Additionally, some functions are only available with the wide-character |
| 84 | configuration of the libraries. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 85 | .PP |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 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. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 91 | .PP |
| 92 | Calling \fBtrace\fR with a nonzero parameter opens the file \fBtrace\fR |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 93 | in the current directory for output. |
| 94 | The parameter is formed by OR'ing |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 95 | values from the list of \fBTRACE_\fP\fIxxx\fR definitions in \fB<curses.h>\fR. |
| 96 | These include: |
| 97 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 98 | .B TRACE_DISABLE |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 99 | turn off tracing. |
| 100 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 101 | .B TRACE_TIMES |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 102 | trace user and system times of updates. |
| 103 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 104 | .B TRACE_TPUTS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 105 | trace tputs calls. |
| 106 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 107 | .B TRACE_UPDATE |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 108 | trace update actions, old & new screens. |
| 109 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 110 | .B TRACE_MOVE |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 111 | trace cursor movement and scrolling. |
| 112 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 113 | .B TRACE_CHARPUT |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 114 | trace all character outputs. |
| 115 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 116 | .B TRACE_ORDINARY |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 121 | .B TRACE_CALLS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 122 | trace all curses calls. |
| 123 | The parameters for each call are traced, as well as return values. |
| 124 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 125 | .B TRACE_VIRTPUT |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 126 | trace virtual character puts, i.e., calls to \fBaddch\fR. |
| 127 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 128 | .B TRACE_IEVENT |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 129 | trace low-level input processing, including timeouts. |
| 130 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 131 | .B TRACE_BITS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 132 | trace state of TTY control bits. |
| 133 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 134 | .B TRACE_ICALLS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 135 | trace internal/nested calls. |
| 136 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 137 | .B TRACE_CCALLS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 138 | trace per-character calls. |
| 139 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 140 | .B TRACE_DATABASE |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 141 | trace read/write of terminfo/termcap data. |
| 142 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 143 | .B TRACE_ATTRS |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 144 | trace changes to video attributes and colors. |
| 145 | .TP 5 |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 146 | .B TRACE_MAXIMUM |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 147 | maximum trace level, enables all of the separate trace features. |
| 148 | .PP |
| 149 | Some tracing features are enabled whenever the \fBtrace\fR parameter |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 150 | is nonzero. |
| 151 | Some features overlap. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 152 | The specific names are used as a guideline. |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 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 |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 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). |