papi.h revision a18dc42fc967d11feba9b8be61c6727dc6c56b48
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
#ifndef _PAPI_H
#define _PAPI_H
/* $Id: papi.h 161 2006-05-03 04:32:59Z njacobs $ */
#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
};
typedef enum {
PAPI_UNSUPPORTED = 0x10,
PAPI_DEFAULT = 0x11,
PAPI_NOT_SETTABLE = 0x15,
PAPI_DELETE = 0x16
#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 */
char *service_name, char *user_name,
char *password,
void *app_data),
void *app_data);
char *user_name);
char *password);
int (*authCB)(papi_service_t s,
void *app_data));
void *app_data);
/* Attribute related */
char *name);
char **vptr);
char *vptr);
int *x, int *y,
char *name);
void **iterator);
char *delim,
char *prefix_fmt, ...);
/* Printer related */
char **requested_attrs,
char **requested_attrs,
char *message);
char *message);
char *name, char **requested_attrs,
int type_mask, int max_num_jobs,
papi_job_t **jobs);
/* Job related */
char *printer,
char *printer,
papi_job_t *job);
papi_job_t *job);
papi_job_t *job);
#ifdef SOLARIS_PRIVATE_POST_0_9
/*
* These have been added to support IPP create-job/send-document with PAPI v0.9
* 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
*/
papi_job_t *job);
#endif /* SOLARIS_PRIVATE_POST_0_9 */
/*
* Internal functions that aren't in the API, but are shared across
* protocol support implementations(psms) and the tightly bound
* listener library. Do not use these in your applications.
*/
extern void list_append();
extern void list_concatenate();
extern void list_remove();
papi_attribute_t **list);
extern void split_and_copy_attributes(char **list,
papi_attribute_t ***in,
papi_attribute_t ***out);
extern int is_localhost(char *hostname);
#ifdef __cplusplus
}
#endif
#endif /* _PAPI_H */