2 * "$Id: notify.h,v 1.1.2.1 2004/07/02 19:12:48 mike Exp $"
4 * Notification definitions for the Common UNIX Printing System (CUPS)
7 * Copyright 1997-2004 by Easy Software Products, all rights reserved.
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
16 * Attn: CUPS Licensing Information
17 * Easy Software Products
18 * 44141 Airport View Drive, Suite 204
19 * Hollywood, Maryland 20636-3142 USA
21 * Voice: (301) 373-9600
22 * EMail: cups-info@cups.org
23 * WWW: http://www.cups.org
28 * Event mask constants...
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,
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
70 * Types and structures...
73 typedef struct cupsd_subscription_str
/**** Subscription object ****/
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
;
92 typedef struct cupsd_event_str
/**** Event object ****/
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 */
110 VAR
int NumEvents
VALUE(0),
111 /* Number of active events */
112 MaxEvents
VALUE(100);
113 /* Maximum number of events to hold */
114 VAR cupsd_event_t
*Events
VALUE(NULL
),
116 *LastEvent
VALUE(NULL
);
117 /* Last event in list */
119 VAR
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 */
129 VAR cupsd_subscription_t
*Subscriptions
VALUE(NULL
),
130 /* List of subscriptions */
131 *LastSubcription
VALUE(NULL
);
132 /* Last subscription in list */
136 * End of "$Id: notify.h,v 1.1.2.1 2004/07/02 19:12:48 mike Exp $".