]> git.ipfire.org Git - thirdparty/cups.git/blame - scheduler/notify.h
Mirror 1.1.x changes.
[thirdparty/cups.git] / scheduler / notify.h
CommitLineData
294f4cee 1/*
bcd9e019 2 * "$Id: notify.h,v 1.1.2.2 2004/08/23 18:01:56 mike Exp $"
294f4cee 3 *
4 * Notification definitions for the Common UNIX Printing System (CUPS)
5 * scheduler.
6 *
7 * Copyright 1997-2004 by Easy Software Products, all rights reserved.
8 *
9 * These coded instructions, statements, and computer programs are the
10 * property of Easy Software Products and are protected by Federal
11 * copyright law. Distribution and use rights are outlined in the file
12 * "LICENSE.txt" which should have been included with this file. If this
13 * file is missing or damaged please contact Easy Software Products
14 * at:
15 *
16 * Attn: CUPS Licensing Information
17 * Easy Software Products
18 * 44141 Airport View Drive, Suite 204
bcd9e019 19 * Hollywood, Maryland 20636 USA
294f4cee 20 *
21 * Voice: (301) 373-9600
22 * EMail: cups-info@cups.org
23 * WWW: http://www.cups.org
24 */
25
26
27/*
28 * Event mask constants...
29 */
30
31enum
32{
33 /* Standard IPP notifications */
34 CUPSD_EVENT_IPP_PRINTER_STATE_CHANGED = 0x00000007,
35 CUPSD_EVENT_IPP_PRINTER_RESTARTED = 0x00000001,
36 CUPSD_EVENT_IPP_PRINTER_SHUTDOWN = 0x00000002,
37 CUPSD_EVENT_IPP_PRINTER_STOPPED = 0x00000004,
38 CUPSD_EVENT_IPP_PRINTER_CONFIG_CHANGED = 0x000000018,
39 CUPSD_EVENT_IPP_PRINTER_MEDIA_CHANGED = 0x00000008,
40 CUPSD_EVENT_IPP_PRINTER_FINISHINGS_CHANGED = 0x00000010,
41 CUPSD_EVENT_IPP_PRINTER_QUEUE_ORDER_CHANGED = 0x00000020,
42 CUPSD_EVENT_IPP_JOB_STATE_CHANGED = 0x000001c0,
43 CUPSD_EVENT_IPP_JOB_CREATED = 0x00000040,
44 CUPSD_EVENT_IPP_JOB_COMPLETED = 0x00000080,
45 CUPSD_EVENT_IPP_JOB_STOPPED = 0x00000100,
46 CUPSD_EVENT_IPP_JOB_CONFIG_CHANGED = 0x00000200,
47 CUPSD_EVENT_IPP_JOB_PROGRESS = 0x00000400,
48
49 /* CUPS event extensions */
50 CUPSD_EVENT_CUPS_QUEUE = 0x003f0000,
51 CUPSD_EVENT_CUPS_QUEUE_ADDED = 0x00030000,
52 CUPSD_EVENT_CUPS_PRINTER_ADDED = 0x00010000,
53 CUPSD_EVENT_CUPS_CLASS_ADDED = 0x00020000,
54 CUPSD_EVENT_CUPS_QUEUE_CHANGED = 0x000c0000,
55 CUPSD_EVENT_CUPS_PRINTER_CHANGED = 0x00040000,
56 CUPSD_EVENT_CUPS_CLASS_CHANGED = 0x00080000,
57 CUPSD_EVENT_CUPS_QUEUE_DELETED = 0x00300000,
58 CUPSD_EVENT_CUPS_PRINTER_DELETED = 0x00100000,
59 CUPSD_EVENT_CUPS_CLASS_DELETED = 0x00200000,
60 CUPSD_EVENT_CUPS_JOB_MOVED = 0x00400000,
61 CUPSD_EVENT_CUPS_DEVICE = 0x03800000,
62 CUPSD_EVENT_CUPS_DEVICE_ADDED = 0x00800000,
63 CUPSD_EVENT_CUPS_DEVICE_CHANGED = 0x01000000,
64 CUPSD_EVENT_CUPS_DEVICE_DELETED = 0x02000000,
65 CUPSD_EVENT_CUPS_OPERATION = 0x04000000
66};
67
68
69/*
70 * Types and structures...
71 */
72
73typedef struct cupsd_subscription_str /**** Subscription object ****/
74{
75 struct cupsd_subscription_str *next; /* Pointer to next subscription */
76 int id; /* subscription-id */
77 unsigned mask; /* Event mask */
78 ipp_t *attrs; /* Subscription attributes */
79 int job_id; /* Subscription Job ID */
80 char *dest; /* Subscription printer/class */
81 cups_ptype_t dtype; /* Type of destination */
82 char *recipient; /* Recipient of subscription */
83 int pid; /* PID of notifier process */
84 int notify_pipe; /* Pipe to process */
85 int status_pipe; /* Pipe from process */
86 int status; /* Exit status of notifier */
87 char *buffer; /* Status buffer */
88 int bufused; /* Amount of buffer in use */
89 time_t last_time; /* Time of last notification */
90} cupsd_subscription_t;
91
92typedef struct cupsd_event_str /**** Event object ****/
93{
94 struct cupsd_event_str *next; /* Pointer to next event */
95 int id; /* event-id */
96 time_t event_time; /* event-time */
97 ipp_t *attrs; /* Event attributes */
98 unsigned mask; /* Event mask */
99 int job_id; /* Event job ID */
100 char *dest; /* Event printer/class */
101 cups_ptype_t dtype; /* Type of destination */
102} cupsd_event_t;
103
104
105/*
106 * Globals...
107 */
108
109
110VAR int NumEvents VALUE(0),
111 /* Number of active events */
112 MaxEvents VALUE(100);
113 /* Maximum number of events to hold */
114VAR cupsd_event_t *Events VALUE(NULL),
115 /* List of events */
116 *LastEvent VALUE(NULL);
117 /* Last event in list */
118
119VAR int MaxSubscriptions VALUE(100),
120 /* Maximum number of subscriptions */
121 MaxSubscriptionsPerUser VALUE(0),
122 /* Maximum subscriptions per user */
123 MaxSubscriptionsPerPrinter VALUE(0),
124 /* Maximum subscriptions per printer */
125 MaxSubscriptionsPerJob VALUE(0),
126 /* Maximum subscriptions per job */
127 NumSubscriptions VALUE(0);
128 /* Number of subscriptions */
129VAR cupsd_subscription_t *Subscriptions VALUE(NULL),
130 /* List of subscriptions */
131 *LastSubcription VALUE(NULL);
132 /* Last subscription in list */
133
134
135/*
bcd9e019 136 * End of "$Id: notify.h,v 1.1.2.2 2004/08/23 18:01:56 mike Exp $".
294f4cee 137 */