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