fix bug that can cause recursive .forward files to fail
[unix-history] / usr / src / bin / sh / input.h
CommitLineData
da486063 1/*-
d1b73048
KB
2 * Copyright (c) 1991, 1993
3 * The Regents of the University of California. All rights reserved.
da486063
KB
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Kenneth Almquist.
7 *
8 * %sccs.include.redist.c%
9 *
d1b73048 10 * @(#)input.h 8.1 (Berkeley) %G%
da486063
KB
11 */
12
13/* PEOF (the end of file marker) is defined in syntax.h */
14
15/*
16 * The input line number. Input.c just defines this variable, and saves
17 * and restores it when files are pushed and popped. The user of this
18 * package must set its value.
19 */
20extern int plinno;
21extern int parsenleft; /* number of characters left in input buffer */
22extern char *parsenextc; /* next character in input buffer */
d83f7b9a 23extern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */
da486063
KB
24
25
26#ifdef __STDC__
27char *pfgets(char *, int);
28int pgetc(void);
29int preadbuffer(void);
30void pungetc(void);
d83f7b9a 31void pushstring(char *, int, void *);
da486063
KB
32void setinputfile(char *, int);
33void setinputfd(int, int);
34void setinputstring(char *, int);
35void popfile(void);
36void popallfiles(void);
37void closescript(void);
38#else
39char *pfgets();
40int pgetc();
41int preadbuffer();
42void pungetc();
da486063
KB
43void setinputfile();
44void setinputfd();
45void setinputstring();
46void popfile();
47void popallfiles();
d83f7b9a 48void pushstring();
da486063
KB
49void closescript();
50#endif
51
52#define pgetc_macro() (--parsenleft >= 0? *parsenextc++ : preadbuffer())