1 /* 2 * System management definitions for the CUPS scheduler. 3 * 4 * Copyright © 2020-2024 by OpenPrinting. 5 * Copyright 2007-2017 by Apple Inc. 6 * Copyright 2006 by Easy Software Products. 7 * 8 * Licensed under Apache License v2.0. See the file "LICENSE" for more information. 9 */ 10 11 /* 12 * Constants... 13 */ 14 15 #define CUPSD_DIRTY_NONE 0 /* Nothing is dirty */ 16 #define CUPSD_DIRTY_PRINTERS 1 /* printers.conf is dirty */ 17 #define CUPSD_DIRTY_CLASSES 2 /* classes.conf is dirty */ 18 #define CUPSD_DIRTY_PRINTCAP 4 /* printcap is dirty */ 19 #define CUPSD_DIRTY_JOBS 8 /* jobs.cache or "c" file(s) are dirty */ 20 #define CUPSD_DIRTY_SUBSCRIPTIONS 16 /* subscriptions.conf is dirty */ 21 22 23 /* 24 * Globals... 25 */ 26 27 VAR int DirtyFiles VALUE(CUPSD_DIRTY_NONE), 28 /* What files are dirty? */ 29 DirtyCleanInterval VALUE(DEFAULT_KEEPALIVE); 30 /* How often do we write dirty files? */ 31 VAR time_t DirtyCleanTime VALUE(0); 32 /* When to clean dirty files next */ 33 VAR int ACPower VALUE(-1), 34 /* Is the system on AC power? */ 35 Sleeping VALUE(0); 36 /* Non-zero if machine is entering or * 37 * in a sleep state... */ 38 VAR time_t SleepJobs VALUE(0); 39 /* Time when all jobs must be * 40 * canceled for system sleep. */ 41 #ifdef __APPLE__ 42 VAR int SysEventPipes[2] VALUE2(-1,-1); 43 /* System event notification pipes */ 44 #endif /* __APPLE__ */ 45 46 47 /* 48 * Prototypes... 49 */ 50 51 extern void cupsdAllowSleep(void); 52 extern void cupsdCleanDirty(void); 53 extern void cupsdMarkDirty(int what); 54 extern void cupsdSetBusyState(int working); 55 extern void cupsdStartSystemMonitor(void); 56 extern void cupsdStopSystemMonitor(void); 57