papi.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _PAPI_H
#define _PAPI_H
#pragma ident "%Z%%M% %I% %E% SMI"
#include <time.h>
#include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Types
*/
/* service related types */
typedef void *papi_service_t;
typedef void *papi_printer_t;
typedef void *papi_job_t;
typedef void *papi_stream_t;
typedef enum {
PAPI_ENCRYPT_IF_REQUESTED, /* Encrypt if requested (TLS upgrade) */
PAPI_ENCRYPT_NEVER, /* Never encrypt */
PAPI_ENCRYPT_REQUIRED, /* Encryption required (TLS upgrade) */
PAPI_ENCRYPT_ALWAYS /* Always encrypt (SSL) */
/* attribute related types */
typedef enum {
typedef enum {
PAPI_RES_PER_INCH = 3,
enum { /* for boolean values */
PAPI_FALSE = 0,
PAPI_TRUE = 1
};
#define PAPI_LIST_JOBS_OTHERS 0x0001
#define PAPI_LIST_JOBS_COMPLETED 0x0002
#define PAPI_LIST_JOBS_NOT_COMPLETED 0x0004
#define PAPI_LIST_JOBS_ALL 0xFFFF
typedef struct papi_attribute_s papi_attribute_t;
typedef union {
char *string; /* PAPI_STRING value */
int integer; /* PAPI_INTEGER value */
char boolean; /* PAPI_BOOLEAN value */
struct { /* PAPI_RANGE value */
int lower;
int upper;
} range;
struct { /* PAPI_RESOLUTION value */
int xres;
int yres;
} resolution;
struct papi_attribute_s {
char *name; /* attribute name */
};
/* job related types */
typedef enum {
PAPI_JT_FORMAT_JDF = 0,
typedef struct {
char *ticket_data;
char *file_name;
/* status related types */
typedef enum {
PAPI_OK = 0x0000,
PAPI_REDIRECTION_OTHER_SITE = 0x0300,
PAPI_BAD_REQUEST = 0x0400,
PAPI_INTERNAL_ERROR = 0x0500,
/* list filter related */
typedef enum {
typedef struct {
union {
struct { /* PAPI_FILTER_BITMASK */
unsigned int mask;
unsigned int value;
} bitmask;
} filter;
enum {
};
/*
* Functions
*/
/* Service related */
const char *service_name,
const char *user_name,
const char *password,
const papi_encryption_t encryption,
void *app_data);
const char *user_name);
const char *password);
const papi_encryption_t encryption);
const int (*authCB)(papi_service_t s));
const void *app_data);
/* Attribute related */
const int flags,
const char *name,
const papi_attribute_value_type_t type,
const papi_attribute_value_t *value);
const char *string);
const int integer);
const char boolean);
const papi_attribute_t **collection);
const char *name);
char **vptr);
int *vptr);
char *vptr);
int *x, int *y,
const char *name);
void **iterator);
const char *delim,
extern void papiAttributeListPrint
/* Printer related */
const char **requested_attrs,
const papi_filter_t *filter,
const char **requested_attrs,
const papi_attribute_t **job_attributes,
const papi_attribute_t **attributes,
const char *message);
const char *name,
const char **requested_attrs,
const int type_mask,
const int max_num_jobs,
papi_job_t **jobs);
/* Job related */
const papi_attribute_t **job_attributes,
const papi_job_ticket_t *job_ticket,
const char *printer,
const papi_attribute_t **job_attributes,
const papi_job_ticket_t *job_ticket,
const papi_attribute_t **job_attributes,
const papi_job_ticket_t *job_ticket,
const char *printer,
const papi_attribute_t **job_attributes,
const papi_job_ticket_t *job_ticket,
const void *buffer,
papi_job_t *job);
const char **requested_attrs,
papi_job_t *job);
const papi_attribute_t **attributes,
papi_job_t *job);
const char *hold_until,
const time_t *hold_until_time);
#ifdef SOLARIS_PRIVATE_POST_1_0
/*
* These have been added to support IPP create-job/send-document with PAPI v1.0
* in an IPP listener using PAPI as it's spooler interface. A future version
* of the API is expected to support this type of functionality
*/
const papi_attribute_t **job_attributes,
const papi_job_ticket_t *job_ticket,
papi_job_t *job);
#endif /* SOLARIS_PRIVATE_POST_1_0 */
#ifdef __cplusplus
}
#endif
#endif /* _PAPI_H */