xref: /OK3568_Linux_fs/external/xserver/hw/dmx/dmxlog.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /*
2*4882a593Smuzhiyun  * Copyright 2001 Red Hat Inc., Durham, North Carolina.
3*4882a593Smuzhiyun  *
4*4882a593Smuzhiyun  * All Rights Reserved.
5*4882a593Smuzhiyun  *
6*4882a593Smuzhiyun  * Permission is hereby granted, free of charge, to any person obtaining
7*4882a593Smuzhiyun  * a copy of this software and associated documentation files (the
8*4882a593Smuzhiyun  * "Software"), to deal in the Software without restriction, including
9*4882a593Smuzhiyun  * without limitation on the rights to use, copy, modify, merge,
10*4882a593Smuzhiyun  * publish, distribute, sublicense, and/or sell copies of the Software,
11*4882a593Smuzhiyun  * and to permit persons to whom the Software is furnished to do so,
12*4882a593Smuzhiyun  * subject to the following conditions:
13*4882a593Smuzhiyun  *
14*4882a593Smuzhiyun  * The above copyright notice and this permission notice (including the
15*4882a593Smuzhiyun  * next paragraph) shall be included in all copies or substantial
16*4882a593Smuzhiyun  * portions of the Software.
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19*4882a593Smuzhiyun  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20*4882a593Smuzhiyun  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21*4882a593Smuzhiyun  * NON-INFRINGEMENT.  IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
22*4882a593Smuzhiyun  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23*4882a593Smuzhiyun  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24*4882a593Smuzhiyun  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25*4882a593Smuzhiyun  * SOFTWARE.
26*4882a593Smuzhiyun  */
27*4882a593Smuzhiyun 
28*4882a593Smuzhiyun /*
29*4882a593Smuzhiyun  * Authors:
30*4882a593Smuzhiyun  *   Rickard E. (Rik) Faith <faith@redhat.com>
31*4882a593Smuzhiyun  *
32*4882a593Smuzhiyun  */
33*4882a593Smuzhiyun 
34*4882a593Smuzhiyun /** \file
35*4882a593Smuzhiyun  * This header is included by all files that need to use the DMX logging
36*4882a593Smuzhiyun  * facilities. */
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun #ifndef _DMXLOG_H_
39*4882a593Smuzhiyun #define _DMXLOG_H_
40*4882a593Smuzhiyun 
41*4882a593Smuzhiyun /** Logging levels -- output is tunable with #dmxSetLogLevel. */
42*4882a593Smuzhiyun typedef enum {
43*4882a593Smuzhiyun     dmxDebug,                   /**< Usually verbose debugging info */
44*4882a593Smuzhiyun     dmxInfo,                    /**< Non-warning information */
45*4882a593Smuzhiyun     dmxWarning,                 /**< A warning that may indicate DMX
46*4882a593Smuzhiyun                                  * will not function as the user
47*4882a593Smuzhiyun                                  * intends. */
48*4882a593Smuzhiyun     dmxError,                   /**< A non-fatal error that probably
49*4882a593Smuzhiyun                                  * indicates DMX will not function as
50*4882a593Smuzhiyun                                  * desired.*/
51*4882a593Smuzhiyun     dmxFatal                    /**< A fatal error that will cause DMX
52*4882a593Smuzhiyun                                  * to shut down. */
53*4882a593Smuzhiyun } dmxLogLevel;
54*4882a593Smuzhiyun 
55*4882a593Smuzhiyun /* Logging functions used by Xserver/hw/dmx routines. */
56*4882a593Smuzhiyun extern dmxLogLevel dmxSetLogLevel(dmxLogLevel newLevel);
57*4882a593Smuzhiyun extern dmxLogLevel dmxGetLogLevel(void);
58*4882a593Smuzhiyun extern void dmxLog(dmxLogLevel logLevel, const char *format,
59*4882a593Smuzhiyun                              ...) _X_ATTRIBUTE_PRINTF(2, 3);
60*4882a593Smuzhiyun extern void dmxLogCont(dmxLogLevel logLevel, const char *format,
61*4882a593Smuzhiyun                              ...) _X_ATTRIBUTE_PRINTF(2, 3);
62*4882a593Smuzhiyun extern const char *dmxEventName(int type);
63*4882a593Smuzhiyun 
64*4882a593Smuzhiyun #ifndef DMX_LOG_STANDALONE
65*4882a593Smuzhiyun extern void dmxLogOutput(DMXScreenInfo * dmxScreen, const char *format,
66*4882a593Smuzhiyun                              ...) _X_ATTRIBUTE_PRINTF(2, 3);
67*4882a593Smuzhiyun extern void dmxLogOutputCont(DMXScreenInfo * dmxScreen, const char *format,
68*4882a593Smuzhiyun                              ...) _X_ATTRIBUTE_PRINTF(2, 3);
69*4882a593Smuzhiyun extern void dmxLogOutputWarning(DMXScreenInfo * dmxScreen, const char *format,
70*4882a593Smuzhiyun                              ...) _X_ATTRIBUTE_PRINTF(2, 3);
71*4882a593Smuzhiyun extern void dmxLogInput(DMXInputInfo * dmxInput, const char *format,
72*4882a593Smuzhiyun                              ...) _X_ATTRIBUTE_PRINTF(2, 3);
73*4882a593Smuzhiyun extern void dmxLogInputCont(DMXInputInfo * dmxInput, const char *format,
74*4882a593Smuzhiyun                              ...) _X_ATTRIBUTE_PRINTF(2, 3);
75*4882a593Smuzhiyun extern void dmxLogArgs(dmxLogLevel logLevel, int argc, char **argv);
76*4882a593Smuzhiyun extern void dmxLogVisual(DMXScreenInfo * dmxScreen, XVisualInfo * vi,
77*4882a593Smuzhiyun                          int defaultVisual);
78*4882a593Smuzhiyun extern const char *dmxXInputEventName(int type);
79*4882a593Smuzhiyun #endif
80*4882a593Smuzhiyun 
81*4882a593Smuzhiyun #endif
82