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