xref: /titanic_52/usr/src/lib/print/libpapi-common/common/papi.h (revision a18dc42fc967d11feba9b8be61c6727dc6c56b48)
1355b4669Sjacobs /*
2355b4669Sjacobs  * CDDL HEADER START
3355b4669Sjacobs  *
4355b4669Sjacobs  * The contents of this file are subject to the terms of the
5355b4669Sjacobs  * Common Development and Distribution License (the "License").
6355b4669Sjacobs  * You may not use this file except in compliance with the License.
7355b4669Sjacobs  *
8355b4669Sjacobs  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9355b4669Sjacobs  * or http://www.opensolaris.org/os/licensing.
10355b4669Sjacobs  * See the License for the specific language governing permissions
11355b4669Sjacobs  * and limitations under the License.
12355b4669Sjacobs  *
13355b4669Sjacobs  * When distributing Covered Code, include this CDDL HEADER in each
14355b4669Sjacobs  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15355b4669Sjacobs  * If applicable, add the following below this CDDL HEADER, with the
16355b4669Sjacobs  * fields enclosed by brackets "[]" replaced with your own identifying
17355b4669Sjacobs  * information: Portions Copyright [yyyy] [name of copyright owner]
18355b4669Sjacobs  *
19355b4669Sjacobs  * CDDL HEADER END
20355b4669Sjacobs  */
21355b4669Sjacobs 
22355b4669Sjacobs /*
23*a18dc42fSps29005  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24355b4669Sjacobs  * Use is subject to license terms.
25355b4669Sjacobs  *
26355b4669Sjacobs  */
27355b4669Sjacobs 
28355b4669Sjacobs #ifndef _PAPI_H
29355b4669Sjacobs #define	_PAPI_H
30355b4669Sjacobs 
31355b4669Sjacobs /* $Id: papi.h 161 2006-05-03 04:32:59Z njacobs $ */
32355b4669Sjacobs 
33355b4669Sjacobs #pragma ident	"%Z%%M%	%I%	%E% SMI"
34355b4669Sjacobs 
35355b4669Sjacobs #include <sys/types.h>
36355b4669Sjacobs #include <time.h>
37355b4669Sjacobs #include <stdio.h>
38355b4669Sjacobs 
39355b4669Sjacobs #ifdef __cplusplus
40355b4669Sjacobs extern "C" {
41355b4669Sjacobs #endif
42355b4669Sjacobs 
43355b4669Sjacobs /*
44355b4669Sjacobs  * Types
45355b4669Sjacobs  */
46355b4669Sjacobs 
47355b4669Sjacobs /*	service related types	*/
48355b4669Sjacobs typedef void *papi_service_t;
49355b4669Sjacobs typedef void *papi_printer_t;
50355b4669Sjacobs typedef void *papi_job_t;
51355b4669Sjacobs typedef void *papi_stream_t;
52355b4669Sjacobs 
53355b4669Sjacobs typedef enum {
54355b4669Sjacobs 	PAPI_ENCRYPT_IF_REQUESTED,	/* Encrypt if requested (TLS upgrade) */
55355b4669Sjacobs 	PAPI_ENCRYPT_NEVER,		/* Never encrypt */
56355b4669Sjacobs 	PAPI_ENCRYPT_REQUIRED,		/* Encryption required (TLS upgrade) */
57355b4669Sjacobs 	PAPI_ENCRYPT_ALWAYS		/* Always encrypt (SSL) */
58355b4669Sjacobs } papi_encryption_t;
59355b4669Sjacobs 
60355b4669Sjacobs /*	attribute related types	*/
61355b4669Sjacobs typedef enum {
62355b4669Sjacobs 	PAPI_STRING,
63355b4669Sjacobs 	PAPI_INTEGER,
64355b4669Sjacobs 	PAPI_BOOLEAN,
65355b4669Sjacobs 	PAPI_RANGE,
66355b4669Sjacobs 	PAPI_RESOLUTION,
67355b4669Sjacobs 	PAPI_DATETIME,
68355b4669Sjacobs 	PAPI_COLLECTION,
69355b4669Sjacobs 	PAPI_METADATA
70355b4669Sjacobs } papi_attribute_value_type_t;
71355b4669Sjacobs 
72355b4669Sjacobs typedef enum {
73355b4669Sjacobs 	PAPI_RES_PER_INCH = 3,
74355b4669Sjacobs 	PAPI_RES_PER_CM
75355b4669Sjacobs } papi_resolution_unit_t;
76355b4669Sjacobs 
77355b4669Sjacobs enum {	/* for boolean values */
78355b4669Sjacobs 	PAPI_FALSE = 0,
79355b4669Sjacobs 	PAPI_TRUE = 1
80355b4669Sjacobs };
81355b4669Sjacobs 
82355b4669Sjacobs typedef enum {
83355b4669Sjacobs 	PAPI_UNSUPPORTED = 0x10,
84355b4669Sjacobs 	PAPI_DEFAULT = 0x11,
85355b4669Sjacobs 	PAPI_UNKNOWN,
86355b4669Sjacobs 	PAPI_NO_VALUE,
87355b4669Sjacobs 	PAPI_NOT_SETTABLE = 0x15,
88355b4669Sjacobs 	PAPI_DELETE = 0x16
89355b4669Sjacobs } papi_metadata_t;
90355b4669Sjacobs 
91355b4669Sjacobs #define	PAPI_LIST_JOBS_OTHERS		0x0001
92355b4669Sjacobs #define	PAPI_LIST_JOBS_COMPLETED	0x0002
93355b4669Sjacobs #define	PAPI_LIST_JOBS_NOT_COMPLETED	0x0004
94355b4669Sjacobs #define	PAPI_LIST_JOBS_ALL		0xFFFF
95355b4669Sjacobs 
96355b4669Sjacobs typedef struct papi_attribute_s papi_attribute_t;
97355b4669Sjacobs 
98355b4669Sjacobs typedef union {
99355b4669Sjacobs 	char *string;				/* PAPI_STRING value */
100355b4669Sjacobs 	int integer;				/* PAPI_INTEGER value */
101355b4669Sjacobs 	char boolean;				/* PAPI_BOOLEAN value */
102355b4669Sjacobs 	struct {				/* PAPI_RANGE value */
103355b4669Sjacobs 		int lower;
104355b4669Sjacobs 		int upper;
105355b4669Sjacobs 	} range;
106355b4669Sjacobs 	struct {				/* PAPI_RESOLUTION value */
107355b4669Sjacobs 		int xres;
108355b4669Sjacobs 		int yres;
109355b4669Sjacobs 		papi_resolution_unit_t units;
110355b4669Sjacobs 	} resolution;
111355b4669Sjacobs 	time_t datetime;			/* PAPI_DATETIME value */
112355b4669Sjacobs 	papi_attribute_t **collection;		/* PAPI_COLLECTION value */
113355b4669Sjacobs 	papi_metadata_t metadata;		/* PAPI_METADATA value */
114355b4669Sjacobs } papi_attribute_value_t;
115355b4669Sjacobs 
116355b4669Sjacobs struct papi_attribute_s {
117355b4669Sjacobs 	char *name;				/* attribute name */
118355b4669Sjacobs 	papi_attribute_value_type_t type;	/* type of values */
119355b4669Sjacobs 	papi_attribute_value_t **values;	/* list of values */
120355b4669Sjacobs };
121355b4669Sjacobs 
122355b4669Sjacobs #define	PAPI_ATTR_APPEND	0x0001	/* Add values to attr */
123355b4669Sjacobs #define	PAPI_ATTR_REPLACE	0x0002	/* Delete existing values, then add */
124355b4669Sjacobs #define	PAPI_ATTR_EXCL		0x0004	/* Fail if attr exists */
125355b4669Sjacobs 
126355b4669Sjacobs /*	job related types	*/
127355b4669Sjacobs typedef enum {
128355b4669Sjacobs 	PAPI_JT_FORMAT_JDF = 0,
129355b4669Sjacobs 	PAPI_JT_FORMAT_PWG = 1
130355b4669Sjacobs } papi_jt_format_t;
131355b4669Sjacobs 
132355b4669Sjacobs typedef struct {
133355b4669Sjacobs 	papi_jt_format_t format;
134355b4669Sjacobs 	char *ticket_data;
135355b4669Sjacobs 	char *file_name;
136355b4669Sjacobs } papi_job_ticket_t;
137355b4669Sjacobs 
138355b4669Sjacobs /*	status related types	*/
139355b4669Sjacobs typedef enum {
140355b4669Sjacobs 	PAPI_OK = 0x0000,
141355b4669Sjacobs 	PAPI_OK_SUBST,
142355b4669Sjacobs 	PAPI_OK_CONFLICT,
143355b4669Sjacobs 	PAPI_OK_IGNORED_SUBSCRIPTIONS,
144355b4669Sjacobs 	PAPI_OK_IGNORED_NOTIFICATIONS,
145355b4669Sjacobs 	PAPI_OK_TOO_MANY_EVENTS,
146355b4669Sjacobs 	PAPI_OK_BUT_CANCEL_SUBSCRIPTION,
147355b4669Sjacobs 	PAPI_REDIRECTION_OTHER_SITE = 0x0300,
148355b4669Sjacobs 	PAPI_BAD_REQUEST = 0x0400,
149355b4669Sjacobs 	PAPI_FORBIDDEN,
150355b4669Sjacobs 	PAPI_NOT_AUTHENTICATED,
151355b4669Sjacobs 	PAPI_NOT_AUTHORIZED,
152355b4669Sjacobs 	PAPI_NOT_POSSIBLE,
153355b4669Sjacobs 	PAPI_TIMEOUT,
154355b4669Sjacobs 	PAPI_NOT_FOUND,
155355b4669Sjacobs 	PAPI_GONE,
156355b4669Sjacobs 	PAPI_REQUEST_ENTITY,
157355b4669Sjacobs 	PAPI_REQUEST_VALUE,
158355b4669Sjacobs 	PAPI_DOCUMENT_FORMAT,
159355b4669Sjacobs 	PAPI_ATTRIBUTES,
160355b4669Sjacobs 	PAPI_URI_SCHEME,
161355b4669Sjacobs 	PAPI_CHARSET,
162355b4669Sjacobs 	PAPI_CONFLICT,
163355b4669Sjacobs 	PAPI_COMPRESSION_NOT_SUPPORTED,
164355b4669Sjacobs 	PAPI_COMPRESSION_ERROR,
165355b4669Sjacobs 	PAPI_DOCUMENT_FORMAT_ERROR,
166355b4669Sjacobs 	PAPI_DOCUMENT_ACCESS_ERROR,
167355b4669Sjacobs 	PAPI_ATTRIBUTES_NOT_SETTABLE,
168355b4669Sjacobs 	PAPI_IGNORED_ALL_SUBSCRIPTIONS,
169355b4669Sjacobs 	PAPI_TOO_MANY_SUBSCRIPTIONS,
170355b4669Sjacobs 	PAPI_IGNORED_ALL_NOTIFICATIONS,
171355b4669Sjacobs 	PAPI_PRINT_SUPPORT_FILE_NOT_FOUND,
172355b4669Sjacobs 	PAPI_INTERNAL_ERROR = 0x0500,
173355b4669Sjacobs 	PAPI_OPERATION_NOT_SUPPORTED,
174355b4669Sjacobs 	PAPI_SERVICE_UNAVAILABLE,
175355b4669Sjacobs 	PAPI_VERSION_NOT_SUPPORTED,
176355b4669Sjacobs 	PAPI_DEVICE_ERROR,
177355b4669Sjacobs 	PAPI_TEMPORARY_ERROR,
178355b4669Sjacobs 	PAPI_NOT_ACCEPTING,
179355b4669Sjacobs 	PAPI_PRINTER_BUSY,
180355b4669Sjacobs 	PAPI_ERROR_JOB_CANCELLED,
181355b4669Sjacobs 	PAPI_MULTIPLE_JOBS_NOT_SUPPORTED,
182355b4669Sjacobs 	PAPI_PRINTER_IS_DEACTIVATED,
183355b4669Sjacobs 	PAPI_BAD_ARGUMENT,
184355b4669Sjacobs 	PAPI_JOB_TICKET_NOT_SUPPORTED
185355b4669Sjacobs } papi_status_t;
186355b4669Sjacobs 
187355b4669Sjacobs /*	list filter related	*/
188355b4669Sjacobs typedef enum {
189355b4669Sjacobs 	PAPI_FILTER_BITMASK = 0
190355b4669Sjacobs } papi_filter_type_t;
191355b4669Sjacobs 
192355b4669Sjacobs typedef struct {
193355b4669Sjacobs 	papi_filter_type_t type;
194355b4669Sjacobs 	union {
195355b4669Sjacobs 		struct {			/* PAPI_FILTER_BITMASK */
196355b4669Sjacobs 			unsigned int mask;
197355b4669Sjacobs 			unsigned int value;
198355b4669Sjacobs 		} bitmask;
199355b4669Sjacobs 	} filter;
200355b4669Sjacobs } papi_filter_t;
201355b4669Sjacobs 
202355b4669Sjacobs enum {
203355b4669Sjacobs 	PAPI_PRINTER_LOCAL = 0x0000,	/* Local destination */
204355b4669Sjacobs 	PAPI_PRINTER_CLASS = 0x0001,	/* Printer class */
205355b4669Sjacobs 	PAPI_PRINTER_REMOTE = 0x0002,	/* Remote destination */
206355b4669Sjacobs 	PAPI_PRINTER_BW = 0x0004,	/* Can do B&W printing */
207355b4669Sjacobs 	PAPI_PRINTER_COLOR = 0x0008,	/* Can do color printing */
208355b4669Sjacobs 	PAPI_PRINTER_DUPLEX = 0x0010,	/* Can do duplex printing */
209355b4669Sjacobs 	PAPI_PRINTER_STAPLE = 0x0020,	/* Can do stapling */
210355b4669Sjacobs 	PAPI_PRINTER_COPIES = 0x0040,	/* Can do copies */
211355b4669Sjacobs 	PAPI_PRINTER_COLLATE = 0x0080,	/* Can collate copies */
212355b4669Sjacobs 	PAPI_PRINTER_PUNCH = 0x0100,	/* Can punch output */
213355b4669Sjacobs 	PAPI_PRINTER_COVER = 0x0200,	/* Can cover output */
214355b4669Sjacobs 	PAPI_PRINTER_BIND = 0x0400,	/* Can bind output */
215355b4669Sjacobs 	PAPI_PRINTER_SORT = 0x0800,	/* Can sort output */
216355b4669Sjacobs 	PAPI_PRINTER_SMALL = 0x1000,	/* Can do letter/legal/a4 */
217355b4669Sjacobs 	PAPI_PRINTER_MEDIUM = 0x2000,	/* Can do tabloid/B/C/A3/A2 */
218355b4669Sjacobs 	PAPI_PRINTER_LARGE = 0x4000,	/* Can do D/E/A1/A0 */
219355b4669Sjacobs 	PAPI_PRINTER_VARIABLE = 0x8000,	/* Can do variable sizes */
220355b4669Sjacobs 	PAPI_PRINTER_IMPLICIT = 0x10000, /* implicit class */
221355b4669Sjacobs 	PAPI_PRINTER_DEFAULT = 0x20000,	/* Default printer on network */
222355b4669Sjacobs 	PAPI_PRINTER_OPTIONS = 0xfffc	/* ~ (CLASS | REMOTE | IMPLICIT) */
223355b4669Sjacobs };
224355b4669Sjacobs 
225355b4669Sjacobs /*
226355b4669Sjacobs  * Functions
227355b4669Sjacobs  */
228355b4669Sjacobs 
229355b4669Sjacobs /* 	Service related		*/
230355b4669Sjacobs extern papi_status_t papiServiceCreate(papi_service_t *handle,
231355b4669Sjacobs 					char *service_name, char *user_name,
232355b4669Sjacobs 					char *password,
233355b4669Sjacobs 					int (*authCB)(papi_service_t svc,
234355b4669Sjacobs 							void *app_data),
235355b4669Sjacobs 					papi_encryption_t encryption,
236355b4669Sjacobs 					void *app_data);
237355b4669Sjacobs extern void papiServiceDestroy(papi_service_t handle);
238355b4669Sjacobs extern papi_status_t papiServiceSetUserName(papi_service_t handle,
239355b4669Sjacobs 					char *user_name);
240355b4669Sjacobs extern papi_status_t papiServiceSetPassword(papi_service_t handle,
241355b4669Sjacobs 					char *password);
242355b4669Sjacobs extern papi_status_t papiServiceSetEncryption(papi_service_t handle,
243355b4669Sjacobs 					papi_encryption_t encryption);
244355b4669Sjacobs extern papi_status_t papiServiceSetAuthCB(papi_service_t handle,
245355b4669Sjacobs 					int (*authCB)(papi_service_t s,
246355b4669Sjacobs 							void *app_data));
247355b4669Sjacobs extern papi_status_t papiServiceSetAppData(papi_service_t handle,
248355b4669Sjacobs 					void *app_data);
249355b4669Sjacobs extern char *papiServiceGetServiceName(papi_service_t handle);
250355b4669Sjacobs extern char *papiServiceGetUserName(papi_service_t handle);
251355b4669Sjacobs extern char *papiServiceGetPassword(papi_service_t handle);
252355b4669Sjacobs extern papi_encryption_t papiServiceGetEncryption(papi_service_t handle);
253355b4669Sjacobs extern void *papiServiceGetAppData(papi_service_t handle);
254355b4669Sjacobs extern papi_attribute_t **papiServiceGetAttributeList(papi_service_t handle);
255355b4669Sjacobs extern char *papiServiceGetStatusMessage(papi_service_t handle);
256355b4669Sjacobs 
257355b4669Sjacobs /*	Attribute related	 */
258355b4669Sjacobs extern papi_status_t papiAttributeListAddValue(papi_attribute_t ***attrs,
259355b4669Sjacobs 					int flags, char *name,
260355b4669Sjacobs 					papi_attribute_value_type_t type,
261355b4669Sjacobs 					papi_attribute_value_t *value);
262355b4669Sjacobs extern papi_status_t papiAttributeListAddString(papi_attribute_t ***attrs,
263355b4669Sjacobs 					int flags, char *name, char *string);
264355b4669Sjacobs extern papi_status_t papiAttributeListAddInteger(papi_attribute_t ***attrs,
265355b4669Sjacobs 					int flags, char *name, int integer);
266355b4669Sjacobs extern papi_status_t papiAttributeListAddBoolean(papi_attribute_t ***attrs,
267355b4669Sjacobs 					int flags, char *name, char boolean);
268355b4669Sjacobs extern papi_status_t papiAttributeListAddRange(papi_attribute_t ***attrs,
269355b4669Sjacobs 					int flags, char *name,
270355b4669Sjacobs 					int lower, int upper);
271355b4669Sjacobs extern papi_status_t papiAttributeListAddResolution(papi_attribute_t ***attrs,
272355b4669Sjacobs 					int flags, char *name,
273355b4669Sjacobs 					int xres, int yres,
274355b4669Sjacobs 					papi_resolution_unit_t units);
275355b4669Sjacobs extern papi_status_t papiAttributeListAddDatetime(papi_attribute_t ***attrs,
276355b4669Sjacobs 					int flags, char *name, time_t datetime);
277355b4669Sjacobs extern papi_status_t papiAttributeListAddCollection(papi_attribute_t ***attrs,
278355b4669Sjacobs 					int flags, char *name,
279355b4669Sjacobs 					papi_attribute_t **collection);
280355b4669Sjacobs extern papi_status_t papiAttributeListAddMetadata(papi_attribute_t ***attrs,
281355b4669Sjacobs 					int flags, char *name,
282355b4669Sjacobs 					papi_metadata_t metadata);
283355b4669Sjacobs extern papi_status_t papiAttributeListDelete(papi_attribute_t ***attributes,
284355b4669Sjacobs 					char *name);
285355b4669Sjacobs extern papi_status_t papiAttributeListGetValue(papi_attribute_t **list,
286355b4669Sjacobs 					void **iterator, char *name,
287355b4669Sjacobs 					papi_attribute_value_type_t type,
288355b4669Sjacobs 					papi_attribute_value_t **value);
289355b4669Sjacobs extern papi_status_t papiAttributeListGetString(papi_attribute_t **list,
290355b4669Sjacobs 					void **iterator, char *name,
291355b4669Sjacobs 					char **vptr);
292355b4669Sjacobs extern papi_status_t papiAttributeListGetInteger(papi_attribute_t **list,
293355b4669Sjacobs 					void **iterator, char *name, int *vptr);
294355b4669Sjacobs extern papi_status_t papiAttributeListGetBoolean(papi_attribute_t **list,
295355b4669Sjacobs 					void **iterator, char *name,
296355b4669Sjacobs 					char *vptr);
297355b4669Sjacobs extern papi_status_t papiAttributeListGetRange(papi_attribute_t **list,
298355b4669Sjacobs 					void **iterator, char *name,
299355b4669Sjacobs 					int *min, int *max);
300355b4669Sjacobs extern papi_status_t papiAttributeListGetResolution(papi_attribute_t **list,
301355b4669Sjacobs 					void **iterator, char *name,
302355b4669Sjacobs 					int *x, int *y,
303355b4669Sjacobs 					papi_resolution_unit_t *units);
304355b4669Sjacobs extern papi_status_t papiAttributeListGetDatetime(papi_attribute_t **list,
305355b4669Sjacobs 					void **iterator, char *name,
306355b4669Sjacobs 					time_t *dt);
307355b4669Sjacobs extern papi_status_t papiAttributeListGetCollection(papi_attribute_t **list,
308355b4669Sjacobs 					void **iterator, char *name,
309355b4669Sjacobs 					papi_attribute_t ***collection);
310355b4669Sjacobs extern papi_status_t papiAttributeListGetMetadata(papi_attribute_t **list,
311355b4669Sjacobs 					void **iterator, char *name,
312355b4669Sjacobs 					papi_metadata_t *vptr);
313355b4669Sjacobs extern papi_attribute_t *papiAttributeListFind(papi_attribute_t **list,
314355b4669Sjacobs 					char *name);
315355b4669Sjacobs extern papi_attribute_t *papiAttributeListGetNext(papi_attribute_t **list,
316355b4669Sjacobs 					void **iterator);
317355b4669Sjacobs extern void papiAttributeListFree(papi_attribute_t **attributes);
318355b4669Sjacobs 
319355b4669Sjacobs extern papi_status_t papiAttributeListFromString(papi_attribute_t ***attrs,
320355b4669Sjacobs 					int flags, char *string);
321355b4669Sjacobs extern papi_status_t papiAttributeListToString(papi_attribute_t **attrs,
322355b4669Sjacobs 					char *delim,
323355b4669Sjacobs 					char *buffer, size_t buflen);
324355b4669Sjacobs extern void papiAttributeListPrint(FILE *fp, papi_attribute_t **list,
325355b4669Sjacobs 					char *prefix_fmt, ...);
326355b4669Sjacobs 
327355b4669Sjacobs /*	Printer related		 */
328355b4669Sjacobs extern papi_status_t papiPrintersList(papi_service_t handle,
329355b4669Sjacobs 					char **requested_attrs,
330355b4669Sjacobs 					papi_filter_t *filter,
331355b4669Sjacobs 					papi_printer_t **printers);
332355b4669Sjacobs extern papi_status_t papiPrinterQuery(papi_service_t handle, char *name,
333355b4669Sjacobs 					char **requested_attrs,
334355b4669Sjacobs 					papi_attribute_t **job_attributes,
335355b4669Sjacobs 					papi_printer_t *printer);
336355b4669Sjacobs extern papi_status_t papiPrinterAdd(papi_service_t handle, char *name,
337355b4669Sjacobs 					papi_attribute_t **attributes,
338355b4669Sjacobs 					papi_printer_t *printer);
339355b4669Sjacobs extern papi_status_t papiPrinterModify(papi_service_t handle, char *name,
340355b4669Sjacobs 					papi_attribute_t **attributes,
341355b4669Sjacobs 					papi_printer_t *printer);
342355b4669Sjacobs extern papi_status_t papiPrinterRemove(papi_service_t handle, char *name);
343355b4669Sjacobs extern papi_status_t papiPrinterDisable(papi_service_t handle, char *name,
344355b4669Sjacobs 					char *message);
345355b4669Sjacobs extern papi_status_t papiPrinterEnable(papi_service_t handle, char *name);
346355b4669Sjacobs extern papi_status_t papiPrinterPause(papi_service_t handle, char *name,
347355b4669Sjacobs 					char *message);
348355b4669Sjacobs extern papi_status_t papiPrinterResume(papi_service_t handle, char *name);
349355b4669Sjacobs extern papi_status_t papiPrinterPurgeJobs(papi_service_t handle,
350355b4669Sjacobs 					char *name, papi_job_t **jobs);
351355b4669Sjacobs extern papi_status_t papiPrinterListJobs(papi_service_t handle,
352355b4669Sjacobs 					char *name, char **requested_attrs,
353355b4669Sjacobs 					int type_mask, int max_num_jobs,
354355b4669Sjacobs 					papi_job_t **jobs);
355355b4669Sjacobs extern papi_attribute_t **papiPrinterGetAttributeList(papi_printer_t printer);
356355b4669Sjacobs extern void papiPrinterFree(papi_printer_t printer);
357355b4669Sjacobs extern void papiPrinterListFree(papi_printer_t *printers);
358355b4669Sjacobs 
359355b4669Sjacobs /*	Job related		*/
360355b4669Sjacobs extern papi_status_t papiJobSubmit(papi_service_t handle, char *printer,
361355b4669Sjacobs 					papi_attribute_t **job_attributes,
362355b4669Sjacobs 					papi_job_ticket_t *job_ticket,
363355b4669Sjacobs 					char **files, papi_job_t *job);
364355b4669Sjacobs extern papi_status_t papiJobSubmitByReference(papi_service_t handle,
365355b4669Sjacobs 					char *printer,
366355b4669Sjacobs 					papi_attribute_t **job_attributes,
367355b4669Sjacobs 					papi_job_ticket_t *job_ticket,
368355b4669Sjacobs 					char **files, papi_job_t *job);
369355b4669Sjacobs extern papi_status_t papiJobValidate(papi_service_t handle, char *printer,
370355b4669Sjacobs 					papi_attribute_t **job_attributes,
371355b4669Sjacobs 					papi_job_ticket_t *job_ticket,
372355b4669Sjacobs 					char **files, papi_job_t *job);
373355b4669Sjacobs extern papi_status_t papiJobStreamOpen(papi_service_t handle,
374355b4669Sjacobs 					char *printer,
375355b4669Sjacobs 					papi_attribute_t **job_attributes,
376355b4669Sjacobs 					papi_job_ticket_t *job_ticket,
377355b4669Sjacobs 					papi_stream_t *stream);
378355b4669Sjacobs extern papi_status_t papiJobStreamWrite(papi_service_t handle,
379355b4669Sjacobs 					papi_stream_t stream,
380355b4669Sjacobs 					void *buffer, size_t buflen);
381355b4669Sjacobs extern papi_status_t papiJobStreamClose(papi_service_t handle,
382355b4669Sjacobs 					papi_stream_t stream,
383355b4669Sjacobs 					papi_job_t *job);
384355b4669Sjacobs extern papi_status_t papiJobQuery(papi_service_t handle, char *printer,
385355b4669Sjacobs 					int32_t job_id, char **requested_attrs,
386355b4669Sjacobs 					papi_job_t *job);
387355b4669Sjacobs extern papi_status_t papiJobModify(papi_service_t handle, char *printer,
388355b4669Sjacobs 					int32_t job_id,
389355b4669Sjacobs 					papi_attribute_t **attributes,
390355b4669Sjacobs 					papi_job_t *job);
391355b4669Sjacobs extern papi_status_t papiJobMove(papi_service_t handle, char *printer,
392355b4669Sjacobs 					int32_t job_id, char *destination);
393355b4669Sjacobs extern papi_status_t papiJobCancel(papi_service_t handle, char *printer,
394355b4669Sjacobs 					int32_t job_id);
395355b4669Sjacobs extern papi_status_t papiJobHold(papi_service_t handle, char *printer,
396355b4669Sjacobs 					int32_t job_id);
397355b4669Sjacobs extern papi_status_t papiJobRelease(papi_service_t handle, char *printer,
398355b4669Sjacobs 					int32_t job_id);
399355b4669Sjacobs extern papi_status_t papiJobRestart(papi_service_t handle, char *printer,
400355b4669Sjacobs 					int32_t job_id);
401355b4669Sjacobs extern papi_status_t papiJobPromote(papi_service_t handle, char *printer,
402355b4669Sjacobs 					int32_t job_id);
403355b4669Sjacobs extern papi_attribute_t **papiJobGetAttributeList(papi_job_t printer);
404355b4669Sjacobs extern char *papiJobGetPrinterName(papi_job_t printer);
405355b4669Sjacobs extern int32_t papiJobGetId(papi_job_t printer);
406355b4669Sjacobs extern papi_job_ticket_t *papiJobGetJobTicket(papi_job_t printer);
407355b4669Sjacobs extern void papiJobFree(papi_job_t job);
408355b4669Sjacobs extern void papiJobListFree(papi_job_t *jobs);
409355b4669Sjacobs 
410355b4669Sjacobs #ifdef SOLARIS_PRIVATE_POST_0_9
411355b4669Sjacobs /*
412355b4669Sjacobs  * These have been added to support IPP create-job/send-document with PAPI v0.9
413355b4669Sjacobs  * in an IPP listener using PAPI as it's spooler interface.  A future version
414355b4669Sjacobs  * of the API is expected to support this type of functionality
415355b4669Sjacobs  */
416355b4669Sjacobs extern papi_status_t papiJobCreate(papi_service_t handle, char *printer,
417355b4669Sjacobs 					papi_attribute_t **job_attributes,
418355b4669Sjacobs 					papi_job_ticket_t *job_ticket,
419355b4669Sjacobs 					papi_job_t *job);
420355b4669Sjacobs extern papi_status_t papiJobStreamAdd(papi_service_t handle, char *printer,
421355b4669Sjacobs 					int32_t id, papi_stream_t *stream);
422355b4669Sjacobs extern papi_status_t papiJobCommit(papi_service_t handle, char *printer,
423355b4669Sjacobs 					int32_t id);
424355b4669Sjacobs extern papi_status_t papiServiceSetPeer(papi_service_t handle, int peerfd);
425355b4669Sjacobs #endif /* SOLARIS_PRIVATE_POST_0_9 */
426355b4669Sjacobs 
427355b4669Sjacobs extern char *papiStatusString(papi_status_t status);
428355b4669Sjacobs 
429355b4669Sjacobs /*
430355b4669Sjacobs  * Internal functions that aren't in the API, but are shared across
431355b4669Sjacobs  * protocol support implementations(psms) and the tightly bound
432355b4669Sjacobs  * listener library.  Do not use these in your applications.
433355b4669Sjacobs  */
434355b4669Sjacobs extern void list_append();
435355b4669Sjacobs extern void list_concatenate();
436355b4669Sjacobs extern void list_remove();
437355b4669Sjacobs extern void copy_attributes(papi_attribute_t ***result,
438355b4669Sjacobs 				papi_attribute_t **list);
439355b4669Sjacobs extern void split_and_copy_attributes(char **list,
440355b4669Sjacobs 				papi_attribute_t **attributes,
441355b4669Sjacobs 				papi_attribute_t ***in,
442355b4669Sjacobs 				papi_attribute_t ***out);
443355b4669Sjacobs 
4440a44ef6dSjacobs extern papi_attribute_t **getprinterbyname(char *name, char *ns);
4450a44ef6dSjacobs 
446*a18dc42fSps29005 extern int is_localhost(char *hostname);
447*a18dc42fSps29005 
448355b4669Sjacobs #ifdef __cplusplus
449355b4669Sjacobs }
450355b4669Sjacobs #endif
451355b4669Sjacobs 
452355b4669Sjacobs #endif /* _PAPI_H */
453