xref: /original-bsd/bin/sh/input.h (revision 28e93ce0)
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.1 (Berkeley) 05/31/93
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 
26 #ifdef __STDC__
27 char *pfgets(char *, int);
28 int pgetc(void);
29 int preadbuffer(void);
30 void pungetc(void);
31 void pushstring(char *, int, void *);
32 void setinputfile(char *, int);
33 void setinputfd(int, int);
34 void setinputstring(char *, int);
35 void popfile(void);
36 void popallfiles(void);
37 void closescript(void);
38 #else
39 char *pfgets();
40 int pgetc();
41 int preadbuffer();
42 void pungetc();
43 void setinputfile();
44 void setinputfd();
45 void setinputstring();
46 void popfile();
47 void popallfiles();
48 void pushstring();
49 void closescript();
50 #endif
51 
52 #define pgetc_macro()	(--parsenleft >= 0? *parsenextc++ : preadbuffer())
53