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
c389c7f85e1e94d7078f66fbb37362b0387243d0Gowtham Thommandra * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs * Use is subject to license terms.
355b4669e025ff377602b6fc7caaf30dbc218371jacobs/* $Id: disable.c 146 2006-03-24 00:26:54Z njacobs $ */
c389c7f85e1e94d7078f66fbb37362b0387243d0Gowtham Thommandra gettext("Usage: %s [-c] [-W] [-r reason] destination ...\n"),
355b4669e025ff377602b6fc7caaf30dbc218371jacobs status = papiPrinterListJobs(svc, dest, req_attrs, 0, 0, &j);
355b4669e025ff377602b6fc7caaf30dbc218371jacobs for (i = 0; j[i] != NULL; j++) {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs papi_attribute_t **a = papiJobGetAttributeList(j[i]);
c389c7f85e1e94d7078f66fbb37362b0387243d0Gowtham Thommandra if (state & 0x082A) { /* If state is RS_ACTIVE */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs switch (c) {
355b4669e025ff377602b6fc7caaf30dbc218371jacobs case 'W': /* wait for active request, not implemented */
355b4669e025ff377602b6fc7caaf30dbc218371jacobs status = papiServiceCreate(&svc, printer, NULL, NULL,
c389c7f85e1e94d7078f66fbb37362b0387243d0Gowtham Thommandra "Failed to contact service for %s: %s\n"),
c389c7f85e1e94d7078f66fbb37362b0387243d0Gowtham Thommandra printer, verbose_papi_message(svc, status));
98f04078d5fc5800e80b21e0b18abe0024af1cbeGowtham Thommandra printf(gettext("printer \"%s\" now disabled\n"),
98f04078d5fc5800e80b21e0b18abe0024af1cbeGowtham Thommandra } else if (status == PAPI_NOT_ACCEPTING) {
98f04078d5fc5800e80b21e0b18abe0024af1cbeGowtham Thommandra "Destination \"%s\" was already disabled.\n"),
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" /* The operation is not supported in lpd protocol */
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" if (status == PAPI_OPERATION_NOT_SUPPORTED) {
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" fprintf(stderr,
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" verbose_papi_message(svc, status));
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" } else {
999637b1fd707bd54b1bd63fa6979a3673826bd0"Nagaraj Yedathore - Sun Microsystems - Bangalore India" fprintf(stderr, gettext("disable: %s: %s\n"),