input.h revision 22988
1251876Speter/*-
2251876Speter * Copyright (c) 1991, 1993
3251876Speter *	The Regents of the University of California.  All rights reserved.
4251876Speter *
5251876Speter * This code is derived from software contributed to Berkeley by
6251876Speter * Kenneth Almquist.
7251876Speter *
8251876Speter * Redistribution and use in source and binary forms, with or without
9251876Speter * modification, are permitted provided that the following conditions
10251876Speter * are met:
11251876Speter * 1. Redistributions of source code must retain the above copyright
12251876Speter *    notice, this list of conditions and the following disclaimer.
13251876Speter * 2. Redistributions in binary form must reproduce the above copyright
14251876Speter *    notice, this list of conditions and the following disclaimer in the
15251876Speter *    documentation and/or other materials provided with the distribution.
16251876Speter * 3. All advertising materials mentioning features or use of this software
17251876Speter *    must display the following acknowledgement:
18251876Speter *	This product includes software developed by the University of
19251876Speter *	California, Berkeley and its contributors.
20251876Speter * 4. Neither the name of the University nor the names of its contributors
21251876Speter *    may be used to endorse or promote products derived from this software
22251876Speter *    without specific prior written permission.
23251876Speter *
24251876Speter * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25251876Speter * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26251876Speter * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27251876Speter * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28251876Speter * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29251876Speter * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30251876Speter * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31251876Speter * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32251876Speter * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33251876Speter * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34251876Speter * SUCH DAMAGE.
35251876Speter *
36251876Speter *	@(#)input.h	8.2 (Berkeley) 5/4/95
37251876Speter *	$Id$
38251876Speter */
39251876Speter
40251876Speter/* PEOF (the end of file marker) is defined in syntax.h */
41251876Speter
42251876Speter/*
43251876Speter * The input line number.  Input.c just defines this variable, and saves
44251876Speter * and restores it when files are pushed and popped.  The user of this
45251876Speter * package must set its value.
46251876Speter */
47251876Speterextern int plinno;
48251876Speterextern int parsenleft;		/* number of characters left in input buffer */
49251876Speterextern char *parsenextc;	/* next character in input buffer */
50251876Speterextern int init_editline;	/* 0 == not setup, 1 == OK, -1 == failed */
51251876Speter
52251876Speterchar *pfgets __P((char *, int));
53251876Speterint pgetc __P((void));
54251876Speterint preadbuffer __P((void));
55251876Spetervoid pungetc __P((void));
56251876Spetervoid pushstring __P((char *, int, void *));
57251876Spetervoid popstring __P((void));
58251876Spetervoid setinputfile __P((char *, int));
59251876Spetervoid setinputfd __P((int, int));
60251876Spetervoid setinputstring __P((char *, int));
61251876Spetervoid popfile __P((void));
62251876Spetervoid popallfiles __P((void));
63251876Spetervoid closescript __P((void));
64251876Speter
65251876Speter#define pgetc_macro()	(--parsenleft >= 0? *parsenextc++ : preadbuffer())
66251876Speter