1*7c478bd9Sstevel@tonic-gate /* 2*7c478bd9Sstevel@tonic-gate * CDDL HEADER START 3*7c478bd9Sstevel@tonic-gate * 4*7c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*7c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*7c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*7c478bd9Sstevel@tonic-gate * with the License. 8*7c478bd9Sstevel@tonic-gate * 9*7c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*7c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*7c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 12*7c478bd9Sstevel@tonic-gate * and limitations under the License. 13*7c478bd9Sstevel@tonic-gate * 14*7c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*7c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*7c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*7c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*7c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*7c478bd9Sstevel@tonic-gate * 20*7c478bd9Sstevel@tonic-gate * CDDL HEADER END 21*7c478bd9Sstevel@tonic-gate */ 22*7c478bd9Sstevel@tonic-gate /* 23*7c478bd9Sstevel@tonic-gate * Copyright 1993 Sun Microsystems, Inc. All rights reserved. 24*7c478bd9Sstevel@tonic-gate * Use is subject to license terms. 25*7c478bd9Sstevel@tonic-gate */ 26*7c478bd9Sstevel@tonic-gate 27*7c478bd9Sstevel@tonic-gate /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 28*7c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 29*7c478bd9Sstevel@tonic-gate 30*7c478bd9Sstevel@tonic-gate 31*7c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.13 */ 32*7c478bd9Sstevel@tonic-gate 33*7c478bd9Sstevel@tonic-gate #if !defined(_LP_REQUESTS_H) 34*7c478bd9Sstevel@tonic-gate #define _LP_REQUESTS_H 35*7c478bd9Sstevel@tonic-gate 36*7c478bd9Sstevel@tonic-gate /** 37*7c478bd9Sstevel@tonic-gate ** The disk copy of the request files: 38*7c478bd9Sstevel@tonic-gate **/ 39*7c478bd9Sstevel@tonic-gate 40*7c478bd9Sstevel@tonic-gate /* 41*7c478bd9Sstevel@tonic-gate * There are 18 fields in the request file. 42*7c478bd9Sstevel@tonic-gate */ 43*7c478bd9Sstevel@tonic-gate #define RQ_MAX 18 44*7c478bd9Sstevel@tonic-gate # define RQ_COPIES 0 45*7c478bd9Sstevel@tonic-gate # define RQ_DEST 1 46*7c478bd9Sstevel@tonic-gate # define RQ_FILE 2 47*7c478bd9Sstevel@tonic-gate # define RQ_FORM 3 48*7c478bd9Sstevel@tonic-gate # define RQ_HANDL 4 49*7c478bd9Sstevel@tonic-gate # define RQ_NOTIFY 5 50*7c478bd9Sstevel@tonic-gate # define RQ_OPTS 6 51*7c478bd9Sstevel@tonic-gate # define RQ_PRIOR 7 52*7c478bd9Sstevel@tonic-gate # define RQ_PAGES 8 53*7c478bd9Sstevel@tonic-gate # define RQ_CHARS 9 54*7c478bd9Sstevel@tonic-gate # define RQ_TITLE 10 55*7c478bd9Sstevel@tonic-gate # define RQ_MODES 11 56*7c478bd9Sstevel@tonic-gate # define RQ_TYPE 12 57*7c478bd9Sstevel@tonic-gate # define RQ_USER 13 58*7c478bd9Sstevel@tonic-gate # define RQ_RAW 14 59*7c478bd9Sstevel@tonic-gate # define RQ_FAST 15 60*7c478bd9Sstevel@tonic-gate # define RQ_STAT 16 61*7c478bd9Sstevel@tonic-gate # define RQ_VERSION 17 62*7c478bd9Sstevel@tonic-gate 63*7c478bd9Sstevel@tonic-gate /** 64*7c478bd9Sstevel@tonic-gate ** The internal copy of a request as seen by the rest of the world: 65*7c478bd9Sstevel@tonic-gate **/ 66*7c478bd9Sstevel@tonic-gate 67*7c478bd9Sstevel@tonic-gate /* 68*7c478bd9Sstevel@tonic-gate * A (char **) list is an array of string pointers (char *) with 69*7c478bd9Sstevel@tonic-gate * a null pointer after the last item. 70*7c478bd9Sstevel@tonic-gate */ 71*7c478bd9Sstevel@tonic-gate typedef struct REQUEST { 72*7c478bd9Sstevel@tonic-gate short copies; /* number of copies of request to print */ 73*7c478bd9Sstevel@tonic-gate char *destination; /* printer or class name */ 74*7c478bd9Sstevel@tonic-gate char **file_list; /* list of files to print: req. content */ 75*7c478bd9Sstevel@tonic-gate char *form; /* preprinted form to print on */ 76*7c478bd9Sstevel@tonic-gate ushort actions; /* mail/write, immediate/hold/resume, raw */ 77*7c478bd9Sstevel@tonic-gate char *alert; /* program to run to alert user when done */ 78*7c478bd9Sstevel@tonic-gate char *options; /* print options; space separated list */ 79*7c478bd9Sstevel@tonic-gate short priority; /* priority level, 0-39, of the request */ 80*7c478bd9Sstevel@tonic-gate char *pages; /* list of pages to print (uniq. please!) */ 81*7c478bd9Sstevel@tonic-gate char *charset; /* character set to select or mount */ 82*7c478bd9Sstevel@tonic-gate char *modes; /* mode(s) of operation; space sep. list */ 83*7c478bd9Sstevel@tonic-gate char *title; /* optional title for banner page */ 84*7c478bd9Sstevel@tonic-gate char *input_type; /* type of content */ 85*7c478bd9Sstevel@tonic-gate char *user; /* user name of person submitting */ 86*7c478bd9Sstevel@tonic-gate ushort outcome; /* success/fauilure */ 87*7c478bd9Sstevel@tonic-gate ushort version; /* version of system sending job*/ 88*7c478bd9Sstevel@tonic-gate } REQUEST; 89*7c478bd9Sstevel@tonic-gate 90*7c478bd9Sstevel@tonic-gate #define BSD_FORM "=bsdForm=" /* form name given to jobs from bsd */ 91*7c478bd9Sstevel@tonic-gate #define VERSION_BSD 0 92*7c478bd9Sstevel@tonic-gate #define VERSION_OLD_LP 1 93*7c478bd9Sstevel@tonic-gate #define VERSION_NEW_LP 2 94*7c478bd9Sstevel@tonic-gate 95*7c478bd9Sstevel@tonic-gate /* 96*7c478bd9Sstevel@tonic-gate * Bit flags for the "actions" member: 97*7c478bd9Sstevel@tonic-gate */ 98*7c478bd9Sstevel@tonic-gate #define ACT_MAIL 0x0001 /* send mail when finished printing */ 99*7c478bd9Sstevel@tonic-gate #define ACT_WRITE 0x0002 /* write to the terminal when finished */ 100*7c478bd9Sstevel@tonic-gate #define ACT_NOTIFY 0x0004 /* tell the remote that this is done */ 101*7c478bd9Sstevel@tonic-gate #define ACT_IMMEDIATE 0x0010 /* print immediately */ 102*7c478bd9Sstevel@tonic-gate #define ACT_HOLD 0x0020 /* don't print until resumed */ 103*7c478bd9Sstevel@tonic-gate #define ACT_RESUME 0x0030 /* resume a held request */ 104*7c478bd9Sstevel@tonic-gate #define ACT_SPECIAL 0x0030 /* bit mask of immediate/hold/resume */ 105*7c478bd9Sstevel@tonic-gate #define ACT_RAW 0x0100 /* don't filter the input */ 106*7c478bd9Sstevel@tonic-gate 107*7c478bd9Sstevel@tonic-gate /* 108*7c478bd9Sstevel@tonic-gate * Currently, the following is used only for alignment patterns: 109*7c478bd9Sstevel@tonic-gate */ 110*7c478bd9Sstevel@tonic-gate #define ACT_FAST 0x8000 /* force all filters to be fast */ 111*7c478bd9Sstevel@tonic-gate 112*7c478bd9Sstevel@tonic-gate 113*7c478bd9Sstevel@tonic-gate /* 114*7c478bd9Sstevel@tonic-gate * Bit flags for the "outcome" member: 115*7c478bd9Sstevel@tonic-gate */ 116*7c478bd9Sstevel@tonic-gate #define RS_HELD 0x0001 /* held pending resume */ 117*7c478bd9Sstevel@tonic-gate #define RS_FILTERING 0x0002 /* slow filter is running */ 118*7c478bd9Sstevel@tonic-gate #define RS_FILTERED 0x0004 /* slow filter has finished running */ 119*7c478bd9Sstevel@tonic-gate #define RS_PRINTING 0x0008 /* on printer */ 120*7c478bd9Sstevel@tonic-gate #define RS_PRINTED 0x0010 /* has finished printing */ 121*7c478bd9Sstevel@tonic-gate #define RS_CHANGING 0x0020 /* request held pending user change */ 122*7c478bd9Sstevel@tonic-gate #define RS_CANCELLED 0x0040 /* request was cancelled */ 123*7c478bd9Sstevel@tonic-gate #define RS_IMMEDIATE 0x0080 /* should be next to print */ 124*7c478bd9Sstevel@tonic-gate #define RS_FAILED 0x0100 /* slow filter or interface failed */ 125*7c478bd9Sstevel@tonic-gate #define RS_SENDING 0x0200 /* Request is in transit to a remote */ 126*7c478bd9Sstevel@tonic-gate #define RS_NOTIFY 0x0400 /* user is to be notified (alert) */ 127*7c478bd9Sstevel@tonic-gate #define RS_NOTIFYING 0x0800 /* notification (alert) is running */ 128*7c478bd9Sstevel@tonic-gate #define RS_SENT 0x1000 /* Request accepted on remote system */ 129*7c478bd9Sstevel@tonic-gate #define RS_ADMINHELD 0x2000 /* administrator placed RS_HELD */ 130*7c478bd9Sstevel@tonic-gate #define RS_REFILTER 0x4000 /* had to change filters */ 131*7c478bd9Sstevel@tonic-gate #define RS_STOPPED 0x8000 /* temporarily stopped the request */ 132*7c478bd9Sstevel@tonic-gate 133*7c478bd9Sstevel@tonic-gate /* 134*7c478bd9Sstevel@tonic-gate * Some bit combinations, for convenience and consistency: 135*7c478bd9Sstevel@tonic-gate * 136*7c478bd9Sstevel@tonic-gate * RS_DONE request is finished printing or was cancelled 137*7c478bd9Sstevel@tonic-gate * RS_ACTIVE request is being handled, can be skipped 138*7c478bd9Sstevel@tonic-gate * RS_GONEREMOTE request is being or has been sent to remote 139*7c478bd9Sstevel@tonic-gate */ 140*7c478bd9Sstevel@tonic-gate #define RS_DONE (RS_CANCELLED|RS_PRINTED|RS_FAILED) 141*7c478bd9Sstevel@tonic-gate #define RS_ACTIVE (RS_FILTERING|RS_PRINTING|RS_CHANGING|RS_NOTIFYING) 142*7c478bd9Sstevel@tonic-gate #define RS_GONEREMOTE (RS_SENT|RS_SENDING) 143*7c478bd9Sstevel@tonic-gate 144*7c478bd9Sstevel@tonic-gate /** 145*7c478bd9Sstevel@tonic-gate ** Various routines. 146*7c478bd9Sstevel@tonic-gate **/ 147*7c478bd9Sstevel@tonic-gate 148*7c478bd9Sstevel@tonic-gate REQUEST * getrequest ( char * ); 149*7c478bd9Sstevel@tonic-gate int putrequest ( char *, REQUEST * ); 150*7c478bd9Sstevel@tonic-gate void freerequest ( REQUEST * ); 151*7c478bd9Sstevel@tonic-gate 152*7c478bd9Sstevel@tonic-gate #endif 153