printer.c revision c389c7f85e1e94d7078f66fbb37362b0387243d0
/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*LINTLIBRARY*/
#include <stdlib.h>
#include <string.h>
#include <libintl.h>
#include <papi_impl.h>
#include <lp.h>
extern int isclass(char *);
void
{
}
}
void
{
int i;
papiPrinterFree(printers[i]);
}
}
{
*request_id = NULL,
*character_set = NULL,
*reject_reason = NULL,
*disable_reason = NULL;
short printer_status = 0;
long enable_date = 0, reject_date = 0;
return (PAPI_BAD_ARGUMENT);
/* ask the spooler for the printer(s) and state */
return (PAPI_SERVICE_UNAVAILABLE);
do {
&enable_date, &reject_date) < 0)
return (PAPI_SERVICE_UNAVAILABLE);
return (PAPI_TEMPORARY_ERROR);
printer);
list_append(printers, p);
}
/* ask the spooler for the class(es) and state */
return (PAPI_SERVICE_UNAVAILABLE);
do {
&reject_date) < 0)
return (PAPI_SERVICE_UNAVAILABLE);
return (PAPI_TEMPORARY_ERROR);
printer);
list_append(printers, p);
}
return (PAPI_OK);
}
char **requested_attrs,
{
char *dest;
*request_id = NULL,
*character_set = NULL,
*reject_reason = NULL,
*disable_reason = NULL;
short printer_status = 0;
long enable_date = 0, reject_date = 0;
return (PAPI_BAD_ARGUMENT);
return (PAPI_TEMPORARY_ERROR);
static char *_default;
int fd;
static char buf[128];
}
}
}
return (pst);
/* get the spooler status data now */
return (PAPI_SERVICE_UNAVAILABLE);
&enable_date, &reject_date) < 0)
return (PAPI_SERVICE_UNAVAILABLE);
return (pst);
/* get the spooler status data now */
return (PAPI_SERVICE_UNAVAILABLE);
&reject_date) < 0)
return (PAPI_SERVICE_UNAVAILABLE);
/* fill the printer object with service information */
} else
return (PAPI_NOT_FOUND);
return (PAPI_OK);
}
{
char *dest;
return (PAPI_BAD_ARGUMENT);
attributes, 0);
dest);
else
dest);
else
} else
return (status);
}
{
char *dest;
return (PAPI_BAD_ARGUMENT);
attributes, 1);
dest);
else
dest);
else
} else
return (status);
}
{
char *dest;
return (PAPI_BAD_ARGUMENT);
} else
return (result);
}
{
return (PAPI_BAD_ARGUMENT);
return (result);
}
{
return (PAPI_BAD_ARGUMENT);
return (result);
}
{
return (PAPI_BAD_ARGUMENT);
return (result);
}
{
return (PAPI_BAD_ARGUMENT);
return (result);
}
{
short more;
long status;
char *dest;
char *req_id;
return (PAPI_BAD_ARGUMENT);
if (more < 0)
return (PAPI_SERVICE_UNAVAILABLE);
do {
return (PAPI_SERVICE_UNAVAILABLE);
switch (status) {
case MOK:
"canceled-jobs", req_id);
break;
case M2LATE:
case MUNKNOWN:
case MNOINFO:
"cancel-failed", req_id);
break;
case MNOPERM:
"cancel-failed", req_id);
break;
default:
status);
return (PAPI_DEVICE_ERROR);
}
return (result);
}
char **requested_attrs, int type_mask,
{
char *dest;
short rc;
int count = 1;
return (PAPI_BAD_ARGUMENT);
if (rc < 0)
return (PAPI_SERVICE_UNAVAILABLE);
do {
*ptr,
return (PAPI_SERVICE_UNAVAILABLE);
continue;
/*
* at this point, we should check to see if the job matches the
* selection criterion defined in "type_mask".
*/
/* too many yet? */
continue;
continue;
*++ptr = '0';
}
return (lpsched_status_to_papi_status(rc));
}
{
return (NULL);
return (tmp->attributes);
}