355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER START
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * The contents of this file are subject to the terms of the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Common Development and Distribution License (the "License").
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You may not use this file except in compliance with the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * See the License for the specific language governing permissions
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * and limitations under the License.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * When distributing Covered Code, include this CDDL HEADER in each
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * If applicable, add the following below this CDDL HEADER, with the
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * fields enclosed by brackets "[]" replaced with your own identifying
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * information: Portions Copyright [yyyy] [name of copyright owner]
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * CDDL HEADER END
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Use is subject to license terms.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/* $Id: printer.c 149 2006-04-25 16:55:01Z njacobs $ */
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India"#include <libintl.h>
355b4669e025ff377602b6fc7caaf30dbc218371jacobs return (1);
355b4669e025ff377602b6fc7caaf30dbc218371jacobs return (1);
355b4669e025ff377602b6fc7caaf30dbc218371jacobs return (0);
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((svc == NULL) || (name == NULL) || (printer == NULL))
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((status = service_fill_in(svc, name)) == PAPI_OK) {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((contains("printer-state", requested_attrs) == 1) ||
355b4669e025ff377602b6fc7caaf30dbc218371jacobs (contains("printer-state-reasons", requested_attrs) == 1))
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" (printer_t **)printer);
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" PAPI_ATTR_APPEND, "printer-name",
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" queue_name_from_uri(svc->uri));
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" PAPI_ATTR_APPEND,
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" "printer-uri-supported", buf);
22a914219d15da040a4bf15ae1df9941858a46aawendyp /* Set printer accepting: mimic prepapi behavior */
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" PAPI_ATTR_REPLACE,
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" "printer-is-accepting-jobs", PAPI_TRUE);
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiPrinterPurgeJobs(papi_service_t handle, char *name, papi_job_t **jobs)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((status = service_fill_in(svc, name)) == PAPI_OK)
355b4669e025ff377602b6fc7caaf30dbc218371jacobspapiPrinterListJobs(papi_service_t handle, char *name,
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((svc == NULL) || (name == NULL) || (jobs == NULL))
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if ((status = service_fill_in(svc, name)) == PAPI_OK)
355b4669e025ff377602b6fc7caaf30dbc218371jacobs return (p->attributes);
355b4669e025ff377602b6fc7caaf30dbc218371jacobs if (p != NULL) {
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India"papi_status_t
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India"papiPrinterDisable(papi_service_t handle, char *name, char *message)
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" service_t *svc = handle;
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" papi_status_t status;
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" if ((status = service_fill_in(svc, name)) == PAPI_OK) {
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" detailed_error(svc,
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" gettext("Warning: %s is remote, disable has no meaning."),
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" queue_name_from_uri(svc->uri));
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" return (PAPI_OPERATION_NOT_SUPPORTED);
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India"papi_status_t
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India"papiPrinterEnable(papi_service_t handle, char *name)
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" service_t *svc = handle;
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" papi_status_t status;
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" if ((status = service_fill_in(svc, name)) == PAPI_OK) {
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" detailed_error(svc,
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" gettext("Warning: %s is remote, enable has no meaning."),
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" queue_name_from_uri(svc->uri));
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" return (PAPI_OPERATION_NOT_SUPPORTED);
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India"papi_status_t
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India"papiPrinterResume(papi_service_t handle, char *name)
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" service_t *svc = handle;
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" papi_status_t status;
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" if ((status = service_fill_in(svc, name)) == PAPI_OK) {
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" detailed_error(svc,
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" gettext("Warning: %s is remote, accept has no meaning."),
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" queue_name_from_uri(svc->uri));
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" return (PAPI_OPERATION_NOT_SUPPORTED);
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India"papi_status_t
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India"papiPrinterPause(papi_service_t handle, char *name, char *message)
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" service_t *svc = handle;
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" papi_status_t status;
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" if ((status = service_fill_in(svc, name)) == PAPI_OK) {
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" detailed_error(svc,
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" gettext("Warning: %s is remote, reject has no meaning."),
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" queue_name_from_uri(svc->uri));