Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 1 | <!-- |
| 2 | **************************************************************************** |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 3 | * Copyright (c) 2000-2010,2015 Free Software Foundation, Inc. * |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 4 | * * |
| 5 | * Permission is hereby granted, free of charge, to any person obtaining a * |
| 6 | * copy of this software and associated documentation files (the * |
| 7 | * "Software"), to deal in the Software without restriction, including * |
| 8 | * without limitation the rights to use, copy, modify, merge, publish, * |
| 9 | * distribute, distribute with modifications, sublicense, and/or sell * |
| 10 | * copies of the Software, and to permit persons to whom the Software is * |
| 11 | * furnished to do so, subject to the following conditions: * |
| 12 | * * |
| 13 | * The above copyright notice and this permission notice shall be included * |
| 14 | * in all copies or substantial portions of the Software. * |
| 15 | * * |
| 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * |
| 17 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * |
| 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * |
| 19 | * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * |
| 20 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * |
| 21 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * |
| 22 | * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * |
| 23 | * * |
| 24 | * Except as contained in this notice, the name(s) of the above copyright * |
| 25 | * holders shall not be used in advertising or otherwise to promote the * |
| 26 | * sale, use or other dealings in this Software without prior written * |
| 27 | * authorization. * |
| 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 @ |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 30 | --> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 31 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 32 | <HTML> |
| 33 | <HEAD> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 34 | <meta http-equiv="Content-Type" content="text/html; charset=us-ascii"> |
| 35 | <meta name="generator" content="Manpage converted by man2html - see http://invisible-island.net/scripts/readme.html#others_scripts"> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 36 | <TITLE>curs_trace 3x</TITLE> |
| 37 | <link rev=made href="mailto:bug-ncurses@gnu.org"> |
| 38 | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
| 39 | </HEAD> |
| 40 | <BODY> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 41 | <H1 class="no-header">curs_trace 3x</H1> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 42 | <PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 43 | <STRONG><A HREF="curs_trace.3x.html">curs_trace(3x)</A></STRONG> <STRONG><A HREF="curs_trace.3x.html">curs_trace(3x)</A></STRONG> |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 49 | <H2><a name="h2-NAME">NAME</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 50 | <STRONG>_tracef</STRONG>, <STRONG>_tracedump</STRONG>, <STRONG>_traceattr</STRONG>, <STRONG>_traceattr2</STRONG>, |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 51 | <STRONG>_nc_tracebits</STRONG>, <STRONG>_tracecchar_t</STRONG>, <STRONG>_tracecchar_t2</STRONG>, <STRONG>_tracechar</STRONG>, |
| 52 | <STRONG>_tracechtype</STRONG>, <STRONG>_tracechtype2</STRONG>, <STRONG>_tracemouse</STRONG>, <STRONG>trace</STRONG> - <STRONG>curses</STRONG> |
| 53 | debugging routines |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 54 | |
| 55 | |
| 56 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 57 | <H2><a name="h2-SYNOPSIS">SYNOPSIS</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 58 | <STRONG>#include</STRONG> <STRONG><curses.h></STRONG> |
| 59 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 60 | <STRONG>void</STRONG> <STRONG>_tracef(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>format</EM><STRONG>,</STRONG> <STRONG>...);</STRONG> |
| 61 | <STRONG>void</STRONG> <STRONG>_tracedump(const</STRONG> <STRONG>char</STRONG> <STRONG>*</STRONG><EM>label</EM><STRONG>,</STRONG> <STRONG>WINDOW</STRONG> <STRONG>*</STRONG><EM>win</EM><STRONG>);</STRONG> |
| 62 | <STRONG>char</STRONG> <STRONG>*_traceattr(attr_t</STRONG> <EM>attr</EM><STRONG>);</STRONG> |
| 63 | <STRONG>char</STRONG> <STRONG>*_traceattr2(int</STRONG> <EM>buffer</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 64 | <STRONG>char</STRONG> <STRONG>*_nc_tracebits(void);</STRONG> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 65 | <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>_tracecchar_t(const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>string</EM><STRONG>);</STRONG> |
| 66 | <STRONG>char</STRONG> <STRONG>*</STRONG> <STRONG>_tracecchar_t2(int</STRONG> <EM>buffer</EM><STRONG>,</STRONG> <STRONG>const</STRONG> <STRONG>cchar_t</STRONG> <STRONG>*</STRONG><EM>string</EM><STRONG>);</STRONG> |
| 67 | <STRONG>char</STRONG> <STRONG>*_tracechar(int</STRONG> <EM>ch</EM><STRONG>);</STRONG> |
| 68 | <STRONG>char</STRONG> <STRONG>*_tracechtype(chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG> |
| 69 | <STRONG>char</STRONG> <STRONG>*_tracechtype2(int</STRONG> <EM>buffer</EM><STRONG>,</STRONG> <STRONG>chtype</STRONG> <EM>ch</EM><STRONG>);</STRONG> |
| 70 | <STRONG>char</STRONG> <STRONG>*_tracemouse(const</STRONG> <STRONG>MEVENT</STRONG> <STRONG>*</STRONG><EM>event</EM><STRONG>);</STRONG> |
| 71 | <STRONG>void</STRONG> <STRONG>trace(const</STRONG> <STRONG>unsigned</STRONG> <STRONG>int</STRONG> <EM>param</EM><STRONG>);</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 72 | |
| 73 | |
| 74 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 75 | <H2><a name="h2-DESCRIPTION">DESCRIPTION</a></H2><PRE> |
| 76 | The <STRONG>trace</STRONG> routines are used for debugging the ncurses li- |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 77 | braries, as well as applications which use the ncurses li- |
| 78 | braries. These functions are normally available only with |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 79 | the debugging library e.g., <EM>libncurses</EM><STRONG>_</STRONG><EM>g.a</EM>, but may be |
| 80 | compiled into any model (shared, static, profile) by |
| 81 | defining the symbol <STRONG>TRACE</STRONG>. Additionally, some functions |
| 82 | are only available with the wide-character configuration |
| 83 | of the libraries. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 84 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 85 | The principal parts of this interface are |
| 86 | |
| 87 | <STRONG>o</STRONG> <STRONG>trace</STRONG>, which selectively enables different tracing |
| 88 | features, and |
| 89 | |
| 90 | <STRONG>o</STRONG> <STRONG>_tracef</STRONG>, which writes formatted data to the <EM>trace</EM> |
| 91 | file. |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 92 | |
| 93 | Calling <STRONG>trace</STRONG> with a nonzero parameter opens the file |
| 94 | <STRONG>trace</STRONG> in the current directory for output. The parameter |
| 95 | is formed by OR'ing values from the list of <STRONG>TRACE_</STRONG><EM>xxx</EM> def- |
| 96 | initions in <STRONG><curses.h></STRONG>. These include: |
| 97 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 98 | <STRONG>TRACE_DISABLE</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 99 | turn off tracing. |
| 100 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 101 | <STRONG>TRACE_TIMES</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 102 | trace user and system times of updates. |
| 103 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 104 | <STRONG>TRACE_TPUTS</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 105 | trace tputs calls. |
| 106 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 107 | <STRONG>TRACE_UPDATE</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 108 | trace update actions, old & new screens. |
| 109 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 110 | <STRONG>TRACE_MOVE</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 111 | trace cursor movement and scrolling. |
| 112 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 113 | <STRONG>TRACE_CHARPUT</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 114 | trace all character outputs. |
| 115 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 116 | <STRONG>TRACE_ORDINARY</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 117 | trace all update actions. The old and new screen |
| 118 | contents are written to the trace file for each re- |
| 119 | fresh. |
| 120 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 121 | <STRONG>TRACE_CALLS</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 122 | trace all curses calls. The parameters for each call |
| 123 | are traced, as well as return values. |
| 124 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 125 | <STRONG>TRACE_VIRTPUT</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 126 | trace virtual character puts, i.e., calls to <STRONG>addch</STRONG>. |
| 127 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 128 | <STRONG>TRACE_IEVENT</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 129 | trace low-level input processing, including timeouts. |
| 130 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 131 | <STRONG>TRACE_BITS</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 132 | trace state of TTY control bits. |
| 133 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 134 | <STRONG>TRACE_ICALLS</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 135 | trace internal/nested calls. |
| 136 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 137 | <STRONG>TRACE_CCALLS</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 138 | trace per-character calls. |
| 139 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 140 | <STRONG>TRACE_DATABASE</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 141 | trace read/write of terminfo/termcap data. |
| 142 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 143 | <STRONG>TRACE_ATTRS</STRONG> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 144 | trace changes to video attributes and colors. |
| 145 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 146 | <STRONG>TRACE_MAXIMUM</STRONG> |
| 147 | maximum trace level, enables all of the separate |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 148 | trace features. |
| 149 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 150 | Some tracing features are enabled whenever the <STRONG>trace</STRONG> pa- |
| 151 | rameter is nonzero. Some features overlap. The specific |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 152 | names are used as a guideline. |
| 153 | |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 154 | The other functions either return a pointer to a string- |
| 155 | area (allocated by the corresponding function), or return |
| 156 | no value (such as <STRONG>_tracedump</STRONG>, which implements the screen |
| 157 | dump for <STRONG>TRACE_UPDATE</STRONG>). The caller should not free these |
| 158 | strings, since the allocation is reused on successive |
| 159 | calls. To work around the problem of a single string-area |
| 160 | per function, some use a buffer-number parameter, telling |
| 161 | the library to allocate additional string-areas. |
| 162 | |
| 163 | These functions check the <STRONG>NCURSES_TRACE</STRONG> environment vari- |
| 164 | able, to set the tracing feature as if <STRONG>trace</STRONG> was called: |
| 165 | |
| 166 | filter, initscr, new_prescr, newterm, nofilter, |
| 167 | restartterm, ripoffline, setupterm, slk_init, tge- |
| 168 | tent, use_env, use_extended_names, use_tioctl |
| 169 | |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 170 | |
| 171 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 172 | <H2><a name="h2-RETURN-VALUE">RETURN VALUE</a></H2><PRE> |
| 173 | Routines which return a value are designed to be used as |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 174 | parameters to the <STRONG>_tracef</STRONG> routine. |
| 175 | |
| 176 | |
| 177 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 178 | <H2><a name="h2-PORTABILITY">PORTABILITY</a></H2><PRE> |
| 179 | These functions are not part of the XSI interface. Some |
| 180 | other curses implementations are known to have similar, |
| 181 | undocumented features, but they are not compatible with |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 182 | ncurses. |
| 183 | |
| 184 | |
| 185 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 186 | <H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 187 | <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>. |
| 188 | |
| 189 | |
| 190 | |
| 191 | <STRONG><A HREF="curs_trace.3x.html">curs_trace(3x)</A></STRONG> |
| 192 | </PRE> |
Steve Kondik | ae271bc | 2015-11-15 02:50:53 +0100 | [diff] [blame] | 193 | <div class="nav"> |
| 194 | <ul> |
| 195 | <li><a href="#h2-NAME">NAME</a></li> |
| 196 | <li><a href="#h2-SYNOPSIS">SYNOPSIS</a></li> |
| 197 | <li><a href="#h2-DESCRIPTION">DESCRIPTION</a></li> |
| 198 | <li><a href="#h2-RETURN-VALUE">RETURN VALUE</a></li> |
| 199 | <li><a href="#h2-PORTABILITY">PORTABILITY</a></li> |
| 200 | <li><a href="#h2-SEE-ALSO">SEE ALSO</a></li> |
| 201 | </ul> |
| 202 | </div> |
Amit Daniel Kachhap | e6a01f5 | 2011-07-20 11:45:59 +0530 | [diff] [blame] | 203 | </BODY> |
| 204 | </HTML> |