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