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