xref: /titanic_52/usr/src/lib/print/libpapi-common/common/common.c (revision 4e5b757fbcf21077677360be274461dcd9064106)
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 /* $Id: common.c 151 2006-04-25 16:55:34Z njacobs $ */
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * Shared "unsupported" function implementations that can be overridden
34  * by libpapi and the various print service modules (psms).
35  */
36 
37 #include <stdlib.h>
38 #include <papi.h>
39 
40 static papi_status_t
41 _unsupported()
42 {
43 	return (PAPI_OPERATION_NOT_SUPPORTED);
44 }
45 
46 static void *
47 _unsupported_null_return()
48 {
49 	return (NULL);
50 }
51 
52 static void
53 _unsupported_no_return()
54 {
55 }
56 
57 /*
58  * Service interfaces
59  */
60 #pragma weak papiServiceCreate = _unsupported
61 #pragma weak papiServiceDestroy = _unsupported_no_return
62 #pragma weak papiServiceSetPeer = _unsupported
63 #pragma weak papiServiceSetUserName = _unsupported
64 #pragma weak papiServiceSetPassword = _unsupported
65 #pragma weak papiServiceSetEncryption = _unsupported
66 #pragma weak papiServiceSetAuthCB = _unsupported
67 #pragma weak papiServiceSetAppData = _unsupported
68 
69 #pragma weak papiServiceGetServiceName = _unsupported_null_return
70 #pragma weak papiServiceGetUserName = _unsupported_null_return
71 #pragma weak papiServiceGetPassword = _unsupported_null_return
72 #pragma weak papiServiceGetAppData = _unsupported_null_return
73 
74 papi_encryption_t
75 papiServiceGetEncryption(papi_service_t handle)
76 {
77 	return (PAPI_ENCRYPT_NEVER);
78 }
79 
80 #pragma weak papiServiceGetAttributeList = _unsupported_null_return
81 #pragma weak papiServiceGetStatusMessage = _unsupported_null_return
82 
83 /*
84  * Printer operations
85  */
86 #pragma weak papiPrintersList = _unsupported
87 #pragma weak papiPrinterQuery = _unsupported
88 #pragma weak papiPrinterEnable = _unsupported
89 #pragma weak papiPrinterDisable = _unsupported
90 #pragma weak papiPrinterPause = _unsupported
91 #pragma weak papiPrinterResume = _unsupported
92 #pragma weak papiPrinterAdd = _unsupported
93 #pragma weak papiPrinterModify = _unsupported
94 #pragma weak papiPrinterRemove = _unsupported
95 #pragma weak papiPrinterPurgeJobs = _unsupported
96 #pragma weak papiPrinterListJobs = _unsupported
97 #pragma weak papiPrinterGetAttributeList = _unsupported_null_return
98 #pragma weak papiPrinterFree = _unsupported_no_return
99 #pragma weak papiPrinterListFree = _unsupported_no_return
100 
101 /*
102  * Job interfaces
103  */
104 #pragma weak papiJobHold = _unsupported
105 #pragma weak papiJobRelease = _unsupported
106 #pragma weak papiJobRestart = _unsupported
107 #pragma weak papiJobPromote = _unsupported
108 #pragma weak papiJobModify = _unsupported
109 #pragma weak papiJobSubmit = _unsupported
110 #pragma weak papiJobSubmitByReference = _unsupported
111 #pragma weak papiJobValidate = _unsupported
112 #pragma weak papiJobStreamOpen = _unsupported
113 #pragma weak papiJobStreamWrite = _unsupported
114 #pragma weak papiJobStreamClose = _unsupported
115 #pragma weak papiJobQuery = _unsupported
116 #pragma weak papiJobMove = _unsupported
117 #pragma weak papiJobCancel = _unsupported
118 #pragma weak papiJobGetAttributeList = _unsupported_null_return
119 #pragma weak papiJobGetPrinterName = _unsupported_null_return
120 #pragma weak papiJobCreate = _unsupported
121 #pragma weak papiJobStreamAdd = _unsupported
122 #pragma weak papiJobCommit = _unsupported
123 
124 int
125 papiJobGetId(papi_job_t job)
126 {
127 	return (-1);
128 }
129 
130 #pragma weak papiJobGetJobTicket = _unsupported_null_return
131 #pragma weak papiJobFree = _unsupported_no_return
132 #pragma weak papiJobListFree = _unsupported_no_return
133 
134 /* private functions */
135 #pragma weak getprinterbyname = _unsupported_null_return
136