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