1 0 stevel /* 2 0 stevel * CDDL HEADER START 3 0 stevel * 4 0 stevel * The contents of this file are subject to the terms of the 5 3125 jacobs * Common Development and Distribution License (the "License"). 6 3125 jacobs * You may not use this file except in compliance with the License. 7 0 stevel * 8 0 stevel * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 0 stevel * or http://www.opensolaris.org/os/licensing. 10 0 stevel * See the License for the specific language governing permissions 11 0 stevel * and limitations under the License. 12 0 stevel * 13 0 stevel * When distributing Covered Code, include this CDDL HEADER in each 14 0 stevel * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 0 stevel * If applicable, add the following below this CDDL HEADER, with the 16 0 stevel * fields enclosed by brackets "[]" replaced with your own identifying 17 0 stevel * information: Portions Copyright [yyyy] [name of copyright owner] 18 0 stevel * 19 0 stevel * CDDL HEADER END 20 0 stevel */ 21 3125 jacobs 22 3125 jacobs /* 23 3125 jacobs * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 24 3125 jacobs * Use is subject to license terms. 25 3125 jacobs */ 26 3125 jacobs 27 0 stevel /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28 0 stevel /* All Rights Reserved */ 29 0 stevel 30 0 stevel #pragma ident "%Z%%M% %I% %E% SMI" 31 0 stevel 32 0 stevel #include "lpsched.h" 33 0 stevel 34 0 stevel 35 0 stevel /** 36 0 stevel ** cancel() - CANCEL A REQUEST 37 0 stevel **/ 38 0 stevel 39 0 stevel int 40 0 stevel cancel (RSTATUS *prs, int spool) 41 0 stevel { 42 0 stevel if (prs->request->outcome & RS_DONE) 43 0 stevel return (0); 44 0 stevel 45 0 stevel prs->request->outcome |= RS_CANCELLED; 46 0 stevel 47 0 stevel if (spool || (prs->request->actions & ACT_NOTIFY)) 48 0 stevel prs->request->outcome |= RS_NOTIFY; 49 0 stevel 50 0 stevel if (prs->request->outcome & RS_PRINTING) { 51 0 stevel terminate(prs->printer->exec); 52 0 stevel } 53 0 stevel else if (prs->request->outcome & RS_FILTERING) { 54 0 stevel terminate (prs->exec); 55 0 stevel } 56 0 stevel else if (prs->request->outcome | RS_NOTIFY) { 57 3125 jacobs notify (prs, "canceled by remote system\n", 0, 0, 0); 58 0 stevel } 59 0 stevel check_request (prs); 60 0 stevel 61 0 stevel return (1); 62 0 stevel } 63