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 /*LINTLIBRARY*/
31*355b4669Sjacobs 
32*355b4669Sjacobs #include <stdlib.h>
33*355b4669Sjacobs #include <stdio.h>
34*355b4669Sjacobs #include <stdarg.h>
35*355b4669Sjacobs #include <string.h>
36*355b4669Sjacobs #include <alloca.h>
37*355b4669Sjacobs #include <libintl.h>
38*355b4669Sjacobs #include <papi.h>
39*355b4669Sjacobs 
40*355b4669Sjacobs static char *calls[] = {
41*355b4669Sjacobs 	/* Attribute Calls */
42*355b4669Sjacobs 	"papiAttributeListAddValue",
43*355b4669Sjacobs 	"papiAttributeListAddBoolean", "papiAttributeListAddCollection",
44*355b4669Sjacobs 	"papiAttributeListAddDatetime", "papiAttributeListAddInteger",
45*355b4669Sjacobs 	"papiAttributeListAddMetadata", "papiAttributeListAddRange",
46*355b4669Sjacobs 	"papiAttributeListAddResolution", "papiAttributeListAddString",
47*355b4669Sjacobs 	"papiAttributeListDelete",
48*355b4669Sjacobs 	"papiAttributeListGetValue", "papiAttributeListGetNext",
49*355b4669Sjacobs 	"papiAttributeListFind",
50*355b4669Sjacobs 	"papiAttributeListGetBoolean", "papiAttributeListGetCollection",
51*355b4669Sjacobs 	"papiAttributeListGetDatetime", "papiAttributeListGetInteger",
52*355b4669Sjacobs 	"papiAttributeListGetMetadata", "papiAttributeListGetRange",
53*355b4669Sjacobs 	"papiAttributeListGetResolution", "papiAttributeListGetString",
54*355b4669Sjacobs 	"papiAttributeListFromString", "papiAttributeListToString",
55*355b4669Sjacobs 	"papiAttributeListFree",
56*355b4669Sjacobs 	/* Job Calls */
57*355b4669Sjacobs 	"papiJobSubmit", "papiJobSubmitByReference", "papiJobValidate",
58*355b4669Sjacobs 	"papiJobStreamOpen", "papiJobStreamWrite", "papiJobStreamClose",
59*355b4669Sjacobs 	"papiJobQuery", "papiJobModify", "papiJobCancel", "papiJobPromote",
60*355b4669Sjacobs 	"papiJobGetAttributeList", "papiJobGetId", "papiJobGetPrinterName",
61*355b4669Sjacobs 	"papiJobGetJobTicket",
62*355b4669Sjacobs 	"papiJobFree", "papiJobListFree",
63*355b4669Sjacobs 	"papiJobHold", "papiJobRelease", "papiJobRestart",
64*355b4669Sjacobs 	/* Printer Calls */
65*355b4669Sjacobs 	"papiPrintersList", "papiPrinterQuery", "papiPrinterModify",
66*355b4669Sjacobs 	"papiPrinterAdd", "papiPrinterRemove",
67*355b4669Sjacobs 	"papiPrinterPause", "papiPrinterResume",
68*355b4669Sjacobs 	"papiPrinterDisable", "papiPrinterEnable",
69*355b4669Sjacobs 	"papiPrinterPurgeJobs", "papiPrinterListJobs",
70*355b4669Sjacobs 	"papiPrinterGetAttributeList",
71*355b4669Sjacobs 	"papiPrinterFree", "papiPrinterListFree",
72*355b4669Sjacobs 	/* Service Calls */
73*355b4669Sjacobs 	"papiServiceCreate", "papiServiceDestroy",
74*355b4669Sjacobs 	"papiServiceGetAppData",
75*355b4669Sjacobs 	"papiServiceGetEncryption", "papiServiceGetPassword",
76*355b4669Sjacobs 	"papiServiceGetServiceName", "papiServiceGetUserName",
77*355b4669Sjacobs 	"papiServiceSetAppData", "papiServiceSetAuthCB",
78*355b4669Sjacobs 	"papiServiceSetEncryption", "papiServiceSetPassword",
79*355b4669Sjacobs 	"papiServiceSetUserName",
80*355b4669Sjacobs 	"papiServiceGetAttributeList", "papiServiceGetStatusMessage",
81*355b4669Sjacobs 	/* Misc Calls */
82*355b4669Sjacobs 	"papiStatusString",
83*355b4669Sjacobs 	"papiLibrarySupportedCall", "papiLibrarySupportedCalls",
84*355b4669Sjacobs 	NULL
85*355b4669Sjacobs };
86*355b4669Sjacobs 
87*355b4669Sjacobs char **
papiLibrarySupportedCalls()88*355b4669Sjacobs papiLibrarySupportedCalls()
89*355b4669Sjacobs {
90*355b4669Sjacobs 	return (calls);
91*355b4669Sjacobs }
92*355b4669Sjacobs 
93*355b4669Sjacobs char
papiLibrarySupportedCall(const char * name)94*355b4669Sjacobs papiLibrarySupportedCall(const char *name)
95*355b4669Sjacobs {
96*355b4669Sjacobs 	int i;
97*355b4669Sjacobs 
98*355b4669Sjacobs 	for (i = 0; calls[i] != NULL; i++)
99*355b4669Sjacobs 		if (strcmp(name, calls[i]) == 0)
100*355b4669Sjacobs 			return (PAPI_TRUE);
101*355b4669Sjacobs 
102*355b4669Sjacobs 	return (PAPI_FALSE);
103*355b4669Sjacobs }
104