]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/ipp.h
950e4005c32ee8ca4048ea2a9cf3361239ed5d2e
[thirdparty/cups.git] / cups / ipp.h
1 /*
2 * "$Id: ipp.h 7847 2008-08-19 04:22:14Z mike $"
3 *
4 * Internet Printing Protocol definitions for CUPS.
5 *
6 * Copyright 2007-2011 by Apple Inc.
7 * Copyright 1997-2006 by Easy Software Products.
8 *
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/".
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"
26
27
28 /*
29 * C++ magic...
30 */
31
32 # ifdef __cplusplus
33 extern "C" {
34 # endif /* __cplusplus */
35
36
37 /*
38 * IPP version string...
39 */
40
41 # define IPP_VERSION "\002\001"
42
43 /*
44 * IPP registered port number...
45 *
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!
49 */
50
51 # define IPP_PORT 631
52
53 /*
54 * Common limits...
55 */
56
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 */
60
61
62 /*
63 * Types and structures...
64 */
65
66 typedef enum ipp_dstate_e /**** Document states ****/
67 {
68 IPP_DOCUMENT_PENDING = 3,
69 IPP_DOCUMENT_PROCESSING = 5,
70 IPP_DOCUMENT_CANCELED = 7,
71 IPP_DOCUMENT_ABORTED,
72 IPP_DOCUMENT_COMPLETED
73 } ipp_dstate_t;
74
75 typedef enum ipp_finish_e /**** Finishings ****/
76 {
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 */
109 } ipp_finish_t;
110
111 typedef enum ipp_jcollate_e /**** Job collation types ****/
112 {
113 IPP_JOB_UNCOLLATED_SHEETS = 3,
114 IPP_JOB_COLLATED_DOCUMENTS,
115 IPP_JOB_UNCOLLATED_DOCUMENTS
116 } ipp_jcollate_t;
117
118 typedef enum ipp_jstate_e /**** Job states ****/
119 {
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
129 } ipp_jstate_t;
130
131 typedef enum ipp_op_e /**** IPP operations ****/
132 {
133 IPP_OP_CUPS_INVALID = -1, /* Invalid operation name for @link ippOpValue@ */
134 IPP_PRINT_JOB = 0x0002, /* Print a single file */
135 IPP_PRINT_URI, /* Print a single URL @private@ */
136 IPP_VALIDATE_JOB, /* Validate job options */
137 IPP_CREATE_JOB, /* Create an empty print job */
138 IPP_SEND_DOCUMENT, /* Add a file to a job */
139 IPP_SEND_URI, /* Add a URL to a job @private@ */
140 IPP_CANCEL_JOB, /* Cancel a job */
141 IPP_GET_JOB_ATTRIBUTES, /* Get job attributes */
142 IPP_GET_JOBS, /* Get a list of jobs */
143 IPP_GET_PRINTER_ATTRIBUTES, /* Get printer attributes */
144 IPP_HOLD_JOB, /* Hold a job for printing */
145 IPP_RELEASE_JOB, /* Release a job for printing */
146 IPP_RESTART_JOB, /* Reprint a job */
147 IPP_PAUSE_PRINTER = 0x0010, /* Stop a printer */
148 IPP_RESUME_PRINTER, /* Start a printer */
149 IPP_PURGE_JOBS, /* Cancel all jobs */
150 IPP_SET_PRINTER_ATTRIBUTES, /* Set printer attributes @private@ */
151 IPP_SET_JOB_ATTRIBUTES, /* Set job attributes */
152 IPP_GET_PRINTER_SUPPORTED_VALUES, /* Get supported attribute values */
153 IPP_CREATE_PRINTER_SUBSCRIPTION, /* Create a printer subscription @since CUPS 1.2/Mac OS X 10.5@ */
154 IPP_CREATE_JOB_SUBSCRIPTION, /* Create a job subscription @since CUPS 1.2/Mac OS X 10.5@ */
155 IPP_GET_SUBSCRIPTION_ATTRIBUTES, /* Get subscription attributes @since CUPS 1.2/Mac OS X 10.5@ */
156 IPP_GET_SUBSCRIPTIONS, /* Get list of subscriptions @since CUPS 1.2/Mac OS X 10.5@ */
157 IPP_RENEW_SUBSCRIPTION, /* Renew a printer subscription @since CUPS 1.2/Mac OS X 10.5@ */
158 IPP_CANCEL_SUBSCRIPTION, /* Cancel a subscription @since CUPS 1.2/Mac OS X 10.5@ */
159 IPP_GET_NOTIFICATIONS, /* Get notification events @since CUPS 1.2/Mac OS X 10.5@ */
160 IPP_SEND_NOTIFICATIONS, /* Send notification events @private@ */
161 IPP_GET_RESOURCE_ATTRIBUTES, /* Get resource attributes @private@ */
162 IPP_GET_RESOURCE_DATA, /* Get resource data @private@ */
163 IPP_GET_RESOURCES, /* Get list of resources @private@ */
164 IPP_GET_PRINT_SUPPORT_FILES, /* Get printer support files @private@ */
165 IPP_ENABLE_PRINTER, /* Start a printer */
166 IPP_DISABLE_PRINTER, /* Stop a printer */
167 IPP_PAUSE_PRINTER_AFTER_CURRENT_JOB, /* Stop printer after the current job @private@ */
168 IPP_HOLD_NEW_JOBS, /* Hold new jobs @private@ */
169 IPP_RELEASE_HELD_NEW_JOBS, /* Release new jobs @private@ */
170 IPP_DEACTIVATE_PRINTER, /* Stop a printer @private@ */
171 IPP_ACTIVATE_PRINTER, /* Start a printer @private@ */
172 IPP_RESTART_PRINTER, /* Restart a printer @private@ */
173 IPP_SHUTDOWN_PRINTER, /* Turn a printer off @private@ */
174 IPP_STARTUP_PRINTER, /* Turn a printer on @private@ */
175 IPP_REPROCESS_JOB, /* Reprint a job @private@ */
176 IPP_CANCEL_CURRENT_JOB, /* Cancel the current job @private@ */
177 IPP_SUSPEND_CURRENT_JOB, /* Suspend the current job @private@ */
178 IPP_RESUME_JOB, /* Resume the current job @private@ */
179 IPP_PROMOTE_JOB, /* Promote a job to print sooner @private@ */
180 IPP_SCHEDULE_JOB_AFTER, /* Schedule a job to print after another @private@ */
181 IPP_CANCEL_DOCUMENT = 0x0033, /* Cancel-Document @private@ */
182 IPP_GET_DOCUMENT_ATTRIBUTES, /* Get-Document-Attributes @private@ */
183 IPP_GET_DOCUMENTS, /* Get-Documents @private@ */
184 IPP_DELETE_DOCUMENT, /* Delete-Document @private@ */
185 IPP_SET_DOCUMENT_ATTRIBUTES, /* Set-Document-Attributes @private@ */
186 IPP_CANCEL_JOBS, /* Cancel-Jobs */
187 IPP_CANCEL_MY_JOBS, /* Cancel-My-Jobs */
188 IPP_RESUBMIT_JOB, /* Resubmit-Job */
189 IPP_CLOSE_JOB, /* Close-Job */
190 IPP_IDENTIFY_PRINTER, /* Identify-Printer (proposed IPP JPS3) */
191 IPP_PRIVATE = 0x4000, /* Reserved @private@ */
192 CUPS_GET_DEFAULT, /* Get the default printer */
193 CUPS_GET_PRINTERS, /* Get a list of printers and/or classes */
194 CUPS_ADD_MODIFY_PRINTER, /* Add or modify a printer */
195 CUPS_DELETE_PRINTER, /* Delete a printer */
196 CUPS_GET_CLASSES, /* Get a list of classes @deprecated@ */
197 CUPS_ADD_MODIFY_CLASS, /* Add or modify a class */
198 CUPS_DELETE_CLASS, /* Delete a class */
199 CUPS_ACCEPT_JOBS, /* Accept new jobs on a printer */
200 CUPS_REJECT_JOBS, /* Reject new jobs on a printer */
201 CUPS_SET_DEFAULT, /* Set the default printer */
202 CUPS_GET_DEVICES, /* Get a list of supported devices */
203 CUPS_GET_PPDS, /* Get a list of supported drivers */
204 CUPS_MOVE_JOB, /* Move a job to a different printer */
205 CUPS_AUTHENTICATE_JOB, /* Authenticate a job @since CUPS 1.2/Mac OS X 10.5@ */
206 CUPS_GET_PPD, /* Get a PPD file @since CUPS 1.3/Mac OS X 10.5@ */
207 CUPS_GET_DOCUMENT = 0x4027 /* Get a document file @since CUPS 1.4/Mac OS X 10.6@ */
208
209 /* Legacy names for the add operations */
210 #define CUPS_ADD_PRINTER CUPS_ADD_MODIFY_PRINTER
211 #define CUPS_ADD_CLASS CUPS_ADD_MODIFY_CLASS
212 } ipp_op_t;
213
214 typedef enum ipp_orient_e /**** Orientation values ****/
215 {
216 IPP_PORTRAIT = 3, /* No rotation */
217 IPP_LANDSCAPE, /* 90 degrees counter-clockwise */
218 IPP_REVERSE_LANDSCAPE, /* 90 degrees clockwise */
219 IPP_REVERSE_PORTRAIT /* 180 degrees */
220 } ipp_orient_t;
221
222 typedef enum ipp_pstate_e /**** Printer states ****/
223 {
224 IPP_PRINTER_IDLE = 3, /* Printer is idle */
225 IPP_PRINTER_PROCESSING, /* Printer is working */
226 IPP_PRINTER_STOPPED /* Printer is stopped */
227 } ipp_pstate_t;
228
229 typedef enum ipp_quality_e /**** Qualities ****/
230 {
231 IPP_QUALITY_DRAFT = 3, /* Draft quality */
232 IPP_QUALITY_NORMAL, /* Normal quality */
233 IPP_QUALITY_HIGH /* High quality */
234 } ipp_quality_t;
235
236 typedef enum ipp_res_e /**** Resolution units ****/
237 {
238 IPP_RES_PER_INCH = 3, /* Pixels per inch */
239 IPP_RES_PER_CM /* Pixels per centimeter */
240 } ipp_res_t;
241
242 typedef enum ipp_state_e /**** IPP states ****/
243 {
244 IPP_ERROR = -1, /* An error occurred */
245 IPP_IDLE, /* Nothing is happening/request completed */
246 IPP_HEADER, /* The request header needs to be sent/received */
247 IPP_ATTRIBUTE, /* One or more attributes need to be sent/received */
248 IPP_DATA /* IPP request data needs to be sent/received */
249 } ipp_state_t;
250
251 typedef enum ipp_status_e /**** IPP status codes ****/
252 {
253 IPP_STATUS_CUPS_INVALID = -1, /* Invalid status name for @link ippErrorValue@ */
254 IPP_OK = 0x0000, /* successful-ok */
255 IPP_OK_SUBST, /* successful-ok-ignored-or-substituted-attributes */
256 IPP_OK_CONFLICT, /* successful-ok-conflicting-attributes */
257 IPP_OK_IGNORED_SUBSCRIPTIONS, /* successful-ok-ignored-subscriptions */
258 IPP_OK_IGNORED_NOTIFICATIONS, /* successful-ok-ignored-notifications @private@ */
259 IPP_OK_TOO_MANY_EVENTS, /* successful-ok-too-many-events */
260 IPP_OK_BUT_CANCEL_SUBSCRIPTION, /* successful-ok-but-cancel-subscription @private@ */
261 IPP_OK_EVENTS_COMPLETE, /* successful-ok-events-complete */
262 IPP_REDIRECTION_OTHER_SITE = 0x200, /* redirection-other-site @private@ */
263 CUPS_SEE_OTHER = 0x280, /* cups-see-other */
264 IPP_BAD_REQUEST = 0x0400, /* client-error-bad-request */
265 IPP_FORBIDDEN, /* client-error-forbidden */
266 IPP_NOT_AUTHENTICATED, /* client-error-not-authenticated */
267 IPP_NOT_AUTHORIZED, /* client-error-not-authorized */
268 IPP_NOT_POSSIBLE, /* client-error-not-possible */
269 IPP_TIMEOUT, /* client-error-timeout */
270 IPP_NOT_FOUND, /* client-error-not-found */
271 IPP_GONE, /* client-error-gone */
272 IPP_REQUEST_ENTITY, /* client-error-request-entity-too-large */
273 IPP_REQUEST_VALUE, /* client-error-request-value-too-long */
274 IPP_DOCUMENT_FORMAT, /* client-error-document-format-not-supported */
275 IPP_ATTRIBUTES, /* client-error-attributes-or-values-not-supported */
276 IPP_URI_SCHEME, /* client-error-uri-scheme-not-supported */
277 IPP_CHARSET, /* client-error-charset-not-supported */
278 IPP_CONFLICT, /* client-error-conflicting-attributes */
279 IPP_COMPRESSION_NOT_SUPPORTED, /* client-error-compression-not-supported */
280 IPP_COMPRESSION_ERROR, /* client-error-compression-error */
281 IPP_DOCUMENT_FORMAT_ERROR, /* client-error-document-format-error */
282 IPP_DOCUMENT_ACCESS_ERROR, /* client-error-document-access-error */
283 IPP_ATTRIBUTES_NOT_SETTABLE, /* client-error-attributes-not-settable */
284 IPP_IGNORED_ALL_SUBSCRIPTIONS, /* client-error-ignored-all-subscriptions */
285 IPP_TOO_MANY_SUBSCRIPTIONS, /* client-error-too-many-subscriptions */
286 IPP_IGNORED_ALL_NOTIFICATIONS, /* client-error-ignored-all-notifications @private@ */
287 IPP_PRINT_SUPPORT_FILE_NOT_FOUND, /* client-error-print-support-file-not-found @private@ */
288 IPP_DOCUMENT_PASSWORD_ERROR, /* client-error-document-password-error */
289 IPP_DOCUMENT_PERMISSION_ERROR, /* client-error-document-permission-error */
290 IPP_DOCUMENT_SECURITY_ERROR, /* client-error-document-security-error */
291 IPP_DOCUMENT_UNPRINTABLE_ERROR, /* client-error-document-unprintable-error */
292
293 IPP_INTERNAL_ERROR = 0x0500, /* server-error-internal-error */
294 IPP_OPERATION_NOT_SUPPORTED, /* server-error-operation-not-supported */
295 IPP_SERVICE_UNAVAILABLE, /* server-error-service-unavailable */
296 IPP_VERSION_NOT_SUPPORTED, /* server-error-version-not-supported */
297 IPP_DEVICE_ERROR, /* server-error-device-error */
298 IPP_TEMPORARY_ERROR, /* server-error-temporary-error */
299 IPP_NOT_ACCEPTING, /* server-error-not-accepting-jobs */
300 IPP_PRINTER_BUSY, /* server-error-busy */
301 IPP_ERROR_JOB_CANCELED, /* server-error-job-canceled */
302 IPP_MULTIPLE_JOBS_NOT_SUPPORTED, /* server-error-multiple-document-jobs-not-supported */
303 IPP_PRINTER_IS_DEACTIVATED, /* server-error-printer-is-deactivated */
304 IPP_TOO_MANY_JOBS, /* server-error-too-many-jobs */
305 IPP_TOO_MANY_DOCUMENTS, /* server-error-too-many-documents */
306
307 IPP_AUTHENTICATION_CANCELED = 0x1000, /* Authentication canceled by user @since CUPS 1.5/Mac OS X 10.7@ */
308 IPP_PKI_ERROR, /* Error negotiating a secure connection @since CUPS 1.5/Mac OS X 10.7@ */
309 IPP_UPGRADE_REQUIRED /* TLS upgrade required */
310
311 /* Legacy name for canceled status */
312 #define IPP_ERROR_JOB_CANCELLED IPP_ERROR_JOB_CANCELED
313
314 } ipp_status_t;
315
316 typedef enum ipp_tag_e /**** Format tags for attributes ****/
317 {
318 IPP_TAG_CUPS_INVALID = -1, /* Invalid tag name for @link ippTagValue@ */
319 IPP_TAG_ZERO = 0x00, /* Zero tag - used for separators */
320 IPP_TAG_OPERATION, /* Operation group */
321 IPP_TAG_JOB, /* Job group */
322 IPP_TAG_END, /* End-of-attributes */
323 IPP_TAG_PRINTER, /* Printer group */
324 IPP_TAG_UNSUPPORTED_GROUP, /* Unsupported attributes group */
325 IPP_TAG_SUBSCRIPTION, /* Subscription group */
326 IPP_TAG_EVENT_NOTIFICATION, /* Event group */
327 IPP_TAG_RESOURCE, /* Resource group @private@ */
328 IPP_TAG_DOCUMENT, /* Document group */
329 IPP_TAG_UNSUPPORTED_VALUE = 0x10, /* Unsupported value */
330 IPP_TAG_DEFAULT, /* Default value */
331 IPP_TAG_UNKNOWN, /* Unknown value */
332 IPP_TAG_NOVALUE, /* No-value value */
333 IPP_TAG_NOTSETTABLE = 0x15, /* Not-settable value */
334 IPP_TAG_DELETEATTR, /* Delete-attribute value */
335 IPP_TAG_ADMINDEFINE, /* Admin-defined value */
336 IPP_TAG_INTEGER = 0x21, /* Integer value */
337 IPP_TAG_BOOLEAN, /* Boolean value */
338 IPP_TAG_ENUM, /* Enumeration value */
339 IPP_TAG_STRING = 0x30, /* Octet string value */
340 IPP_TAG_DATE, /* Date/time value */
341 IPP_TAG_RESOLUTION, /* Resolution value */
342 IPP_TAG_RANGE, /* Range value */
343 IPP_TAG_BEGIN_COLLECTION, /* Beginning of collection value */
344 IPP_TAG_TEXTLANG, /* Text-with-language value */
345 IPP_TAG_NAMELANG, /* Name-with-language value */
346 IPP_TAG_END_COLLECTION, /* End of collection value */
347 IPP_TAG_TEXT = 0x41, /* Text value */
348 IPP_TAG_NAME, /* Name value */
349 IPP_TAG_RESERVED_STRING, /* Reserved for future string value @private@ */
350 IPP_TAG_KEYWORD, /* Keyword value */
351 IPP_TAG_URI, /* URI value */
352 IPP_TAG_URISCHEME, /* URI scheme value */
353 IPP_TAG_CHARSET, /* Character set value */
354 IPP_TAG_LANGUAGE, /* Language value */
355 IPP_TAG_MIMETYPE, /* MIME media type value */
356 IPP_TAG_MEMBERNAME, /* Collection member name value */
357 IPP_TAG_EXTENSION = 0x7f, /* Extension point for 32-bit tags */
358 IPP_TAG_MASK = 0x7fffffff, /* Mask for copied attribute values @private@ */
359 /* The following expression is used to avoid compiler warnings with +/-0x80000000 */
360 IPP_TAG_COPY = -0x7fffffff-1 /* Bitflag for copied attribute values @private@ */
361 } ipp_tag_t;
362
363 typedef unsigned char ipp_uchar_t; /**** Unsigned 8-bit integer/character ****/
364 typedef struct _ipp_s ipp_t; /**** IPP request/response data ****/
365 typedef struct _ipp_attribute_s ipp_attribute_t;
366 /**** IPP attribute ****/
367
368 /**** New in CUPS 1.2 ****/
369 typedef ssize_t (*ipp_iocb_t)(void *context, ipp_uchar_t *buffer, size_t bytes);
370 /**** IPP IO Callback Function @since CUPS 1.2/Mac OS X 10.5@ ****/
371
372 /**** New in CUPS 1.6 ****/
373 typedef int (*ipp_copycb_t)(void *context, ipp_t *dst, ipp_attribute_t *attr);
374
375
376 /*
377 * Prototypes...
378 */
379
380 extern ipp_attribute_t *ippAddBoolean(ipp_t *ipp, ipp_tag_t group,
381 const char *name, char value);
382 extern ipp_attribute_t *ippAddBooleans(ipp_t *ipp, ipp_tag_t group,
383 const char *name, int num_values,
384 const char *values);
385 extern ipp_attribute_t *ippAddDate(ipp_t *ipp, ipp_tag_t group,
386 const char *name, const ipp_uchar_t *value);
387 extern ipp_attribute_t *ippAddInteger(ipp_t *ipp, ipp_tag_t group,
388 ipp_tag_t value_tag, const char *name,
389 int value);
390 extern ipp_attribute_t *ippAddIntegers(ipp_t *ipp, ipp_tag_t group,
391 ipp_tag_t value_tag, const char *name,
392 int num_values, const int *values);
393 extern ipp_attribute_t *ippAddRange(ipp_t *ipp, ipp_tag_t group,
394 const char *name, int lower, int upper);
395 extern ipp_attribute_t *ippAddRanges(ipp_t *ipp, ipp_tag_t group,
396 const char *name, int num_values,
397 const int *lower, const int *upper);
398 extern ipp_attribute_t *ippAddResolution(ipp_t *ipp, ipp_tag_t group,
399 const char *name, ipp_res_t units,
400 int xres, int yres);
401 extern ipp_attribute_t *ippAddResolutions(ipp_t *ipp, ipp_tag_t group,
402 const char *name, int num_values,
403 ipp_res_t units, const int *xres,
404 const int *yres);
405 extern ipp_attribute_t *ippAddSeparator(ipp_t *ipp);
406 extern ipp_attribute_t *ippAddString(ipp_t *ipp, ipp_tag_t group,
407 ipp_tag_t value_tag, const char *name,
408 const char *language, const char *value);
409 extern ipp_attribute_t *ippAddStrings(ipp_t *ipp, ipp_tag_t group,
410 ipp_tag_t value_tag, const char *name,
411 int num_values, const char *language,
412 const char * const *values);
413 extern time_t ippDateToTime(const ipp_uchar_t *date);
414 extern void ippDelete(ipp_t *ipp);
415 extern const char *ippErrorString(ipp_status_t error);
416 extern ipp_attribute_t *ippFindAttribute(ipp_t *ipp, const char *name,
417 ipp_tag_t value_tag);
418 extern ipp_attribute_t *ippFindNextAttribute(ipp_t *ipp, const char *name,
419 ipp_tag_t value_tag);
420 extern size_t ippLength(ipp_t *ipp);
421 extern ipp_t *ippNew(void);
422 extern ipp_state_t ippRead(http_t *http, ipp_t *ipp);
423 extern const ipp_uchar_t *ippTimeToDate(time_t t);
424 extern ipp_state_t ippWrite(http_t *http, ipp_t *ipp);
425 extern int ippPort(void);
426 extern void ippSetPort(int p);
427
428 /**** New in CUPS 1.1.19 ****/
429 extern ipp_attribute_t *ippAddCollection(ipp_t *ipp, ipp_tag_t group,
430 const char *name, ipp_t *value) _CUPS_API_1_1_19;
431 extern ipp_attribute_t *ippAddCollections(ipp_t *ipp, ipp_tag_t group,
432 const char *name, int num_values,
433 const ipp_t **values) _CUPS_API_1_1_19;
434 extern void ippDeleteAttribute(ipp_t *ipp, ipp_attribute_t *attr) _CUPS_API_1_1_19;
435 extern ipp_state_t ippReadFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19;
436 extern ipp_state_t ippWriteFile(int fd, ipp_t *ipp) _CUPS_API_1_1_19;
437
438 /**** New in CUPS 1.2/Mac OS X 10.5 ****/
439 extern ipp_attribute_t *ippAddOctetString(ipp_t *ipp, ipp_tag_t group,
440 const char *name,
441 const void *data, int datalen) _CUPS_API_1_2;
442 extern ipp_status_t ippErrorValue(const char *name) _CUPS_API_1_2;
443 extern ipp_t *ippNewRequest(ipp_op_t op) _CUPS_API_1_2;
444 extern const char *ippOpString(ipp_op_t op) _CUPS_API_1_2;
445 extern ipp_op_t ippOpValue(const char *name) _CUPS_API_1_2;
446 extern ipp_state_t ippReadIO(void *src, ipp_iocb_t cb, int blocking,
447 ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2;
448 extern ipp_state_t ippWriteIO(void *dst, ipp_iocb_t cb, int blocking,
449 ipp_t *parent, ipp_t *ipp) _CUPS_API_1_2;
450
451 /**** New in CUPS 1.4/Mac OS X 10.6 ****/
452 extern const char *ippTagString(ipp_tag_t tag) _CUPS_API_1_4;
453 extern ipp_tag_t ippTagValue(const char *name) _CUPS_API_1_4;
454
455 /**** New in CUPS 1.6 ****/
456 extern ipp_attribute_t *ippAddOutOfBand(ipp_t *ipp, ipp_tag_t group,
457 ipp_tag_t value_tag, const char *name)
458 _CUPS_API_1_6;
459 extern size_t ippAttributeString(ipp_attribute_t *attr, char *buffer,
460 size_t bufsize) _CUPS_API_1_6;
461 extern ipp_attribute_t *ippCopyAttribute(ipp_t *dst, ipp_attribute_t *attr,
462 int quickcopy) _CUPS_API_1_6;
463 extern int ippCopyAttributes(ipp_t *dst, ipp_t *src,
464 int quickcopy, ipp_copycb_t cb,
465 void *context) _CUPS_API_1_6;
466 extern int ippDeleteValues(ipp_t *ipp, ipp_attribute_t **attr,
467 int element, int count) _CUPS_API_1_6;
468 extern const char *ippEnumString(const char *attrname, int enumvalue)
469 _CUPS_API_1_6;
470 extern int ippEnumValue(const char *attrname,
471 const char *enumstring) _CUPS_API_1_6;
472 extern ipp_attribute_t *ippFirstAttribute(ipp_t *ipp) _CUPS_API_1_6;
473 extern int ippGetBoolean(ipp_attribute_t *attr, int element)
474 _CUPS_API_1_6;
475 extern ipp_t *ippGetCollection(ipp_attribute_t *attr,
476 int element) _CUPS_API_1_6;
477 extern int ippGetCount(ipp_attribute_t *attr) _CUPS_API_1_6;
478 extern const ipp_uchar_t *ippGetDate(ipp_attribute_t *attr, int element)
479 _CUPS_API_1_6;
480 extern ipp_tag_t ippGetGroupTag(ipp_attribute_t *attr) _CUPS_API_1_6;
481 extern int ippGetInteger(ipp_attribute_t *attr, int element)
482 _CUPS_API_1_6;
483 extern const char *ippGetName(ipp_attribute_t *attr) _CUPS_API_1_6;
484 extern ipp_op_t ippGetOperation(ipp_t *ipp) _CUPS_API_1_6;
485 extern int ippGetRange(ipp_attribute_t *attr, int element,
486 int *upper) _CUPS_API_1_6;
487 extern int ippGetRequestId(ipp_t *ipp) _CUPS_API_1_6;
488 extern int ippGetResolution(ipp_attribute_t *attr, int element,
489 int *yres, ipp_res_t *units)
490 _CUPS_API_1_6;
491 extern ipp_state_t ippGetState(ipp_t *ipp) _CUPS_API_1_6;
492 extern ipp_status_t ippGetStatusCode(ipp_t *ipp) _CUPS_API_1_6;
493 extern const char *ippGetString(ipp_attribute_t *attr, int element,
494 const char **language) _CUPS_API_1_6;
495 extern ipp_tag_t ippGetValueTag(ipp_attribute_t *attr) _CUPS_API_1_6;
496 extern int ippGetVersion(ipp_t *ipp, int *minor) _CUPS_API_1_6;
497 extern ipp_attribute_t *ippNextAttribute(ipp_t *ipp) _CUPS_API_1_6;
498 extern int ippSetBoolean(ipp_t *ipp, ipp_attribute_t **attr,
499 int element, int boolvalue) _CUPS_API_1_6;
500 extern int ippSetCollection(ipp_t *ipp, ipp_attribute_t **attr,
501 int element, ipp_t *colvalue)
502 _CUPS_API_1_6;
503 extern int ippSetDate(ipp_t *ipp, ipp_attribute_t **attr,
504 int element, const ipp_uchar_t *datevalue)
505 _CUPS_API_1_6;
506 extern int ippSetGroupTag(ipp_t *ipp, ipp_attribute_t **attr,
507 ipp_tag_t group_tag) _CUPS_API_1_6;
508 extern int ippSetInteger(ipp_t *ipp, ipp_attribute_t **attr,
509 int element, int intvalue) _CUPS_API_1_6;
510 extern int ippSetName(ipp_t *ipp, ipp_attribute_t **attr,
511 const char *name) _CUPS_API_1_6;
512 extern int ippSetOperation(ipp_t *ipp, ipp_op_t op) _CUPS_API_1_6;
513 extern int ippSetRange(ipp_t *ipp, ipp_attribute_t **attr,
514 int element, int lowervalue, int uppervalue)
515 _CUPS_API_1_6;
516 extern int ippSetRequestId(ipp_t *ipp, int request_id)
517 _CUPS_API_1_6;
518 extern int ippSetResolution(ipp_t *ipp, ipp_attribute_t **attr,
519 int element, ipp_res_t unitsvalue,
520 int xresvalue, int yresvalue)
521 _CUPS_API_1_6;
522 extern int ippSetState(ipp_t *ipp, ipp_state_t state)
523 _CUPS_API_1_6;
524 extern int ippSetStatusCode(ipp_t *ipp, ipp_status_t status)
525 _CUPS_API_1_6;
526 extern int ippSetString(ipp_t *ipp, ipp_attribute_t **attr,
527 int element, const char *strvalue)
528 _CUPS_API_1_6;
529 extern int ippSetValueTag(ipp_t *ipp, ipp_attribute_t **attr,
530 ipp_tag_t value_tag) _CUPS_API_1_6;
531 extern int ippSetVersion(ipp_t *ipp, int major, int minor)
532 _CUPS_API_1_6;
533
534
535 /*
536 * C++ magic...
537 */
538
539 # ifdef __cplusplus
540 }
541 # endif /* __cplusplus */
542 #endif /* !_CUPS_IPP_H_ */
543
544 /*
545 * End of "$Id: ipp.h 7847 2008-08-19 04:22:14Z mike $".
546 */