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