input.h revision 1556
11556Srgrimes/*- 21556Srgrimes * Copyright (c) 1991, 1993 31556Srgrimes * The Regents of the University of California. All rights reserved. 41556Srgrimes * 51556Srgrimes * This code is derived from software contributed to Berkeley by 61556Srgrimes * Kenneth Almquist. 71556Srgrimes * 81556Srgrimes * Redistribution and use in source and binary forms, with or without 91556Srgrimes * modification, are permitted provided that the following conditions 101556Srgrimes * are met: 111556Srgrimes * 1. Redistributions of source code must retain the above copyright 121556Srgrimes * notice, this list of conditions and the following disclaimer. 131556Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 141556Srgrimes * notice, this list of conditions and the following disclaimer in the 151556Srgrimes * documentation and/or other materials provided with the distribution. 161556Srgrimes * 3. All advertising materials mentioning features or use of this software 171556Srgrimes * must display the following acknowledgement: 181556Srgrimes * This product includes software developed by the University of 191556Srgrimes * California, Berkeley and its contributors. 201556Srgrimes * 4. Neither the name of the University nor the names of its contributors 211556Srgrimes * may be used to endorse or promote products derived from this software 221556Srgrimes * without specific prior written permission. 231556Srgrimes * 241556Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 251556Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 261556Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 271556Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 281556Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 291556Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 301556Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 311556Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 321556Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 331556Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 341556Srgrimes * SUCH DAMAGE. 351556Srgrimes * 361556Srgrimes * @(#)input.h 8.1 (Berkeley) 5/31/93 371556Srgrimes */ 381556Srgrimes 391556Srgrimes/* PEOF (the end of file marker) is defined in syntax.h */ 401556Srgrimes 411556Srgrimes/* 421556Srgrimes * The input line number. Input.c just defines this variable, and saves 431556Srgrimes * and restores it when files are pushed and popped. The user of this 441556Srgrimes * package must set its value. 451556Srgrimes */ 461556Srgrimesextern int plinno; 471556Srgrimesextern int parsenleft; /* number of characters left in input buffer */ 481556Srgrimesextern char *parsenextc; /* next character in input buffer */ 491556Srgrimesextern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */ 501556Srgrimes 511556Srgrimes 521556Srgrimes#ifdef __STDC__ 531556Srgrimeschar *pfgets(char *, int); 541556Srgrimesint pgetc(void); 551556Srgrimesint preadbuffer(void); 561556Srgrimesvoid pungetc(void); 571556Srgrimesvoid pushstring(char *, int, void *); 581556Srgrimesvoid setinputfile(char *, int); 591556Srgrimesvoid setinputfd(int, int); 601556Srgrimesvoid setinputstring(char *, int); 611556Srgrimesvoid popfile(void); 621556Srgrimesvoid popallfiles(void); 631556Srgrimesvoid closescript(void); 641556Srgrimes#else 651556Srgrimeschar *pfgets(); 661556Srgrimesint pgetc(); 671556Srgrimesint preadbuffer(); 681556Srgrimesvoid pungetc(); 691556Srgrimesvoid setinputfile(); 701556Srgrimesvoid setinputfd(); 711556Srgrimesvoid setinputstring(); 721556Srgrimesvoid popfile(); 731556Srgrimesvoid popallfiles(); 741556Srgrimesvoid pushstring(); 751556Srgrimesvoid closescript(); 761556Srgrimes#endif 771556Srgrimes 781556Srgrimes#define pgetc_macro() (--parsenleft >= 0? *parsenextc++ : preadbuffer()) 79