]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/ipp.h
Update svn:keyword properties.
[thirdparty/cups.git] / cups / ipp.h
CommitLineData
ef416fc2 1/*
f2d18633 2 * "$Id$"
ef416fc2 3 *
5a6b583a 4 * Internet Printing Protocol definitions for CUPS.
ef416fc2 5 *
db8b865d 6 * Copyright 2007-2013 by Apple Inc.
ef416fc2 7 * Copyright 1997-2006 by Easy Software Products.
8 *
9 * These coded instructions, statements, and computer programs are the
bc44d920 10 * property of Apple Inc. and are protected by Federal copyright
11 * law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 * which should have been included with this file. If this file is
13 * file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 14 *
15 * This file is subject to the Apple OS-Developed Software exception.
16 */
17
18#ifndef _CUPS_IPP_H_
19# define _CUPS_IPP_H_
20
21/*
22 * Include necessary headers...
23 */
24
25# include "http.h"
c1420c87 26# include <stdarg.h>
ef416fc2 27
28
29/*
30 * C++ magic...
31 */
32
33# ifdef __cplusplus
34extern "C" {
35# endif /* __cplusplus */
36
37
38/*
39 * IPP version string...
40 */
41
5a6b583a 42# define IPP_VERSION "\002\001"
ef416fc2 43
44/*
45 * IPP registered port number...
46 *
47 * Note: Applications should never use IPP_PORT, but instead use the
48 * ippPort() function to allow overrides via the IPP_PORT environment
49 * variable and services file if needed!
50 */
51
52# define IPP_PORT 631
53
54/*
55 * Common limits...
56 */
57
5a9febac
MS
58# define IPP_MAX_CHARSET 64 /* Maximum length of charset values w/nul */
59# define IPP_MAX_KEYWORD 256 /* Maximum length of keyword values w/nul */
60# define IPP_MAX_LANGUAGE 64 /* Maximum length of naturalLanguage values w/nul */
a41f09e2 61# define IPP_MAX_LENGTH 32767 /* Maximum size of any single value */
5a9febac
MS
62# define IPP_MAX_MIMETYPE 256 /* Maximum length of mimeMediaType values w/nul */
63# define IPP_MAX_NAME 256 /* Maximum length of common name values w/nul */
64# define IPP_MAX_OCTETSTRING 1023 /* Maximum length of octetString values w/o nul */
65# define IPP_MAX_TEXT 1024 /* Maximum length of text values w/nul */
66# define IPP_MAX_URI 1024 /* Maximum length of uri values w/nul */
67# define IPP_MAX_URISCHEME 64 /* Maximum length of uriScheme values w/nul */
ef416fc2 68# define IPP_MAX_VALUES 8 /* Power-of-2 allocation increment */
69
70
71/*
72 * Types and structures...
73 */
74
a2326b5b 75typedef enum ipp_dstate_e /**** Document states ****/
ef416fc2 76{
a469f8a5
MS
77 IPP_DOCUMENT_PENDING = 3, /* Document is pending */
78 IPP_DOCUMENT_PROCESSING = 5, /* Document is processing */
79 IPP_DOCUMENT_CANCELED = 7, /* Document is canceled */
80 IPP_DOCUMENT_ABORTED, /* Document is aborted */
81 IPP_DOCUMENT_COMPLETED /* Document is completed */
82
83# ifndef _CUPS_NO_DEPRECATED
84# define IPP_DOCUMENT_PENDING IPP_DSTATE_PENDING
85# define IPP_DOCUMENT_PROCESSING IPP_DSTATE_PROCESSING
86# define IPP_DOCUMENT_CANCELED IPP_DSTATE_CANCELED
87# define IPP_DOCUMENT_ABORTED IPP_DSTATE_ABORTED
88# define IPP_DOCUMENT_COMPLETED IPP_DSTATE_COMPLETED
89# endif /* !_CUPS_NO_DEPRECATED */
a2326b5b 90} ipp_dstate_t;
ef416fc2 91
a469f8a5 92typedef enum ipp_finishings_e /**** Finishings ****/
ef416fc2 93{
ecdc0628 94 IPP_FINISHINGS_NONE = 3, /* No finishing */
95 IPP_FINISHINGS_STAPLE, /* Staple (any location) */
96 IPP_FINISHINGS_PUNCH, /* Punch (any location/count) */
97 IPP_FINISHINGS_COVER, /* Add cover */
98 IPP_FINISHINGS_BIND, /* Bind */
99 IPP_FINISHINGS_SADDLE_STITCH, /* Staple interior */
100 IPP_FINISHINGS_EDGE_STITCH, /* Stitch along any side */
101 IPP_FINISHINGS_FOLD, /* Fold (any type) */
102 IPP_FINISHINGS_TRIM, /* Trim (any type) */
103 IPP_FINISHINGS_BALE, /* Bale (any type) */
104 IPP_FINISHINGS_BOOKLET_MAKER, /* Fold to make booklet */
6961465f 105 IPP_FINISHINGS_JOG_OFFSET, /* Offset for binding (any type) */
ecdc0628 106 IPP_FINISHINGS_STAPLE_TOP_LEFT = 20, /* Staple top left corner */
107 IPP_FINISHINGS_STAPLE_BOTTOM_LEFT, /* Staple bottom left corner */
108 IPP_FINISHINGS_STAPLE_TOP_RIGHT, /* Staple top right corner */
109 IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT, /* Staple bottom right corner */
110 IPP_FINISHINGS_EDGE_STITCH_LEFT, /* Stitch along left side */
111 IPP_FINISHINGS_EDGE_STITCH_TOP, /* Stitch along top edge */
112 IPP_FINISHINGS_EDGE_STITCH_RIGHT, /* Stitch along right side */
113 IPP_FINISHINGS_EDGE_STITCH_BOTTOM, /* Stitch along bottom edge */
114 IPP_FINISHINGS_STAPLE_DUAL_LEFT, /* Two staples on left */
115 IPP_FINISHINGS_STAPLE_DUAL_TOP, /* Two staples on top */
116 IPP_FINISHINGS_STAPLE_DUAL_RIGHT, /* Two staples on right */
117 IPP_FINISHINGS_STAPLE_DUAL_BOTTOM, /* Two staples on bottom */
118 IPP_FINISHINGS_BIND_LEFT = 50, /* Bind on left */
119 IPP_FINISHINGS_BIND_TOP, /* Bind on top */
120 IPP_FINISHINGS_BIND_RIGHT, /* Bind on right */
a2326b5b
MS
121 IPP_FINISHINGS_BIND_BOTTOM, /* Bind on bottom */
122 IPP_FINISHINGS_TRIM_AFTER_PAGES = 60, /* Trim output after each page */
123 IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS, /* Trim output after each document */
124 IPP_FINISHINGS_TRIM_AFTER_COPIES, /* Trim output after each copy */
a469f8a5 125 IPP_FINISHINGS_TRIM_AFTER_JOB, /* Trim output after job */
9475ec92
MS
126 IPP_FINISHINGS_PUNCH_TOP_LEFT = 70, /* Punch 1 hole top left */
127 IPP_FINISHINGS_PUNCH_BOTTOM_LEFT, /* Punch 1 hole bottom left */
128 IPP_FINISHINGS_PUNCH_TOP_RIGHT, /* Punch 1 hole top right */
129 IPP_FINISHINGS_PUNCH_BOTTOM_RIGHT, /* Punch 1 hole bottom right */
130 IPP_FINISHINGS_PUNCH_DUAL_LEFT, /* Punch 2 holes left side */
131 IPP_FINISHINGS_PUNCH_DUAL_TOP, /* Punch 2 holes top edge */
132 IPP_FINISHINGS_PUNCH_DUAL_RIGHT, /* Punch 2 holes right side */
133 IPP_FINISHINGS_PUNCH_DUAL_BOTTOM, /* Punch 2 holes bottom edge */
134 IPP_FINISHINGS_PUNCH_TRIPLE_LEFT, /* Punch 3 holes left side */
135 IPP_FINISHINGS_PUNCH_TRIPLE_TOP, /* Punch 3 holes top edge */
136 IPP_FINISHINGS_PUNCH_TRIPLE_RIGHT, /* Punch 3 holes right side */
137 IPP_FINISHINGS_PUNCH_TRIPLE_BOTTOM, /* Punch 3 holes bottom edge */
138 IPP_FINISHINGS_PUNCH_QUAD_LEFT, /* Punch 4 holes left side */
139 IPP_FINISHINGS_PUNCH_QUAD_TOP, /* Punch 4 holes top edge */
140 IPP_FINISHINGS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side */
141 IPP_FINISHINGS_PUNCH_QUAD_BOTTOM, /* Punch 4 holes bottom edge */
142 IPP_FINISHINGS_FOLD_ACCORDIAN = 90, /* Accordian-fold the paper vertically into four sections */
143 IPP_FINISHINGS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically */
144 IPP_FINISHINGS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline */
145 IPP_FINISHINGS_FOLD_HALF, /* Fold the paper in half vertically */
146 IPP_FINISHINGS_FOLD_HALF_Z, /* Fold the paper in half horizontally, then Z-fold the paper vertically */
147 IPP_FINISHINGS_FOLD_LEFT_GATE, /* Fold the top quarter of the paper towards the midline */
148 IPP_FINISHINGS_FOLD_LETTER, /* Fold the paper into three sections vertically; sometimes also known as a C fold*/
149 IPP_FINISHINGS_FOLD_PARALLEL, /* Fold the paper in half vertically two times, yielding four sections */
150 IPP_FINISHINGS_FOLD_POSTER, /* Fold the paper in half horizontally and vertically; sometimes also called a cross fold */
151 IPP_FINISHINGS_FOLD_RIGHT_GATE, /* Fold the bottom quarter of the paper towards the midline */
152 IPP_FINISHINGS_FOLD_Z, /* Fold the paper vertically into three sections, forming a Z */
a469f8a5 153
9475ec92 154 /* CUPS extensions for finishings (pre-standard versions of values above) */
a469f8a5
MS
155 IPP_FINISHINGS_CUPS_PUNCH_TOP_LEFT = 0x40000046,
156 /* Punch 1 hole top left */
157 IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_LEFT,/* Punch 1 hole bottom left */
158 IPP_FINISHINGS_CUPS_PUNCH_TOP_RIGHT, /* Punch 1 hole top right */
159 IPP_FINISHINGS_CUPS_PUNCH_BOTTOM_RIGHT,
160 /* Punch 1 hole bottom right */
161 IPP_FINISHINGS_CUPS_PUNCH_DUAL_LEFT, /* Punch 2 holes left side */
162 IPP_FINISHINGS_CUPS_PUNCH_DUAL_TOP, /* Punch 2 holes top edge */
163 IPP_FINISHINGS_CUPS_PUNCH_DUAL_RIGHT, /* Punch 2 holes right side */
164 IPP_FINISHINGS_CUPS_PUNCH_DUAL_BOTTOM,/* Punch 2 holes bottom edge */
165 IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_LEFT,/* Punch 3 holes left side */
166 IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_TOP, /* Punch 3 holes top edge */
167 IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_RIGHT,
168 /* Punch 3 holes right side */
169 IPP_FINISHINGS_CUPS_PUNCH_TRIPLE_BOTTOM,
170 /* Punch 3 holes bottom edge */
171 IPP_FINISHINGS_CUPS_PUNCH_QUAD_LEFT, /* Punch 4 holes left side */
172 IPP_FINISHINGS_CUPS_PUNCH_QUAD_TOP, /* Punch 4 holes top edge */
173 IPP_FINISHINGS_CUPS_PUNCH_QUAD_RIGHT, /* Punch 4 holes right side */
6961465f
MS
174 IPP_FINISHINGS_CUPS_PUNCH_QUAD_BOTTOM,/* Punch 4 holes bottom edge */
175
176 IPP_FINISHINGS_CUPS_FOLD_ACCORDIAN = 0x4000005A,
177 /* Accordian-fold the paper vertically into four sections */
178 IPP_FINISHINGS_CUPS_FOLD_DOUBLE_GATE, /* Fold the top and bottom quarters of the paper towards the midline, then fold in half vertically */
179 IPP_FINISHINGS_CUPS_FOLD_GATE, /* Fold the top and bottom quarters of the paper towards the midline */
180 IPP_FINISHINGS_CUPS_FOLD_HALF, /* Fold the paper in half vertically */
181 IPP_FINISHINGS_CUPS_FOLD_HALF_Z, /* Fold the paper in half horizontally, then Z-fold the paper vertically */
182 IPP_FINISHINGS_CUPS_FOLD_LEFT_GATE, /* Fold the top quarter of the paper towards the midline */
183 IPP_FINISHINGS_CUPS_FOLD_LETTER, /* Fold the paper into three sections vertically; sometimes also known as a C fold*/
184 IPP_FINISHINGS_CUPS_FOLD_PARALLEL, /* Fold the paper in half vertically two times, yielding four sections */
185 IPP_FINISHINGS_CUPS_FOLD_POSTER, /* Fold the paper in half horizontally and vertically; sometimes also called a cross fold */
186 IPP_FINISHINGS_CUPS_FOLD_RIGHT_GATE, /* Fold the bottom quarter of the paper towards the midline */
187 IPP_FINISHINGS_CUPS_FOLD_Z /* Fold the paper vertically into three sections, forming a Z */
a469f8a5
MS
188} ipp_finishings_t;
189# ifndef _CUPS_NO_DEPRECATED
6961465f
MS
190# define IPP_FINISHINGS_JOB_OFFSET IPP_FINISHINGS_JOG_OFFSET
191 /* Long-time misspelling... */
a469f8a5
MS
192typedef enum ipp_finishings_e ipp_finish_t;
193# endif /* !_CUPS_NO_DEPRECATED */
ef416fc2 194
a2326b5b 195typedef enum ipp_jcollate_e /**** Job collation types ****/
ef416fc2 196{
a469f8a5
MS
197 IPP_JCOLLATE_UNCOLLATED_SHEETS = 3,
198 IPP_JCOLLATE_COLLATED_DOCUMENTS,
199 IPP_JCOLLATE_UNCOLLATED_DOCUMENTS
200
201# ifndef _CUPS_NO_DEPRECATED
202# define IPP_JOB_UNCOLLATED_SHEETS IPP_JCOLLATE_UNCOLLATED_SHEETS
203# define IPP_JOB_COLLATED_DOCUMENTS IPP_JCOLLATE_COLLATED_DOCUMENTS
204# define IPP_JOB_UNCOLLATED_DOCUMENTS IPP_JCOLLATE_UNCOLLATED_DOCUMENTS
205# endif /* !_CUPS_NO_DEPRECATED */
a2326b5b 206} ipp_jcollate_t;
ef416fc2 207
5a6b583a 208typedef enum ipp_jstate_e /**** Job states ****/
ef416fc2 209{
a469f8a5
MS
210 IPP_JSTATE_PENDING = 3, /* Job is waiting to be printed */
211 IPP_JSTATE_HELD, /* Job is held for printing */
212 IPP_JSTATE_PROCESSING, /* Job is currently printing */
213 IPP_JSTATE_STOPPED, /* Job has been stopped */
214 IPP_JSTATE_CANCELED, /* Job has been canceled */
215 IPP_JSTATE_ABORTED, /* Job has aborted due to error */
216 IPP_JSTATE_COMPLETED /* Job has completed successfully */
217
218# ifndef _CUPS_NO_DEPRECATED
219# define IPP_JOB_PENDING IPP_JSTATE_PENDING
220# define IPP_JOB_HELD IPP_JSTATE_HELD
221# define IPP_JOB_PROCESSING IPP_JSTATE_PROCESSING
222# define IPP_JOB_STOPPED IPP_JSTATE_STOPPED
223# define IPP_JOB_CANCELED IPP_JSTATE_CANCELED
224# define IPP_JOB_ABORTED IPP_JSTATE_ABORTED
225# define IPP_JOB_COMPLETED IPP_JSTATE_COMPLETED
a2326b5b 226 /* Legacy name for canceled state */
a469f8a5
MS
227# define IPP_JOB_CANCELLED IPP_JSTATE_CANCELED
228# endif /* !_CUPS_NO_DEPRECATED */
a2326b5b 229} ipp_jstate_t;
ef416fc2 230
5a6b583a 231typedef enum ipp_op_e /**** IPP operations ****/
ef416fc2 232{
dcb445bc 233 IPP_OP_CUPS_INVALID = -1, /* Invalid operation name for @link ippOpValue@ */
a469f8a5
MS
234 IPP_OP_CUPS_NONE = 0, /* No operation @private@ */
235 IPP_OP_PRINT_JOB = 0x0002, /* Print a single file */
236 IPP_OP_PRINT_URI, /* Print a single URL @private@ */
237 IPP_OP_VALIDATE_JOB, /* Validate job options */
238 IPP_OP_CREATE_JOB, /* Create an empty print job */
239 IPP_OP_SEND_DOCUMENT, /* Add a file to a job */
240 IPP_OP_SEND_URI, /* Add a URL to a job @private@ */
241 IPP_OP_CANCEL_JOB, /* Cancel a job */
242 IPP_OP_GET_JOB_ATTRIBUTES, /* Get job attributes */
243 IPP_OP_GET_JOBS, /* Get a list of jobs */
244 IPP_OP_GET_PRINTER_ATTRIBUTES, /* Get printer attributes */
245 IPP_OP_HOLD_JOB, /* Hold a job for printing */
246 IPP_OP_RELEASE_JOB, /* Release a job for printing */
247 IPP_OP_RESTART_JOB, /* Reprint a job */
248 IPP_OP_PAUSE_PRINTER = 0x0010, /* Stop a printer */
249 IPP_OP_RESUME_PRINTER, /* Start a printer */
250 IPP_OP_PURGE_JOBS, /* Cancel all jobs */
251 IPP_OP_SET_PRINTER_ATTRIBUTES, /* Set printer attributes @private@ */
252 IPP_OP_SET_JOB_ATTRIBUTES, /* Set job attributes */
253 IPP_OP_GET_PRINTER_SUPPORTED_VALUES, /* Get supported attribute values */
254 IPP_OP_CREATE_PRINTER_SUBSCRIPTION, /* Create a printer subscription @since CUPS 1.2/OS X 10.5@ */
255 IPP_OP_CREATE_JOB_SUBSCRIPTION, /* Create a job subscription @since CUPS 1.2/OS X 10.5@ */
256 IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES, /* Get subscription attributes @since CUPS 1.2/OS X 10.5@ */
257 IPP_OP_GET_SUBSCRIPTIONS, /* Get list of subscriptions @since CUPS 1.2/OS X 10.5@ */
258 IPP_OP_RENEW_SUBSCRIPTION, /* Renew a printer subscription @since CUPS 1.2/OS X 10.5@ */
259 IPP_OP_CANCEL_SUBSCRIPTION, /* Cancel a subscription @since CUPS 1.2/OS X 10.5@ */
260 IPP_OP_GET_NOTIFICATIONS, /* Get notification events @since CUPS 1.2/OS X 10.5@ */
261 IPP_OP_SEND_NOTIFICATIONS, /* Send notification events @private@ */
262 IPP_OP_GET_RESOURCE_ATTRIBUTES, /* Get resource attributes @private@ */
263 IPP_OP_GET_RESOURCE_DATA, /* Get resource data @private@ */
264 IPP_OP_GET_RESOURCES, /* Get list of resources @private@ */
265 IPP_OP_GET_PRINT_SUPPORT_FILES, /* Get printer support files @private@ */
266 IPP_OP_ENABLE_PRINTER, /* Start a printer */
267 IPP_OP_DISABLE_PRINTER, /* Stop a printer */
268 IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB,
269 /* Stop printer after the current job @private@ */
270 IPP_OP_HOLD_NEW_JOBS, /* Hold new jobs @private@ */
271 IPP_OP_RELEASE_HELD_NEW_JOBS, /* Release new jobs @private@ */
272 IPP_OP_DEACTIVATE_PRINTER, /* Stop a printer @private@ */
273 IPP_OP_ACTIVATE_PRINTER, /* Start a printer @private@ */
274 IPP_OP_RESTART_PRINTER, /* Restart a printer @private@ */
275 IPP_OP_SHUTDOWN_PRINTER, /* Turn a printer off @private@ */
276 IPP_OP_STARTUP_PRINTER, /* Turn a printer on @private@ */
277 IPP_OP_REPROCESS_JOB, /* Reprint a job @private@ */
278 IPP_OP_CANCEL_CURRENT_JOB, /* Cancel the current job @private@ */
279 IPP_OP_SUSPEND_CURRENT_JOB, /* Suspend the current job @private@ */
280 IPP_OP_RESUME_JOB, /* Resume the current job @private@ */
281 IPP_OP_PROMOTE_JOB, /* Promote a job to print sooner @private@ */
282 IPP_OP_SCHEDULE_JOB_AFTER, /* Schedule a job to print after another @private@ */
283 IPP_OP_CANCEL_DOCUMENT = 0x0033, /* Cancel-Document @private@ */
284 IPP_OP_GET_DOCUMENT_ATTRIBUTES, /* Get-Document-Attributes @private@ */
285 IPP_OP_GET_DOCUMENTS, /* Get-Documents @private@ */
286 IPP_OP_DELETE_DOCUMENT, /* Delete-Document @private@ */
287 IPP_OP_SET_DOCUMENT_ATTRIBUTES, /* Set-Document-Attributes @private@ */
288 IPP_OP_CANCEL_JOBS, /* Cancel-Jobs */
289 IPP_OP_CANCEL_MY_JOBS, /* Cancel-My-Jobs */
290 IPP_OP_RESUBMIT_JOB, /* Resubmit-Job */
291 IPP_OP_CLOSE_JOB, /* Close-Job */
9475ec92
MS
292 IPP_OP_IDENTIFY_PRINTER, /* Identify-Printer @private@ */
293 IPP_OP_VALIDATE_DOCUMENT, /* Validate-Document @private@ */
294 IPP_OP_SEND_HARDCOPY_DOCUMENT, /* Send-Hardcopy-Document @private@ */
295
a469f8a5
MS
296 IPP_OP_PRIVATE = 0x4000, /* Reserved @private@ */
297 IPP_OP_CUPS_GET_DEFAULT, /* Get the default printer */
298 IPP_OP_CUPS_GET_PRINTERS, /* Get a list of printers and/or classes */
299 IPP_OP_CUPS_ADD_MODIFY_PRINTER, /* Add or modify a printer */
300 IPP_OP_CUPS_DELETE_PRINTER, /* Delete a printer */
301 IPP_OP_CUPS_GET_CLASSES, /* Get a list of classes @deprecated@ */
302 IPP_OP_CUPS_ADD_MODIFY_CLASS, /* Add or modify a class */
303 IPP_OP_CUPS_DELETE_CLASS, /* Delete a class */
304 IPP_OP_CUPS_ACCEPT_JOBS, /* Accept new jobs on a printer */
305 IPP_OP_CUPS_REJECT_JOBS, /* Reject new jobs on a printer */
306 IPP_OP_CUPS_SET_DEFAULT, /* Set the default printer */
307 IPP_OP_CUPS_GET_DEVICES, /* Get a list of supported devices */
308 IPP_OP_CUPS_GET_PPDS, /* Get a list of supported drivers */
309 IPP_OP_CUPS_MOVE_JOB, /* Move a job to a different printer */
310 IPP_OP_CUPS_AUTHENTICATE_JOB, /* Authenticate a job @since CUPS 1.2/OS X 10.5@ */
311 IPP_OP_CUPS_GET_PPD, /* Get a PPD file @since CUPS 1.3/OS X 10.5@ */
312 IPP_OP_CUPS_GET_DOCUMENT = 0x4027 /* Get a document file @since CUPS 1.4/OS X 10.6@ */
313
314# ifndef _CUPS_NO_DEPRECATED
315# define IPP_PRINT_JOB IPP_OP_PRINT_JOB
316# define IPP_PRINT_URI IPP_OP_PRINT_URI
317# define IPP_VALIDATE_JOB IPP_OP_VALIDATE_JOB
318# define IPP_CREATE_JOB IPP_OP_CREATE_JOB
319# define IPP_SEND_DOCUMENT IPP_OP_SEND_DOCUMENT
320# define IPP_SEND_URI IPP_OP_SEND_URI
321# define IPP_CANCEL_JOB IPP_OP_CANCEL_JOB
322# define IPP_GET_JOB_ATTRIBUTES IPP_OP_GET_JOB_ATTRIBUTES
323# define IPP_GET_JOBS IPP_OP_GET_JOBS
324# define IPP_GET_PRINTER_ATTRIBUTES IPP_OP_GET_PRINTER_ATTRIBUTES
325# define IPP_HOLD_JOB IPP_OP_HOLD_JOB
326# define IPP_RELEASE_JOB IPP_OP_RELEASE_JOB
327# define IPP_RESTART_JOB IPP_OP_RESTART_JOB
328# define IPP_PAUSE_PRINTER IPP_OP_PAUSE_PRINTER
329# define IPP_RESUME_PRINTER IPP_OP_RESUME_PRINTER
330# define IPP_PURGE_JOBS IPP_OP_PURGE_JOBS
331# define IPP_SET_PRINTER_ATTRIBUTES IPP_OP_SET_PRINTER_ATTRIBUTES
332# define IPP_SET_JOB_ATTRIBUTES IPP_OP_SET_JOB_ATTRIBUTES
333# define IPP_GET_PRINTER_SUPPORTED_VALUES IPP_OP_GET_PRINTER_SUPPORTED_VALUES
334# define IPP_CREATE_PRINTER_SUBSCRIPTION IPP_OP_CREATE_PRINTER_SUBSCRIPTION
335# define IPP_CREATE_JOB_SUBSCRIPTION IPP_OP_CREATE_JOB_SUBSCRIPTION
336# define IPP_GET_SUBSCRIPTION_ATTRIBUTES IPP_OP_GET_SUBSCRIPTION_ATTRIBUTES
337# define IPP_GET_SUBSCRIPTIONS IPP_OP_GET_SUBSCRIPTIONS
338# define IPP_RENEW_SUBSCRIPTION IPP_OP_RENEW_SUBSCRIPTION
339# define IPP_CANCEL_SUBSCRIPTION IPP_OP_CANCEL_SUBSCRIPTION
340# define IPP_GET_NOTIFICATIONS IPP_OP_GET_NOTIFICATIONS
341# define IPP_SEND_NOTIFICATIONS IPP_OP_SEND_NOTIFICATIONS
342# define IPP_GET_RESOURCE_ATTRIBUTES IPP_OP_GET_RESOURCE_ATTRIBUTES
343# define IPP_GET_RESOURCE_DATA IPP_OP_GET_RESOURCE_DATA
344# define IPP_GET_RESOURCES IPP_OP_GET_RESOURCES
345# define IPP_GET_PRINT_SUPPORT_FILES IPP_OP_GET_PRINT_SUPPORT_FILES
346# define IPP_ENABLE_PRINTER IPP_OP_ENABLE_PRINTER
347# define IPP_DISABLE_PRINTER IPP_OP_DISABLE_PRINTER
348# define IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB IPP_OP_PAUSE_PRINTER_AFTER_CURRENT_JOB
349# define IPP_HOLD_NEW_JOBS IPP_OP_HOLD_NEW_JOBS
350# define IPP_RELEASE_HELD_NEW_JOBS IPP_OP_RELEASE_HELD_NEW_JOBS
351# define IPP_DEACTIVATE_PRINTER IPP_OP_DEACTIVATE_PRINTER
352# define IPP_ACTIVATE_PRINTER IPP_OP_ACTIVATE_PRINTER
353# define IPP_RESTART_PRINTER IPP_OP_RESTART_PRINTER
354# define IPP_SHUTDOWN_PRINTER IPP_OP_SHUTDOWN_PRINTER
355# define IPP_STARTUP_PRINTER IPP_OP_STARTUP_PRINTER
356# define IPP_REPROCESS_JOB IPP_OP_REPROCESS_JOB
357# define IPP_CANCEL_CURRENT_JOB IPP_OP_CANCEL_CURRENT_JOB
358# define IPP_SUSPEND_CURRENT_JOB IPP_OP_SUSPEND_CURRENT_JOB
359# define IPP_RESUME_JOB IPP_OP_RESUME_JOB
360# define IPP_PROMOTE_JOB IPP_OP_PROMOTE_JOB
361# define IPP_SCHEDULE_JOB_AFTER IPP_OP_SCHEDULE_JOB_AFTER
362# define IPP_CANCEL_DOCUMENT IPP_OP_CANCEL_DOCUMENT
363# define IPP_GET_DOCUMENT_ATTRIBUTES IPP_OP_GET_DOCUMENT_ATTRIBUTES
364# define IPP_GET_DOCUMENTS IPP_OP_GET_DOCUMENTS
365# define IPP_DELETE_DOCUMENT IPP_OP_DELETE_DOCUMENT
366# define IPP_SET_DOCUMENT_ATTRIBUTES IPP_OP_SET_DOCUMENT_ATTRIBUTES
367# define IPP_CANCEL_JOBS IPP_OP_CANCEL_JOBS
368# define IPP_CANCEL_MY_JOBS IPP_OP_CANCEL_MY_JOBS
369# define IPP_RESUBMIT_JOB IPP_OP_RESUBMIT_JOB
370# define IPP_CLOSE_JOB IPP_OP_CLOSE_JOB
371# define IPP_IDENTIFY_PRINTER IPP_OP_IDENTIFY_PRINTER
372# define IPP_VALIDATE_DOCUMENT IPP_OP_VALIDATE_DOCUMENT
373# define IPP_PRIVATE IPP_OP_PRIVATE
374# define CUPS_GET_DEFAULT IPP_OP_CUPS_GET_DEFAULT
375# define CUPS_GET_PRINTERS IPP_OP_CUPS_GET_PRINTERS
376# define CUPS_ADD_MODIFY_PRINTER IPP_OP_CUPS_ADD_MODIFY_PRINTER
377# define CUPS_DELETE_PRINTER IPP_OP_CUPS_DELETE_PRINTER
378# define CUPS_GET_CLASSES IPP_OP_CUPS_GET_CLASSES
379# define CUPS_ADD_MODIFY_CLASS IPP_OP_CUPS_ADD_MODIFY_CLASS
380# define CUPS_DELETE_CLASS IPP_OP_CUPS_DELETE_CLASS
381# define CUPS_ACCEPT_JOBS IPP_OP_CUPS_ACCEPT_JOBS
382# define CUPS_REJECT_JOBS IPP_OP_CUPS_REJECT_JOBS
383# define CUPS_SET_DEFAULT IPP_OP_CUPS_SET_DEFAULT
384# define CUPS_GET_DEVICES IPP_OP_CUPS_GET_DEVICES
385# define CUPS_GET_PPDS IPP_OP_CUPS_GET_PPDS
386# define CUPS_MOVE_JOB IPP_OP_CUPS_MOVE_JOB
387# define CUPS_AUTHENTICATE_JOB IPP_OP_CUPS_AUTHENTICATE_JOB
388# define CUPS_GET_PPD IPP_OP_CUPS_GET_PPD
389# define CUPS_GET_DOCUMENT IPP_OP_CUPS_GET_DOCUMENT
390 /* Legacy names */
391# define CUPS_ADD_PRINTER IPP_OP_CUPS_ADD_MODIFY_PRINTER
392# define CUPS_ADD_CLASS IPP_OP_CUPS_ADD_MODIFY_CLASS
393# endif /* !_CUPS_NO_DEPRECATED */
a2326b5b
MS
394} ipp_op_t;
395
396typedef enum ipp_orient_e /**** Orientation values ****/
397{
a469f8a5
MS
398 IPP_ORIENT_PORTRAIT = 3, /* No rotation */
399 IPP_ORIENT_LANDSCAPE, /* 90 degrees counter-clockwise */
400 IPP_ORIENT_REVERSE_LANDSCAPE, /* 90 degrees clockwise */
401 IPP_ORIENT_REVERSE_PORTRAIT /* 180 degrees */
402
403# ifndef _CUPS_NO_DEPRECATED
404# define IPP_PORTRAIT IPP_ORIENT_PORTRAIT
405# define IPP_LANDSCAPE IPP_ORIENT_LANDSCAPE
406# define IPP_REVERSE_LANDSCAPE IPP_ORIENT_REVERSE_LANDSCAPE
407# define IPP_REVERSE_PORTRAIT IPP_ORIENT_REVERSE_PORTRAIT
408# endif /* !_CUPS_NO_DEPRECATED */
a2326b5b
MS
409} ipp_orient_t;
410
411typedef enum ipp_pstate_e /**** Printer states ****/
412{
a469f8a5
MS
413 IPP_PSTATE_IDLE = 3, /* Printer is idle */
414 IPP_PSTATE_PROCESSING, /* Printer is working */
415 IPP_PSTATE_STOPPED /* Printer is stopped */
416
417# ifndef _CUPS_NO_DEPRECATED
418# define IPP_PRINTER_IDLE IPP_PSTATE_IDLE
419# define IPP_PRINTER_PROCESSING IPP_PSTATE_PROCESSING
420# define IPP_PRINTER_STOPPED IPP_PSTATE_STOPPED
421# endif /* _CUPS_NO_DEPRECATED */
a2326b5b
MS
422} ipp_pstate_t;
423
424typedef enum ipp_quality_e /**** Qualities ****/
425{
426 IPP_QUALITY_DRAFT = 3, /* Draft quality */
427 IPP_QUALITY_NORMAL, /* Normal quality */
428 IPP_QUALITY_HIGH /* High quality */
429} ipp_quality_t;
430
431typedef enum ipp_res_e /**** Resolution units ****/
432{
433 IPP_RES_PER_INCH = 3, /* Pixels per inch */
434 IPP_RES_PER_CM /* Pixels per centimeter */
435} ipp_res_t;
436
437typedef enum ipp_state_e /**** IPP states ****/
438{
a469f8a5
MS
439 IPP_STATE_ERROR = -1, /* An error occurred */
440 IPP_STATE_IDLE, /* Nothing is happening/request completed */
441 IPP_STATE_HEADER, /* The request header needs to be sent/received */
442 IPP_STATE_ATTRIBUTE, /* One or more attributes need to be sent/received */
443 IPP_STATE_DATA /* IPP request data needs to be sent/received */
444
445# ifndef _CUPS_NO_DEPRECATED
446# define IPP_ERROR IPP_STATE_ERROR
447# define IPP_IDLE IPP_STATE_IDLE
448# define IPP_HEADER IPP_STATE_HEADER
449# define IPP_ATTRIBUTE IPP_STATE_ATTRIBUTE
450# define IPP_DATA IPP_STATE_DATA
451# endif /* !_CUPS_NO_DEPRECATED */
a2326b5b 452} ipp_state_t;
fa73b229 453
5a6b583a 454typedef enum ipp_status_e /**** IPP status codes ****/
ef416fc2 455{
dcb445bc 456 IPP_STATUS_CUPS_INVALID = -1, /* Invalid status name for @link ippErrorValue@ */
a469f8a5
MS
457 IPP_STATUS_OK = 0x0000, /* successful-ok */
458 IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED, /* successful-ok-ignored-or-substituted-attributes */
459 IPP_STATUS_OK_CONFLICTING, /* successful-ok-conflicting-attributes */
460 IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS, /* successful-ok-ignored-subscriptions */
461 IPP_STATUS_OK_IGNORED_NOTIFICATIONS, /* successful-ok-ignored-notifications @private@ */
462 IPP_STATUS_OK_TOO_MANY_EVENTS, /* successful-ok-too-many-events */
463 IPP_STATUS_OK_BUT_CANCEL_SUBSCRIPTION,/* successful-ok-but-cancel-subscription @private@ */
464 IPP_STATUS_OK_EVENTS_COMPLETE, /* successful-ok-events-complete */
465 IPP_STATUS_REDIRECTION_OTHER_SITE = 0x0200,
466 /* redirection-other-site @private@ */
467 IPP_STATUS_CUPS_SEE_OTHER = 0x0280, /* cups-see-other */
468 IPP_STATUS_ERROR_BAD_REQUEST = 0x0400,/* client-error-bad-request */
469 IPP_STATUS_ERROR_FORBIDDEN, /* client-error-forbidden */
470 IPP_STATUS_ERROR_NOT_AUTHENTICATED, /* client-error-not-authenticated */
471 IPP_STATUS_ERROR_NOT_AUTHORIZED, /* client-error-not-authorized */
472 IPP_STATUS_ERROR_NOT_POSSIBLE, /* client-error-not-possible */
473 IPP_STATUS_ERROR_TIMEOUT, /* client-error-timeout */
474 IPP_STATUS_ERROR_NOT_FOUND, /* client-error-not-found */
475 IPP_STATUS_ERROR_GONE, /* client-error-gone */
476 IPP_STATUS_ERROR_REQUEST_ENTITY, /* client-error-request-entity-too-large */
477 IPP_STATUS_ERROR_REQUEST_VALUE, /* client-error-request-value-too-long */
478 IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED,
479 /* client-error-document-format-not-supported */
480 IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES,/* client-error-attributes-or-values-not-supported */
481 IPP_STATUS_ERROR_URI_SCHEME, /* client-error-uri-scheme-not-supported */
482 IPP_STATUS_ERROR_CHARSET, /* client-error-charset-not-supported */
483 IPP_STATUS_ERROR_CONFLICTING, /* client-error-conflicting-attributes */
484 IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED,
485 /* client-error-compression-not-supported */
486 IPP_STATUS_ERROR_COMPRESSION_ERROR, /* client-error-compression-error */
487 IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR,
488 /* client-error-document-format-error */
489 IPP_STATUS_ERROR_DOCUMENT_ACCESS, /* client-error-document-access-error */
490 IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE,
491 /* client-error-attributes-not-settable */
492 IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS,
493 /* client-error-ignored-all-subscriptions */
494 IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS,
495 /* client-error-too-many-subscriptions */
496 IPP_STATUS_ERROR_IGNORED_ALL_NOTIFICATIONS,
497 /* client-error-ignored-all-notifications @private@ */
498 IPP_STATUS_ERROR_PRINT_SUPPORT_FILE_NOT_FOUND,
499 /* client-error-print-support-file-not-found @private@ */
500 IPP_STATUS_ERROR_DOCUMENT_PASSWORD, /* client-error-document-password-error */
501 IPP_STATUS_ERROR_DOCUMENT_PERMISSION, /* client-error-document-permission-error */
502 IPP_STATUS_ERROR_DOCUMENT_SECURITY, /* client-error-document-security-error */
503 IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE,/* client-error-document-unprintable-error */
504
505 /* Proposed extensions for paid printing */
506 IPP_STATUS_ERROR_CUPS_ACCOUNT_INFO_NEEDED = 0x049C,
507 /* cups-error-account-info-needed @since CUPS 1.7@ */
508 IPP_STATUS_ERROR_CUPS_ACCOUNT_CLOSED, /* cups-error-account-closed @since CUPS 1.7@ */
509 IPP_STATUS_ERROR_CUPS_ACCOUNT_LIMIT_REACHED,
510 /* cups-error-account-limit-reached @since CUPS 1.7@ */
511 IPP_STATUS_ERROR_CUPS_ACCOUNT_AUTHORIZATION_FAILED,
512 /* cups-error-account-authorization-failed @since CUPS 1.7@ */
513
514 IPP_STATUS_ERROR_INTERNAL = 0x0500, /* server-error-internal-error */
515 IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED,
516 /* server-error-operation-not-supported */
517 IPP_STATUS_ERROR_SERVICE_UNAVAILABLE, /* server-error-service-unavailable */
518 IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED,
519 /* server-error-version-not-supported */
520 IPP_STATUS_ERROR_DEVICE, /* server-error-device-error */
521 IPP_STATUS_ERROR_TEMPORARY, /* server-error-temporary-error */
522 IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS, /* server-error-not-accepting-jobs */
523 IPP_STATUS_ERROR_BUSY, /* server-error-busy */
524 IPP_STATUS_ERROR_JOB_CANCELED, /* server-error-job-canceled */
525 IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED,
526 /* server-error-multiple-document-jobs-not-supported */
527 IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED,
528 /* server-error-printer-is-deactivated */
529 IPP_STATUS_ERROR_TOO_MANY_JOBS, /* server-error-too-many-jobs */
530 IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS, /* server-error-too-many-documents */
531
532 /* These are internal and never sent over the wire... */
533 IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED = 0x1000,
534 /* cups-authentication-canceled - Authentication canceled by user @since CUPS 1.5/OS X 10.7@ */
535 IPP_STATUS_ERROR_CUPS_PKI, /* cups-pki-error - Error negotiating a secure connection @since CUPS 1.5/OS X 10.7@ */
536 IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED/* cups-upgrade-required - TLS upgrade required */
537
538# ifndef _CUPS_NO_DEPRECATED
539# define IPP_OK IPP_STATUS_OK
540# define IPP_OK_SUBST IPP_STATUS_OK_IGNORED_OR_SUBSTITUTED
541# define IPP_OK_CONFLICT IPP_STATUS_OK_CONFLICTING
542# define IPP_OK_IGNORED_SUBSCRIPTIONS IPP_STATUS_OK_IGNORED_SUBSCRIPTIONS
543# define IPP_OK_IGNORED_NOTIFICATIONS IPP_STATUS_OK_IGNORED_NOTIFICATIONS
544# define IPP_OK_TOO_MANY_EVENTS IPP_STATUS_OK_TOO_MANY_EVENTS
545# define IPP_OK_BUT_CANCEL_SUBSCRIPTION IPP_STATUS_OK_BUT_CANCEL_SUBSCRIPTION
546# define IPP_OK_EVENTS_COMPLETE IPP_STATUS_OK_EVENTS_COMPLETE
547# define IPP_REDIRECTION_OTHER_SITE IPP_STATUS_REDIRECTION_OTHER_SITE
548# define CUPS_SEE_OTHER IPP_STATUS_CUPS_SEE_OTHER
549# define IPP_BAD_REQUEST IPP_STATUS_ERROR_BAD_REQUEST
550# define IPP_FORBIDDEN IPP_STATUS_ERROR_FORBIDDEN
551# define IPP_NOT_AUTHENTICATED IPP_STATUS_ERROR_NOT_AUTHENTICATED
552# define IPP_NOT_AUTHORIZED IPP_STATUS_ERROR_NOT_AUTHORIZED
553# define IPP_NOT_POSSIBLE IPP_STATUS_ERROR_NOT_POSSIBLE
554# define IPP_TIMEOUT IPP_STATUS_ERROR_TIMEOUT
555# define IPP_NOT_FOUND IPP_STATUS_ERROR_NOT_FOUND
556# define IPP_GONE IPP_STATUS_ERROR_GONE
557# define IPP_REQUEST_ENTITY IPP_STATUS_ERROR_REQUEST_ENTITY
558# define IPP_REQUEST_VALUE IPP_STATUS_ERROR_REQUEST_VALUE
559# define IPP_DOCUMENT_FORMAT IPP_STATUS_ERROR_DOCUMENT_FORMAT_NOT_SUPPORTED
560# define IPP_ATTRIBUTES IPP_STATUS_ERROR_ATTRIBUTES_OR_VALUES
561# define IPP_URI_SCHEME IPP_STATUS_ERROR_URI_SCHEME
562# define IPP_CHARSET IPP_STATUS_ERROR_CHARSET
563# define IPP_CONFLICT IPP_STATUS_ERROR_CONFLICTING
564# define IPP_COMPRESSION_NOT_SUPPORTED IPP_STATUS_ERROR_COMPRESSION_NOT_SUPPORTED
565# define IPP_COMPRESSION_ERROR IPP_STATUS_ERROR_COMPRESSION_ERROR
566# define IPP_DOCUMENT_FORMAT_ERROR IPP_STATUS_ERROR_DOCUMENT_FORMAT_ERROR
567# define IPP_DOCUMENT_ACCESS_ERROR IPP_STATUS_ERROR_DOCUMENT_ACCESS
568# define IPP_ATTRIBUTES_NOT_SETTABLE IPP_STATUS_ERROR_ATTRIBUTES_NOT_SETTABLE
569# define IPP_IGNORED_ALL_SUBSCRIPTIONS IPP_STATUS_ERROR_IGNORED_ALL_SUBSCRIPTIONS
570# define IPP_TOO_MANY_SUBSCRIPTIONS IPP_STATUS_ERROR_TOO_MANY_SUBSCRIPTIONS
571# define IPP_IGNORED_ALL_NOTIFICATIONS IPP_STATUS_ERROR_IGNORED_ALL_NOTIFICATIONS
572# define IPP_PRINT_SUPPORT_FILE_NOT_FOUND IPP_STATUS_ERROR_PRINT_SUPPORT_FILE_NOT_FOUND
573# define IPP_DOCUMENT_PASSWORD_ERROR IPP_STATUS_ERROR_DOCUMENT_PASSWORD
574# define IPP_DOCUMENT_PERMISSION_ERROR IPP_STATUS_ERROR_DOCUMENT_PERMISSION
575# define IPP_DOCUMENT_SECURITY_ERROR IPP_STATUS_ERROR_DOCUMENT_SECURITY
576# define IPP_DOCUMENT_UNPRINTABLE_ERROR IPP_STATUS_ERROR_DOCUMENT_UNPRINTABLE
577# define IPP_INTERNAL_ERROR IPP_STATUS_ERROR_INTERNAL
578# define IPP_OPERATION_NOT_SUPPORTED IPP_STATUS_ERROR_OPERATION_NOT_SUPPORTED
579# define IPP_SERVICE_UNAVAILABLE IPP_STATUS_ERROR_SERVICE_UNAVAILABLE
580# define IPP_VERSION_NOT_SUPPORTED IPP_STATUS_ERROR_VERSION_NOT_SUPPORTED
581# define IPP_DEVICE_ERROR IPP_STATUS_ERROR_DEVICE
582# define IPP_TEMPORARY_ERROR IPP_STATUS_ERROR_TEMPORARY
583# define IPP_NOT_ACCEPTING IPP_STATUS_ERROR_NOT_ACCEPTING_JOBS
584# define IPP_PRINTER_BUSY IPP_STATUS_ERROR_BUSY
585# define IPP_ERROR_JOB_CANCELED IPP_STATUS_ERROR_JOB_CANCELED
586# define IPP_MULTIPLE_JOBS_NOT_SUPPORTED IPP_STATUS_ERROR_MULTIPLE_JOBS_NOT_SUPPORTED
587# define IPP_PRINTER_IS_DEACTIVATED IPP_STATUS_ERROR_PRINTER_IS_DEACTIVATED
588# define IPP_TOO_MANY_JOBS IPP_STATUS_ERROR_TOO_MANY_JOBS
589# define IPP_TOO_MANY_DOCUMENTS IPP_STATUS_ERROR_TOO_MANY_DOCUMENTS
590# define IPP_AUTHENTICATION_CANCELED IPP_STATUS_ERROR_CUPS_AUTHENTICATION_CANCELED
591# define IPP_PKI_ERROR IPP_STATUS_ERROR_CUPS_PKI
592# define IPP_UPGRADE_REQUIRED IPP_STATUS_ERROR_CUPS_UPGRADE_REQUIRED
593 /* Legacy name for canceled status */
594# define IPP_ERROR_JOB_CANCELLED IPP_STATUS_ERROR_JOB_CANCELED
595# endif /* _CUPS_NO_DEPRECATED */
a2326b5b 596} ipp_status_t;
ef416fc2 597
a2326b5b 598typedef enum ipp_tag_e /**** Format tags for attributes ****/
ef416fc2 599{
dcb445bc 600 IPP_TAG_CUPS_INVALID = -1, /* Invalid tag name for @link ippTagValue@ */
a2326b5b
MS
601 IPP_TAG_ZERO = 0x00, /* Zero tag - used for separators */
602 IPP_TAG_OPERATION, /* Operation group */
603 IPP_TAG_JOB, /* Job group */
604 IPP_TAG_END, /* End-of-attributes */
605 IPP_TAG_PRINTER, /* Printer group */
606 IPP_TAG_UNSUPPORTED_GROUP, /* Unsupported attributes group */
607 IPP_TAG_SUBSCRIPTION, /* Subscription group */
608 IPP_TAG_EVENT_NOTIFICATION, /* Event group */
609 IPP_TAG_RESOURCE, /* Resource group @private@ */
610 IPP_TAG_DOCUMENT, /* Document group */
611 IPP_TAG_UNSUPPORTED_VALUE = 0x10, /* Unsupported value */
612 IPP_TAG_DEFAULT, /* Default value */
613 IPP_TAG_UNKNOWN, /* Unknown value */
614 IPP_TAG_NOVALUE, /* No-value value */
615 IPP_TAG_NOTSETTABLE = 0x15, /* Not-settable value */
616 IPP_TAG_DELETEATTR, /* Delete-attribute value */
617 IPP_TAG_ADMINDEFINE, /* Admin-defined value */
618 IPP_TAG_INTEGER = 0x21, /* Integer value */
619 IPP_TAG_BOOLEAN, /* Boolean value */
620 IPP_TAG_ENUM, /* Enumeration value */
621 IPP_TAG_STRING = 0x30, /* Octet string value */
622 IPP_TAG_DATE, /* Date/time value */
623 IPP_TAG_RESOLUTION, /* Resolution value */
624 IPP_TAG_RANGE, /* Range value */
625 IPP_TAG_BEGIN_COLLECTION, /* Beginning of collection value */
626 IPP_TAG_TEXTLANG, /* Text-with-language value */
627 IPP_TAG_NAMELANG, /* Name-with-language value */
628 IPP_TAG_END_COLLECTION, /* End of collection value */
629 IPP_TAG_TEXT = 0x41, /* Text value */
630 IPP_TAG_NAME, /* Name value */
631 IPP_TAG_RESERVED_STRING, /* Reserved for future string value @private@ */
632 IPP_TAG_KEYWORD, /* Keyword value */
633 IPP_TAG_URI, /* URI value */
634 IPP_TAG_URISCHEME, /* URI scheme value */
635 IPP_TAG_CHARSET, /* Character set value */
636 IPP_TAG_LANGUAGE, /* Language value */
637 IPP_TAG_MIMETYPE, /* MIME media type value */
638 IPP_TAG_MEMBERNAME, /* Collection member name value */
639 IPP_TAG_EXTENSION = 0x7f, /* Extension point for 32-bit tags */
a469f8a5 640 IPP_TAG_CUPS_MASK = 0x7fffffff, /* Mask for copied attribute values @private@ */
a2326b5b 641 /* The following expression is used to avoid compiler warnings with +/-0x80000000 */
a469f8a5
MS
642 IPP_TAG_CUPS_CONST = -0x7fffffff-1 /* Bitflag for copied/const attribute values @private@ */
643
644# ifndef _CUPS_NO_DEPRECATED
645# define IPP_TAG_MASK IPP_TAG_CUPS_MASK
646# define IPP_TAG_COPY IPP_TAG_CUPS_CONST
647# endif /* !_CUPS_NO_DEPRECATED */
a2326b5b 648} ipp_tag_t;
ef416fc2 649
a2326b5b
MS
650typedef unsigned char ipp_uchar_t; /**** Unsigned 8-bit integer/character ****/
651typedef struct _ipp_s ipp_t; /**** IPP request/response data ****/
652typedef struct _ipp_attribute_s ipp_attribute_t;
653 /**** IPP attribute ****/
ef416fc2 654
f3c17241 655/**** New in CUPS 1.2/OS X 10.5 ****/
a2326b5b 656typedef ssize_t (*ipp_iocb_t)(void *context, ipp_uchar_t *buffer, size_t bytes);
f3c17241 657 /**** IPP IO Callback Function @since CUPS 1.2/OS X 10.5@ ****/
aaf19ab0 658
f3c17241 659/**** New in CUPS 1.6/OS X 10.8 ****/
a2326b5b 660typedef int (*ipp_copycb_t)(void *context, ipp_t *dst, ipp_attribute_t *attr);
ef416fc2 661
662
82cc1f9a 663/*
f3c17241
MS
664 * The following structures are PRIVATE starting with CUPS 1.6/OS X 10.8.
665 * Please use the new accessor functions available in CUPS 1.6 and later, as
666 * these definitions will be moved to a private header file in a future release.
82cc1f9a 667 *
a469f8a5 668 * Define _IPP_PRIVATE_STRUCTURES to 1 to cause the private IPP structures to be
f3c17241
MS
669 * exposed in CUPS 1.6. This happens automatically on OS X when compiling for
670 * a deployment target of 10.7 or earlier.
a469f8a5
MS
671 *
672 * Define _IPP_PRIVATE_STRUCTURES to 0 to prevent the private IPP structures
673 * from being exposed. This is useful when migrating existing code to the new
674 * accessors.
82cc1f9a
MS
675 */
676
a469f8a5
MS
677# ifdef _IPP_PRIVATE_STRUCTURES
678 /* Somebody has overridden the value */
679# elif defined(_CUPS_SOURCE) || defined(_CUPS_IPP_PRIVATE_H_)
82cc1f9a
MS
680 /* Building CUPS */
681# define _IPP_PRIVATE_STRUCTURES 1
682# elif defined(__APPLE__)
683# if defined(MAC_OS_X_VERSION_10_8) && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8
684 /* Building for 10.7 and earlier */
685# define _IPP_PRIVATE_STRUCTURES 1
686# elif !defined(MAC_OS_X_VERSION_10_8)
687 /* Building for 10.7 and earlier */
688# define _IPP_PRIVATE_STRUCTURES 1
689# endif /* MAC_OS_X_VERSION_10_8 && MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_8 */
a469f8a5
MS
690# else
691# define _IPP_PRIVATE_STRUCTURES 0
82cc1f9a
MS
692# endif /* _CUPS_SOURCE || _CUPS_IPP_PRIVATE_H_ */
693
a469f8a5 694# if _IPP_PRIVATE_STRUCTURES
82cc1f9a
MS
695typedef union _ipp_request_u /**** Request Header ****/
696{
697 struct /* Any Header */
698 {
699 ipp_uchar_t version[2]; /* Protocol version number */
700 int op_status; /* Operation ID or status code*/
701 int request_id; /* Request ID */
702 } any;
703
704 struct /* Operation Header */
705 {
706 ipp_uchar_t version[2]; /* Protocol version number */
707 ipp_op_t operation_id; /* Operation ID */
708 int request_id; /* Request ID */
709 } op;
710
711 struct /* Status Header */
712 {
713 ipp_uchar_t version[2]; /* Protocol version number */
714 ipp_status_t status_code; /* Status code */
715 int request_id; /* Request ID */
716 } status;
717
718 /**** New in CUPS 1.1.19 ****/
f3c17241 719 struct /* Event Header @since CUPS 1.1.19/OS X 10.3@ */
82cc1f9a
MS
720 {
721 ipp_uchar_t version[2]; /* Protocol version number */
722 ipp_status_t status_code; /* Status code */
723 int request_id; /* Request ID */
724 } event;
725} _ipp_request_t;
726
727/**** New in CUPS 1.1.19 ****/
728
729typedef union _ipp_value_u /**** Attribute Value ****/
730{
731 int integer; /* Integer/enumerated value */
732
733 char boolean; /* Boolean value */
734
735 ipp_uchar_t date[11]; /* Date/time value */
736
737 struct
738 {
739 int xres, /* Horizontal resolution */
740 yres; /* Vertical resolution */
741 ipp_res_t units; /* Resolution units */
742 } resolution; /* Resolution value */
743
744 struct
745 {
746 int lower, /* Lower value */
747 upper; /* Upper value */
748 } range; /* Range of integers value */
749
750 struct
751 {
752 char *language; /* Language code */
753 char *text; /* String */
754 } string; /* String with language value */
755
756 struct
757 {
758 int length; /* Length of attribute */
759 void *data; /* Data in attribute */
760 } unknown; /* Unknown attribute type */
761
762/**** New in CUPS 1.1.19 ****/
f3c17241 763 ipp_t *collection; /* Collection value @since CUPS 1.1.19/OS X 10.3@ */
82cc1f9a
MS
764} _ipp_value_t;
765typedef _ipp_value_t ipp_value_t; /**** Convenience typedef that will be removed @private@ ****/
766
767struct _ipp_attribute_s /**** Attribute ****/
768{
769 ipp_attribute_t *next; /* Next attribute in list */
770 ipp_tag_t group_tag, /* Job/Printer/Operation group tag */
771 value_tag; /* What type of value is it? */
772 char *name; /* Name of attribute */
773 int num_values; /* Number of values */
774 _ipp_value_t values[1]; /* Values */
775};
776
777struct _ipp_s /**** IPP Request/Response/Notification ****/
778{
779 ipp_state_t state; /* State of request */
780 _ipp_request_t request; /* Request header */
781 ipp_attribute_t *attrs; /* Attributes */
782 ipp_attribute_t *last; /* Last attribute in list */
783 ipp_attribute_t *current; /* Current attribute (for read/write) */
784 ipp_tag_t curtag; /* Current attribute group tag */
785
786/**** New in CUPS 1.2 ****/
f3c17241 787 ipp_attribute_t *prev; /* Previous attribute (for read) @since CUPS 1.2/OS X 10.5@ */
82cc1f9a
MS
788
789/**** New in CUPS 1.4.4 ****/
f3c17241 790 int use; /* Use count @since CUPS 1.4.4/OS X 10.6.?@ */
82cc1f9a
MS
791};
792# endif /* _IPP_PRIVATE_STRUCTURES */
793
794
ef416fc2 795/*
796 * Prototypes...
797 */
798
fa73b229 799extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group,
800 const char *name, char value);
801extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group,
802 const char *name, int num_values,
803 const char *values);
804extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group,
805 const char *name, const ipp_uchar_t *value);
806extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group,
a2326b5b 807 ipp_tag_t value_tag, const char *name,
fa73b229 808 int value);
809extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group,
a2326b5b 810 ipp_tag_t value_tag, const char *name,
fa73b229 811 int num_values, const int *values);
812extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group,
813 const char *name, int lower, int upper);
814extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group,
815 const char *name, int num_values,
816 const int *lower, const int *upper);
817extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group,
818 const char *name, ipp_res_t units,
819 int xres, int yres);
820extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group,
821 const char *name, int num_values,
822 ipp_res_t units, const int *xres,
823 const int *yres);
ef416fc2 824extern ipp_attribute_t *ippAddSeparator(ipp_t *ipp);
fa73b229 825extern ipp_attribute_t *ippAddString(ipp_t *ipp, ipp_tag_t group,
a2326b5b
MS
826 ipp_tag_t value_tag, const char *name,
827 const char *language, const char *value);
fa73b229 828extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group,
a2326b5b
MS
829 ipp_tag_t value_tag, const char *name,
830 int num_values, const char *language,
fa73b229 831 const char * const *values);
ef416fc2 832extern time_t ippDateToTime(const ipp_uchar_t *date);
833extern void ippDelete(ipp_t *ipp);
834extern const char *ippErrorString(ipp_status_t error);
835extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name,
a2326b5b 836 ipp_tag_t value_tag);
ef416fc2 837extern ipp_attribute_t *ippFindNextAttribute(ipp_t *ipp, const char *name,
a2326b5b 838 ipp_tag_t value_tag);
ef416fc2 839extern size_t ippLength(ipp_t *ipp);
840extern ipp_t *ippNew(void);
841extern ipp_state_t ippRead(http_t *http, ipp_t *ipp);
842extern const ipp_uchar_t *ippTimeToDate(time_t t);
843extern ipp_state_t ippWrite(http_t *http, ipp_t *ipp);
844extern int ippPort(void);
845extern void ippSetPort(int p);
846
847/**** New in CUPS 1.1.19 ****/
fa73b229 848extern ipp_attribute_t *ippAddCollection(ipp_t *ipp, ipp_tag_t group,
2fb76298 849 const char *name, ipp_t *value) _CUPS_API_1_1_19;
fa73b229 850extern ipp_attribute_t *ippAddCollections(ipp_t *ipp, ipp_tag_t group,
851 const char *name, int num_values,
2fb76298
MS
852 const ipp_t **values) _CUPS_API_1_1_19;
853extern void ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr) _CUPS_API_1_1_19;
854extern ipp_state_t ippReadFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19;
855extern ipp_state_t ippWriteFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19;
ef416fc2 856
f3c17241 857/**** New in CUPS 1.2/OS X 10.5 ****/
ef416fc2 858extern ipp_attribute_t *ippAddOctetString(ipp_t *ipp, ipp_tag_t group,
859 const char *name,
2fb76298
MS
860 const void *data, int datalen) _CUPS_API_1_2;
861extern ipp_status_t ippErrorValue(const char *name) _CUPS_API_1_2;
862extern ipp_t *ippNewRequest(ipp_op_t op) _CUPS_API_1_2;
863extern const char *ippOpString(ipp_op_t op) _CUPS_API_1_2;
864extern ipp_op_t ippOpValue(const char *name) _CUPS_API_1_2;
a4d04587 865extern ipp_state_t ippReadIO(void *src, ipp_iocb_t cb, int blocking,
2fb76298 866 ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2;
a4d04587 867extern ipp_state_t ippWriteIO(void *dst, ipp_iocb_t cb, int blocking,
2fb76298 868 ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2;
ef416fc2 869
f3c17241 870/**** New in CUPS 1.4/OS X 10.6 ****/
1ff0402e
MS
871extern const char *ippTagString(ipp_tag_t tag) _CUPS_API_1_4;
872extern ipp_tag_t ippTagValue(const char *name) _CUPS_API_1_4;
873
f3c17241 874/**** New in CUPS 1.6/OS X 10.8 ****/
9c80ffa2
MS
875extern ipp_attribute_t *ippAddOutOfBand(ipp_t *ipp, ipp_tag_t group,
876 ipp_tag_t value_tag, const char *name)
877 _CUPS_API_1_6;
a2326b5b
MS
878extern size_t ippAttributeString(ipp_attribute_t *attr, char *buffer,
879 size_t bufsize) _CUPS_API_1_6;
880extern ipp_attribute_t *ippCopyAttribute(ipp_t *dst, ipp_attribute_t *attr,
881 int quickcopy) _CUPS_API_1_6;
882extern int ippCopyAttributes(ipp_t *dst, ipp_t *src,
9c80ffa2
MS
883 int quickcopy, ipp_copycb_t cb,
884 void *context) _CUPS_API_1_6;
885extern int ippDeleteValues(ipp_t *ipp, ipp_attribute_t **attr,
886 int element, int count) _CUPS_API_1_6;
887extern const char *ippEnumString(const char *attrname, int enumvalue)
888 _CUPS_API_1_6;
889extern int ippEnumValue(const char *attrname,
890 const char *enumstring) _CUPS_API_1_6;
a2326b5b
MS
891extern ipp_attribute_t *ippFirstAttribute(ipp_t *ipp) _CUPS_API_1_6;
892extern int ippGetBoolean(ipp_attribute_t *attr, int element)
893 _CUPS_API_1_6;
894extern ipp_t *ippGetCollection(ipp_attribute_t *attr,
895 int element) _CUPS_API_1_6;
896extern int ippGetCount(ipp_attribute_t *attr) _CUPS_API_1_6;
9c80ffa2
MS
897extern const ipp_uchar_t *ippGetDate(ipp_attribute_t *attr, int element)
898 _CUPS_API_1_6;
a2326b5b
MS
899extern ipp_tag_t ippGetGroupTag(ipp_attribute_t *attr) _CUPS_API_1_6;
900extern int ippGetInteger(ipp_attribute_t *attr, int element)
901 _CUPS_API_1_6;
902extern const char *ippGetName(ipp_attribute_t *attr) _CUPS_API_1_6;
903extern ipp_op_t ippGetOperation(ipp_t *ipp) _CUPS_API_1_6;
9c80ffa2
MS
904extern int ippGetRange(ipp_attribute_t *attr, int element,
905 int *upper) _CUPS_API_1_6;
a2326b5b
MS
906extern int ippGetRequestId(ipp_t *ipp) _CUPS_API_1_6;
907extern int ippGetResolution(ipp_attribute_t *attr, int element,
9c80ffa2
MS
908 int *yres, ipp_res_t *units)
909 _CUPS_API_1_6;
910extern ipp_state_t ippGetState(ipp_t *ipp) _CUPS_API_1_6;
a2326b5b
MS
911extern ipp_status_t ippGetStatusCode(ipp_t *ipp) _CUPS_API_1_6;
912extern const char *ippGetString(ipp_attribute_t *attr, int element,
913 const char **language) _CUPS_API_1_6;
914extern ipp_tag_t ippGetValueTag(ipp_attribute_t *attr) _CUPS_API_1_6;
915extern int ippGetVersion(ipp_t *ipp, int *minor) _CUPS_API_1_6;
916extern ipp_attribute_t *ippNextAttribute(ipp_t *ipp) _CUPS_API_1_6;
917extern int ippSetBoolean(ipp_t *ipp, ipp_attribute_t **attr,
918 int element, int boolvalue) _CUPS_API_1_6;
919extern int ippSetCollection(ipp_t *ipp, ipp_attribute_t **attr,
9c80ffa2
MS
920 int element, ipp_t *colvalue)
921 _CUPS_API_1_6;
922extern int ippSetDate(ipp_t *ipp, ipp_attribute_t **attr,
923 int element, const ipp_uchar_t *datevalue)
924 _CUPS_API_1_6;
a2326b5b
MS
925extern int ippSetGroupTag(ipp_t *ipp, ipp_attribute_t **attr,
926 ipp_tag_t group_tag) _CUPS_API_1_6;
927extern int ippSetInteger(ipp_t *ipp, ipp_attribute_t **attr,
928 int element, int intvalue) _CUPS_API_1_6;
9c80ffa2
MS
929extern int ippSetName(ipp_t *ipp, ipp_attribute_t **attr,
930 const char *name) _CUPS_API_1_6;
a2326b5b 931extern int ippSetOperation(ipp_t *ipp, ipp_op_t op) _CUPS_API_1_6;
9c80ffa2
MS
932extern int ippSetRange(ipp_t *ipp, ipp_attribute_t **attr,
933 int element, int lowervalue, int uppervalue)
934 _CUPS_API_1_6;
a2326b5b
MS
935extern int ippSetRequestId(ipp_t *ipp, int request_id)
936 _CUPS_API_1_6;
937extern int ippSetResolution(ipp_t *ipp, ipp_attribute_t **attr,
938 int element, ipp_res_t unitsvalue,
9c80ffa2
MS
939 int xresvalue, int yresvalue)
940 _CUPS_API_1_6;
941extern int ippSetState(ipp_t *ipp, ipp_state_t state)
942 _CUPS_API_1_6;
943extern int ippSetStatusCode(ipp_t *ipp, ipp_status_t status)
944 _CUPS_API_1_6;
a2326b5b 945extern int ippSetString(ipp_t *ipp, ipp_attribute_t **attr,
9c80ffa2
MS
946 int element, const char *strvalue)
947 _CUPS_API_1_6;
a2326b5b
MS
948extern int ippSetValueTag(ipp_t *ipp, ipp_attribute_t **attr,
949 ipp_tag_t value_tag) _CUPS_API_1_6;
9c80ffa2
MS
950extern int ippSetVersion(ipp_t *ipp, int major, int minor)
951 _CUPS_API_1_6;
a2326b5b 952
a469f8a5
MS
953/**** New in CUPS 1.7 ****/
954extern ipp_attribute_t *ippAddStringf(ipp_t *ipp, ipp_tag_t group,
955 ipp_tag_t value_tag, const char *name,
956 const char *language, const char *format,
957 ...) _CUPS_API_1_7;
958extern ipp_attribute_t *ippAddStringfv(ipp_t *ipp, ipp_tag_t group,
959 ipp_tag_t value_tag, const char *name,
960 const char *language,
961 const char *format, va_list ap)
962 _CUPS_API_1_7;
963extern int ippContainsInteger(ipp_attribute_t *attr, int value)
964 _CUPS_API_1_7;
965extern int ippContainsString(ipp_attribute_t *attr,
966 const char *value) _CUPS_API_1_7;
db8b865d 967extern cups_array_t *ippCreateRequestedArray(ipp_t *request) _CUPS_API_1_7;
6961465f
MS
968extern void *ippGetOctetString(ipp_attribute_t *attr, int element,
969 int *datalen) _CUPS_API_1_7;
a469f8a5 970extern ipp_t *ippNewResponse(ipp_t *request) _CUPS_API_1_7;
6961465f
MS
971extern int ippSetOctetString(ipp_t *ipp, ipp_attribute_t **attr,
972 int element, const void *data,
973 int datalen) _CUPS_API_1_7;
a469f8a5
MS
974extern int ippSetStringf(ipp_t *ipp, ipp_attribute_t **attr,
975 int element, const char *format,
976 ...) _CUPS_API_1_7;
977extern int ippSetStringfv(ipp_t *ipp, ipp_attribute_t **attr,
978 int element, const char *format,
979 va_list ap) _CUPS_API_1_7;
c1420c87
MS
980extern int ippValidateAttribute(ipp_attribute_t *attr)
981 _CUPS_API_1_7;
982extern int ippValidateAttributes(ipp_t *ipp) _CUPS_API_1_7;
a469f8a5 983
ef416fc2 984
985/*
986 * C++ magic...
987 */
988
989# ifdef __cplusplus
990}
991# endif /* __cplusplus */
992#endif /* !_CUPS_IPP_H_ */
993
994/*
f2d18633 995 * End of "$Id$".
ef416fc2 996 */