xref: /illumos-gate/usr/src/lib/print/libpapi-dynamic/common/papi_impl.h (revision 86d949f9497332fe19be6b5d711d265eb957439f)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  *
26  */
27 
28 #ifndef _PAPI_IMPL_H
29 #define	_PAPI_IMPL_H
30 
31 /* $Id: papi_impl.h 161 2006-05-03 04:32:59Z njacobs $ */
32 
33 #include <papi.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 #include <time.h>
40 #include <sys/types.h>
41 #include <stdarg.h>
42 #include <uri.h>
43 
44 /*
45  * Implementation specific types/prototypes/definitions follow
46  *
47  *
48  * Ex:
49  */
50 
51 typedef struct {
52 	papi_attribute_t **attributes;
53 	void *so_handle;
54 	void *svc_handle;
55 	char *name;
56 	char *user;
57 	char *password;
58 	int (*authCB)(papi_service_t svc, void *app_data);
59 	papi_encryption_t encryption;
60 	void *app_data;
61 	uri_t *uri;
62 	int peer_fd;
63 } service_t;
64 
65 typedef struct job {
66 	service_t *svc;
67 	papi_job_t *job;
68 } job_t;
69 
70 typedef struct {
71 	service_t *svc;
72 	papi_printer_t *printer;
73 	papi_attribute_t **attributes;
74 	char svc_is_internal;
75 } printer_t;
76 
77 extern papi_status_t psm_open(service_t *svc, char *name);
78 extern void *psm_sym(service_t *svc, char *name);
79 extern void psm_close(void *handle);
80 extern void detailed_error(service_t *svc, char *fmt, ...);
81 extern papi_status_t service_connect(service_t *svc, char *uri);
82 extern papi_attribute_t **getprinterentry(char *ns);
83 extern papi_attribute_t **getprinterbyname(char *name, char *ns);
84 extern int setprinterentry(int stayopen, char *ns);
85 extern int endprinterentry(int stayopen);
86 
87 
88 
89 extern void list_remove();
90 
91 #ifdef __cplusplus
92 }
93 #endif
94 
95 #endif /* _PAPI_IMPL_H */
96