input-file.h revision 78828
1138323Swollman/* input_file.h header for input-file.c 22742Swollman Copyright 1987, 1992, 1993, 2000 Free Software Foundation, Inc. 32742Swollman 42742Swollman This file is part of GAS, the GNU Assembler. 52742Swollman 62742Swollman GAS is free software; you can redistribute it and/or modify 72742Swollman it under the terms of the GNU General Public License as published by 858787Sru the Free Software Foundation; either version 2, or (at your option) 92742Swollman any later version. 1058787Sru 112742Swollman GAS is distributed in the hope that it will be useful, 122742Swollman but WITHOUT ANY WARRANTY; without even the implied warranty of 132742Swollman MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 142742Swollman GNU General Public License for more details. 152742Swollman 1658787Sru You should have received a copy of the GNU General Public License 1758787Sru along with GAS; see the file COPYING. If not, write to the Free 1858787Sru Software Foundation, 59 Temple Place - Suite 330, Boston, MA 1958787Sru 02111-1307, USA. */ 2058787Sru 2158787Sru/*"input_file.c":Operating-system dependant functions to read source files.*/ 2258787Sru 2358787Sru/* 2458787Sru * No matter what the operating system, this module must provide the 2558787Sru * following services to its callers. 2658787Sru * 2714343Swollman * input_file_begin() Call once before anything else. 2814343Swollman * 2914343Swollman * input_file_end() Call once after everything else. 3014343Swollman * 3114343Swollman * input_file_buffer_size() Call anytime. Returns largest possible 3214343Swollman * delivery from 3314343Swollman * input_file_give_next_buffer(). 3475267Swollman * 3517200Swollman * input_file_open(name) Call once for each input file. 3675267Swollman * 3775267Swollman * input_file_give_next_buffer(where) Call once to get each new buffer. 3817200Swollman * Return 0: no more chars left in file, 3917200Swollman * the file has already been closed. 4017200Swollman * Otherwise: return a pointer to just 4117200Swollman * after the last character we read 4217200Swollman * into the buffer. 4317200Swollman * If we can only read 0 characters, then 4417200Swollman * end-of-file is faked. 4517200Swollman * 4617200Swollman * input_file_push() Push state, which can be restored 4717200Swollman * later. Does implicit input_file_begin. 4817200Swollman * Returns char * to saved state. 4917200Swollman * 5017200Swollman * input_file_pop (arg) Pops previously saved state. 5117200Swollman * 5275267Swollman * input_file_close () Closes opened file. 5375267Swollman * 5475267Swollman * All errors are reported (using as_perror) so caller doesn't have to think 5575267Swollman * about I/O errors. No I/O errors are fatal: an end-of-file may be faked. 5675267Swollman */ 5775267Swollman 5875267Swollmanchar *input_file_give_next_buffer PARAMS ((char *where)); 5975267Swollmanchar *input_file_push PARAMS ((void)); 6075267Swollmanunsigned int input_file_buffer_size PARAMS ((void)); 6175267Swollmanint input_file_is_open PARAMS ((void)); 6217200Swollmanvoid input_file_begin PARAMS ((void)); 632742Swollmanvoid input_file_close PARAMS ((void)); 642742Swollmanvoid input_file_end PARAMS ((void)); 6519878Swollmanvoid input_file_open PARAMS ((char *filename, int pre)); 6619878Swollmanvoid input_file_pop PARAMS ((char *arg)); 672742Swollman