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