input-file.h revision 77298
179561Siedowse/* input_file.h header for input-file.c 2107868Siedowse Copyright (C) 1987, 1992 Free Software Foundation, Inc. 379561Siedowse 479561Siedowse This file is part of GAS, the GNU Assembler. 579561Siedowse 679561Siedowse GAS is free software; you can redistribute it and/or modify 779561Siedowse it under the terms of the GNU General Public License as published by 879561Siedowse the Free Software Foundation; either version 2, or (at your option) 979561Siedowse any later version. 1079561Siedowse 1179561Siedowse GAS is distributed in the hope that it will be useful, 1279561Siedowse but WITHOUT ANY WARRANTY; without even the implied warranty of 1379561Siedowse MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1479561Siedowse GNU General Public License for more details. 1579561Siedowse 1679561Siedowse You should have received a copy of the GNU General Public License 1779561Siedowse along with GAS; see the file COPYING. If not, write to the Free 1879561Siedowse Software Foundation, 59 Temple Place - Suite 330, Boston, MA 1979561Siedowse 02111-1307, USA. */ 2079561Siedowse 2179561Siedowse/*"input_file.c":Operating-system dependant functions to read source files.*/ 2279561Siedowse 2379561Siedowse/* 2479561Siedowse * No matter what the operating system, this module must provide the 2579561Siedowse * following services to its callers. 2679561Siedowse * 2779561Siedowse * input_file_begin() Call once before anything else. 2879561Siedowse * 2979561Siedowse * input_file_end() Call once after everything else. 3079561Siedowse * 3179561Siedowse * input_file_buffer_size() Call anytime. Returns largest possible 3279561Siedowse * delivery from 3379561Siedowse * input_file_give_next_buffer(). 3479561Siedowse * 3579561Siedowse * input_file_open(name) Call once for each input file. 3679561Siedowse * 3779561Siedowse * input_file_give_next_buffer(where) Call once to get each new buffer. 3884811Sjhb * Return 0: no more chars left in file, 3979561Siedowse * the file has already been closed. 4079561Siedowse * Otherwise: return a pointer to just 4179561Siedowse * after the last character we read 4279561Siedowse * into the buffer. 4379561Siedowse * If we can only read 0 characters, then 4479561Siedowse * end-of-file is faked. 4579561Siedowse * 4679561Siedowse * input_file_push() Push state, which can be restored 4779561Siedowse * later. Does implicit input_file_begin. 4892768Sjeff * Returns char * to saved state. 4979561Siedowse * 5079561Siedowse * input_file_pop (arg) Pops previously saved state. 5179561Siedowse * 5279561Siedowse * input_file_close () Closes opened file. 5379561Siedowse * 5479561Siedowse * All errors are reported (using as_perror) so caller doesn't have to think 5579561Siedowse * about I/O errors. No I/O errors are fatal: an end-of-file may be faked. 5679561Siedowse */ 5779561Siedowse 5879561Siedowsechar *input_file_give_next_buffer PARAMS ((char *where)); 5992807Sdwmalonechar *input_file_push PARAMS ((void)); 6079561Siedowseunsigned int input_file_buffer_size PARAMS ((void)); 6192098Siedowseint input_file_is_open PARAMS ((void)); 6279561Siedowsevoid input_file_begin PARAMS ((void)); 6379561Siedowsevoid input_file_close PARAMS ((void)); 6479561Siedowsevoid input_file_end PARAMS ((void)); 6579561Siedowsevoid input_file_open PARAMS ((char *filename, int pre)); 6679561Siedowsevoid input_file_pop PARAMS ((char *arg)); 6779561Siedowse