trace.h revision 956cc18d
1956cc18dSsnj/* $XTermId: trace.h,v 1.47 2009/06/17 09:24:31 tom Exp $ */ 2d522f475Smrg 3d522f475Smrg/************************************************************ 4d522f475Smrg 5956cc18dSsnjCopyright 1997-2008,2009 by Thomas E. Dickey 6d522f475Smrg 7d522f475Smrg All Rights Reserved 8d522f475Smrg 9d522f475SmrgPermission to use, copy, modify, and distribute this software and its 10d522f475Smrgdocumentation for any purpose and without fee is hereby granted, 11d522f475Smrgprovided that the above copyright notice appear in all copies and that 12d522f475Smrgboth that copyright notice and this permission notice appear in 13d522f475Smrgsupporting documentation, and that the name of the above listed 14d522f475Smrgcopyright holder(s) not be used in advertising or publicity pertaining 15d522f475Smrgto distribution of the software without specific, written prior 16d522f475Smrgpermission. 17d522f475Smrg 18d522f475SmrgTHE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD 19d522f475SmrgTO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 20d522f475SmrgAND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE 21d522f475SmrgLIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 22d522f475SmrgWHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 23d522f475SmrgACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 24d522f475SmrgOR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 25d522f475Smrg 26d522f475Smrg********************************************************/ 27d522f475Smrg 28d522f475Smrg/* 29d522f475Smrg * Common/useful definitions for XTERM application 30d522f475Smrg */ 31d522f475Smrg#ifndef included_trace_h 32d522f475Smrg#define included_trace_h 33d522f475Smrg 34d522f475Smrg#include <xterm.h> 35d522f475Smrg 36d522f475Smrg#if OPT_TRACE 37d522f475Smrg 38d522f475Smrgextern void Trace ( const char *, ... ) 39d522f475Smrg#ifdef GCC_PRINTF 40d522f475Smrg __attribute__ ((format(printf,1,2))) 41d522f475Smrg#endif 42d522f475Smrg ; 43956cc18dSsnj#undef TRACE 44d522f475Smrg#define TRACE(p) Trace p 45d522f475Smrg 46d522f475Smrg#if OPT_TRACE > 1 47d522f475Smrg#define TRACE2(p) Trace p 48d522f475Smrg#endif 49d522f475Smrg 50956cc18dSsnjextern char * visibleChars (Char * /* buf */, unsigned /* len */); 51d522f475Smrgextern char * visibleIChar (IChar *, unsigned); 52956cc18dSsnjextern char * visibleIChars (IChar * /* buf */, unsigned /* len */); 53d522f475Smrgextern const char * visibleEventType (int); 54956cc18dSsnjextern const char * visibleSelectionTarget(Display * /* d */, Atom /* a */); 55d522f475Smrgextern const char * visibleXError (int /* code */); 56956cc18dSsnjextern const char * visibleChrsetName(unsigned /* chrset */); 57d522f475Smrg 58d522f475Smrgextern void TraceArgv(const char * /* tag */, char ** /* argv */); 59956cc18dSsnj#undef TRACE_ARGV 60d522f475Smrg#define TRACE_ARGV(tag,argv) TraceArgv(tag,argv) 61d522f475Smrg 62d522f475Smrgextern char *trace_who; 63956cc18dSsnj#undef TRACE_CHILD 64d522f475Smrg#define TRACE_CHILD int tracing_child = (trace_who = "child") != 0; (void) tracing_child; 65d522f475Smrg 66d522f475Smrgextern void TraceSizeHints(XSizeHints *); 67956cc18dSsnj#undef TRACE_HINTS 68d522f475Smrg#define TRACE_HINTS(hints) TraceSizeHints(hints) 69d522f475Smrg 702eaa94a1Schristosextern void TraceIds(const char * /* fname */, int /* lnum */); 71956cc18dSsnj#undef TRACE_IDS 72d522f475Smrg#define TRACE_IDS TraceIds(__FILE__, __LINE__) 73d522f475Smrg 742eaa94a1Schristosextern void TraceOptions(OptionHelp * /* options */, XrmOptionDescRec * /* resources */, Cardinal /* count */); 75956cc18dSsnj#undef TRACE_OPTS 76d522f475Smrg#define TRACE_OPTS(opts,ress,lens) TraceOptions(opts,ress,lens) 77d522f475Smrg 78d522f475Smrgextern void TraceTranslations(const char *, Widget); 79956cc18dSsnj#undef TRACE_TRANS 80d522f475Smrg#define TRACE_TRANS(name,w) TraceTranslations(name,w) 81d522f475Smrg 82d522f475Smrgextern void TraceWMSizeHints(XtermWidget); 83956cc18dSsnj#undef TRACE_WM_HINTS 84d522f475Smrg#define TRACE_WM_HINTS(w) TraceWMSizeHints(w) 85d522f475Smrg 86d522f475Smrgextern void TraceXtermResources(void); 87956cc18dSsnj#undef TRACE_XRES 88d522f475Smrg#define TRACE_XRES() TraceXtermResources() 89d522f475Smrg 902eaa94a1Schristosextern int TraceResizeRequest(const char * /* fn */, int /* ln */, Widget /* w */, Dimension /* reqwide */, Dimension /* reqhigh */, Dimension * /* gotwide */, Dimension * /* gothigh */); 91956cc18dSsnj#undef REQ_RESIZE 922eaa94a1Schristos#define REQ_RESIZE(w, reqwide, reqhigh, gotwide, gothigh) \ 932eaa94a1Schristos TraceResizeRequest(__FILE__, __LINE__, w, reqwide, reqhigh, gotwide, gothigh) 942eaa94a1Schristos 952eaa94a1Schristos#else 962eaa94a1Schristos 972eaa94a1Schristos#define REQ_RESIZE(w, reqwide, reqhigh, gotwide, gothigh) \ 982eaa94a1Schristos XtMakeResizeRequest((Widget) (w), \ 992eaa94a1Schristos (Dimension) (reqwide), (Dimension) (reqhigh), \ 1002eaa94a1Schristos (gotwide), (gothigh)) 1012eaa94a1Schristos 102d522f475Smrg#endif 103d522f475Smrg 104d522f475Smrg#endif /* included_trace_h */ 105