/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
*/
/* $Id: printer.c 146 2006-03-24 00:26:54Z njacobs $ */
#pragma ident "%Z%%M% %I% %E% SMI"
/*LINTLIBRARY*/
#include <stdlib.h>
#include <papi_impl.h>
#include <config-site.h>
void
{
}
}
void
{
int i;
papiPrinterFree(printers[i]);
}
}
/*
* Enumeration of printers is not part of the IPP specification, so many
* servers will probably not respond back with a list of printers, but
* CUPS has implemented an extension to IPP to enumerate printers and
* implements this IPP extension, so CUPS and Solaris can provide this
* to IPP clients.
*/
#ifndef OPID_CUPS_GET_PRINTERS /* for servers that will enumerate */
#endif /* OPID_CUPS_GET_PRINTERS */
#ifndef OPID_CUPS_DELETE_PRINTER /* for servers that can delete */
#endif /* OPID_CUPS_DELETE_PRINTER */
#ifndef OPID_CUPS_GET_CLASSES /* for servers that will enumerate */
#endif /* OPID_CUPS_GET_CLASSES */
{
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
if (requested_attrs != NULL) {
int i;
for (i = 0; requested_attrs[i] != NULL; i++)
"requested-attributes", requested_attrs[i]);
}
"operational-attributes-group", op);
"printer-attributes-group", &op);
return (PAPI_TEMPORARY_ERROR);
list_append(printers, p);
}
return (result);
}
char **requested_attrs,
{
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
return (PAPI_TEMPORARY_ERROR);
if (requested_attrs != NULL) {
int i;
for (i = 0; requested_attrs[i] != NULL; i++)
"requested-attributes", requested_attrs[i]);
}
"operational-attributes-group", op);
"printer-attributes-group", &op);
return (result);
}
static papi_status_t
{
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
switch (type) {
case OPID_DISABLE_PRINTER:
"printer-message-from-operator", message);
break;
case OPID_PAUSE_PRINTER:
"printer-state-message", message);
break;
default: /* a message value is of no use */
break;
}
"operational-attributes-group", op);
return (result);
}
{
}
{
}
{
}
{
}
/*
* there is no IPP create operation, the set-printer-attibutes operation
* is the closest we have, so we will assume that the server will create
* a printer and set attributes if there is none.
*/
{
}
{
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
return (PAPI_TEMPORARY_ERROR);
"operational-attributes-group", op);
"printer-attributes-group", attributes);
"printer-attributes-group", &op);
return (result);
}
{
}
papi_job_t **jobs)
{
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
"operational-attributes-group", op);
"job-attributes-group", &op);
return (PAPI_TEMPORARY_ERROR);
list_append(jobs, j);
}
return (result);
}
char **requested_attrs, int type_mask,
{
return (PAPI_BAD_ARGUMENT);
/* if we are already connected, use that connection. */
return (result);
if (requested_attrs != NULL) {
int i;
for (i = 0; requested_attrs[i] != NULL; i++)
"requested-attributes", requested_attrs[i]);
}
"operational-attributes-group", op);
"job-attributes-group", &op);
return (PAPI_TEMPORARY_ERROR);
list_append(jobs, j);
}
return (result);
}
{
if (p != NULL)
result = p->attributes;
return (result);
}