xref: /original-bsd/bin/sh/input.h (revision 6d5a9f9c)
1 /*-
2  * Copyright (c) 1991, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Kenneth Almquist.
7  *
8  * %sccs.include.redist.c%
9  *
10  *	@(#)input.h	8.2 (Berkeley) 05/04/95
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  */
20 extern int plinno;
21 extern int parsenleft;		/* number of characters left in input buffer */
22 extern char *parsenextc;	/* next character in input buffer */
23 extern int init_editline;	/* 0 == not setup, 1 == OK, -1 == failed */
24 
25 char *pfgets __P((char *, int));
26 int pgetc __P((void));
27 int preadbuffer __P((void));
28 void pungetc __P((void));
29 void pushstring __P((char *, int, void *));
30 void popstring __P((void));
31 void setinputfile __P((char *, int));
32 void setinputfd __P((int, int));
33 void setinputstring __P((char *, int));
34 void popfile __P((void));
35 void popallfiles __P((void));
36 void closescript __P((void));
37 
38 #define pgetc_macro()	(--parsenleft >= 0? *parsenextc++ : preadbuffer())
39