input-file.h 2.3 KB

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