1 /*
2  * Private debugging APIs for CUPS.
3  *
4  * Copyright © 2007-2018 by Apple Inc.
5  * Copyright © 1997-2005 by Easy Software Products.
6  *
7  * Licensed under Apache License v2.0.  See the file "LICENSE" for more
8  * information.
9  */
10 
11 #ifndef _CUPS_DEBUG_PRIVATE_H_
12 #  define _CUPS_DEBUG_PRIVATE_H_
13 
14 
15 /*
16  * Include necessary headers...
17  */
18 
19 #  include <cups/versioning.h>
20 
21 
22 /*
23  * C++ magic...
24  */
25 
26 #  ifdef __cplusplus
27 extern "C" {
28 #  endif /* __cplusplus */
29 
30 
31 /*
32  * The debug macros are used if you compile with DEBUG defined.
33  *
34  * Usage:
35  *
36  *   DEBUG_set("logfile", "level", "filter", 1)
37  *
38  * The DEBUG_set macro allows an application to programmatically enable (or
39  * disable) debug logging.  The arguments correspond to the CUPS_DEBUG_LOG,
40  * CUPS_DEBUG_LEVEL, and CUPS_DEBUG_FILTER environment variables.  The 1 on the
41  * end forces the values to override the environment.
42  */
43 
44 #  ifdef DEBUG
45 #    define DEBUG_set(logfile,level,filter) _cups_debug_set(logfile,level,filter,1)
46 #  else
47 #    define DEBUG_set(logfile,level,filter)
48 #  endif /* DEBUG */
49 
50 
51 /*
52  * Prototypes...
53  */
54 
55 extern void	_cups_debug_set(const char *logfile, const char *level, const char *filter, int force) _CUPS_PRIVATE;
56 #  ifdef _WIN32
57 extern int	_cups_gettimeofday(struct timeval *tv, void *tz) _CUPS_PRIVATE;
58 #    define gettimeofday(a,b) _cups_gettimeofday(a, b)
59 #  endif /* _WIN32 */
60 
61 #  ifdef __cplusplus
62 }
63 #  endif /* __cplusplus */
64 
65 #endif /* !_CUPS_DEBUG_PRIVATE_H_ */
66