2 * "$Id: ipp.h 7847 2008-08-19 04:22:14Z mike $"
4 * Internet Printing Protocol definitions for CUPS.
6 * Copyright 2007-2011 by Apple Inc.
7 * Copyright 1997-2006 by Easy Software Products.
9 * These coded instructions, statements, and computer programs are the
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/".
15 * This file is subject to the Apple OS-Developed Software exception.
22 * Include necessary headers...
34 # endif /* __cplusplus */
38 * IPP version string...
41 # define IPP_VERSION "\002\001"
44 * IPP registered port number...
46 * Note: Applications should never use IPP_PORT, but instead use the
47 * ippPort() function to allow overrides via the IPP_PORT environment
48 * variable and services file if needed!
57 # define IPP_MAX_LENGTH 32767 /* Maximum size of any single value */
58 # define IPP_MAX_NAME 256 /* Maximum length of common name values */
59 # define IPP_MAX_VALUES 8 /* Power-of-2 allocation increment */
63 * Types and structures...
66 typedef enum ipp_dstate_e
/**** Document states ****/
68 IPP_DOCUMENT_PENDING
= 3,
69 IPP_DOCUMENT_PROCESSING
= 5,
70 IPP_DOCUMENT_CANCELED
= 7,
72 IPP_DOCUMENT_COMPLETED
75 typedef enum ipp_finish_e
/**** Finishings ****/
77 IPP_FINISHINGS_NONE
= 3, /* No finishing */
78 IPP_FINISHINGS_STAPLE
, /* Staple (any location) */
79 IPP_FINISHINGS_PUNCH
, /* Punch (any location/count) */
80 IPP_FINISHINGS_COVER
, /* Add cover */
81 IPP_FINISHINGS_BIND
, /* Bind */
82 IPP_FINISHINGS_SADDLE_STITCH
, /* Staple interior */
83 IPP_FINISHINGS_EDGE_STITCH
, /* Stitch along any side */
84 IPP_FINISHINGS_FOLD
, /* Fold (any type) */
85 IPP_FINISHINGS_TRIM
, /* Trim (any type) */
86 IPP_FINISHINGS_BALE
, /* Bale (any type) */
87 IPP_FINISHINGS_BOOKLET_MAKER
, /* Fold to make booklet */
88 IPP_FINISHINGS_JOB_OFFSET
, /* Offset for binding (any type) */
89 IPP_FINISHINGS_STAPLE_TOP_LEFT
= 20, /* Staple top left corner */
90 IPP_FINISHINGS_STAPLE_BOTTOM_LEFT
, /* Staple bottom left corner */
91 IPP_FINISHINGS_STAPLE_TOP_RIGHT
, /* Staple top right corner */
92 IPP_FINISHINGS_STAPLE_BOTTOM_RIGHT
, /* Staple bottom right corner */
93 IPP_FINISHINGS_EDGE_STITCH_LEFT
, /* Stitch along left side */
94 IPP_FINISHINGS_EDGE_STITCH_TOP
, /* Stitch along top edge */
95 IPP_FINISHINGS_EDGE_STITCH_RIGHT
, /* Stitch along right side */
96 IPP_FINISHINGS_EDGE_STITCH_BOTTOM
, /* Stitch along bottom edge */
97 IPP_FINISHINGS_STAPLE_DUAL_LEFT
, /* Two staples on left */
98 IPP_FINISHINGS_STAPLE_DUAL_TOP
, /* Two staples on top */
99 IPP_FINISHINGS_STAPLE_DUAL_RIGHT
, /* Two staples on right */
100 IPP_FINISHINGS_STAPLE_DUAL_BOTTOM
, /* Two staples on bottom */
101 IPP_FINISHINGS_BIND_LEFT
= 50, /* Bind on left */
102 IPP_FINISHINGS_BIND_TOP
, /* Bind on top */
103 IPP_FINISHINGS_BIND_RIGHT
, /* Bind on right */
104 IPP_FINISHINGS_BIND_BOTTOM
, /* Bind on bottom */
105 IPP_FINISHINGS_TRIM_AFTER_PAGES
= 60, /* Trim output after each page */
106 IPP_FINISHINGS_TRIM_AFTER_DOCUMENTS
, /* Trim output after each document */
107 IPP_FINISHINGS_TRIM_AFTER_COPIES
, /* Trim output after each copy */
108 IPP_FINISHINGS_TRIM_AFTER_JOB
/* Trim output after job */
111 typedef enum ipp_jcollate_e
/**** Job collation types ****/
113 IPP_JOB_UNCOLLATED_SHEETS
= 3,
114 IPP_JOB_COLLATED_DOCUMENTS
,
115 IPP_JOB_UNCOLLATED_DOCUMENTS
118 typedef enum ipp_jstate_e
/**** Job states ****/
120 IPP_JOB_PENDING
= 3, /* Job is waiting to be printed */
121 IPP_JOB_HELD
, /* Job is held for printing */
122 IPP_JOB_PROCESSING
, /* Job is currently printing */
123 IPP_JOB_STOPPED
, /* Job has been stopped */
124 IPP_JOB_CANCELED
, /* Job has been canceled */
125 IPP_JOB_ABORTED
, /* Job has aborted due to error */
126 IPP_JOB_COMPLETED
/* Job has completed successfully */
127 /* Legacy name for canceled state */
128 #define IPP_JOB_CANCELLED IPP_JOB_CANCELED
131 typedef enum ipp_op_e
/**** IPP operations ****/
133 IPP_PRINT_JOB
= 0x0002, /* Print a single file */
134 IPP_PRINT_URI
, /* Print a single URL @private@ */
135 IPP_VALIDATE_JOB
, /* Validate job options */
136 IPP_CREATE_JOB
, /* Create an empty print job */
137 IPP_SEND_DOCUMENT
, /* Add a file to a job */
138 IPP_SEND_URI
, /* Add a URL to a job @private@ */
139 IPP_CANCEL_JOB
, /* Cancel a job */
140 IPP_GET_JOB_ATTRIBUTES
, /* Get job attributes */
141 IPP_GET_JOBS
, /* Get a list of jobs */
142 IPP_GET_PRINTER_ATTRIBUTES
, /* Get printer attributes */
143 IPP_HOLD_JOB
, /* Hold a job for printing */
144 IPP_RELEASE_JOB
, /* Release a job for printing */
145 IPP_RESTART_JOB
, /* Reprint a job */
146 IPP_PAUSE_PRINTER
= 0x0010, /* Stop a printer */
147 IPP_RESUME_PRINTER
, /* Start a printer */
148 IPP_PURGE_JOBS
, /* Cancel all jobs */
149 IPP_SET_PRINTER_ATTRIBUTES
, /* Set printer attributes @private@ */
150 IPP_SET_JOB_ATTRIBUTES
, /* Set job attributes */
151 IPP_GET_PRINTER_SUPPORTED_VALUES
, /* Get supported attribute values */
152 IPP_CREATE_PRINTER_SUBSCRIPTION
, /* Create a printer subscription @since CUPS 1.2/Mac OS X 10.5@ */
153 IPP_CREATE_JOB_SUBSCRIPTION
, /* Create a job subscription @since CUPS 1.2/Mac OS X 10.5@ */
154 IPP_GET_SUBSCRIPTION_ATTRIBUTES
, /* Get subscription attributes @since CUPS 1.2/Mac OS X 10.5@ */
155 IPP_GET_SUBSCRIPTIONS
, /* Get list of subscriptions @since CUPS 1.2/Mac OS X 10.5@ */
156 IPP_RENEW_SUBSCRIPTION
, /* Renew a printer subscription @since CUPS 1.2/Mac OS X 10.5@ */
157 IPP_CANCEL_SUBSCRIPTION
, /* Cancel a subscription @since CUPS 1.2/Mac OS X 10.5@ */
158 IPP_GET_NOTIFICATIONS
, /* Get notification events @since CUPS 1.2/Mac OS X 10.5@ */
159 IPP_SEND_NOTIFICATIONS
, /* Send notification events @private@ */
160 IPP_GET_RESOURCE_ATTRIBUTES
, /* Get resource attributes @private@ */
161 IPP_GET_RESOURCE_DATA
, /* Get resource data @private@ */
162 IPP_GET_RESOURCES
, /* Get list of resources @private@ */
163 IPP_GET_PRINT_SUPPORT_FILES
, /* Get printer support files @private@ */
164 IPP_ENABLE_PRINTER
, /* Start a printer */
165 IPP_DISABLE_PRINTER
, /* Stop a printer */
166 IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB
, /* Stop printer after the current job @private@ */
167 IPP_HOLD_NEW_JOBS
, /* Hold new jobs @private@ */
168 IPP_RELEASE_HELD_NEW_JOBS
, /* Release new jobs @private@ */
169 IPP_DEACTIVATE_PRINTER
, /* Stop a printer @private@ */
170 IPP_ACTIVATE_PRINTER
, /* Start a printer @private@ */
171 IPP_RESTART_PRINTER
, /* Restart a printer @private@ */
172 IPP_SHUTDOWN_PRINTER
, /* Turn a printer off @private@ */
173 IPP_STARTUP_PRINTER
, /* Turn a printer on @private@ */
174 IPP_REPROCESS_JOB
, /* Reprint a job @private@ */
175 IPP_CANCEL_CURRENT_JOB
, /* Cancel the current job @private@ */
176 IPP_SUSPEND_CURRENT_JOB
, /* Suspend the current job @private@ */
177 IPP_RESUME_JOB
, /* Resume the current job @private@ */
178 IPP_PROMOTE_JOB
, /* Promote a job to print sooner @private@ */
179 IPP_SCHEDULE_JOB_AFTER
, /* Schedule a job to print after another @private@ */
180 IPP_CANCEL_DOCUMENT
= 0x0033, /* Cancel-Document @private@ */
181 IPP_GET_DOCUMENT_ATTRIBUTES
, /* Get-Document-Attributes @private@ */
182 IPP_GET_DOCUMENTS
, /* Get-Documents @private@ */
183 IPP_DELETE_DOCUMENT
, /* Delete-Document @private@ */
184 IPP_SET_DOCUMENT_ATTRIBUTES
, /* Set-Document-Attributes @private@ */
185 IPP_CANCEL_JOBS
, /* Cancel-Jobs */
186 IPP_CANCEL_MY_JOBS
, /* Cancel-My-Jobs */
187 IPP_RESUBMIT_JOB
, /* Resubmit-Job */
188 IPP_CLOSE_JOB
, /* Close-Job */
189 IPP_IDENTIFY_PRINTER
, /* Identify-Printer (proposed IPP JPS3) */
190 IPP_PRIVATE
= 0x4000, /* Reserved @private@ */
191 CUPS_GET_DEFAULT
, /* Get the default printer */
192 CUPS_GET_PRINTERS
, /* Get a list of printers and/or classes */
193 CUPS_ADD_MODIFY_PRINTER
, /* Add or modify a printer */
194 CUPS_DELETE_PRINTER
, /* Delete a printer */
195 CUPS_GET_CLASSES
, /* Get a list of classes @deprecated@ */
196 CUPS_ADD_MODIFY_CLASS
, /* Add or modify a class */
197 CUPS_DELETE_CLASS
, /* Delete a class */
198 CUPS_ACCEPT_JOBS
, /* Accept new jobs on a printer */
199 CUPS_REJECT_JOBS
, /* Reject new jobs on a printer */
200 CUPS_SET_DEFAULT
, /* Set the default printer */
201 CUPS_GET_DEVICES
, /* Get a list of supported devices */
202 CUPS_GET_PPDS
, /* Get a list of supported drivers */
203 CUPS_MOVE_JOB
, /* Move a job to a different printer */
204 CUPS_AUTHENTICATE_JOB
, /* Authenticate a job @since CUPS 1.2/Mac OS X 10.5@ */
205 CUPS_GET_PPD
, /* Get a PPD file @since CUPS 1.3/Mac OS X 10.5@ */
206 CUPS_GET_DOCUMENT
= 0x4027 /* Get a document file @since CUPS 1.4/Mac OS X 10.6@ */
208 /* Legacy names for the add operations */
209 #define CUPS_ADD_PRINTER CUPS_ADD_MODIFY_PRINTER
210 #define CUPS_ADD_CLASS CUPS_ADD_MODIFY_CLASS
213 typedef enum ipp_orient_e
/**** Orientation values ****/
215 IPP_PORTRAIT
= 3, /* No rotation */
216 IPP_LANDSCAPE
, /* 90 degrees counter-clockwise */
217 IPP_REVERSE_LANDSCAPE
, /* 90 degrees clockwise */
218 IPP_REVERSE_PORTRAIT
/* 180 degrees */
221 typedef enum ipp_pstate_e
/**** Printer states ****/
223 IPP_PRINTER_IDLE
= 3, /* Printer is idle */
224 IPP_PRINTER_PROCESSING
, /* Printer is working */
225 IPP_PRINTER_STOPPED
/* Printer is stopped */
228 typedef enum ipp_quality_e
/**** Qualities ****/
230 IPP_QUALITY_DRAFT
= 3, /* Draft quality */
231 IPP_QUALITY_NORMAL
, /* Normal quality */
232 IPP_QUALITY_HIGH
/* High quality */
235 typedef enum ipp_res_e
/**** Resolution units ****/
237 IPP_RES_PER_INCH
= 3, /* Pixels per inch */
238 IPP_RES_PER_CM
/* Pixels per centimeter */
241 typedef enum ipp_state_e
/**** IPP states ****/
243 IPP_ERROR
= -1, /* An error occurred */
244 IPP_IDLE
, /* Nothing is happening/request completed */
245 IPP_HEADER
, /* The request header needs to be sent/received */
246 IPP_ATTRIBUTE
, /* One or more attributes need to be sent/received */
247 IPP_DATA
/* IPP request data needs to be sent/received */
250 typedef enum ipp_status_e
/**** IPP status codes ****/
252 IPP_OK
= 0x0000, /* successful-ok */
253 IPP_OK_SUBST
, /* successful-ok-ignored-or-substituted-attributes */
254 IPP_OK_CONFLICT
, /* successful-ok-conflicting-attributes */
255 IPP_OK_IGNORED_SUBSCRIPTIONS
, /* successful-ok-ignored-subscriptions */
256 IPP_OK_IGNORED_NOTIFICATIONS
, /* successful-ok-ignored-notifications @private@ */
257 IPP_OK_TOO_MANY_EVENTS
, /* successful-ok-too-many-events */
258 IPP_OK_BUT_CANCEL_SUBSCRIPTION
, /* successful-ok-but-cancel-subscription @private@ */
259 IPP_OK_EVENTS_COMPLETE
, /* successful-ok-events-complete */
260 IPP_REDIRECTION_OTHER_SITE
= 0x200, /* redirection-other-site @private@ */
261 CUPS_SEE_OTHER
= 0x280, /* cups-see-other */
262 IPP_BAD_REQUEST
= 0x0400, /* client-error-bad-request */
263 IPP_FORBIDDEN
, /* client-error-forbidden */
264 IPP_NOT_AUTHENTICATED
, /* client-error-not-authenticated */
265 IPP_NOT_AUTHORIZED
, /* client-error-not-authorized */
266 IPP_NOT_POSSIBLE
, /* client-error-not-possible */
267 IPP_TIMEOUT
, /* client-error-timeout */
268 IPP_NOT_FOUND
, /* client-error-not-found */
269 IPP_GONE
, /* client-error-gone */
270 IPP_REQUEST_ENTITY
, /* client-error-request-entity-too-large */
271 IPP_REQUEST_VALUE
, /* client-error-request-value-too-long */
272 IPP_DOCUMENT_FORMAT
, /* client-error-document-format-not-supported */
273 IPP_ATTRIBUTES
, /* client-error-attributes-or-values-not-supported */
274 IPP_URI_SCHEME
, /* client-error-uri-scheme-not-supported */
275 IPP_CHARSET
, /* client-error-charset-not-supported */
276 IPP_CONFLICT
, /* client-error-conflicting-attributes */
277 IPP_COMPRESSION_NOT_SUPPORTED
, /* client-error-compression-not-supported */
278 IPP_COMPRESSION_ERROR
, /* client-error-compression-error */
279 IPP_DOCUMENT_FORMAT_ERROR
, /* client-error-document-format-error */
280 IPP_DOCUMENT_ACCESS_ERROR
, /* client-error-document-access-error */
281 IPP_ATTRIBUTES_NOT_SETTABLE
, /* client-error-attributes-not-settable */
282 IPP_IGNORED_ALL_SUBSCRIPTIONS
, /* client-error-ignored-all-subscriptions */
283 IPP_TOO_MANY_SUBSCRIPTIONS
, /* client-error-too-many-subscriptions */
284 IPP_IGNORED_ALL_NOTIFICATIONS
, /* client-error-ignored-all-notifications @private@ */
285 IPP_PRINT_SUPPORT_FILE_NOT_FOUND
, /* client-error-print-support-file-not-found @private@ */
286 IPP_DOCUMENT_PASSWORD_ERROR
, /* client-error-document-password-error */
287 IPP_DOCUMENT_PERMISSION_ERROR
, /* client-error-document-permission-error */
288 IPP_DOCUMENT_SECURITY_ERROR
, /* client-error-document-security-error */
289 IPP_DOCUMENT_UNPRINTABLE_ERROR
, /* client-error-document-unprintable-error */
291 IPP_INTERNAL_ERROR
= 0x0500, /* server-error-internal-error */
292 IPP_OPERATION_NOT_SUPPORTED
, /* server-error-operation-not-supported */
293 IPP_SERVICE_UNAVAILABLE
, /* server-error-service-unavailable */
294 IPP_VERSION_NOT_SUPPORTED
, /* server-error-version-not-supported */
295 IPP_DEVICE_ERROR
, /* server-error-device-error */
296 IPP_TEMPORARY_ERROR
, /* server-error-temporary-error */
297 IPP_NOT_ACCEPTING
, /* server-error-not-accepting-jobs */
298 IPP_PRINTER_BUSY
, /* server-error-busy */
299 IPP_ERROR_JOB_CANCELED
, /* server-error-job-canceled */
300 IPP_MULTIPLE_JOBS_NOT_SUPPORTED
, /* server-error-multiple-document-jobs-not-supported */
301 IPP_PRINTER_IS_DEACTIVATED
, /* server-error-printer-is-deactivated */
302 IPP_TOO_MANY_JOBS
, /* server-error-too-many-jobs */
303 IPP_TOO_MANY_DOCUMENTS
, /* server-error-too-many-documents */
305 IPP_AUTHENTICATION_CANCELED
= 0x1000, /* Authentication canceled by user @since CUPS 1.5/Mac OS X 10.7@ */
306 IPP_PKI_ERROR
, /* Error negotiating a secure connection @since CUPS 1.5/Mac OS X 10.7@ */
307 IPP_UPGRADE_REQUIRED
/* TLS upgrade required */
309 /* Legacy name for canceled status */
310 #define IPP_ERROR_JOB_CANCELLED IPP_ERROR_JOB_CANCELED
314 typedef enum ipp_tag_e
/**** Format tags for attributes ****/
316 IPP_TAG_ZERO
= 0x00, /* Zero tag - used for separators */
317 IPP_TAG_OPERATION
, /* Operation group */
318 IPP_TAG_JOB
, /* Job group */
319 IPP_TAG_END
, /* End-of-attributes */
320 IPP_TAG_PRINTER
, /* Printer group */
321 IPP_TAG_UNSUPPORTED_GROUP
, /* Unsupported attributes group */
322 IPP_TAG_SUBSCRIPTION
, /* Subscription group */
323 IPP_TAG_EVENT_NOTIFICATION
, /* Event group */
324 IPP_TAG_RESOURCE
, /* Resource group @private@ */
325 IPP_TAG_DOCUMENT
, /* Document group */
326 IPP_TAG_UNSUPPORTED_VALUE
= 0x10, /* Unsupported value */
327 IPP_TAG_DEFAULT
, /* Default value */
328 IPP_TAG_UNKNOWN
, /* Unknown value */
329 IPP_TAG_NOVALUE
, /* No-value value */
330 IPP_TAG_NOTSETTABLE
= 0x15, /* Not-settable value */
331 IPP_TAG_DELETEATTR
, /* Delete-attribute value */
332 IPP_TAG_ADMINDEFINE
, /* Admin-defined value */
333 IPP_TAG_INTEGER
= 0x21, /* Integer value */
334 IPP_TAG_BOOLEAN
, /* Boolean value */
335 IPP_TAG_ENUM
, /* Enumeration value */
336 IPP_TAG_STRING
= 0x30, /* Octet string value */
337 IPP_TAG_DATE
, /* Date/time value */
338 IPP_TAG_RESOLUTION
, /* Resolution value */
339 IPP_TAG_RANGE
, /* Range value */
340 IPP_TAG_BEGIN_COLLECTION
, /* Beginning of collection value */
341 IPP_TAG_TEXTLANG
, /* Text-with-language value */
342 IPP_TAG_NAMELANG
, /* Name-with-language value */
343 IPP_TAG_END_COLLECTION
, /* End of collection value */
344 IPP_TAG_TEXT
= 0x41, /* Text value */
345 IPP_TAG_NAME
, /* Name value */
346 IPP_TAG_RESERVED_STRING
, /* Reserved for future string value @private@ */
347 IPP_TAG_KEYWORD
, /* Keyword value */
348 IPP_TAG_URI
, /* URI value */
349 IPP_TAG_URISCHEME
, /* URI scheme value */
350 IPP_TAG_CHARSET
, /* Character set value */
351 IPP_TAG_LANGUAGE
, /* Language value */
352 IPP_TAG_MIMETYPE
, /* MIME media type value */
353 IPP_TAG_MEMBERNAME
, /* Collection member name value */
354 IPP_TAG_EXTENSION
= 0x7f, /* Extension point for 32-bit tags */
355 IPP_TAG_MASK
= 0x7fffffff, /* Mask for copied attribute values @private@ */
356 /* The following expression is used to avoid compiler warnings with +/-0x80000000 */
357 IPP_TAG_COPY
= -0x7fffffff-1 /* Bitflag for copied attribute values @private@ */
360 typedef unsigned char ipp_uchar_t
; /**** Unsigned 8-bit integer/character ****/
361 typedef struct _ipp_s ipp_t
; /**** IPP request/response data ****/
362 typedef struct _ipp_attribute_s ipp_attribute_t
;
363 /**** IPP attribute ****/
365 /**** New in CUPS 1.2 ****/
366 typedef ssize_t (*ipp_iocb_t
)(void *context
, ipp_uchar_t
*buffer
, size_t bytes
);
367 /**** IPP IO Callback Function @since CUPS 1.2/Mac OS X 10.5@ ****/
369 /**** New in CUPS 1.6 ****/
370 typedef int (*ipp_copycb_t
)(void *context
, ipp_t
*dst
, ipp_attribute_t
*attr
);
377 extern ipp_attribute_t
*ippAddBoolean(ipp_t
*ipp
, ipp_tag_t group
,
378 const char *name
, char value
);
379 extern ipp_attribute_t
*ippAddBooleans(ipp_t
*ipp
, ipp_tag_t group
,
380 const char *name
, int num_values
,
382 extern ipp_attribute_t
*ippAddDate(ipp_t
*ipp
, ipp_tag_t group
,
383 const char *name
, const ipp_uchar_t
*value
);
384 extern ipp_attribute_t
*ippAddInteger(ipp_t
*ipp
, ipp_tag_t group
,
385 ipp_tag_t value_tag
, const char *name
,
387 extern ipp_attribute_t
*ippAddIntegers(ipp_t
*ipp
, ipp_tag_t group
,
388 ipp_tag_t value_tag
, const char *name
,
389 int num_values
, const int *values
);
390 extern ipp_attribute_t
*ippAddRange(ipp_t
*ipp
, ipp_tag_t group
,
391 const char *name
, int lower
, int upper
);
392 extern ipp_attribute_t
*ippAddRanges(ipp_t
*ipp
, ipp_tag_t group
,
393 const char *name
, int num_values
,
394 const int *lower
, const int *upper
);
395 extern ipp_attribute_t
*ippAddResolution(ipp_t
*ipp
, ipp_tag_t group
,
396 const char *name
, ipp_res_t units
,
398 extern ipp_attribute_t
*ippAddResolutions(ipp_t
*ipp
, ipp_tag_t group
,
399 const char *name
, int num_values
,
400 ipp_res_t units
, const int *xres
,
402 extern ipp_attribute_t
*ippAddSeparator(ipp_t
*ipp
);
403 extern ipp_attribute_t
*ippAddString(ipp_t
*ipp
, ipp_tag_t group
,
404 ipp_tag_t value_tag
, const char *name
,
405 const char *language
, const char *value
);
406 extern ipp_attribute_t
*ippAddStrings(ipp_t
*ipp
, ipp_tag_t group
,
407 ipp_tag_t value_tag
, const char *name
,
408 int num_values
, const char *language
,
409 const char * const *values
);
410 extern time_t ippDateToTime(const ipp_uchar_t
*date
);
411 extern void ippDelete(ipp_t
*ipp
);
412 extern const char *ippErrorString(ipp_status_t error
);
413 extern ipp_attribute_t
*ippFindAttribute(ipp_t
*ipp
, const char *name
,
414 ipp_tag_t value_tag
);
415 extern ipp_attribute_t
*ippFindNextAttribute(ipp_t
*ipp
, const char *name
,
416 ipp_tag_t value_tag
);
417 extern size_t ippLength(ipp_t
*ipp
);
418 extern ipp_t
*ippNew(void);
419 extern ipp_state_t
ippRead(http_t
*http
, ipp_t
*ipp
);
420 extern const ipp_uchar_t
*ippTimeToDate(time_t t
);
421 extern ipp_state_t
ippWrite(http_t
*http
, ipp_t
*ipp
);
422 extern int ippPort(void);
423 extern void ippSetPort(int p
);
425 /**** New in CUPS 1.1.19 ****/
426 extern ipp_attribute_t
*ippAddCollection(ipp_t
*ipp
, ipp_tag_t group
,
427 const char *name
, ipp_t
*value
) _CUPS_API_1_1_19
;
428 extern ipp_attribute_t
*ippAddCollections(ipp_t
*ipp
, ipp_tag_t group
,
429 const char *name
, int num_values
,
430 const ipp_t
**values
) _CUPS_API_1_1_19
;
431 extern void ippDeleteAttribute(ipp_t
*ipp
, ipp_attribute_t
*attr
) _CUPS_API_1_1_19
;
432 extern ipp_state_t
ippReadFile(int fd
, ipp_t
*ipp
) _CUPS_API_1_1_19
;
433 extern ipp_state_t
ippWriteFile(int fd
, ipp_t
*ipp
) _CUPS_API_1_1_19
;
435 /**** New in CUPS 1.2/Mac OS X 10.5 ****/
436 extern ipp_attribute_t
*ippAddOctetString(ipp_t
*ipp
, ipp_tag_t group
,
438 const void *data
, int datalen
) _CUPS_API_1_2
;
439 extern ipp_status_t
ippErrorValue(const char *name
) _CUPS_API_1_2
;
440 extern ipp_t
*ippNewRequest(ipp_op_t op
) _CUPS_API_1_2
;
441 extern const char *ippOpString(ipp_op_t op
) _CUPS_API_1_2
;
442 extern ipp_op_t
ippOpValue(const char *name
) _CUPS_API_1_2
;
443 extern ipp_state_t
ippReadIO(void *src
, ipp_iocb_t cb
, int blocking
,
444 ipp_t
*parent
, ipp_t
*ipp
) _CUPS_API_1_2
;
445 extern ipp_state_t
ippWriteIO(void *dst
, ipp_iocb_t cb
, int blocking
,
446 ipp_t
*parent
, ipp_t
*ipp
) _CUPS_API_1_2
;
448 /**** New in CUPS 1.4/Mac OS X 10.6 ****/
449 extern const char *ippTagString(ipp_tag_t tag
) _CUPS_API_1_4
;
450 extern ipp_tag_t
ippTagValue(const char *name
) _CUPS_API_1_4
;
452 /**** New in CUPS 1.6 ****/
453 extern ipp_attribute_t
*ippAddOutOfBand(ipp_t
*ipp
, ipp_tag_t group
,
454 ipp_tag_t value_tag
, const char *name
)
456 extern size_t ippAttributeString(ipp_attribute_t
*attr
, char *buffer
,
457 size_t bufsize
) _CUPS_API_1_6
;
458 extern ipp_attribute_t
*ippCopyAttribute(ipp_t
*dst
, ipp_attribute_t
*attr
,
459 int quickcopy
) _CUPS_API_1_6
;
460 extern int ippCopyAttributes(ipp_t
*dst
, ipp_t
*src
,
461 int quickcopy
, ipp_copycb_t cb
,
462 void *context
) _CUPS_API_1_6
;
463 extern int ippDeleteValues(ipp_t
*ipp
, ipp_attribute_t
**attr
,
464 int element
, int count
) _CUPS_API_1_6
;
465 extern const char *ippEnumString(const char *attrname
, int enumvalue
)
467 extern int ippEnumValue(const char *attrname
,
468 const char *enumstring
) _CUPS_API_1_6
;
469 extern ipp_attribute_t
*ippFirstAttribute(ipp_t
*ipp
) _CUPS_API_1_6
;
470 extern int ippGetBoolean(ipp_attribute_t
*attr
, int element
)
472 extern ipp_t
*ippGetCollection(ipp_attribute_t
*attr
,
473 int element
) _CUPS_API_1_6
;
474 extern int ippGetCount(ipp_attribute_t
*attr
) _CUPS_API_1_6
;
475 extern const ipp_uchar_t
*ippGetDate(ipp_attribute_t
*attr
, int element
)
477 extern ipp_tag_t
ippGetGroupTag(ipp_attribute_t
*attr
) _CUPS_API_1_6
;
478 extern int ippGetInteger(ipp_attribute_t
*attr
, int element
)
480 extern const char *ippGetName(ipp_attribute_t
*attr
) _CUPS_API_1_6
;
481 extern ipp_op_t
ippGetOperation(ipp_t
*ipp
) _CUPS_API_1_6
;
482 extern int ippGetRange(ipp_attribute_t
*attr
, int element
,
483 int *upper
) _CUPS_API_1_6
;
484 extern int ippGetRequestId(ipp_t
*ipp
) _CUPS_API_1_6
;
485 extern int ippGetResolution(ipp_attribute_t
*attr
, int element
,
486 int *yres
, ipp_res_t
*units
)
488 extern ipp_state_t
ippGetState(ipp_t
*ipp
) _CUPS_API_1_6
;
489 extern ipp_status_t
ippGetStatusCode(ipp_t
*ipp
) _CUPS_API_1_6
;
490 extern const char *ippGetString(ipp_attribute_t
*attr
, int element
,
491 const char **language
) _CUPS_API_1_6
;
492 extern ipp_tag_t
ippGetValueTag(ipp_attribute_t
*attr
) _CUPS_API_1_6
;
493 extern int ippGetVersion(ipp_t
*ipp
, int *minor
) _CUPS_API_1_6
;
494 extern ipp_attribute_t
*ippNextAttribute(ipp_t
*ipp
) _CUPS_API_1_6
;
495 extern int ippSetBoolean(ipp_t
*ipp
, ipp_attribute_t
**attr
,
496 int element
, int boolvalue
) _CUPS_API_1_6
;
497 extern int ippSetCollection(ipp_t
*ipp
, ipp_attribute_t
**attr
,
498 int element
, ipp_t
*colvalue
)
500 extern int ippSetDate(ipp_t
*ipp
, ipp_attribute_t
**attr
,
501 int element
, const ipp_uchar_t
*datevalue
)
503 extern int ippSetGroupTag(ipp_t
*ipp
, ipp_attribute_t
**attr
,
504 ipp_tag_t group_tag
) _CUPS_API_1_6
;
505 extern int ippSetInteger(ipp_t
*ipp
, ipp_attribute_t
**attr
,
506 int element
, int intvalue
) _CUPS_API_1_6
;
507 extern int ippSetName(ipp_t
*ipp
, ipp_attribute_t
**attr
,
508 const char *name
) _CUPS_API_1_6
;
509 extern int ippSetOperation(ipp_t
*ipp
, ipp_op_t op
) _CUPS_API_1_6
;
510 extern int ippSetRange(ipp_t
*ipp
, ipp_attribute_t
**attr
,
511 int element
, int lowervalue
, int uppervalue
)
513 extern int ippSetRequestId(ipp_t
*ipp
, int request_id
)
515 extern int ippSetResolution(ipp_t
*ipp
, ipp_attribute_t
**attr
,
516 int element
, ipp_res_t unitsvalue
,
517 int xresvalue
, int yresvalue
)
519 extern int ippSetState(ipp_t
*ipp
, ipp_state_t state
)
521 extern int ippSetStatusCode(ipp_t
*ipp
, ipp_status_t status
)
523 extern int ippSetString(ipp_t
*ipp
, ipp_attribute_t
**attr
,
524 int element
, const char *strvalue
)
526 extern int ippSetValueTag(ipp_t
*ipp
, ipp_attribute_t
**attr
,
527 ipp_tag_t value_tag
) _CUPS_API_1_6
;
528 extern int ippSetVersion(ipp_t
*ipp
, int major
, int minor
)
538 # endif /* __cplusplus */
539 #endif /* !_CUPS_IPP_H_ */
542 * End of "$Id: ipp.h 7847 2008-08-19 04:22:14Z mike $".