1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PAPIPRINTERSLIST 3PAPI "Jan 17, 2007"
7 .SH NAME
8 papiPrintersList, papiPrinterQuery, papiPrinterAdd, papiPrinterModify,
9 papiPrinterRemove, papiPrinterDisable, papiPrinterEnable, papiPrinterPause,
10 papiPrinterResume, papiPrinterPurgeJobs, papiPrinterListJobs,
11 papiPrinterGetAttributeList, papiPrinterFree, papiPrinterListFree \- print
12 object manipulation
13 .SH SYNOPSIS
14 .LP
15 .nf
16 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lpapi\fR [ \fIlibrary\fR\&.\|.\|. ]
17 #include <papi.h>
18
19 \fBpapi_status_t\fR \fBpapiPrintersList\fR(\fBpapi_service_t\fR \fIhandle\fR,
20 \fBchar **\fR\fIrequested_attrs\fR, \fBpapi_filter_t *\fR\fIfilter\fR,
21 \fBpapi_printer_t **\fR\fIprinters\fR);
22 .fi
23
24 .LP
25 .nf
26 \fBpapi_status_t\fR \fBpapiPrinterQuery\fR(\fBpapi_service_t\fR \fIhandle\fR, \fBchar *\fR\fIname\fR,
387 papiServiceDestroy(svc);
388 exit(1);
389 }
390
391 if (printers != NULL) {
392 int i;
393
394 for (i = 0; printers[i] != NULL; i++) {
395 papi_attribute_t **list =
396 papiPrinterGetAttributeList(printers[i]);
397
398 if (list != NULL) {
399 char *name = "unknown";
400 char *uri = "unknown";
401
402 (void) papiAttributeListGetString(list, NULL,
403 "printer-name", &name);
404
405 (void) papiAttributeListGetString(list, NULL,
406 "printer-uri-supported", &uri);
407 printf("%s is %s\n", name, uri);
408 }
409 }
410 papiPrinterListFree(printers);
411 }
412
413 papiServiceDestroy(svc);
414
415 exit(0);
416 }
417 .fi
418 .in -2
419
420 .LP
421 \fBExample 2 \fRDump all printer attributes.
422 .sp
423 .in +2
424 .nf
425 /*
426 * program to query a printer for it's attributes via PAPI
427 */
|
1 '\" te
2 .\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PAPIPRINTERSLIST 3PAPI "Sep 10, 2013"
7 .SH NAME
8 papiPrintersList, papiPrinterQuery, papiPrinterAdd, papiPrinterModify,
9 papiPrinterRemove, papiPrinterDisable, papiPrinterEnable, papiPrinterPause,
10 papiPrinterResume, papiPrinterPurgeJobs, papiPrinterListJobs,
11 papiPrinterGetAttributeList, papiPrinterFree, papiPrinterListFree \- print
12 object manipulation
13 .SH SYNOPSIS
14 .LP
15 .nf
16 cc [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lpapi\fR [ \fIlibrary\fR\&.\|.\|. ]
17 #include <papi.h>
18
19 \fBpapi_status_t\fR \fBpapiPrintersList\fR(\fBpapi_service_t\fR \fIhandle\fR,
20 \fBchar **\fR\fIrequested_attrs\fR, \fBpapi_filter_t *\fR\fIfilter\fR,
21 \fBpapi_printer_t **\fR\fIprinters\fR);
22 .fi
23
24 .LP
25 .nf
26 \fBpapi_status_t\fR \fBpapiPrinterQuery\fR(\fBpapi_service_t\fR \fIhandle\fR, \fBchar *\fR\fIname\fR,
387 papiServiceDestroy(svc);
388 exit(1);
389 }
390
391 if (printers != NULL) {
392 int i;
393
394 for (i = 0; printers[i] != NULL; i++) {
395 papi_attribute_t **list =
396 papiPrinterGetAttributeList(printers[i]);
397
398 if (list != NULL) {
399 char *name = "unknown";
400 char *uri = "unknown";
401
402 (void) papiAttributeListGetString(list, NULL,
403 "printer-name", &name);
404
405 (void) papiAttributeListGetString(list, NULL,
406 "printer-uri-supported", &uri);
407 printf("%s is %s\en", name, uri);
408 }
409 }
410 papiPrinterListFree(printers);
411 }
412
413 papiServiceDestroy(svc);
414
415 exit(0);
416 }
417 .fi
418 .in -2
419
420 .LP
421 \fBExample 2 \fRDump all printer attributes.
422 .sp
423 .in +2
424 .nf
425 /*
426 * program to query a printer for it's attributes via PAPI
427 */
|