]>
Commit | Line | Data |
---|---|---|
fa73b229 | 1 | /* |
75bd9771 | 2 | * "$Id: ipp-private.h 7259 2008-01-28 22:26:04Z mike $" |
fa73b229 | 3 | * |
71e16022 | 4 | * Private IPP definitions for CUPS. |
fa73b229 | 5 | * |
a2326b5b | 6 | * Copyright 2007-2011 by Apple Inc. |
fa73b229 | 7 | * Copyright 1997-2006 by Easy Software Products. |
8 | * | |
9 | * These coded instructions, statements, and computer programs are the | |
bc44d920 | 10 | * property of Apple Inc. and are protected by Federal copyright |
11 | * law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | * which should have been included with this file. If this file is | |
13 | * file is missing or damaged, see the license at "http://www.cups.org/". | |
fa73b229 | 14 | * |
15 | * This file is subject to the Apple OS-Developed Software exception. | |
16 | */ | |
17 | ||
18 | #ifndef _CUPS_IPP_PRIVATE_H_ | |
19 | # define _CUPS_IPP_PRIVATE_H_ | |
20 | ||
21 | /* | |
22 | * Include necessary headers... | |
23 | */ | |
24 | ||
71e16022 | 25 | # include <cups/ipp.h> |
fa73b229 | 26 | |
27 | ||
28 | /* | |
29 | * C++ magic... | |
30 | */ | |
31 | ||
32 | # ifdef __cplusplus | |
33 | extern "C" { | |
34 | # endif /* __cplusplus */ | |
35 | ||
36 | ||
1f6f3dbc MS |
37 | /* |
38 | * Constants... | |
39 | */ | |
40 | ||
41 | # define IPP_BUF_SIZE (IPP_MAX_LENGTH + 2) | |
42 | /* Size of buffer */ | |
43 | ||
44 | ||
8ca02f3c | 45 | /* |
46 | * Structures... | |
47 | */ | |
48 | ||
a2326b5b MS |
49 | typedef union _ipp_request_u /**** Request Header ****/ |
50 | { | |
51 | struct /* Any Header */ | |
52 | { | |
53 | ipp_uchar_t version[2]; /* Protocol version number */ | |
54 | int op_status; /* Operation ID or status code*/ | |
55 | int request_id; /* Request ID */ | |
56 | } any; | |
57 | ||
58 | struct /* Operation Header */ | |
59 | { | |
60 | ipp_uchar_t version[2]; /* Protocol version number */ | |
61 | ipp_op_t operation_id; /* Operation ID */ | |
62 | int request_id; /* Request ID */ | |
63 | } op; | |
64 | ||
65 | struct /* Status Header */ | |
66 | { | |
67 | ipp_uchar_t version[2]; /* Protocol version number */ | |
68 | ipp_status_t status_code; /* Status code */ | |
69 | int request_id; /* Request ID */ | |
70 | } status; | |
71 | ||
72 | /**** New in CUPS 1.1.19 ****/ | |
73 | struct /* Event Header @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
74 | { | |
75 | ipp_uchar_t version[2]; /* Protocol version number */ | |
76 | ipp_status_t status_code; /* Status code */ | |
77 | int request_id; /* Request ID */ | |
78 | } event; | |
79 | } _ipp_request_t; | |
80 | ||
81 | /**** New in CUPS 1.1.19 ****/ | |
82 | ||
83 | typedef union _ipp_value_u /**** Attribute Value ****/ | |
84 | { | |
85 | int integer; /* Integer/enumerated value */ | |
86 | ||
87 | char boolean; /* Boolean value */ | |
88 | ||
89 | ipp_uchar_t date[11]; /* Date/time value */ | |
90 | ||
91 | struct | |
92 | { | |
93 | int xres, /* Horizontal resolution */ | |
94 | yres; /* Vertical resolution */ | |
95 | ipp_res_t units; /* Resolution units */ | |
96 | } resolution; /* Resolution value */ | |
97 | ||
98 | struct | |
99 | { | |
100 | int lower, /* Lower value */ | |
101 | upper; /* Upper value */ | |
102 | } range; /* Range of integers value */ | |
103 | ||
104 | struct | |
105 | { | |
106 | char *language; /* Language code */ | |
107 | char *text; /* String */ | |
108 | } string; /* String with language value */ | |
109 | ||
110 | struct | |
111 | { | |
112 | int length; /* Length of attribute */ | |
113 | void *data; /* Data in attribute */ | |
114 | } unknown; /* Unknown attribute type */ | |
115 | ||
116 | /**** New in CUPS 1.1.19 ****/ | |
117 | ipp_t *collection; /* Collection value @since CUPS 1.1.19/Mac OS X 10.3@ */ | |
118 | } _ipp_value_t; | |
119 | ||
120 | struct _ipp_attribute_s /**** Attribute ****/ | |
121 | { | |
122 | ipp_attribute_t *next; /* Next attribute in list */ | |
123 | ipp_tag_t group_tag, /* Job/Printer/Operation group tag */ | |
124 | value_tag; /* What type of value is it? */ | |
125 | char *name; /* Name of attribute */ | |
126 | int num_values; /* Number of values */ | |
127 | _ipp_value_t values[1]; /* Values */ | |
128 | }; | |
129 | ||
130 | struct _ipp_s /**** IPP Request/Response/Notification ****/ | |
131 | { | |
132 | ipp_state_t state; /* State of request */ | |
133 | _ipp_request_t request; /* Request header */ | |
134 | ipp_attribute_t *attrs; /* Attributes */ | |
135 | ipp_attribute_t *last; /* Last attribute in list */ | |
136 | ipp_attribute_t *current; /* Current attribute (for read/write) */ | |
137 | ipp_tag_t curtag; /* Current attribute group tag */ | |
138 | ||
139 | /**** New in CUPS 1.2 ****/ | |
140 | ipp_attribute_t *prev; /* Previous attribute (for read) @since CUPS 1.2/Mac OS X 10.5@ */ | |
141 | ||
142 | /**** New in CUPS 1.4.4 ****/ | |
143 | int use; /* Use count @since CUPS 1.4.4/Mac OS X 10.6.?@ */ | |
144 | }; | |
145 | ||
1f6f3dbc MS |
146 | typedef struct _ipp_buffer_s /**** Read/write buffer ****/ |
147 | { | |
148 | unsigned char d[IPP_BUF_SIZE];/* Data buffer */ | |
149 | struct _ipp_buffer_s *next; /* Next buffer in list */ | |
150 | int used; /* Is this buffer used? */ | |
151 | } _ipp_buffer_t; | |
152 | ||
8ca02f3c | 153 | typedef struct /**** Attribute mapping data ****/ |
154 | { | |
5a738aea | 155 | int multivalue; /* Option has multiple values? */ |
8ca02f3c | 156 | const char *name; /* Option/attribute name */ |
157 | ipp_tag_t value_tag; /* Value tag for this attribute */ | |
158 | ipp_tag_t group_tag; /* Group tag for this attribute */ | |
159 | } _ipp_option_t; | |
160 | ||
161 | ||
fa73b229 | 162 | /* |
163 | * Prototypes for private functions... | |
164 | */ | |
165 | ||
8ca02f3c | 166 | extern _ipp_option_t *_ippFindOption(const char *name); |
fa73b229 | 167 | |
168 | ||
169 | /* | |
170 | * C++ magic... | |
171 | */ | |
172 | ||
173 | # ifdef __cplusplus | |
174 | } | |
175 | # endif /* __cplusplus */ | |
176 | #endif /* !_CUPS_IPP_H_ */ | |
177 | ||
178 | /* | |
75bd9771 | 179 | * End of "$Id: ipp-private.h 7259 2008-01-28 22:26:04Z mike $". |
fa73b229 | 180 | */ |