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