xref: /onnv-gate/usr/src/lib/print/libpapi-common/common/common.c (revision 3125:084bca4d4623)
12264Sjacobs /*
22264Sjacobs  * CDDL HEADER START
32264Sjacobs  *
42264Sjacobs  * The contents of this file are subject to the terms of the
52264Sjacobs  * Common Development and Distribution License (the "License").
62264Sjacobs  * You may not use this file except in compliance with the License.
72264Sjacobs  *
82264Sjacobs  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92264Sjacobs  * or http://www.opensolaris.org/os/licensing.
102264Sjacobs  * See the License for the specific language governing permissions
112264Sjacobs  * and limitations under the License.
122264Sjacobs  *
132264Sjacobs  * When distributing Covered Code, include this CDDL HEADER in each
142264Sjacobs  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152264Sjacobs  * If applicable, add the following below this CDDL HEADER, with the
162264Sjacobs  * fields enclosed by brackets "[]" replaced with your own identifying
172264Sjacobs  * information: Portions Copyright [yyyy] [name of copyright owner]
182264Sjacobs  *
192264Sjacobs  * CDDL HEADER END
202264Sjacobs  */
212264Sjacobs 
222264Sjacobs /*
232264Sjacobs  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
242264Sjacobs  * Use is subject to license terms.
252264Sjacobs  *
262264Sjacobs  */
272264Sjacobs 
282264Sjacobs /* $Id: common.c 151 2006-04-25 16:55:34Z njacobs $ */
292264Sjacobs 
302264Sjacobs #pragma ident	"%Z%%M%	%I%	%E% SMI"
312264Sjacobs 
322264Sjacobs /*
332264Sjacobs  * Shared "unsupported" function implementations that can be overridden
342264Sjacobs  * by libpapi and the various print service modules (psms).
352264Sjacobs  */
362264Sjacobs 
372264Sjacobs #include <stdlib.h>
382264Sjacobs #include <papi.h>
392264Sjacobs 
402264Sjacobs static papi_status_t
_unsupported()412264Sjacobs _unsupported()
422264Sjacobs {
432264Sjacobs 	return (PAPI_OPERATION_NOT_SUPPORTED);
442264Sjacobs }
452264Sjacobs 
462264Sjacobs static void *
_unsupported_null_return()472264Sjacobs _unsupported_null_return()
482264Sjacobs {
492264Sjacobs 	return (NULL);
502264Sjacobs }
512264Sjacobs 
522264Sjacobs static void
_unsupported_no_return()532264Sjacobs _unsupported_no_return()
542264Sjacobs {
552264Sjacobs }
562264Sjacobs 
572264Sjacobs /*
582264Sjacobs  * Service interfaces
592264Sjacobs  */
602264Sjacobs #pragma weak papiServiceCreate = _unsupported
612264Sjacobs #pragma weak papiServiceDestroy = _unsupported_no_return
622264Sjacobs #pragma weak papiServiceSetPeer = _unsupported
632264Sjacobs #pragma weak papiServiceSetUserName = _unsupported
642264Sjacobs #pragma weak papiServiceSetPassword = _unsupported
652264Sjacobs #pragma weak papiServiceSetEncryption = _unsupported
662264Sjacobs #pragma weak papiServiceSetAuthCB = _unsupported
672264Sjacobs #pragma weak papiServiceSetAppData = _unsupported
682264Sjacobs 
692264Sjacobs #pragma weak papiServiceGetServiceName = _unsupported_null_return
702264Sjacobs #pragma weak papiServiceGetUserName = _unsupported_null_return
712264Sjacobs #pragma weak papiServiceGetPassword = _unsupported_null_return
722264Sjacobs #pragma weak papiServiceGetAppData = _unsupported_null_return
732264Sjacobs 
742264Sjacobs papi_encryption_t
papiServiceGetEncryption(papi_service_t handle)752264Sjacobs papiServiceGetEncryption(papi_service_t handle)
762264Sjacobs {
772264Sjacobs 	return (PAPI_ENCRYPT_NEVER);
782264Sjacobs }
792264Sjacobs 
802264Sjacobs #pragma weak papiServiceGetAttributeList = _unsupported_null_return
812264Sjacobs #pragma weak papiServiceGetStatusMessage = _unsupported_null_return
822264Sjacobs 
832264Sjacobs /*
842264Sjacobs  * Printer operations
852264Sjacobs  */
862264Sjacobs #pragma weak papiPrintersList = _unsupported
872264Sjacobs #pragma weak papiPrinterQuery = _unsupported
882264Sjacobs #pragma weak papiPrinterEnable = _unsupported
892264Sjacobs #pragma weak papiPrinterDisable = _unsupported
902264Sjacobs #pragma weak papiPrinterPause = _unsupported
912264Sjacobs #pragma weak papiPrinterResume = _unsupported
922264Sjacobs #pragma weak papiPrinterAdd = _unsupported
932264Sjacobs #pragma weak papiPrinterModify = _unsupported
942264Sjacobs #pragma weak papiPrinterRemove = _unsupported
952264Sjacobs #pragma weak papiPrinterPurgeJobs = _unsupported
962264Sjacobs #pragma weak papiPrinterListJobs = _unsupported
972264Sjacobs #pragma weak papiPrinterGetAttributeList = _unsupported_null_return
982264Sjacobs #pragma weak papiPrinterFree = _unsupported_no_return
992264Sjacobs #pragma weak papiPrinterListFree = _unsupported_no_return
1002264Sjacobs 
1012264Sjacobs /*
1022264Sjacobs  * Job interfaces
1032264Sjacobs  */
1042264Sjacobs #pragma weak papiJobHold = _unsupported
1052264Sjacobs #pragma weak papiJobRelease = _unsupported
1062264Sjacobs #pragma weak papiJobRestart = _unsupported
1072264Sjacobs #pragma weak papiJobPromote = _unsupported
1082264Sjacobs #pragma weak papiJobModify = _unsupported
1092264Sjacobs #pragma weak papiJobSubmit = _unsupported
1102264Sjacobs #pragma weak papiJobSubmitByReference = _unsupported
1112264Sjacobs #pragma weak papiJobValidate = _unsupported
1122264Sjacobs #pragma weak papiJobStreamOpen = _unsupported
1132264Sjacobs #pragma weak papiJobStreamWrite = _unsupported
1142264Sjacobs #pragma weak papiJobStreamClose = _unsupported
1152264Sjacobs #pragma weak papiJobQuery = _unsupported
1162264Sjacobs #pragma weak papiJobMove = _unsupported
1172264Sjacobs #pragma weak papiJobCancel = _unsupported
1182264Sjacobs #pragma weak papiJobGetAttributeList = _unsupported_null_return
1192264Sjacobs #pragma weak papiJobGetPrinterName = _unsupported_null_return
1202264Sjacobs #pragma weak papiJobCreate = _unsupported
1212264Sjacobs #pragma weak papiJobStreamAdd = _unsupported
1222264Sjacobs #pragma weak papiJobCommit = _unsupported
1232264Sjacobs 
1242264Sjacobs int
papiJobGetId(papi_job_t job)1252264Sjacobs papiJobGetId(papi_job_t job)
1262264Sjacobs {
1272264Sjacobs 	return (-1);
1282264Sjacobs }
1292264Sjacobs 
1302264Sjacobs #pragma weak papiJobGetJobTicket = _unsupported_null_return
1312264Sjacobs #pragma weak papiJobFree = _unsupported_no_return
1322264Sjacobs #pragma weak papiJobListFree = _unsupported_no_return
133*3125Sjacobs 
134*3125Sjacobs /* private functions */
135*3125Sjacobs #pragma weak getprinterbyname = _unsupported_null_return
136