12264Sjacobs /* 22264Sjacobs * CDDL HEADER START 32264Sjacobs * 42264Sjacobs * The contents of this file are subject to the terms of the 52264Sjacobs * Common Development and Distribution License (the "License"). 62264Sjacobs * You may not use this file except in compliance with the License. 72264Sjacobs * 82264Sjacobs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 92264Sjacobs * or http://www.opensolaris.org/os/licensing. 102264Sjacobs * See the License for the specific language governing permissions 112264Sjacobs * and limitations under the License. 122264Sjacobs * 132264Sjacobs * When distributing Covered Code, include this CDDL HEADER in each 142264Sjacobs * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 152264Sjacobs * If applicable, add the following below this CDDL HEADER, with the 162264Sjacobs * fields enclosed by brackets "[]" replaced with your own identifying 172264Sjacobs * information: Portions Copyright [yyyy] [name of copyright owner] 182264Sjacobs * 192264Sjacobs * CDDL HEADER END 202264Sjacobs */ 212264Sjacobs 222264Sjacobs /* 23*7132Sps29005 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. 242264Sjacobs * Use is subject to license terms. 252264Sjacobs * 262264Sjacobs */ 272264Sjacobs 282264Sjacobs #ifndef _PAPI_H 292264Sjacobs #define _PAPI_H 302264Sjacobs 312264Sjacobs /* $Id: papi.h 161 2006-05-03 04:32:59Z njacobs $ */ 322264Sjacobs 332264Sjacobs #pragma ident "%Z%%M% %I% %E% SMI" 342264Sjacobs 352264Sjacobs #include <sys/types.h> 362264Sjacobs #include <time.h> 372264Sjacobs #include <stdio.h> 382264Sjacobs 392264Sjacobs #ifdef __cplusplus 402264Sjacobs extern "C" { 412264Sjacobs #endif 422264Sjacobs 432264Sjacobs /* 442264Sjacobs * Types 452264Sjacobs */ 462264Sjacobs 472264Sjacobs /* service related types */ 482264Sjacobs typedef void *papi_service_t; 492264Sjacobs typedef void *papi_printer_t; 502264Sjacobs typedef void *papi_job_t; 512264Sjacobs typedef void *papi_stream_t; 522264Sjacobs 532264Sjacobs typedef enum { 542264Sjacobs PAPI_ENCRYPT_IF_REQUESTED, /* Encrypt if requested (TLS upgrade) */ 552264Sjacobs PAPI_ENCRYPT_NEVER, /* Never encrypt */ 562264Sjacobs PAPI_ENCRYPT_REQUIRED, /* Encryption required (TLS upgrade) */ 572264Sjacobs PAPI_ENCRYPT_ALWAYS /* Always encrypt (SSL) */ 582264Sjacobs } papi_encryption_t; 592264Sjacobs 602264Sjacobs /* attribute related types */ 612264Sjacobs typedef enum { 622264Sjacobs PAPI_STRING, 632264Sjacobs PAPI_INTEGER, 642264Sjacobs PAPI_BOOLEAN, 652264Sjacobs PAPI_RANGE, 662264Sjacobs PAPI_RESOLUTION, 672264Sjacobs PAPI_DATETIME, 682264Sjacobs PAPI_COLLECTION, 692264Sjacobs PAPI_METADATA 702264Sjacobs } papi_attribute_value_type_t; 712264Sjacobs 722264Sjacobs typedef enum { 732264Sjacobs PAPI_RES_PER_INCH = 3, 742264Sjacobs PAPI_RES_PER_CM 752264Sjacobs } papi_resolution_unit_t; 762264Sjacobs 772264Sjacobs enum { /* for boolean values */ 782264Sjacobs PAPI_FALSE = 0, 792264Sjacobs PAPI_TRUE = 1 802264Sjacobs }; 812264Sjacobs 822264Sjacobs typedef enum { 832264Sjacobs PAPI_UNSUPPORTED = 0x10, 842264Sjacobs PAPI_DEFAULT = 0x11, 852264Sjacobs PAPI_UNKNOWN, 862264Sjacobs PAPI_NO_VALUE, 872264Sjacobs PAPI_NOT_SETTABLE = 0x15, 882264Sjacobs PAPI_DELETE = 0x16 892264Sjacobs } papi_metadata_t; 902264Sjacobs 912264Sjacobs #define PAPI_LIST_JOBS_OTHERS 0x0001 922264Sjacobs #define PAPI_LIST_JOBS_COMPLETED 0x0002 932264Sjacobs #define PAPI_LIST_JOBS_NOT_COMPLETED 0x0004 942264Sjacobs #define PAPI_LIST_JOBS_ALL 0xFFFF 952264Sjacobs 962264Sjacobs typedef struct papi_attribute_s papi_attribute_t; 972264Sjacobs 982264Sjacobs typedef union { 992264Sjacobs char *string; /* PAPI_STRING value */ 1002264Sjacobs int integer; /* PAPI_INTEGER value */ 1012264Sjacobs char boolean; /* PAPI_BOOLEAN value */ 1022264Sjacobs struct { /* PAPI_RANGE value */ 1032264Sjacobs int lower; 1042264Sjacobs int upper; 1052264Sjacobs } range; 1062264Sjacobs struct { /* PAPI_RESOLUTION value */ 1072264Sjacobs int xres; 1082264Sjacobs int yres; 1092264Sjacobs papi_resolution_unit_t units; 1102264Sjacobs } resolution; 1112264Sjacobs time_t datetime; /* PAPI_DATETIME value */ 1122264Sjacobs papi_attribute_t **collection; /* PAPI_COLLECTION value */ 1132264Sjacobs papi_metadata_t metadata; /* PAPI_METADATA value */ 1142264Sjacobs } papi_attribute_value_t; 1152264Sjacobs 1162264Sjacobs struct papi_attribute_s { 1172264Sjacobs char *name; /* attribute name */ 1182264Sjacobs papi_attribute_value_type_t type; /* type of values */ 1192264Sjacobs papi_attribute_value_t **values; /* list of values */ 1202264Sjacobs }; 1212264Sjacobs 1222264Sjacobs #define PAPI_ATTR_APPEND 0x0001 /* Add values to attr */ 1232264Sjacobs #define PAPI_ATTR_REPLACE 0x0002 /* Delete existing values, then add */ 1242264Sjacobs #define PAPI_ATTR_EXCL 0x0004 /* Fail if attr exists */ 1252264Sjacobs 1262264Sjacobs /* job related types */ 1272264Sjacobs typedef enum { 1282264Sjacobs PAPI_JT_FORMAT_JDF = 0, 1292264Sjacobs PAPI_JT_FORMAT_PWG = 1 1302264Sjacobs } papi_jt_format_t; 1312264Sjacobs 1322264Sjacobs typedef struct { 1332264Sjacobs papi_jt_format_t format; 1342264Sjacobs char *ticket_data; 1352264Sjacobs char *file_name; 1362264Sjacobs } papi_job_ticket_t; 1372264Sjacobs 1382264Sjacobs /* status related types */ 1392264Sjacobs typedef enum { 1402264Sjacobs PAPI_OK = 0x0000, 1412264Sjacobs PAPI_OK_SUBST, 1422264Sjacobs PAPI_OK_CONFLICT, 1432264Sjacobs PAPI_OK_IGNORED_SUBSCRIPTIONS, 1442264Sjacobs PAPI_OK_IGNORED_NOTIFICATIONS, 1452264Sjacobs PAPI_OK_TOO_MANY_EVENTS, 1462264Sjacobs PAPI_OK_BUT_CANCEL_SUBSCRIPTION, 1472264Sjacobs PAPI_REDIRECTION_OTHER_SITE = 0x0300, 1482264Sjacobs PAPI_BAD_REQUEST = 0x0400, 1492264Sjacobs PAPI_FORBIDDEN, 1502264Sjacobs PAPI_NOT_AUTHENTICATED, 1512264Sjacobs PAPI_NOT_AUTHORIZED, 1522264Sjacobs PAPI_NOT_POSSIBLE, 1532264Sjacobs PAPI_TIMEOUT, 1542264Sjacobs PAPI_NOT_FOUND, 1552264Sjacobs PAPI_GONE, 1562264Sjacobs PAPI_REQUEST_ENTITY, 1572264Sjacobs PAPI_REQUEST_VALUE, 1582264Sjacobs PAPI_DOCUMENT_FORMAT, 1592264Sjacobs PAPI_ATTRIBUTES, 1602264Sjacobs PAPI_URI_SCHEME, 1612264Sjacobs PAPI_CHARSET, 1622264Sjacobs PAPI_CONFLICT, 1632264Sjacobs PAPI_COMPRESSION_NOT_SUPPORTED, 1642264Sjacobs PAPI_COMPRESSION_ERROR, 1652264Sjacobs PAPI_DOCUMENT_FORMAT_ERROR, 1662264Sjacobs PAPI_DOCUMENT_ACCESS_ERROR, 1672264Sjacobs PAPI_ATTRIBUTES_NOT_SETTABLE, 1682264Sjacobs PAPI_IGNORED_ALL_SUBSCRIPTIONS, 1692264Sjacobs PAPI_TOO_MANY_SUBSCRIPTIONS, 1702264Sjacobs PAPI_IGNORED_ALL_NOTIFICATIONS, 1712264Sjacobs PAPI_PRINT_SUPPORT_FILE_NOT_FOUND, 1722264Sjacobs PAPI_INTERNAL_ERROR = 0x0500, 1732264Sjacobs PAPI_OPERATION_NOT_SUPPORTED, 1742264Sjacobs PAPI_SERVICE_UNAVAILABLE, 1752264Sjacobs PAPI_VERSION_NOT_SUPPORTED, 1762264Sjacobs PAPI_DEVICE_ERROR, 1772264Sjacobs PAPI_TEMPORARY_ERROR, 1782264Sjacobs PAPI_NOT_ACCEPTING, 1792264Sjacobs PAPI_PRINTER_BUSY, 1802264Sjacobs PAPI_ERROR_JOB_CANCELLED, 1812264Sjacobs PAPI_MULTIPLE_JOBS_NOT_SUPPORTED, 1822264Sjacobs PAPI_PRINTER_IS_DEACTIVATED, 1832264Sjacobs PAPI_BAD_ARGUMENT, 1842264Sjacobs PAPI_JOB_TICKET_NOT_SUPPORTED 1852264Sjacobs } papi_status_t; 1862264Sjacobs 1872264Sjacobs /* list filter related */ 1882264Sjacobs typedef enum { 1892264Sjacobs PAPI_FILTER_BITMASK = 0 1902264Sjacobs } papi_filter_type_t; 1912264Sjacobs 1922264Sjacobs typedef struct { 1932264Sjacobs papi_filter_type_t type; 1942264Sjacobs union { 1952264Sjacobs struct { /* PAPI_FILTER_BITMASK */ 1962264Sjacobs unsigned int mask; 1972264Sjacobs unsigned int value; 1982264Sjacobs } bitmask; 1992264Sjacobs } filter; 2002264Sjacobs } papi_filter_t; 2012264Sjacobs 2022264Sjacobs enum { 2032264Sjacobs PAPI_PRINTER_LOCAL = 0x0000, /* Local destination */ 2042264Sjacobs PAPI_PRINTER_CLASS = 0x0001, /* Printer class */ 2052264Sjacobs PAPI_PRINTER_REMOTE = 0x0002, /* Remote destination */ 2062264Sjacobs PAPI_PRINTER_BW = 0x0004, /* Can do B&W printing */ 2072264Sjacobs PAPI_PRINTER_COLOR = 0x0008, /* Can do color printing */ 2082264Sjacobs PAPI_PRINTER_DUPLEX = 0x0010, /* Can do duplex printing */ 2092264Sjacobs PAPI_PRINTER_STAPLE = 0x0020, /* Can do stapling */ 2102264Sjacobs PAPI_PRINTER_COPIES = 0x0040, /* Can do copies */ 2112264Sjacobs PAPI_PRINTER_COLLATE = 0x0080, /* Can collate copies */ 2122264Sjacobs PAPI_PRINTER_PUNCH = 0x0100, /* Can punch output */ 2132264Sjacobs PAPI_PRINTER_COVER = 0x0200, /* Can cover output */ 2142264Sjacobs PAPI_PRINTER_BIND = 0x0400, /* Can bind output */ 2152264Sjacobs PAPI_PRINTER_SORT = 0x0800, /* Can sort output */ 2162264Sjacobs PAPI_PRINTER_SMALL = 0x1000, /* Can do letter/legal/a4 */ 2172264Sjacobs PAPI_PRINTER_MEDIUM = 0x2000, /* Can do tabloid/B/C/A3/A2 */ 2182264Sjacobs PAPI_PRINTER_LARGE = 0x4000, /* Can do D/E/A1/A0 */ 2192264Sjacobs PAPI_PRINTER_VARIABLE = 0x8000, /* Can do variable sizes */ 2202264Sjacobs PAPI_PRINTER_IMPLICIT = 0x10000, /* implicit class */ 2212264Sjacobs PAPI_PRINTER_DEFAULT = 0x20000, /* Default printer on network */ 2222264Sjacobs PAPI_PRINTER_OPTIONS = 0xfffc /* ~ (CLASS | REMOTE | IMPLICIT) */ 2232264Sjacobs }; 2242264Sjacobs 2252264Sjacobs /* 2262264Sjacobs * Functions 2272264Sjacobs */ 2282264Sjacobs 2292264Sjacobs /* Service related */ 2302264Sjacobs extern papi_status_t papiServiceCreate(papi_service_t *handle, 2312264Sjacobs char *service_name, char *user_name, 2322264Sjacobs char *password, 2332264Sjacobs int (*authCB)(papi_service_t svc, 2342264Sjacobs void *app_data), 2352264Sjacobs papi_encryption_t encryption, 2362264Sjacobs void *app_data); 2372264Sjacobs extern void papiServiceDestroy(papi_service_t handle); 2382264Sjacobs extern papi_status_t papiServiceSetUserName(papi_service_t handle, 2392264Sjacobs char *user_name); 2402264Sjacobs extern papi_status_t papiServiceSetPassword(papi_service_t handle, 2412264Sjacobs char *password); 2422264Sjacobs extern papi_status_t papiServiceSetEncryption(papi_service_t handle, 2432264Sjacobs papi_encryption_t encryption); 2442264Sjacobs extern papi_status_t papiServiceSetAuthCB(papi_service_t handle, 2452264Sjacobs int (*authCB)(papi_service_t s, 2462264Sjacobs void *app_data)); 2472264Sjacobs extern papi_status_t papiServiceSetAppData(papi_service_t handle, 2482264Sjacobs void *app_data); 2492264Sjacobs extern char *papiServiceGetServiceName(papi_service_t handle); 2502264Sjacobs extern char *papiServiceGetUserName(papi_service_t handle); 2512264Sjacobs extern char *papiServiceGetPassword(papi_service_t handle); 2522264Sjacobs extern papi_encryption_t papiServiceGetEncryption(papi_service_t handle); 2532264Sjacobs extern void *papiServiceGetAppData(papi_service_t handle); 2542264Sjacobs extern papi_attribute_t **papiServiceGetAttributeList(papi_service_t handle); 2552264Sjacobs extern char *papiServiceGetStatusMessage(papi_service_t handle); 2562264Sjacobs 2572264Sjacobs /* Attribute related */ 2582264Sjacobs extern papi_status_t papiAttributeListAddValue(papi_attribute_t ***attrs, 2592264Sjacobs int flags, char *name, 2602264Sjacobs papi_attribute_value_type_t type, 2612264Sjacobs papi_attribute_value_t *value); 2622264Sjacobs extern papi_status_t papiAttributeListAddString(papi_attribute_t ***attrs, 2632264Sjacobs int flags, char *name, char *string); 2642264Sjacobs extern papi_status_t papiAttributeListAddInteger(papi_attribute_t ***attrs, 2652264Sjacobs int flags, char *name, int integer); 2662264Sjacobs extern papi_status_t papiAttributeListAddBoolean(papi_attribute_t ***attrs, 2672264Sjacobs int flags, char *name, char boolean); 2682264Sjacobs extern papi_status_t papiAttributeListAddRange(papi_attribute_t ***attrs, 2692264Sjacobs int flags, char *name, 2702264Sjacobs int lower, int upper); 2712264Sjacobs extern papi_status_t papiAttributeListAddResolution(papi_attribute_t ***attrs, 2722264Sjacobs int flags, char *name, 2732264Sjacobs int xres, int yres, 2742264Sjacobs papi_resolution_unit_t units); 2752264Sjacobs extern papi_status_t papiAttributeListAddDatetime(papi_attribute_t ***attrs, 2762264Sjacobs int flags, char *name, time_t datetime); 2772264Sjacobs extern papi_status_t papiAttributeListAddCollection(papi_attribute_t ***attrs, 2782264Sjacobs int flags, char *name, 2792264Sjacobs papi_attribute_t **collection); 2802264Sjacobs extern papi_status_t papiAttributeListAddMetadata(papi_attribute_t ***attrs, 2812264Sjacobs int flags, char *name, 2822264Sjacobs papi_metadata_t metadata); 2832264Sjacobs extern papi_status_t papiAttributeListDelete(papi_attribute_t ***attributes, 2842264Sjacobs char *name); 2852264Sjacobs extern papi_status_t papiAttributeListGetValue(papi_attribute_t **list, 2862264Sjacobs void **iterator, char *name, 2872264Sjacobs papi_attribute_value_type_t type, 2882264Sjacobs papi_attribute_value_t **value); 2892264Sjacobs extern papi_status_t papiAttributeListGetString(papi_attribute_t **list, 2902264Sjacobs void **iterator, char *name, 2912264Sjacobs char **vptr); 2922264Sjacobs extern papi_status_t papiAttributeListGetInteger(papi_attribute_t **list, 2932264Sjacobs void **iterator, char *name, int *vptr); 2942264Sjacobs extern papi_status_t papiAttributeListGetBoolean(papi_attribute_t **list, 2952264Sjacobs void **iterator, char *name, 2962264Sjacobs char *vptr); 2972264Sjacobs extern papi_status_t papiAttributeListGetRange(papi_attribute_t **list, 2982264Sjacobs void **iterator, char *name, 2992264Sjacobs int *min, int *max); 3002264Sjacobs extern papi_status_t papiAttributeListGetResolution(papi_attribute_t **list, 3012264Sjacobs void **iterator, char *name, 3022264Sjacobs int *x, int *y, 3032264Sjacobs papi_resolution_unit_t *units); 3042264Sjacobs extern papi_status_t papiAttributeListGetDatetime(papi_attribute_t **list, 3052264Sjacobs void **iterator, char *name, 3062264Sjacobs time_t *dt); 3072264Sjacobs extern papi_status_t papiAttributeListGetCollection(papi_attribute_t **list, 3082264Sjacobs void **iterator, char *name, 3092264Sjacobs papi_attribute_t ***collection); 3102264Sjacobs extern papi_status_t papiAttributeListGetMetadata(papi_attribute_t **list, 3112264Sjacobs void **iterator, char *name, 3122264Sjacobs papi_metadata_t *vptr); 3132264Sjacobs extern papi_attribute_t *papiAttributeListFind(papi_attribute_t **list, 3142264Sjacobs char *name); 3152264Sjacobs extern papi_attribute_t *papiAttributeListGetNext(papi_attribute_t **list, 3162264Sjacobs void **iterator); 3172264Sjacobs extern void papiAttributeListFree(papi_attribute_t **attributes); 3182264Sjacobs 3192264Sjacobs extern papi_status_t papiAttributeListFromString(papi_attribute_t ***attrs, 3202264Sjacobs int flags, char *string); 3212264Sjacobs extern papi_status_t papiAttributeListToString(papi_attribute_t **attrs, 3222264Sjacobs char *delim, 3232264Sjacobs char *buffer, size_t buflen); 3242264Sjacobs extern void papiAttributeListPrint(FILE *fp, papi_attribute_t **list, 3252264Sjacobs char *prefix_fmt, ...); 3262264Sjacobs 3272264Sjacobs /* Printer related */ 3282264Sjacobs extern papi_status_t papiPrintersList(papi_service_t handle, 3292264Sjacobs char **requested_attrs, 3302264Sjacobs papi_filter_t *filter, 3312264Sjacobs papi_printer_t **printers); 3322264Sjacobs extern papi_status_t papiPrinterQuery(papi_service_t handle, char *name, 3332264Sjacobs char **requested_attrs, 3342264Sjacobs papi_attribute_t **job_attributes, 3352264Sjacobs papi_printer_t *printer); 3362264Sjacobs extern papi_status_t papiPrinterAdd(papi_service_t handle, char *name, 3372264Sjacobs papi_attribute_t **attributes, 3382264Sjacobs papi_printer_t *printer); 3392264Sjacobs extern papi_status_t papiPrinterModify(papi_service_t handle, char *name, 3402264Sjacobs papi_attribute_t **attributes, 3412264Sjacobs papi_printer_t *printer); 3422264Sjacobs extern papi_status_t papiPrinterRemove(papi_service_t handle, char *name); 3432264Sjacobs extern papi_status_t papiPrinterDisable(papi_service_t handle, char *name, 3442264Sjacobs char *message); 3452264Sjacobs extern papi_status_t papiPrinterEnable(papi_service_t handle, char *name); 3462264Sjacobs extern papi_status_t papiPrinterPause(papi_service_t handle, char *name, 3472264Sjacobs char *message); 3482264Sjacobs extern papi_status_t papiPrinterResume(papi_service_t handle, char *name); 3492264Sjacobs extern papi_status_t papiPrinterPurgeJobs(papi_service_t handle, 3502264Sjacobs char *name, papi_job_t **jobs); 3512264Sjacobs extern papi_status_t papiPrinterListJobs(papi_service_t handle, 3522264Sjacobs char *name, char **requested_attrs, 3532264Sjacobs int type_mask, int max_num_jobs, 3542264Sjacobs papi_job_t **jobs); 3552264Sjacobs extern papi_attribute_t **papiPrinterGetAttributeList(papi_printer_t printer); 3562264Sjacobs extern void papiPrinterFree(papi_printer_t printer); 3572264Sjacobs extern void papiPrinterListFree(papi_printer_t *printers); 3582264Sjacobs 3592264Sjacobs /* Job related */ 3602264Sjacobs extern papi_status_t papiJobSubmit(papi_service_t handle, char *printer, 3612264Sjacobs papi_attribute_t **job_attributes, 3622264Sjacobs papi_job_ticket_t *job_ticket, 3632264Sjacobs char **files, papi_job_t *job); 3642264Sjacobs extern papi_status_t papiJobSubmitByReference(papi_service_t handle, 3652264Sjacobs char *printer, 3662264Sjacobs papi_attribute_t **job_attributes, 3672264Sjacobs papi_job_ticket_t *job_ticket, 3682264Sjacobs char **files, papi_job_t *job); 3692264Sjacobs extern papi_status_t papiJobValidate(papi_service_t handle, char *printer, 3702264Sjacobs papi_attribute_t **job_attributes, 3712264Sjacobs papi_job_ticket_t *job_ticket, 3722264Sjacobs char **files, papi_job_t *job); 3732264Sjacobs extern papi_status_t papiJobStreamOpen(papi_service_t handle, 3742264Sjacobs char *printer, 3752264Sjacobs papi_attribute_t **job_attributes, 3762264Sjacobs papi_job_ticket_t *job_ticket, 3772264Sjacobs papi_stream_t *stream); 3782264Sjacobs extern papi_status_t papiJobStreamWrite(papi_service_t handle, 3792264Sjacobs papi_stream_t stream, 3802264Sjacobs void *buffer, size_t buflen); 3812264Sjacobs extern papi_status_t papiJobStreamClose(papi_service_t handle, 3822264Sjacobs papi_stream_t stream, 3832264Sjacobs papi_job_t *job); 3842264Sjacobs extern papi_status_t papiJobQuery(papi_service_t handle, char *printer, 3852264Sjacobs int32_t job_id, char **requested_attrs, 3862264Sjacobs papi_job_t *job); 3872264Sjacobs extern papi_status_t papiJobModify(papi_service_t handle, char *printer, 3882264Sjacobs int32_t job_id, 3892264Sjacobs papi_attribute_t **attributes, 3902264Sjacobs papi_job_t *job); 3912264Sjacobs extern papi_status_t papiJobMove(papi_service_t handle, char *printer, 3922264Sjacobs int32_t job_id, char *destination); 3932264Sjacobs extern papi_status_t papiJobCancel(papi_service_t handle, char *printer, 3942264Sjacobs int32_t job_id); 3952264Sjacobs extern papi_status_t papiJobHold(papi_service_t handle, char *printer, 3962264Sjacobs int32_t job_id); 3972264Sjacobs extern papi_status_t papiJobRelease(papi_service_t handle, char *printer, 3982264Sjacobs int32_t job_id); 3992264Sjacobs extern papi_status_t papiJobRestart(papi_service_t handle, char *printer, 4002264Sjacobs int32_t job_id); 4012264Sjacobs extern papi_status_t papiJobPromote(papi_service_t handle, char *printer, 4022264Sjacobs int32_t job_id); 4032264Sjacobs extern papi_attribute_t **papiJobGetAttributeList(papi_job_t printer); 4042264Sjacobs extern char *papiJobGetPrinterName(papi_job_t printer); 4052264Sjacobs extern int32_t papiJobGetId(papi_job_t printer); 4062264Sjacobs extern papi_job_ticket_t *papiJobGetJobTicket(papi_job_t printer); 4072264Sjacobs extern void papiJobFree(papi_job_t job); 4082264Sjacobs extern void papiJobListFree(papi_job_t *jobs); 4092264Sjacobs 4102264Sjacobs #ifdef SOLARIS_PRIVATE_POST_0_9 4112264Sjacobs /* 4122264Sjacobs * These have been added to support IPP create-job/send-document with PAPI v0.9 4132264Sjacobs * in an IPP listener using PAPI as it's spooler interface. A future version 4142264Sjacobs * of the API is expected to support this type of functionality 4152264Sjacobs */ 4162264Sjacobs extern papi_status_t papiJobCreate(papi_service_t handle, char *printer, 4172264Sjacobs papi_attribute_t **job_attributes, 4182264Sjacobs papi_job_ticket_t *job_ticket, 4192264Sjacobs papi_job_t *job); 4202264Sjacobs extern papi_status_t papiJobStreamAdd(papi_service_t handle, char *printer, 4212264Sjacobs int32_t id, papi_stream_t *stream); 4222264Sjacobs extern papi_status_t papiJobCommit(papi_service_t handle, char *printer, 4232264Sjacobs int32_t id); 4242264Sjacobs extern papi_status_t papiServiceSetPeer(papi_service_t handle, int peerfd); 4252264Sjacobs #endif /* SOLARIS_PRIVATE_POST_0_9 */ 4262264Sjacobs 4272264Sjacobs extern char *papiStatusString(papi_status_t status); 4282264Sjacobs 4292264Sjacobs /* 4302264Sjacobs * Internal functions that aren't in the API, but are shared across 4312264Sjacobs * protocol support implementations(psms) and the tightly bound 4322264Sjacobs * listener library. Do not use these in your applications. 4332264Sjacobs */ 4342264Sjacobs extern void list_append(); 4352264Sjacobs extern void list_concatenate(); 4362264Sjacobs extern void list_remove(); 4372264Sjacobs extern void copy_attributes(papi_attribute_t ***result, 4382264Sjacobs papi_attribute_t **list); 4392264Sjacobs extern void split_and_copy_attributes(char **list, 4402264Sjacobs papi_attribute_t **attributes, 4412264Sjacobs papi_attribute_t ***in, 4422264Sjacobs papi_attribute_t ***out); 4432264Sjacobs 4443125Sjacobs extern papi_attribute_t **getprinterbyname(char *name, char *ns); 4453125Sjacobs 446*7132Sps29005 extern int is_localhost(char *hostname); 447*7132Sps29005 4482264Sjacobs #ifdef __cplusplus 4492264Sjacobs } 4502264Sjacobs #endif 4512264Sjacobs 4522264Sjacobs #endif /* _PAPI_H */ 453