input.h revision 1557
144196Srnordier/*-
2185579Sluigi * Copyright (c) 1991, 1993
344196Srnordier *	The Regents of the University of California.  All rights reserved.
444196Srnordier *
544196Srnordier * This code is derived from software contributed to Berkeley by
644196Srnordier * Kenneth Almquist.
744196Srnordier *
844196Srnordier * Redistribution and use in source and binary forms, with or without
944196Srnordier * modification, are permitted provided that the following conditions
1044196Srnordier * are met:
1144196Srnordier * 1. Redistributions of source code must retain the above copyright
1244196Srnordier *    notice, this list of conditions and the following disclaimer.
1344196Srnordier * 2. Redistributions in binary form must reproduce the above copyright
1444196Srnordier *    notice, this list of conditions and the following disclaimer in the
1544196Srnordier *    documentation and/or other materials provided with the distribution.
1644196Srnordier * 3. All advertising materials mentioning features or use of this software
1744196Srnordier *    must display the following acknowledgement:
1844196Srnordier *	This product includes software developed by the University of
1944196Srnordier *	California, Berkeley and its contributors.
2044196Srnordier * 4. Neither the name of the University nor the names of its contributors
2144196Srnordier *    may be used to endorse or promote products derived from this software
2244196Srnordier *    without specific prior written permission.
2344196Srnordier *
2444196Srnordier * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2544196Srnordier * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2644196Srnordier * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2744196Srnordier * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28114601Sobrien * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29114601Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3044196Srnordier * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3144196Srnordier * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3244196Srnordier * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33104272Sphk * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3444196Srnordier * SUCH DAMAGE.
3544196Srnordier *
3644196Srnordier *	@(#)input.h	8.1 (Berkeley) 5/31/93
3744196Srnordier */
3844196Srnordier
39148036Sphk/* PEOF (the end of file marker) is defined in syntax.h */
4044196Srnordier
4144196Srnordier/*
4244196Srnordier * The input line number.  Input.c just defines this variable, and saves
4344196Srnordier * and restores it when files are pushed and popped.  The user of this
4444196Srnordier * package must set its value.
4544196Srnordier */
4644196Srnordierextern int plinno;
4744196Srnordierextern int parsenleft;		/* number of characters left in input buffer */
48185579Sluigiextern char *parsenextc;	/* next character in input buffer */
49185579Sluigiextern int init_editline;	/* 0 == not setup, 1 == OK, -1 == failed */
5044196Srnordier
5144196Srnordier
52185579Sluigi#ifdef __STDC__
53185579Sluigichar *pfgets(char *, int);
54185579Sluigiint pgetc(void);
55185579Sluigiint preadbuffer(void);
56185579Sluigivoid pungetc(void);
57185579Sluigivoid pushstring(char *, int, void *);
58185579Sluigivoid setinputfile(char *, int);
59185579Sluigivoid setinputfd(int, int);
60185579Sluigivoid setinputstring(char *, int);
61185579Sluigivoid popfile(void);
6244196Srnordiervoid popallfiles(void);
63227250Sedvoid closescript(void);
64185579Sluigi#else
65185579Sluigichar *pfgets();
66185579Sluigiint pgetc();
67185579Sluigiint preadbuffer();
68185579Sluigivoid pungetc();
69227250Sedvoid setinputfile();
70185579Sluigivoid setinputfd();
71185579Sluigivoid setinputstring();
72185579Sluigivoid popfile();
73185579Sluigivoid popallfiles();
74185579Sluigivoid pushstring();
75185579Sluigivoid closescript();
76185579Sluigi#endif
7744196Srnordier
7844196Srnordier#define pgetc_macro()	(--parsenleft >= 0? *parsenextc++ : preadbuffer())
7944196Srnordier