1 /* input_file.h header for input-file.c
2 Copyright (C) 1987, 1992 Free Software Foundation, Inc.
4 This file is part of GAS, the GNU Assembler.
6 GAS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GAS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GAS; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 /*"input_file.c":Operating-system dependant functions to read source files.*/
23 * $FreeBSD: src/gnu/usr.bin/as/input-file.h,v 1.6 1999/08/27 23:34:18 peter Exp $
24 * $DragonFly: src/gnu/usr.bin/as/Attic/input-file.h,v 1.2 2003/06/17 04:25:44 dillon Exp $
29 * No matter what the operating system, this module must provide the
30 * following services to its callers.
32 * input_file_begin() Call once before anything else.
34 * input_file_end() Call once after everything else.
36 * input_file_buffer_size() Call anytime. Returns largest possible
38 * input_file_give_next_buffer().
40 * input_file_open(name) Call once for each input file.
42 * input_file_give_next_buffer(where) Call once to get each new buffer.
43 * Return 0: no more chars left in file,
44 * the file has already been closed.
45 * Otherwise: return a pointer to just
46 * after the last character we read
48 * If we can only read 0 characters, then
49 * end-of-file is faked.
51 * input_file_push() Push state, which can be restored
52 * later. Does implicit input_file_begin.
53 * Returns char * to saved state.
55 * input_file_pop (arg) Pops previously saved state.
57 * input_file_close () Closes opened file.
59 * All errors are reported (using as_perror) so caller doesn't have to think
60 * about I/O errors. No I/O errors are fatal: an end-of-file may be faked.
65 char *input_file_give_next_buffer(char *where);
66 char *input_file_push(void);
67 int input_file_buffer_size(void);
68 int input_file_is_open(void);
69 void input_file_begin(void);
70 void input_file_close(void);
71 void input_file_end(void);
72 void input_file_open(char *filename, int pre);
73 void input_file_pop(char *arg);
75 #else /* not __STDC__ */
77 char *input_file_give_next_buffer();
78 char *input_file_push();
79 int input_file_buffer_size();
80 int input_file_is_open();
81 void input_file_begin();
82 void input_file_close();
83 void input_file_end();
84 void input_file_open();
85 void input_file_pop();
87 #endif /* not __STDC__ */
89 /* end of input_file.h */