1curs_trace(3X)                                                  curs_trace(3X)
2
3
4

NAME

6       trace, _tracef, _traceattr, _traceattr2, _tracecchar_t, _tracecchar_t2,
7       _tracechar, _tracechtype, _tracechtype2, _nc_tracebits, _tracedump,
8       _tracemouse - curses debugging routines
9

SYNOPSIS

11       #include <curses.h>
12
13       void trace(const unsigned int param);
14
15       void _tracef(const char *format, ...);
16
17       char *_traceattr(attr_t attr);
18       char *_traceattr2(int buffer, chtype ch);
19       char *_tracecchar_t(const cchar_t *string);
20       char *_tracecchar_t2(int buffer, const cchar_t *string);
21       char *_tracechar(int ch);
22       char *_tracechtype(chtype ch);
23       char *_tracechtype2(int buffer, chtype ch);
24
25       void _tracedump(const char *label, WINDOW *win);
26       char *_nc_tracebits(void);
27       char *_tracemouse(const MEVENT *event);
28

DESCRIPTION

30       The  trace  routines  are  used for debugging the ncurses libraries, as
31       well as applications which use the ncurses libraries.  These  functions
32       are  normally available only with the debugging library e.g., libncurs‐
33       es_g.a, but may be compiled into any model (shared, static, profile) by
34       defining  the  symbol  TRACE.   Additionally,  some  functions are only
35       available with the wide-character configuration of the libraries.
36
37   Functions
38       The principal parts of this interface are
39
40       ·   trace, which selectively enables different tracing features, and
41
42       ·   _tracef, which writes formatted data to the trace file.
43
44       Calling trace with a nonzero parameter creates the file  trace  in  the
45       current  directory  for output.  If the file already exists, no tracing
46       is done.
47
48       The other functions either return a pointer to a string-area (allocated
49       by the corresponding function), or return no value (such as _tracedump,
50       which implements the screen dump for TRACE_UPDATE).  The caller  should
51       not  free  these  strings, since the allocation is reused on successive
52       calls.  To work around the problem of a single  string-area  per  func‐
53       tion,  some use a buffer-number parameter, telling the library to allo‐
54       cate additional string-areas.
55
56   Trace Parameter
57       The trace parameter is  formed  by  OR'ing  values  from  the  list  of
58       TRACE_xxx definitions in <curses.h>.  These include:
59
60       TRACE_DISABLE
61            turn off tracing by passing a zero parameter.
62
63            The  library flushes the output file, but retains an open file-de‐
64            scriptor to the trace file so that it can resume tracing later  if
65            a nonzero parameter is passed to the trace function.
66
67       TRACE_TIMES
68            trace user and system times of updates.
69
70       TRACE_TPUTS
71            trace tputs(3X) calls.
72
73       TRACE_UPDATE
74            trace update actions, old & new screens.
75
76       TRACE_MOVE
77            trace cursor movement and scrolling.
78
79       TRACE_CHARPUT
80            trace all character outputs.
81
82       TRACE_ORDINARY
83            trace  all  update  actions.   The old and new screen contents are
84            written to the trace file for each refresh.
85
86       TRACE_CALLS
87            trace all curses calls.  The parameters for each call are  traced,
88            as well as return values.
89
90       TRACE_VIRTPUT
91            trace virtual character puts, i.e., calls to addch.
92
93       TRACE_IEVENT
94            trace low-level input processing, including timeouts.
95
96       TRACE_BITS
97            trace state of TTY control bits.
98
99       TRACE_ICALLS
100            trace internal/nested calls.
101
102       TRACE_CCALLS
103            trace per-character calls.
104
105       TRACE_DATABASE
106            trace read/write of terminfo/termcap data.
107
108       TRACE_ATTRS
109            trace changes to video attributes and colors.
110
111       TRACE_MAXIMUM
112            maximum trace level, enables all of the separate trace features.
113
114       Some  tracing  features  are  enabled  whenever  the trace parameter is
115       nonzero.  Some features overlap.  The specific  names  are  used  as  a
116       guideline.
117
118   Initialization
119       These  functions  check  the NCURSES_TRACE environment variable, to set
120       the tracing feature as if trace was called:
121
122           filter, initscr, new_prescr, newterm, nofilter, restartterm,
123           ripoffline, setupterm, slk_init, tgetent, use_env,
124           use_extended_names, use_tioctl
125
126   Command-line Utilities
127       The command-line utilities such as  tic(1)  provide  a  verbose  option
128       which  extends  the  set  of messages written using the trace function.
129       Both of these (-v and trace) use the same variable (_nc_tracing), which
130       determines the messages which are written.
131
132       Because  the  command-line  utilities may call initialization functions
133       such as setupterm, tgetent or use_extended_names, some of their  debug‐
134       ging  output may be directed to the trace file if the NCURSES_TRACE en‐
135       vironment variable is set:
136
137       ·   messages produced in the utility are written to the standard error.
138
139       ·   messages produced by the underlying library are written to trace.
140
141       If ncurses is built without tracing, none of the latter  are  produced,
142       and fewer diagnostics are provided by the command-line utilities.
143

RETURN VALUE

145       Routines  which return a value are designed to be used as parameters to
146       the _tracef routine.
147

PORTABILITY

149       These functions are not part of the XSI interface.  Some  other  curses
150       implementations  are  known to have similar, undocumented features, but
151       they are not compatible with ncurses.
152
153       A few functions are not provided when symbol versioning is used:
154
155           _nc_tracebits, _tracedump, _tracemouse
156

SEE ALSO

158       curses(3X).
159
160
161
162                                                                curs_trace(3X)
Impressum