input.h revision 50471
11541Srgrimes/*- 21541Srgrimes * Copyright (c) 1991, 1993 31541Srgrimes * The Regents of the University of California. All rights reserved. 41541Srgrimes * 51541Srgrimes * This code is derived from software contributed to Berkeley by 61541Srgrimes * Kenneth Almquist. 71541Srgrimes * 81541Srgrimes * Redistribution and use in source and binary forms, with or without 91541Srgrimes * modification, are permitted provided that the following conditions 101541Srgrimes * are met: 111541Srgrimes * 1. Redistributions of source code must retain the above copyright 121541Srgrimes * notice, this list of conditions and the following disclaimer. 131541Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 141541Srgrimes * notice, this list of conditions and the following disclaimer in the 151541Srgrimes * documentation and/or other materials provided with the distribution. 161541Srgrimes * 3. All advertising materials mentioning features or use of this software 171541Srgrimes * must display the following acknowledgement: 181541Srgrimes * This product includes software developed by the University of 191541Srgrimes * California, Berkeley and its contributors. 201541Srgrimes * 4. Neither the name of the University nor the names of its contributors 211541Srgrimes * may be used to endorse or promote products derived from this software 221541Srgrimes * without specific prior written permission. 231541Srgrimes * 241541Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 251541Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 261541Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 271541Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 281541Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 291541Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 301541Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 311541Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 321541Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 331541Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34116189Sobrien * SUCH DAMAGE. 35116189Sobrien * 36116189Sobrien * @(#)input.h 8.2 (Berkeley) 5/4/95 3718207Sbde * $FreeBSD: head/bin/sh/input.h 50471 1999-08-27 23:15:48Z peter $ 381541Srgrimes */ 391541Srgrimes 401541Srgrimes/* PEOF (the end of file marker) is defined in syntax.h */ 411541Srgrimes 421541Srgrimes/* 431541Srgrimes * The input line number. Input.c just defines this variable, and saves 441541Srgrimes * and restores it when files are pushed and popped. The user of this 451541Srgrimes * package must set its value. 461541Srgrimes */ 471541Srgrimesextern int plinno; 481541Srgrimesextern int parsenleft; /* number of characters left in input buffer */ 491541Srgrimesextern char *parsenextc; /* next character in input buffer */ 501541Srgrimesextern int init_editline; /* 0 == not setup, 1 == OK, -1 == failed */ 511541Srgrimes 521541Srgrimeschar *pfgets __P((char *, int)); 531541Srgrimesint pgetc __P((void)); 541541Srgrimesint preadbuffer __P((void)); 551541Srgrimesvoid pungetc __P((void)); 561541Srgrimesvoid pushstring __P((char *, int, void *)); 5741434Snatevoid popstring __P((void)); 581541Srgrimesvoid setinputfile __P((char *, int)); 591541Srgrimesvoid setinputfd __P((int, int)); 601541Srgrimesvoid setinputstring __P((char *, int)); 611541Srgrimesvoid popfile __P((void)); 621541Srgrimesvoid popallfiles __P((void)); 63void closescript __P((void)); 64 65#define pgetc_macro() (--parsenleft >= 0? *parsenextc++ : preadbuffer()) 66