xref: /csrg-svn/bin/sh/input.h (revision 54317)
147120Sbostic /*-
247120Sbostic  * Copyright (c) 1991 The Regents of the University of California.
347120Sbostic  * All rights reserved.
447120Sbostic  *
547120Sbostic  * This code is derived from software contributed to Berkeley by
647120Sbostic  * Kenneth Almquist.
747120Sbostic  *
847120Sbostic  * %sccs.include.redist.c%
947120Sbostic  *
10*54317Smarc  *	@(#)input.h	5.2 (Berkeley) 06/23/92
1147120Sbostic  */
1247120Sbostic 
1347120Sbostic /* PEOF (the end of file marker) is defined in syntax.h */
1447120Sbostic 
1547120Sbostic /*
1647120Sbostic  * The input line number.  Input.c just defines this variable, and saves
1747120Sbostic  * and restores it when files are pushed and popped.  The user of this
1847120Sbostic  * package must set its value.
1947120Sbostic  */
2047120Sbostic extern int plinno;
2147120Sbostic extern int parsenleft;		/* number of characters left in input buffer */
2247120Sbostic extern char *parsenextc;	/* next character in input buffer */
23*54317Smarc extern int init_editline;	/* 0 == not setup, 1 == OK, -1 == failed */
2447120Sbostic 
2547120Sbostic 
2647120Sbostic #ifdef __STDC__
2747120Sbostic char *pfgets(char *, int);
2847120Sbostic int pgetc(void);
2947120Sbostic int preadbuffer(void);
3047120Sbostic void pungetc(void);
31*54317Smarc void pushstring(char *, int, void *);
3247120Sbostic void setinputfile(char *, int);
3347120Sbostic void setinputfd(int, int);
3447120Sbostic void setinputstring(char *, int);
3547120Sbostic void popfile(void);
3647120Sbostic void popallfiles(void);
3747120Sbostic void closescript(void);
3847120Sbostic #else
3947120Sbostic char *pfgets();
4047120Sbostic int pgetc();
4147120Sbostic int preadbuffer();
4247120Sbostic void pungetc();
4347120Sbostic void setinputfile();
4447120Sbostic void setinputfd();
4547120Sbostic void setinputstring();
4647120Sbostic void popfile();
4747120Sbostic void popallfiles();
48*54317Smarc void pushstring();
4947120Sbostic void closescript();
5047120Sbostic #endif
5147120Sbostic 
5247120Sbostic #define pgetc_macro()	(--parsenleft >= 0? *parsenextc++ : preadbuffer())
53