1*355b4669Sjacobs /* 2*355b4669Sjacobs * CDDL HEADER START 3*355b4669Sjacobs * 4*355b4669Sjacobs * The contents of this file are subject to the terms of the 5*355b4669Sjacobs * Common Development and Distribution License (the "License"). 6*355b4669Sjacobs * You may not use this file except in compliance with the License. 7*355b4669Sjacobs * 8*355b4669Sjacobs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9*355b4669Sjacobs * or http://www.opensolaris.org/os/licensing. 10*355b4669Sjacobs * See the License for the specific language governing permissions 11*355b4669Sjacobs * and limitations under the License. 12*355b4669Sjacobs * 13*355b4669Sjacobs * When distributing Covered Code, include this CDDL HEADER in each 14*355b4669Sjacobs * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15*355b4669Sjacobs * If applicable, add the following below this CDDL HEADER, with the 16*355b4669Sjacobs * fields enclosed by brackets "[]" replaced with your own identifying 17*355b4669Sjacobs * information: Portions Copyright [yyyy] [name of copyright owner] 18*355b4669Sjacobs * 19*355b4669Sjacobs * CDDL HEADER END 20*355b4669Sjacobs */ 21*355b4669Sjacobs 22*355b4669Sjacobs /* 23*355b4669Sjacobs * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24*355b4669Sjacobs * Use is subject to license terms. 25*355b4669Sjacobs * 26*355b4669Sjacobs */ 27*355b4669Sjacobs 28*355b4669Sjacobs /* $Id: library.c 146 2006-03-24 00:26:54Z njacobs $ */ 29*355b4669Sjacobs 30*355b4669Sjacobs #pragma ident "%Z%%M% %I% %E% SMI" 31*355b4669Sjacobs 32*355b4669Sjacobs /*LINTLIBRARY*/ 33*355b4669Sjacobs 34*355b4669Sjacobs #include <stdlib.h> 35*355b4669Sjacobs #include <stdio.h> 36*355b4669Sjacobs #include <stdarg.h> 37*355b4669Sjacobs #include <string.h> 38*355b4669Sjacobs #include <alloca.h> 39*355b4669Sjacobs #include <libintl.h> 40*355b4669Sjacobs #include <papi.h> 41*355b4669Sjacobs 42*355b4669Sjacobs static char *calls[] = { 43*355b4669Sjacobs /* Attribute Calls */ 44*355b4669Sjacobs "papiAttributeListAddValue", 45*355b4669Sjacobs "papiAttributeListAddBoolean", "papiAttributeListAddCollection", 46*355b4669Sjacobs "papiAttributeListAddDatetime", "papiAttributeListAddInteger", 47*355b4669Sjacobs "papiAttributeListAddMetadata", "papiAttributeListAddRange", 48*355b4669Sjacobs "papiAttributeListAddResolution", "papiAttributeListAddString", 49*355b4669Sjacobs "papiAttributeListDelete", 50*355b4669Sjacobs "papiAttributeListGetValue", "papiAttributeListGetNext", 51*355b4669Sjacobs "papiAttributeListFind", 52*355b4669Sjacobs "papiAttributeListGetBoolean", "papiAttributeListGetCollection", 53*355b4669Sjacobs "papiAttributeListGetDatetime", "papiAttributeListGetInteger", 54*355b4669Sjacobs "papiAttributeListGetMetadata", "papiAttributeListGetRange", 55*355b4669Sjacobs "papiAttributeListGetResolution", "papiAttributeListGetString", 56*355b4669Sjacobs "papiAttributeListFromString", "papiAttributeListToString", 57*355b4669Sjacobs "papiAttributeListFree", 58*355b4669Sjacobs /* Job Calls */ 59*355b4669Sjacobs "papiJobSubmit", "papiJobSubmitByReference", "papiJobValidate", 60*355b4669Sjacobs "papiJobStreamOpen", "papiJobStreamWrite", "papiJobStreamClose", 61*355b4669Sjacobs "papiJobQuery", "papiJobModify", "papiJobCancel", "papiJobPromote", 62*355b4669Sjacobs "papiJobGetAttributeList", "papiJobGetId", "papiJobGetPrinterName", 63*355b4669Sjacobs "papiJobGetJobTicket", 64*355b4669Sjacobs "papiJobFree", "papiJobListFree", 65*355b4669Sjacobs "papiJobHold", "papiJobRelease", "papiJobRestart", 66*355b4669Sjacobs /* Printer Calls */ 67*355b4669Sjacobs "papiPrintersList", "papiPrinterQuery", "papiPrinterModify", 68*355b4669Sjacobs "papiPrinterAdd", "papiPrinterRemove", 69*355b4669Sjacobs "papiPrinterPause", "papiPrinterResume", 70*355b4669Sjacobs "papiPrinterDisable", "papiPrinterEnable", 71*355b4669Sjacobs "papiPrinterPurgeJobs", "papiPrinterListJobs", 72*355b4669Sjacobs "papiPrinterGetAttributeList", 73*355b4669Sjacobs "papiPrinterFree", "papiPrinterListFree", 74*355b4669Sjacobs /* Service Calls */ 75*355b4669Sjacobs "papiServiceCreate", "papiServiceDestroy", 76*355b4669Sjacobs "papiServiceGetAppData", 77*355b4669Sjacobs "papiServiceGetEncryption", "papiServiceGetPassword", 78*355b4669Sjacobs "papiServiceGetServiceName", "papiServiceGetUserName", 79*355b4669Sjacobs "papiServiceSetAppData", "papiServiceSetAuthCB", 80*355b4669Sjacobs "papiServiceSetEncryption", "papiServiceSetPassword", 81*355b4669Sjacobs "papiServiceSetUserName", 82*355b4669Sjacobs "papiServiceGetAttributeList", "papiServiceGetStatusMessage", 83*355b4669Sjacobs /* Misc Calls */ 84*355b4669Sjacobs "papiStatusString", 85*355b4669Sjacobs "papiLibrarySupportedCall", "papiLibrarySupportedCalls", 86*355b4669Sjacobs NULL 87*355b4669Sjacobs }; 88*355b4669Sjacobs 89*355b4669Sjacobs char ** 90*355b4669Sjacobs papiLibrarySupportedCalls() 91*355b4669Sjacobs { 92*355b4669Sjacobs return (calls); 93*355b4669Sjacobs } 94*355b4669Sjacobs 95*355b4669Sjacobs char 96*355b4669Sjacobs papiLibrarySupportedCall(const char *name) 97*355b4669Sjacobs { 98*355b4669Sjacobs int i; 99*355b4669Sjacobs 100*355b4669Sjacobs for (i = 0; calls[i] != NULL; i++) 101*355b4669Sjacobs if (strcmp(name, calls[i]) == 0) 102*355b4669Sjacobs return (PAPI_TRUE); 103*355b4669Sjacobs 104*355b4669Sjacobs return (PAPI_FALSE); 105*355b4669Sjacobs } 106