2010-08-04 Tristan Gingold <gingold@adacore.com>
[binutils.git] / gas / input-file.h
blob716f2a6c1c8dc6cb1c6a61da26ebd64298635098
1 /* input_file.h header for input-file.c
2 Copyright 1987, 1992, 1993, 2000, 2003, 2005, 2006, 2007
3 Free Software Foundation, Inc.
5 This file is part of GAS, the GNU Assembler.
7 GAS is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
12 GAS is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GAS; see the file COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
20 02110-1301, USA. */
22 /*"input_file.c":Operating-system dependant functions to read source files.*/
25 * No matter what the operating system, this module must provide the
26 * following services to its callers.
28 * input_file_begin() Call once before anything else.
30 * input_file_end() Call once after everything else.
32 * input_file_buffer_size() Call anytime. Returns largest possible
33 * delivery from
34 * input_file_give_next_buffer().
36 * input_file_open(name) Call once for each input file.
38 * input_file_give_next_buffer(where) Call once to get each new buffer.
39 * Return 0: no more chars left in file,
40 * the file has already been closed.
41 * Otherwise: return a pointer to just
42 * after the last character we read
43 * into the buffer.
44 * If we can only read 0 characters, then
45 * end-of-file is faked.
47 * input_file_push() Push state, which can be restored
48 * later. Does implicit input_file_begin.
49 * Returns char * to saved state.
51 * input_file_pop (arg) Pops previously saved state.
53 * input_file_close () Closes opened file.
55 * All errors are reported so caller doesn't have to think
56 * about I/O errors.
59 char *input_file_give_next_buffer (char *where);
60 char *input_file_push (void);
61 unsigned int input_file_buffer_size (void);
62 void input_file_begin (void);
63 void input_file_close (void);
64 void input_file_end (void);
65 void input_file_open (char *filename, int pre);
66 void input_file_pop (char *arg);