trace.h revision 956cc18d
1/* $XTermId: trace.h,v 1.47 2009/06/17 09:24:31 tom Exp $ */
2
3/************************************************************
4
5Copyright 1997-2008,2009 by Thomas E. Dickey
6
7                        All Rights Reserved
8
9Permission to use, copy, modify, and distribute this software and its
10documentation for any purpose and without fee is hereby granted,
11provided that the above copyright notice appear in all copies and that
12both that copyright notice and this permission notice appear in
13supporting documentation, and that the name of the above listed
14copyright holder(s) not be used in advertising or publicity pertaining
15to distribution of the software without specific, written prior
16permission.
17
18THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD
19TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
20AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE
21LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
22WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
23ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
24OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
25
26********************************************************/
27
28/*
29 * Common/useful definitions for XTERM application
30 */
31#ifndef	included_trace_h
32#define	included_trace_h
33
34#include <xterm.h>
35
36#if OPT_TRACE
37
38extern	void	Trace ( const char *, ... )
39#ifdef GCC_PRINTF
40	__attribute__ ((format(printf,1,2)))
41#endif
42	;
43#undef  TRACE
44#define TRACE(p) Trace p
45
46#if OPT_TRACE > 1
47#define TRACE2(p) Trace p
48#endif
49
50extern	char *	visibleChars (Char * /* buf */, unsigned /* len */);
51extern	char *	visibleIChar (IChar *, unsigned);
52extern	char *	visibleIChars (IChar * /* buf */, unsigned /* len */);
53extern	const char * visibleEventType (int);
54extern	const char * visibleSelectionTarget(Display * /* d */, Atom /* a */);
55extern	const char * visibleXError (int /* code */);
56extern  const char * visibleChrsetName(unsigned /* chrset */);
57
58extern	void	TraceArgv(const char * /* tag */, char ** /* argv */);
59#undef  TRACE_ARGV
60#define	TRACE_ARGV(tag,argv) TraceArgv(tag,argv)
61
62extern	char	*trace_who;
63#undef  TRACE_CHILD
64#define TRACE_CHILD int tracing_child = (trace_who = "child") != 0; (void) tracing_child;
65
66extern	void	TraceSizeHints(XSizeHints *);
67#undef  TRACE_HINTS
68#define	TRACE_HINTS(hints) TraceSizeHints(hints)
69
70extern	void	TraceIds(const char * /* fname */, int  /* lnum */);
71#undef  TRACE_IDS
72#define	TRACE_IDS TraceIds(__FILE__, __LINE__)
73
74extern	void	TraceOptions(OptionHelp * /* options */, XrmOptionDescRec * /* resources */, Cardinal  /* count */);
75#undef  TRACE_OPTS
76#define	TRACE_OPTS(opts,ress,lens) TraceOptions(opts,ress,lens)
77
78extern	void	TraceTranslations(const char *, Widget);
79#undef  TRACE_TRANS
80#define	TRACE_TRANS(name,w) TraceTranslations(name,w)
81
82extern	void	TraceWMSizeHints(XtermWidget);
83#undef  TRACE_WM_HINTS
84#define	TRACE_WM_HINTS(w) TraceWMSizeHints(w)
85
86extern	void	TraceXtermResources(void);
87#undef  TRACE_XRES
88#define	TRACE_XRES() TraceXtermResources()
89
90extern	int	TraceResizeRequest(const char * /* fn */, int  /* ln */, Widget  /* w */, Dimension  /* reqwide */, Dimension  /* reqhigh */, Dimension * /* gotwide */, Dimension * /* gothigh */);
91#undef  REQ_RESIZE
92#define REQ_RESIZE(w, reqwide, reqhigh, gotwide, gothigh) \
93	TraceResizeRequest(__FILE__, __LINE__, w, reqwide, reqhigh, gotwide, gothigh)
94
95#else
96
97#define REQ_RESIZE(w, reqwide, reqhigh, gotwide, gothigh) \
98	XtMakeResizeRequest((Widget) (w), \
99			    (Dimension) (reqwide), (Dimension) (reqhigh), \
100			    (gotwide), (gothigh))
101
102#endif
103
104#endif	/* included_trace_h */
105