179746Sgad/* 279746Sgad * ------+---------+---------+---------+---------+---------+---------+---------* 3220586Sgad * Copyright (c) 2001,2011 - Garance Alistair Drosehn <gad@FreeBSD.org>. 479746Sgad * All rights reserved. 579746Sgad * 679746Sgad * Redistribution and use in source and binary forms, with or without 779746Sgad * modification, are permitted provided that the following conditions 879746Sgad * are met: 979746Sgad * 1. Redistributions of source code must retain the above copyright 1079746Sgad * notice, this list of conditions and the following disclaimer. 1179746Sgad * 2. Redistributions in binary form must reproduce the above copyright 1279746Sgad * notice, this list of conditions and the following disclaimer in the 1379746Sgad * documentation and/or other materials provided with the distribution. 1479746Sgad * 1579746Sgad * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1679746Sgad * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1779746Sgad * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1879746Sgad * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1979746Sgad * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2079746Sgad * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2179746Sgad * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2279746Sgad * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2379746Sgad * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2479746Sgad * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2579746Sgad * SUCH DAMAGE. 2679746Sgad * 2779746Sgad * The views and conclusions contained in the software and documentation 2879746Sgad * are those of the authors and should not be interpreted as representing 2979746Sgad * official policies, either expressed or implied, of the FreeBSD Project. 3079746Sgad * 3179746Sgad * ------+---------+---------+---------+---------+---------+---------+---------* 3279746Sgad * $FreeBSD$ 3379746Sgad * ------+---------+---------+---------+---------+---------+---------+---------* 3479746Sgad */ 3579746Sgad 3679746Sgad/* 3779746Sgad * ctlinfo - This collection of routines will know everything there is to 3879746Sgad * know about the information inside a control file ('cf*') which is used 3979746Sgad * to describe a print job in lpr & friends. The eventual goal is that it 4079746Sgad * will be the ONLY source file to know what's inside these control-files. 4179746Sgad */ 4279746Sgad 4379746Sgadstruct cjprivate; /* used internal to ctl* routines */ 4479746Sgad 4579746Sgadstruct cjobinfo { 4679746Sgad int cji_dfcount; /* number of data files to print */ 4779746Sgad int cji_uncount; /* number of unlink-file requests */ 4879746Sgad char *cji_accthost; /* the host that this job came from, 4979746Sgad * for accounting purposes (usually 5079746Sgad * the host where the original 'lpr' 5179746Sgad * was done) */ 5279746Sgad char *cji_acctuser; /* userid who should be charged for 5379746Sgad * this job (usually, the userid which 5479746Sgad * did the original 'lpr') */ 5579746Sgad char *cji_class; /* class-name */ 5679746Sgad char *cji_curqueue; /* printer-queue that this cf-file is 5779746Sgad * curently sitting in (mainly used 5879746Sgad * in syslog error messages) */ 5979746Sgad char *cji_fname; /* filename of the control file */ 6079746Sgad char *cji_jobname; /* job-name (for banner) */ 6179746Sgad char *cji_mailto; /* userid to send email to (or null) */ 62220586Sgad char *cji_headruser; /* "literal" user-name (for banner) or 6379746Sgad * NULL if no banner-page is wanted */ 6479746Sgad struct cjprivate *cji_priv; 6579746Sgad}; 6679746Sgad 67117541Sgad#include "lp.cdefs.h" /* A cross-platform version of <sys/cdefs.h> */ 6879746Sgad 6979746Sgad__BEGIN_DECLS 7099840Sgadvoid ctl_freeinf(struct cjobinfo *_cjinf); 7199840Sgadstruct cjobinfo *ctl_readcf(const char *_ptrname, const char *_cfname); 7279746Sgadchar *ctl_renametf(const char *_ptrname, const char *_tfname); 7379746Sgad__END_DECLS 74