1/*
2 * $Id: file.h,v 1.8 2009-10-13 22:55:37 didg Exp $
3 *
4 * Copyright (c) 1990,1991 Regents of The University of Michigan.
5 * All Rights Reserved.  See COPYRIGHT.
6 */
7
8#ifndef PAPD_FILE_H
9#define PAPD_FILE_H 1
10
11#include <sys/cdefs.h>
12
13struct papfile {
14    int			pf_state;
15    struct state	*pf_xstate;
16    int			pf_bufsize;
17    int			pf_datalen;
18    char		*pf_buf;
19    char		*pf_data;
20    int		origin;
21};
22
23#define PF_BOT		(1<<0)
24#define PF_EOF		(1<<1)
25#define PF_QUERY	(1<<2)
26#define PF_STW		(1<<3)
27#define PF_TRANSLATE	(1<<4)
28
29#define CONSUME( pf, len )  {   (pf)->pf_data += (len); \
30				(pf)->pf_datalen -= (len); \
31				if ((pf)->pf_datalen <= 0) { \
32				    (pf)->pf_data = (pf)->pf_buf; \
33				    (pf)->pf_datalen = 0; \
34				} \
35			    }
36
37#define PF_MORESPACE	1024
38
39int markline ( struct papfile *, char **, int *, int * );
40void morespace ( struct papfile *, const char *, int );
41void append ( struct papfile *, const char *, int );
42void spoolerror ( struct papfile *, char * );
43
44#endif /* PAPD_FILE_H */
45