lpsched-printers.c revision f06271be56df67ca3faa4ca4bc51457dad15c3b5
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*LINTLIBRARY*/
#include <stdlib.h>
#include <libintl.h>
#include <unistd.h>
#include <string.h>
#include <papi_impl.h>
#include "class.h"
void
unsigned short status)
{
return;
"printer-state", 0x05); /* stopped */
"printer-state-reasons", "moving-to-paused");
else if (status & PS_FAULTED)
"printer-state-reasons", "none");
else if (status & PS_FORM_FAULT)
"printer-state-reasons",
"interpreter-resource-unavailable");
else
"printer-state-reasons", "paused");
"printer-state", 0x04); /* processing */
"printer-state-reasons", "moving-to-paused");
} else {
"printer-state", 0x03); /* idle */
}
"printer-is-accepting-jobs",
"printer-is-processing-jobs",
}
void
{
if (attributes == NULL)
return;
"multiple-document-jobs-supported", PAPI_TRUE);
"multiple-document-handling-supported",
"seperate-documents-colated-copies");
"pdl-override-supported", "not-attempted");
"job-priority-supported", 40);
"job-priority-default", 20);
"copies-supported", 1, 65535);
"copies-default", 1);
"page-ranges-supported", PAPI_TRUE);
"number-up-supported", 1);
"number-up-default", 1);
"job-hold-until-supported", "no-hold");
"job-hold-until-supported", "indefinite");
"job-hold-until-default", "no-hold");
"document-format-default", "application/octet-stream");
}
char *dest)
{
return (PAPI_BAD_ARGUMENT);
/* get the configuration DB data */
gettext("unable to read configuration data"));
return (PAPI_DEVICE_ERROR);
}
/* name */
"printer-uri-supported", uri);
}
/* banner */
"job-sheets-supported", "optional");
"job-sheets-supported", "none");
"job-sheets-supported", "standard");
/* input_types */
int i;
PAPI_ATTR_APPEND, "document-format-supported",
}
/* description */
/* add lpsched specific attributes */
#ifdef CAN_DO_MODULES
#endif /* CAN_DO_MODULES */
"lpsched-fault-alert-command",
"lpsched-fault-alert-threshold",
tmp->fault_alert.Q);
"lpsched-fault-alert-interval",
tmp->fault_alert.W);
}
"requesting-user-name-allowed", allowed);
"requesting-user-name-denied", denied);
"form-supported", f_allowed);
/*
* All forms allowed case
* When all forms are allowed forms.allow does not get created but
* forms.deny file gets created with no entries
*/
"form-supported", "all");
#ifdef LP_USE_PAPI_ATTR
int fd;
/* construct the two URIs for the printer's PPD file */
/* failed to get systen name */
}
"ppd-file-uri", buf);
"lpsched-printer-configure-ppd-uri", buf);
/*
* We don't return error on any of the error conditions, we just
* silently return without adding the attribute.
*/
}
#endif
return (PAPI_OK);
}
short status, char *request_id,
long disable_date, long reject_date)
{
if (p == NULL)
return (PAPI_BAD_ARGUMENT);
"form-ready", form);
"lpsched-active-job", request_id);
"lpsched-mounted-char-set", character_set);
"lpsched-disable-reason", disable_reason);
"lpsched-disable-date", disable_date);
"lpsched-reject-reason", reject_reason);
"lpsched-reject-date", reject_date);
/* add the current system time */
/* add the time since last enabled */
/* add the status information */
"printer-state-reasons", "none");
return (PAPI_OK);
}
/*
* This puts the class information in only. It could create a hybrid
* printer object to return, but that is problematic at best.
*/
char *dest)
{
return (PAPI_BAD_ARGUMENT);
/* get the configuration DB data */
gettext("unable to read configuration data"));
return (PAPI_DEVICE_ERROR);
}
/* name */
"printer-uri-supported", uri);
}
int i;
"member-names", members[i]);
}
return (PAPI_OK);
}
char *reject_reason, long reject_date)
{
if (p == NULL)
return (PAPI_BAD_ARGUMENT);
"lpsched-reject-reason", reject_reason);
"lpsched-reject-date", reject_date);
/* add the current system time */
/* add the status information */
"printer-state-reasons", "none");
return (PAPI_OK);
}
{
int flags;
/* banner needs some conversion to the bitfield */
"job-sheets-supported", &string);
flags |= BAN_ALWAYS;
if (flags != 0)
/* input_types needs mime-type conversion */
"document-format-supported", &string);
}
#ifdef LP_USE_PAPI_ATTR
#endif
return (PAPI_OK);
}