1*2264Sjacobs /* 2*2264Sjacobs * CDDL HEADER START 3*2264Sjacobs * 4*2264Sjacobs * The contents of this file are subject to the terms of the 5*2264Sjacobs * Common Development and Distribution License (the "License"). 6*2264Sjacobs * You may not use this file except in compliance with the License. 7*2264Sjacobs * 8*2264Sjacobs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*2264Sjacobs * or http://www.opensolaris.org/os/licensing. 10*2264Sjacobs * See the License for the specific language governing permissions 11*2264Sjacobs * and limitations under the License. 12*2264Sjacobs * 13*2264Sjacobs * When distributing Covered Code, include this CDDL HEADER in each 14*2264Sjacobs * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*2264Sjacobs * If applicable, add the following below this CDDL HEADER, with the 16*2264Sjacobs * fields enclosed by brackets "[]" replaced with your own identifying 17*2264Sjacobs * information: Portions Copyright [yyyy] [name of copyright owner] 18*2264Sjacobs * 19*2264Sjacobs * CDDL HEADER END 20*2264Sjacobs */ 21*2264Sjacobs 22*2264Sjacobs /* 23*2264Sjacobs * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*2264Sjacobs * Use is subject to license terms. 25*2264Sjacobs * 26*2264Sjacobs */ 27*2264Sjacobs 28*2264Sjacobs #ifndef _PAPI_H 29*2264Sjacobs #define _PAPI_H 30*2264Sjacobs 31*2264Sjacobs /* $Id: papi.h 161 2006-05-03 04:32:59Z njacobs $ */ 32*2264Sjacobs 33*2264Sjacobs #pragma ident "%Z%%M% %I% %E% SMI" 34*2264Sjacobs 35*2264Sjacobs #include <sys/types.h> 36*2264Sjacobs #include <time.h> 37*2264Sjacobs #include <stdio.h> 38*2264Sjacobs 39*2264Sjacobs #ifdef __cplusplus 40*2264Sjacobs extern "C" { 41*2264Sjacobs #endif 42*2264Sjacobs 43*2264Sjacobs /* 44*2264Sjacobs * Types 45*2264Sjacobs */ 46*2264Sjacobs 47*2264Sjacobs /* service related types */ 48*2264Sjacobs typedef void *papi_service_t; 49*2264Sjacobs typedef void *papi_printer_t; 50*2264Sjacobs typedef void *papi_job_t; 51*2264Sjacobs typedef void *papi_stream_t; 52*2264Sjacobs 53*2264Sjacobs typedef enum { 54*2264Sjacobs PAPI_ENCRYPT_IF_REQUESTED, /* Encrypt if requested (TLS upgrade) */ 55*2264Sjacobs PAPI_ENCRYPT_NEVER, /* Never encrypt */ 56*2264Sjacobs PAPI_ENCRYPT_REQUIRED, /* Encryption required (TLS upgrade) */ 57*2264Sjacobs PAPI_ENCRYPT_ALWAYS /* Always encrypt (SSL) */ 58*2264Sjacobs } papi_encryption_t; 59*2264Sjacobs 60*2264Sjacobs /* attribute related types */ 61*2264Sjacobs typedef enum { 62*2264Sjacobs PAPI_STRING, 63*2264Sjacobs PAPI_INTEGER, 64*2264Sjacobs PAPI_BOOLEAN, 65*2264Sjacobs PAPI_RANGE, 66*2264Sjacobs PAPI_RESOLUTION, 67*2264Sjacobs PAPI_DATETIME, 68*2264Sjacobs PAPI_COLLECTION, 69*2264Sjacobs PAPI_METADATA 70*2264Sjacobs } papi_attribute_value_type_t; 71*2264Sjacobs 72*2264Sjacobs typedef enum { 73*2264Sjacobs PAPI_RES_PER_INCH = 3, 74*2264Sjacobs PAPI_RES_PER_CM 75*2264Sjacobs } papi_resolution_unit_t; 76*2264Sjacobs 77*2264Sjacobs enum { /* for boolean values */ 78*2264Sjacobs PAPI_FALSE = 0, 79*2264Sjacobs PAPI_TRUE = 1 80*2264Sjacobs }; 81*2264Sjacobs 82*2264Sjacobs typedef enum { 83*2264Sjacobs PAPI_UNSUPPORTED = 0x10, 84*2264Sjacobs PAPI_DEFAULT = 0x11, 85*2264Sjacobs PAPI_UNKNOWN, 86*2264Sjacobs PAPI_NO_VALUE, 87*2264Sjacobs PAPI_NOT_SETTABLE = 0x15, 88*2264Sjacobs PAPI_DELETE = 0x16 89*2264Sjacobs } papi_metadata_t; 90*2264Sjacobs 91*2264Sjacobs #define PAPI_LIST_JOBS_OTHERS 0x0001 92*2264Sjacobs #define PAPI_LIST_JOBS_COMPLETED 0x0002 93*2264Sjacobs #define PAPI_LIST_JOBS_NOT_COMPLETED 0x0004 94*2264Sjacobs #define PAPI_LIST_JOBS_ALL 0xFFFF 95*2264Sjacobs 96*2264Sjacobs typedef struct papi_attribute_s papi_attribute_t; 97*2264Sjacobs 98*2264Sjacobs typedef union { 99*2264Sjacobs char *string; /* PAPI_STRING value */ 100*2264Sjacobs int integer; /* PAPI_INTEGER value */ 101*2264Sjacobs char boolean; /* PAPI_BOOLEAN value */ 102*2264Sjacobs struct { /* PAPI_RANGE value */ 103*2264Sjacobs int lower; 104*2264Sjacobs int upper; 105*2264Sjacobs } range; 106*2264Sjacobs struct { /* PAPI_RESOLUTION value */ 107*2264Sjacobs int xres; 108*2264Sjacobs int yres; 109*2264Sjacobs papi_resolution_unit_t units; 110*2264Sjacobs } resolution; 111*2264Sjacobs time_t datetime; /* PAPI_DATETIME value */ 112*2264Sjacobs papi_attribute_t **collection; /* PAPI_COLLECTION value */ 113*2264Sjacobs papi_metadata_t metadata; /* PAPI_METADATA value */ 114*2264Sjacobs } papi_attribute_value_t; 115*2264Sjacobs 116*2264Sjacobs struct papi_attribute_s { 117*2264Sjacobs char *name; /* attribute name */ 118*2264Sjacobs papi_attribute_value_type_t type; /* type of values */ 119*2264Sjacobs papi_attribute_value_t **values; /* list of values */ 120*2264Sjacobs }; 121*2264Sjacobs 122*2264Sjacobs #define PAPI_ATTR_APPEND 0x0001 /* Add values to attr */ 123*2264Sjacobs #define PAPI_ATTR_REPLACE 0x0002 /* Delete existing values, then add */ 124*2264Sjacobs #define PAPI_ATTR_EXCL 0x0004 /* Fail if attr exists */ 125*2264Sjacobs 126*2264Sjacobs /* job related types */ 127*2264Sjacobs typedef enum { 128*2264Sjacobs PAPI_JT_FORMAT_JDF = 0, 129*2264Sjacobs PAPI_JT_FORMAT_PWG = 1 130*2264Sjacobs } papi_jt_format_t; 131*2264Sjacobs 132*2264Sjacobs typedef struct { 133*2264Sjacobs papi_jt_format_t format; 134*2264Sjacobs char *ticket_data; 135*2264Sjacobs char *file_name; 136*2264Sjacobs } papi_job_ticket_t; 137*2264Sjacobs 138*2264Sjacobs /* status related types */ 139*2264Sjacobs typedef enum { 140*2264Sjacobs PAPI_OK = 0x0000, 141*2264Sjacobs PAPI_OK_SUBST, 142*2264Sjacobs PAPI_OK_CONFLICT, 143*2264Sjacobs PAPI_OK_IGNORED_SUBSCRIPTIONS, 144*2264Sjacobs PAPI_OK_IGNORED_NOTIFICATIONS, 145*2264Sjacobs PAPI_OK_TOO_MANY_EVENTS, 146*2264Sjacobs PAPI_OK_BUT_CANCEL_SUBSCRIPTION, 147*2264Sjacobs PAPI_REDIRECTION_OTHER_SITE = 0x0300, 148*2264Sjacobs PAPI_BAD_REQUEST = 0x0400, 149*2264Sjacobs PAPI_FORBIDDEN, 150*2264Sjacobs PAPI_NOT_AUTHENTICATED, 151*2264Sjacobs PAPI_NOT_AUTHORIZED, 152*2264Sjacobs PAPI_NOT_POSSIBLE, 153*2264Sjacobs PAPI_TIMEOUT, 154*2264Sjacobs PAPI_NOT_FOUND, 155*2264Sjacobs PAPI_GONE, 156*2264Sjacobs PAPI_REQUEST_ENTITY, 157*2264Sjacobs PAPI_REQUEST_VALUE, 158*2264Sjacobs PAPI_DOCUMENT_FORMAT, 159*2264Sjacobs PAPI_ATTRIBUTES, 160*2264Sjacobs PAPI_URI_SCHEME, 161*2264Sjacobs PAPI_CHARSET, 162*2264Sjacobs PAPI_CONFLICT, 163*2264Sjacobs PAPI_COMPRESSION_NOT_SUPPORTED, 164*2264Sjacobs PAPI_COMPRESSION_ERROR, 165*2264Sjacobs PAPI_DOCUMENT_FORMAT_ERROR, 166*2264Sjacobs PAPI_DOCUMENT_ACCESS_ERROR, 167*2264Sjacobs PAPI_ATTRIBUTES_NOT_SETTABLE, 168*2264Sjacobs PAPI_IGNORED_ALL_SUBSCRIPTIONS, 169*2264Sjacobs PAPI_TOO_MANY_SUBSCRIPTIONS, 170*2264Sjacobs PAPI_IGNORED_ALL_NOTIFICATIONS, 171*2264Sjacobs PAPI_PRINT_SUPPORT_FILE_NOT_FOUND, 172*2264Sjacobs PAPI_INTERNAL_ERROR = 0x0500, 173*2264Sjacobs PAPI_OPERATION_NOT_SUPPORTED, 174*2264Sjacobs PAPI_SERVICE_UNAVAILABLE, 175*2264Sjacobs PAPI_VERSION_NOT_SUPPORTED, 176*2264Sjacobs PAPI_DEVICE_ERROR, 177*2264Sjacobs PAPI_TEMPORARY_ERROR, 178*2264Sjacobs PAPI_NOT_ACCEPTING, 179*2264Sjacobs PAPI_PRINTER_BUSY, 180*2264Sjacobs PAPI_ERROR_JOB_CANCELLED, 181*2264Sjacobs PAPI_MULTIPLE_JOBS_NOT_SUPPORTED, 182*2264Sjacobs PAPI_PRINTER_IS_DEACTIVATED, 183*2264Sjacobs PAPI_BAD_ARGUMENT, 184*2264Sjacobs PAPI_JOB_TICKET_NOT_SUPPORTED 185*2264Sjacobs } papi_status_t; 186*2264Sjacobs 187*2264Sjacobs /* list filter related */ 188*2264Sjacobs typedef enum { 189*2264Sjacobs PAPI_FILTER_BITMASK = 0 190*2264Sjacobs } papi_filter_type_t; 191*2264Sjacobs 192*2264Sjacobs typedef struct { 193*2264Sjacobs papi_filter_type_t type; 194*2264Sjacobs union { 195*2264Sjacobs struct { /* PAPI_FILTER_BITMASK */ 196*2264Sjacobs unsigned int mask; 197*2264Sjacobs unsigned int value; 198*2264Sjacobs } bitmask; 199*2264Sjacobs } filter; 200*2264Sjacobs } papi_filter_t; 201*2264Sjacobs 202*2264Sjacobs enum { 203*2264Sjacobs PAPI_PRINTER_LOCAL = 0x0000, /* Local destination */ 204*2264Sjacobs PAPI_PRINTER_CLASS = 0x0001, /* Printer class */ 205*2264Sjacobs PAPI_PRINTER_REMOTE = 0x0002, /* Remote destination */ 206*2264Sjacobs PAPI_PRINTER_BW = 0x0004, /* Can do B&W printing */ 207*2264Sjacobs PAPI_PRINTER_COLOR = 0x0008, /* Can do color printing */ 208*2264Sjacobs PAPI_PRINTER_DUPLEX = 0x0010, /* Can do duplex printing */ 209*2264Sjacobs PAPI_PRINTER_STAPLE = 0x0020, /* Can do stapling */ 210*2264Sjacobs PAPI_PRINTER_COPIES = 0x0040, /* Can do copies */ 211*2264Sjacobs PAPI_PRINTER_COLLATE = 0x0080, /* Can collate copies */ 212*2264Sjacobs PAPI_PRINTER_PUNCH = 0x0100, /* Can punch output */ 213*2264Sjacobs PAPI_PRINTER_COVER = 0x0200, /* Can cover output */ 214*2264Sjacobs PAPI_PRINTER_BIND = 0x0400, /* Can bind output */ 215*2264Sjacobs PAPI_PRINTER_SORT = 0x0800, /* Can sort output */ 216*2264Sjacobs PAPI_PRINTER_SMALL = 0x1000, /* Can do letter/legal/a4 */ 217*2264Sjacobs PAPI_PRINTER_MEDIUM = 0x2000, /* Can do tabloid/B/C/A3/A2 */ 218*2264Sjacobs PAPI_PRINTER_LARGE = 0x4000, /* Can do D/E/A1/A0 */ 219*2264Sjacobs PAPI_PRINTER_VARIABLE = 0x8000, /* Can do variable sizes */ 220*2264Sjacobs PAPI_PRINTER_IMPLICIT = 0x10000, /* implicit class */ 221*2264Sjacobs PAPI_PRINTER_DEFAULT = 0x20000, /* Default printer on network */ 222*2264Sjacobs PAPI_PRINTER_OPTIONS = 0xfffc /* ~ (CLASS | REMOTE | IMPLICIT) */ 223*2264Sjacobs }; 224*2264Sjacobs 225*2264Sjacobs /* 226*2264Sjacobs * Functions 227*2264Sjacobs */ 228*2264Sjacobs 229*2264Sjacobs /* Service related */ 230*2264Sjacobs extern papi_status_t papiServiceCreate(papi_service_t *handle, 231*2264Sjacobs char *service_name, char *user_name, 232*2264Sjacobs char *password, 233*2264Sjacobs int (*authCB)(papi_service_t svc, 234*2264Sjacobs void *app_data), 235*2264Sjacobs papi_encryption_t encryption, 236*2264Sjacobs void *app_data); 237*2264Sjacobs extern void papiServiceDestroy(papi_service_t handle); 238*2264Sjacobs extern papi_status_t papiServiceSetUserName(papi_service_t handle, 239*2264Sjacobs char *user_name); 240*2264Sjacobs extern papi_status_t papiServiceSetPassword(papi_service_t handle, 241*2264Sjacobs char *password); 242*2264Sjacobs extern papi_status_t papiServiceSetEncryption(papi_service_t handle, 243*2264Sjacobs papi_encryption_t encryption); 244*2264Sjacobs extern papi_status_t papiServiceSetAuthCB(papi_service_t handle, 245*2264Sjacobs int (*authCB)(papi_service_t s, 246*2264Sjacobs void *app_data)); 247*2264Sjacobs extern papi_status_t papiServiceSetAppData(papi_service_t handle, 248*2264Sjacobs void *app_data); 249*2264Sjacobs extern char *papiServiceGetServiceName(papi_service_t handle); 250*2264Sjacobs extern char *papiServiceGetUserName(papi_service_t handle); 251*2264Sjacobs extern char *papiServiceGetPassword(papi_service_t handle); 252*2264Sjacobs extern papi_encryption_t papiServiceGetEncryption(papi_service_t handle); 253*2264Sjacobs extern void *papiServiceGetAppData(papi_service_t handle); 254*2264Sjacobs extern papi_attribute_t **papiServiceGetAttributeList(papi_service_t handle); 255*2264Sjacobs extern char *papiServiceGetStatusMessage(papi_service_t handle); 256*2264Sjacobs 257*2264Sjacobs /* Attribute related */ 258*2264Sjacobs extern papi_status_t papiAttributeListAddValue(papi_attribute_t ***attrs, 259*2264Sjacobs int flags, char *name, 260*2264Sjacobs papi_attribute_value_type_t type, 261*2264Sjacobs papi_attribute_value_t *value); 262*2264Sjacobs extern papi_status_t papiAttributeListAddString(papi_attribute_t ***attrs, 263*2264Sjacobs int flags, char *name, char *string); 264*2264Sjacobs extern papi_status_t papiAttributeListAddInteger(papi_attribute_t ***attrs, 265*2264Sjacobs int flags, char *name, int integer); 266*2264Sjacobs extern papi_status_t papiAttributeListAddBoolean(papi_attribute_t ***attrs, 267*2264Sjacobs int flags, char *name, char boolean); 268*2264Sjacobs extern papi_status_t papiAttributeListAddRange(papi_attribute_t ***attrs, 269*2264Sjacobs int flags, char *name, 270*2264Sjacobs int lower, int upper); 271*2264Sjacobs extern papi_status_t papiAttributeListAddResolution(papi_attribute_t ***attrs, 272*2264Sjacobs int flags, char *name, 273*2264Sjacobs int xres, int yres, 274*2264Sjacobs papi_resolution_unit_t units); 275*2264Sjacobs extern papi_status_t papiAttributeListAddDatetime(papi_attribute_t ***attrs, 276*2264Sjacobs int flags, char *name, time_t datetime); 277*2264Sjacobs extern papi_status_t papiAttributeListAddCollection(papi_attribute_t ***attrs, 278*2264Sjacobs int flags, char *name, 279*2264Sjacobs papi_attribute_t **collection); 280*2264Sjacobs extern papi_status_t papiAttributeListAddMetadata(papi_attribute_t ***attrs, 281*2264Sjacobs int flags, char *name, 282*2264Sjacobs papi_metadata_t metadata); 283*2264Sjacobs extern papi_status_t papiAttributeListDelete(papi_attribute_t ***attributes, 284*2264Sjacobs char *name); 285*2264Sjacobs extern papi_status_t papiAttributeListGetValue(papi_attribute_t **list, 286*2264Sjacobs void **iterator, char *name, 287*2264Sjacobs papi_attribute_value_type_t type, 288*2264Sjacobs papi_attribute_value_t **value); 289*2264Sjacobs extern papi_status_t papiAttributeListGetString(papi_attribute_t **list, 290*2264Sjacobs void **iterator, char *name, 291*2264Sjacobs char **vptr); 292*2264Sjacobs extern papi_status_t papiAttributeListGetInteger(papi_attribute_t **list, 293*2264Sjacobs void **iterator, char *name, int *vptr); 294*2264Sjacobs extern papi_status_t papiAttributeListGetBoolean(papi_attribute_t **list, 295*2264Sjacobs void **iterator, char *name, 296*2264Sjacobs char *vptr); 297*2264Sjacobs extern papi_status_t papiAttributeListGetRange(papi_attribute_t **list, 298*2264Sjacobs void **iterator, char *name, 299*2264Sjacobs int *min, int *max); 300*2264Sjacobs extern papi_status_t papiAttributeListGetResolution(papi_attribute_t **list, 301*2264Sjacobs void **iterator, char *name, 302*2264Sjacobs int *x, int *y, 303*2264Sjacobs papi_resolution_unit_t *units); 304*2264Sjacobs extern papi_status_t papiAttributeListGetDatetime(papi_attribute_t **list, 305*2264Sjacobs void **iterator, char *name, 306*2264Sjacobs time_t *dt); 307*2264Sjacobs extern papi_status_t papiAttributeListGetCollection(papi_attribute_t **list, 308*2264Sjacobs void **iterator, char *name, 309*2264Sjacobs papi_attribute_t ***collection); 310*2264Sjacobs extern papi_status_t papiAttributeListGetMetadata(papi_attribute_t **list, 311*2264Sjacobs void **iterator, char *name, 312*2264Sjacobs papi_metadata_t *vptr); 313*2264Sjacobs extern papi_attribute_t *papiAttributeListFind(papi_attribute_t **list, 314*2264Sjacobs char *name); 315*2264Sjacobs extern papi_attribute_t *papiAttributeListGetNext(papi_attribute_t **list, 316*2264Sjacobs void **iterator); 317*2264Sjacobs extern void papiAttributeListFree(papi_attribute_t **attributes); 318*2264Sjacobs 319*2264Sjacobs extern papi_status_t papiAttributeListFromString(papi_attribute_t ***attrs, 320*2264Sjacobs int flags, char *string); 321*2264Sjacobs extern papi_status_t papiAttributeListToString(papi_attribute_t **attrs, 322*2264Sjacobs char *delim, 323*2264Sjacobs char *buffer, size_t buflen); 324*2264Sjacobs extern void papiAttributeListPrint(FILE *fp, papi_attribute_t **list, 325*2264Sjacobs char *prefix_fmt, ...); 326*2264Sjacobs 327*2264Sjacobs /* Printer related */ 328*2264Sjacobs extern papi_status_t papiPrintersList(papi_service_t handle, 329*2264Sjacobs char **requested_attrs, 330*2264Sjacobs papi_filter_t *filter, 331*2264Sjacobs papi_printer_t **printers); 332*2264Sjacobs extern papi_status_t papiPrinterQuery(papi_service_t handle, char *name, 333*2264Sjacobs char **requested_attrs, 334*2264Sjacobs papi_attribute_t **job_attributes, 335*2264Sjacobs papi_printer_t *printer); 336*2264Sjacobs extern papi_status_t papiPrinterAdd(papi_service_t handle, char *name, 337*2264Sjacobs papi_attribute_t **attributes, 338*2264Sjacobs papi_printer_t *printer); 339*2264Sjacobs extern papi_status_t papiPrinterModify(papi_service_t handle, char *name, 340*2264Sjacobs papi_attribute_t **attributes, 341*2264Sjacobs papi_printer_t *printer); 342*2264Sjacobs extern papi_status_t papiPrinterRemove(papi_service_t handle, char *name); 343*2264Sjacobs extern papi_status_t papiPrinterDisable(papi_service_t handle, char *name, 344*2264Sjacobs char *message); 345*2264Sjacobs extern papi_status_t papiPrinterEnable(papi_service_t handle, char *name); 346*2264Sjacobs extern papi_status_t papiPrinterPause(papi_service_t handle, char *name, 347*2264Sjacobs char *message); 348*2264Sjacobs extern papi_status_t papiPrinterResume(papi_service_t handle, char *name); 349*2264Sjacobs extern papi_status_t papiPrinterPurgeJobs(papi_service_t handle, 350*2264Sjacobs char *name, papi_job_t **jobs); 351*2264Sjacobs extern papi_status_t papiPrinterListJobs(papi_service_t handle, 352*2264Sjacobs char *name, char **requested_attrs, 353*2264Sjacobs int type_mask, int max_num_jobs, 354*2264Sjacobs papi_job_t **jobs); 355*2264Sjacobs extern papi_attribute_t **papiPrinterGetAttributeList(papi_printer_t printer); 356*2264Sjacobs extern void papiPrinterFree(papi_printer_t printer); 357*2264Sjacobs extern void papiPrinterListFree(papi_printer_t *printers); 358*2264Sjacobs 359*2264Sjacobs /* Job related */ 360*2264Sjacobs extern papi_status_t papiJobSubmit(papi_service_t handle, char *printer, 361*2264Sjacobs papi_attribute_t **job_attributes, 362*2264Sjacobs papi_job_ticket_t *job_ticket, 363*2264Sjacobs char **files, papi_job_t *job); 364*2264Sjacobs extern papi_status_t papiJobSubmitByReference(papi_service_t handle, 365*2264Sjacobs char *printer, 366*2264Sjacobs papi_attribute_t **job_attributes, 367*2264Sjacobs papi_job_ticket_t *job_ticket, 368*2264Sjacobs char **files, papi_job_t *job); 369*2264Sjacobs extern papi_status_t papiJobValidate(papi_service_t handle, char *printer, 370*2264Sjacobs papi_attribute_t **job_attributes, 371*2264Sjacobs papi_job_ticket_t *job_ticket, 372*2264Sjacobs char **files, papi_job_t *job); 373*2264Sjacobs extern papi_status_t papiJobStreamOpen(papi_service_t handle, 374*2264Sjacobs char *printer, 375*2264Sjacobs papi_attribute_t **job_attributes, 376*2264Sjacobs papi_job_ticket_t *job_ticket, 377*2264Sjacobs papi_stream_t *stream); 378*2264Sjacobs extern papi_status_t papiJobStreamWrite(papi_service_t handle, 379*2264Sjacobs papi_stream_t stream, 380*2264Sjacobs void *buffer, size_t buflen); 381*2264Sjacobs extern papi_status_t papiJobStreamClose(papi_service_t handle, 382*2264Sjacobs papi_stream_t stream, 383*2264Sjacobs papi_job_t *job); 384*2264Sjacobs extern papi_status_t papiJobQuery(papi_service_t handle, char *printer, 385*2264Sjacobs int32_t job_id, char **requested_attrs, 386*2264Sjacobs papi_job_t *job); 387*2264Sjacobs extern papi_status_t papiJobModify(papi_service_t handle, char *printer, 388*2264Sjacobs int32_t job_id, 389*2264Sjacobs papi_attribute_t **attributes, 390*2264Sjacobs papi_job_t *job); 391*2264Sjacobs extern papi_status_t papiJobMove(papi_service_t handle, char *printer, 392*2264Sjacobs int32_t job_id, char *destination); 393*2264Sjacobs extern papi_status_t papiJobCancel(papi_service_t handle, char *printer, 394*2264Sjacobs int32_t job_id); 395*2264Sjacobs extern papi_status_t papiJobHold(papi_service_t handle, char *printer, 396*2264Sjacobs int32_t job_id); 397*2264Sjacobs extern papi_status_t papiJobRelease(papi_service_t handle, char *printer, 398*2264Sjacobs int32_t job_id); 399*2264Sjacobs extern papi_status_t papiJobRestart(papi_service_t handle, char *printer, 400*2264Sjacobs int32_t job_id); 401*2264Sjacobs extern papi_status_t papiJobPromote(papi_service_t handle, char *printer, 402*2264Sjacobs int32_t job_id); 403*2264Sjacobs extern papi_attribute_t **papiJobGetAttributeList(papi_job_t printer); 404*2264Sjacobs extern char *papiJobGetPrinterName(papi_job_t printer); 405*2264Sjacobs extern int32_t papiJobGetId(papi_job_t printer); 406*2264Sjacobs extern papi_job_ticket_t *papiJobGetJobTicket(papi_job_t printer); 407*2264Sjacobs extern void papiJobFree(papi_job_t job); 408*2264Sjacobs extern void papiJobListFree(papi_job_t *jobs); 409*2264Sjacobs 410*2264Sjacobs #ifdef SOLARIS_PRIVATE_POST_0_9 411*2264Sjacobs /* 412*2264Sjacobs * These have been added to support IPP create-job/send-document with PAPI v0.9 413*2264Sjacobs * in an IPP listener using PAPI as it's spooler interface. A future version 414*2264Sjacobs * of the API is expected to support this type of functionality 415*2264Sjacobs */ 416*2264Sjacobs extern papi_status_t papiJobCreate(papi_service_t handle, char *printer, 417*2264Sjacobs papi_attribute_t **job_attributes, 418*2264Sjacobs papi_job_ticket_t *job_ticket, 419*2264Sjacobs papi_job_t *job); 420*2264Sjacobs extern papi_status_t papiJobStreamAdd(papi_service_t handle, char *printer, 421*2264Sjacobs int32_t id, papi_stream_t *stream); 422*2264Sjacobs extern papi_status_t papiJobCommit(papi_service_t handle, char *printer, 423*2264Sjacobs int32_t id); 424*2264Sjacobs extern papi_status_t papiServiceSetPeer(papi_service_t handle, int peerfd); 425*2264Sjacobs #endif /* SOLARIS_PRIVATE_POST_0_9 */ 426*2264Sjacobs 427*2264Sjacobs extern char *papiStatusString(papi_status_t status); 428*2264Sjacobs 429*2264Sjacobs /* 430*2264Sjacobs * Internal functions that aren't in the API, but are shared across 431*2264Sjacobs * protocol support implementations(psms) and the tightly bound 432*2264Sjacobs * listener library. Do not use these in your applications. 433*2264Sjacobs */ 434*2264Sjacobs extern void list_append(); 435*2264Sjacobs extern void list_concatenate(); 436*2264Sjacobs extern void list_remove(); 437*2264Sjacobs extern void copy_attributes(papi_attribute_t ***result, 438*2264Sjacobs papi_attribute_t **list); 439*2264Sjacobs extern void split_and_copy_attributes(char **list, 440*2264Sjacobs papi_attribute_t **attributes, 441*2264Sjacobs papi_attribute_t ***in, 442*2264Sjacobs papi_attribute_t ***out); 443*2264Sjacobs 444*2264Sjacobs #ifdef __cplusplus 445*2264Sjacobs } 446*2264Sjacobs #endif 447*2264Sjacobs 448*2264Sjacobs #endif /* _PAPI_H */ 449