/*
* CDDL HEADER START
*
* 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.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
/* $Id: printer.c 151 2006-04-25 16:55:34Z njacobs $ */
#pragma ident "%Z%%M% %I% %E% SMI"
/*LINTLIBRARY*/
#include <stdlib.h>
#include <papi_impl.h>
void
{
void (*f)();
if (f != NULL)
if (tmp->svc_is_internal != 0)
}
}
void
{
int i;
papiPrinterFree(printers[i]);
}
}
/* Enumerate a list of printers from the loaded print service. */
static papi_status_t
{
papi_status_t (*f)();
return (PAPI_BAD_ARGUMENT);
/* connect to the service if we are not connected */
return (result);
if (f != NULL)
&svc_printers);
/*
* copy the resulting printer object pointers into our own
* representation of a printer object because we need the
* service context to operate against the individual printer
* objects. We free the list now because we no longer need
* it and would have no way of freeing it later.
*/
int i;
for (i = 0; svc_printers[i] != NULL; i++) {
return (PAPI_TEMPORARY_ERROR);
p->printer = svc_printers[i];
list_append(printers, p);
}
}
return (result);
}
/* Get printer attributes from it's print service */
static papi_status_t
{
/* get the psm and uri from the attributes */
"print-service-module", &psm);
&uri);
/* contact the service for the printer */
return (result);
/* get the printer from the service */
}
return (result);
}
/* are the requested attributes contained in the list */
static int
{
int i;
return (0);
return (0);
return (1);
}
/* Enumerate a list of printers from the Name Service */
static papi_status_t
{
return (PAPI_BAD_ARGUMENT);
/* retrieve printers from the nameservice */
setprinterentry(0, NULL);
return (PAPI_TEMPORARY_ERROR);
p->attributes = attrs;
list_append(printers, p);
}
/* if we have printers, check if our request has been satisfied */
int i;
/* walk through the list */
/* see if the name service satisfied the request */
}
}
return (PAPI_OK);
}
{
papi_status_t (*f)();
return (PAPI_BAD_ARGUMENT);
else /* not connected, use the name svc */
return (result);
}
{
papi_status_t (*f)();
return (PAPI_BAD_ARGUMENT);
return (result);
return (PAPI_TEMPORARY_ERROR);
if (f != NULL)
job_attributes, &p->printer);
} else {
setprinterentry(0, NULL);
if (p->attributes == NULL)
else
}
return (result);
}
static papi_status_t
char *function)
{
papi_status_t (*f)();
return (PAPI_BAD_ARGUMENT);
return (result);
if (f != NULL)
return (result);
}
static papi_status_t
char *function)
{
papi_status_t (*f)();
return (PAPI_BAD_ARGUMENT);
return (result);
if (f != NULL)
return (result);
}
{
"papiPrinterDisable"));
}
{
"papiPrinterPause"));
}
{
"papiPrinterEnable"));
}
{
"papiPrinterResume"));
}
static papi_status_t
char *function)
{
papi_status_t (*f)();
return (PAPI_BAD_ARGUMENT);
return (result);
return (PAPI_TEMPORARY_ERROR);
if (f != NULL)
&p->printer);
return (result);
}
{
"papiPrinterAdd"));
}
{
"papiPrinterModify"));
}
{
papi_status_t (*f)();
return (PAPI_BAD_ARGUMENT);
return (result);
if (f != NULL)
return (result);
}
{
papi_status_t (*f)();
return (PAPI_BAD_ARGUMENT);
return (result);
if (f != NULL)
/*
* copy the resulting job object pointers into our own
* representation of a job object because we need the
* service context to operate against the individual job
* objects. We free the list now because we no longer need
* it and would have no way of freeing it later.
*/
int i;
return (PAPI_TEMPORARY_ERROR);
list_append(jobs, j);
}
}
return (result);
}
{
papi_status_t (*f)();
return (PAPI_BAD_ARGUMENT);
return (result);
if (f != NULL)
/*
* copy the resulting job object pointers into our own
* representation of a job object because we need the
* service context to operate against the individual job
* objects. We free the list now because we no longer need
* it and would have no way of freeing it later.
*/
int i;
return (PAPI_TEMPORARY_ERROR);
list_append(jobs, j);
}
}
return (result);
}
{
papi_attribute_t **(*f)();
"papiPrinterGetAttributeList");
if (f != NULL)
} else
result = p->attributes;
return (result);
}