xref: /titanic_51/usr/src/lib/print/libpapi-common/common/common.c (revision 0a44ef6d9afbfe052a7e975f55ea0d2954b62a82)
1355b4669Sjacobs /*
2355b4669Sjacobs  * CDDL HEADER START
3355b4669Sjacobs  *
4355b4669Sjacobs  * The contents of this file are subject to the terms of the
5355b4669Sjacobs  * Common Development and Distribution License (the "License").
6355b4669Sjacobs  * You may not use this file except in compliance with the License.
7355b4669Sjacobs  *
8355b4669Sjacobs  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9355b4669Sjacobs  * or http://www.opensolaris.org/os/licensing.
10355b4669Sjacobs  * See the License for the specific language governing permissions
11355b4669Sjacobs  * and limitations under the License.
12355b4669Sjacobs  *
13355b4669Sjacobs  * When distributing Covered Code, include this CDDL HEADER in each
14355b4669Sjacobs  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15355b4669Sjacobs  * If applicable, add the following below this CDDL HEADER, with the
16355b4669Sjacobs  * fields enclosed by brackets "[]" replaced with your own identifying
17355b4669Sjacobs  * information: Portions Copyright [yyyy] [name of copyright owner]
18355b4669Sjacobs  *
19355b4669Sjacobs  * CDDL HEADER END
20355b4669Sjacobs  */
21355b4669Sjacobs 
22355b4669Sjacobs /*
23355b4669Sjacobs  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
24355b4669Sjacobs  * Use is subject to license terms.
25355b4669Sjacobs  *
26355b4669Sjacobs  */
27355b4669Sjacobs 
28355b4669Sjacobs /* $Id: common.c 151 2006-04-25 16:55:34Z njacobs $ */
29355b4669Sjacobs 
30355b4669Sjacobs #pragma ident	"%Z%%M%	%I%	%E% SMI"
31355b4669Sjacobs 
32355b4669Sjacobs /*
33355b4669Sjacobs  * Shared "unsupported" function implementations that can be overridden
34355b4669Sjacobs  * by libpapi and the various print service modules (psms).
35355b4669Sjacobs  */
36355b4669Sjacobs 
37355b4669Sjacobs #include <stdlib.h>
38355b4669Sjacobs #include <papi.h>
39355b4669Sjacobs 
40355b4669Sjacobs static papi_status_t
41355b4669Sjacobs _unsupported()
42355b4669Sjacobs {
43355b4669Sjacobs 	return (PAPI_OPERATION_NOT_SUPPORTED);
44355b4669Sjacobs }
45355b4669Sjacobs 
46355b4669Sjacobs static void *
47355b4669Sjacobs _unsupported_null_return()
48355b4669Sjacobs {
49355b4669Sjacobs 	return (NULL);
50355b4669Sjacobs }
51355b4669Sjacobs 
52355b4669Sjacobs static void
53355b4669Sjacobs _unsupported_no_return()
54355b4669Sjacobs {
55355b4669Sjacobs }
56355b4669Sjacobs 
57355b4669Sjacobs /*
58355b4669Sjacobs  * Service interfaces
59355b4669Sjacobs  */
60355b4669Sjacobs #pragma weak papiServiceCreate = _unsupported
61355b4669Sjacobs #pragma weak papiServiceDestroy = _unsupported_no_return
62355b4669Sjacobs #pragma weak papiServiceSetPeer = _unsupported
63355b4669Sjacobs #pragma weak papiServiceSetUserName = _unsupported
64355b4669Sjacobs #pragma weak papiServiceSetPassword = _unsupported
65355b4669Sjacobs #pragma weak papiServiceSetEncryption = _unsupported
66355b4669Sjacobs #pragma weak papiServiceSetAuthCB = _unsupported
67355b4669Sjacobs #pragma weak papiServiceSetAppData = _unsupported
68355b4669Sjacobs 
69355b4669Sjacobs #pragma weak papiServiceGetServiceName = _unsupported_null_return
70355b4669Sjacobs #pragma weak papiServiceGetUserName = _unsupported_null_return
71355b4669Sjacobs #pragma weak papiServiceGetPassword = _unsupported_null_return
72355b4669Sjacobs #pragma weak papiServiceGetAppData = _unsupported_null_return
73355b4669Sjacobs 
74355b4669Sjacobs papi_encryption_t
75355b4669Sjacobs papiServiceGetEncryption(papi_service_t handle)
76355b4669Sjacobs {
77355b4669Sjacobs 	return (PAPI_ENCRYPT_NEVER);
78355b4669Sjacobs }
79355b4669Sjacobs 
80355b4669Sjacobs #pragma weak papiServiceGetAttributeList = _unsupported_null_return
81355b4669Sjacobs #pragma weak papiServiceGetStatusMessage = _unsupported_null_return
82355b4669Sjacobs 
83355b4669Sjacobs /*
84355b4669Sjacobs  * Printer operations
85355b4669Sjacobs  */
86355b4669Sjacobs #pragma weak papiPrintersList = _unsupported
87355b4669Sjacobs #pragma weak papiPrinterQuery = _unsupported
88355b4669Sjacobs #pragma weak papiPrinterEnable = _unsupported
89355b4669Sjacobs #pragma weak papiPrinterDisable = _unsupported
90355b4669Sjacobs #pragma weak papiPrinterPause = _unsupported
91355b4669Sjacobs #pragma weak papiPrinterResume = _unsupported
92355b4669Sjacobs #pragma weak papiPrinterAdd = _unsupported
93355b4669Sjacobs #pragma weak papiPrinterModify = _unsupported
94355b4669Sjacobs #pragma weak papiPrinterRemove = _unsupported
95355b4669Sjacobs #pragma weak papiPrinterPurgeJobs = _unsupported
96355b4669Sjacobs #pragma weak papiPrinterListJobs = _unsupported
97355b4669Sjacobs #pragma weak papiPrinterGetAttributeList = _unsupported_null_return
98355b4669Sjacobs #pragma weak papiPrinterFree = _unsupported_no_return
99355b4669Sjacobs #pragma weak papiPrinterListFree = _unsupported_no_return
100355b4669Sjacobs 
101355b4669Sjacobs /*
102355b4669Sjacobs  * Job interfaces
103355b4669Sjacobs  */
104355b4669Sjacobs #pragma weak papiJobHold = _unsupported
105355b4669Sjacobs #pragma weak papiJobRelease = _unsupported
106355b4669Sjacobs #pragma weak papiJobRestart = _unsupported
107355b4669Sjacobs #pragma weak papiJobPromote = _unsupported
108355b4669Sjacobs #pragma weak papiJobModify = _unsupported
109355b4669Sjacobs #pragma weak papiJobSubmit = _unsupported
110355b4669Sjacobs #pragma weak papiJobSubmitByReference = _unsupported
111355b4669Sjacobs #pragma weak papiJobValidate = _unsupported
112355b4669Sjacobs #pragma weak papiJobStreamOpen = _unsupported
113355b4669Sjacobs #pragma weak papiJobStreamWrite = _unsupported
114355b4669Sjacobs #pragma weak papiJobStreamClose = _unsupported
115355b4669Sjacobs #pragma weak papiJobQuery = _unsupported
116355b4669Sjacobs #pragma weak papiJobMove = _unsupported
117355b4669Sjacobs #pragma weak papiJobCancel = _unsupported
118355b4669Sjacobs #pragma weak papiJobGetAttributeList = _unsupported_null_return
119355b4669Sjacobs #pragma weak papiJobGetPrinterName = _unsupported_null_return
120355b4669Sjacobs #pragma weak papiJobCreate = _unsupported
121355b4669Sjacobs #pragma weak papiJobStreamAdd = _unsupported
122355b4669Sjacobs #pragma weak papiJobCommit = _unsupported
123355b4669Sjacobs 
124355b4669Sjacobs int
125355b4669Sjacobs papiJobGetId(papi_job_t job)
126355b4669Sjacobs {
127355b4669Sjacobs 	return (-1);
128355b4669Sjacobs }
129355b4669Sjacobs 
130355b4669Sjacobs #pragma weak papiJobGetJobTicket = _unsupported_null_return
131355b4669Sjacobs #pragma weak papiJobFree = _unsupported_no_return
132355b4669Sjacobs #pragma weak papiJobListFree = _unsupported_no_return
133*0a44ef6dSjacobs 
134*0a44ef6dSjacobs /* private functions */
135*0a44ef6dSjacobs #pragma weak getprinterbyname = _unsupported_null_return
136