input-file.h revision 130561
133965Sjdp/* input_file.h header for input-file.c 278828Sobrien Copyright 1987, 1992, 1993, 2000 Free Software Foundation, Inc. 333965Sjdp 433965Sjdp This file is part of GAS, the GNU Assembler. 533965Sjdp 633965Sjdp GAS is free software; you can redistribute it and/or modify 733965Sjdp it under the terms of the GNU General Public License as published by 833965Sjdp the Free Software Foundation; either version 2, or (at your option) 933965Sjdp any later version. 1033965Sjdp 1133965Sjdp GAS is distributed in the hope that it will be useful, 1233965Sjdp but WITHOUT ANY WARRANTY; without even the implied warranty of 1333965Sjdp MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1433965Sjdp GNU General Public License for more details. 1533965Sjdp 1633965Sjdp You should have received a copy of the GNU General Public License 1777298Sobrien along with GAS; see the file COPYING. If not, write to the Free 1877298Sobrien Software Foundation, 59 Temple Place - Suite 330, Boston, MA 1977298Sobrien 02111-1307, USA. */ 2033965Sjdp 2133965Sjdp/*"input_file.c":Operating-system dependant functions to read source files.*/ 2233965Sjdp 2333965Sjdp/* 2433965Sjdp * No matter what the operating system, this module must provide the 2533965Sjdp * following services to its callers. 2633965Sjdp * 2733965Sjdp * input_file_begin() Call once before anything else. 2833965Sjdp * 2933965Sjdp * input_file_end() Call once after everything else. 3033965Sjdp * 3133965Sjdp * input_file_buffer_size() Call anytime. Returns largest possible 3233965Sjdp * delivery from 3333965Sjdp * input_file_give_next_buffer(). 3433965Sjdp * 3533965Sjdp * input_file_open(name) Call once for each input file. 3633965Sjdp * 3733965Sjdp * input_file_give_next_buffer(where) Call once to get each new buffer. 3833965Sjdp * Return 0: no more chars left in file, 3933965Sjdp * the file has already been closed. 4033965Sjdp * Otherwise: return a pointer to just 4133965Sjdp * after the last character we read 4233965Sjdp * into the buffer. 4333965Sjdp * If we can only read 0 characters, then 4433965Sjdp * end-of-file is faked. 4533965Sjdp * 4633965Sjdp * input_file_push() Push state, which can be restored 4733965Sjdp * later. Does implicit input_file_begin. 4833965Sjdp * Returns char * to saved state. 4933965Sjdp * 5033965Sjdp * input_file_pop (arg) Pops previously saved state. 5133965Sjdp * 5233965Sjdp * input_file_close () Closes opened file. 5333965Sjdp * 5433965Sjdp * All errors are reported (using as_perror) so caller doesn't have to think 5533965Sjdp * about I/O errors. No I/O errors are fatal: an end-of-file may be faked. 5633965Sjdp */ 5733965Sjdp 58130561Sobrienchar *input_file_give_next_buffer (char *where); 59130561Sobrienchar *input_file_push (void); 60130561Sobrienunsigned int input_file_buffer_size (void); 61130561Sobrienint input_file_is_open (void); 62130561Sobrienvoid input_file_begin (void); 63130561Sobrienvoid input_file_close (void); 64130561Sobrienvoid input_file_end (void); 65130561Sobrienvoid input_file_open (char *filename, int pre); 66130561Sobrienvoid input_file_pop (char *arg); 67