input-file.h revision 130561
1259698Sdim/* input_file.h header for input-file.c 2259698Sdim Copyright 1987, 1992, 1993, 2000 Free Software Foundation, Inc. 3259698Sdim 4259698Sdim This file is part of GAS, the GNU Assembler. 5259698Sdim 6259698Sdim GAS is free software; you can redistribute it and/or modify 7259698Sdim it under the terms of the GNU General Public License as published by 8259698Sdim the Free Software Foundation; either version 2, or (at your option) 9259698Sdim any later version. 10259698Sdim 11259698Sdim GAS is distributed in the hope that it will be useful, 12259698Sdim but WITHOUT ANY WARRANTY; without even the implied warranty of 13259698Sdim MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14259698Sdim GNU General Public License for more details. 15259698Sdim 16259698Sdim You should have received a copy of the GNU General Public License 17259698Sdim along with GAS; see the file COPYING. If not, write to the Free 18280031Sdim Software Foundation, 59 Temple Place - Suite 330, Boston, MA 19259698Sdim 02111-1307, USA. */ 20280031Sdim 21259698Sdim/*"input_file.c":Operating-system dependant functions to read source files.*/ 22288943Sdim 23276479Sdim/* 24259698Sdim * No matter what the operating system, this module must provide the 25259698Sdim * following services to its callers. 26259698Sdim * 27259698Sdim * input_file_begin() Call once before anything else. 28259698Sdim * 29276479Sdim * input_file_end() Call once after everything else. 30259698Sdim * 31259698Sdim * input_file_buffer_size() Call anytime. Returns largest possible 32259698Sdim * delivery from 33259698Sdim * input_file_give_next_buffer(). 34280031Sdim * 35280031Sdim * input_file_open(name) Call once for each input file. 36259698Sdim * 37276479Sdim * input_file_give_next_buffer(where) Call once to get each new buffer. 38259698Sdim * Return 0: no more chars left in file, 39259698Sdim * the file has already been closed. 40259698Sdim * Otherwise: return a pointer to just 41259698Sdim * after the last character we read 42259698Sdim * into the buffer. 43259698Sdim * If we can only read 0 characters, then 44276479Sdim * end-of-file is faked. 45276479Sdim * 46259698Sdim * input_file_push() Push state, which can be restored 47280031Sdim * later. Does implicit input_file_begin. 48259698Sdim * Returns char * to saved state. 49276479Sdim * 50259698Sdim * input_file_pop (arg) Pops previously saved state. 51280031Sdim * 52259698Sdim * input_file_close () Closes opened file. 53276479Sdim * 54276479Sdim * All errors are reported (using as_perror) so caller doesn't have to think 55276479Sdim * about I/O errors. No I/O errors are fatal: an end-of-file may be faked. 56259698Sdim */ 57280031Sdim 58280031Sdimchar *input_file_give_next_buffer (char *where); 59280031Sdimchar *input_file_push (void); 60280031Sdimunsigned int input_file_buffer_size (void); 61280031Sdimint input_file_is_open (void); 62280031Sdimvoid input_file_begin (void); 63280031Sdimvoid input_file_close (void); 64259698Sdimvoid input_file_end (void); 65259698Sdimvoid input_file_open (char *filename, int pre); 66280031Sdimvoid input_file_pop (char *arg); 67280031Sdim