lf.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. /* The IGEN simulator generator for GDB, the GNU Debugger.
  2. Copyright 2002-2022 Free Software Foundation, Inc.
  3. Contributed by Andrew Cagney.
  4. This file is part of GDB.
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  15. #include "ansidecl.h"
  16. /* LF: Line Numbered Output Stream */
  17. typedef struct _lf lf;
  18. typedef enum
  19. {
  20. lf_is_h,
  21. lf_is_c,
  22. lf_is_text,
  23. }
  24. lf_file_type;
  25. typedef enum
  26. {
  27. lf_include_references,
  28. lf_omit_references,
  29. }
  30. lf_file_references;
  31. /* Open the file NAME for writing ("-" for stdout). Use REAL_NAME
  32. when refering to the opened file. Line number information (in the
  33. output) can be suppressed with FILE_REFERENCES ==
  34. LF_OMIT_REFERENCES. TYPE is to determine the formatting of some of
  35. the print messages below. */
  36. extern lf *lf_open
  37. (char *name,
  38. char *real_name,
  39. lf_file_references file_references,
  40. lf_file_type type, const char *program);
  41. extern lf_file_type lf_get_file_type (const lf *file);
  42. extern void lf_close (lf *file);
  43. /* Basic output functions */
  44. extern int lf_write (lf *file, const char *string, int len);
  45. extern int lf_putchr (lf *file, const char ch);
  46. extern int lf_putstr (lf *file, const char *string);
  47. extern int lf_putint (lf *file, int decimal);
  48. extern int lf_putbin (lf *file, int decimal, int width);
  49. extern int lf_printf
  50. (lf *file, const char *fmt, ...) ATTRIBUTE_PRINTF (2, 3);
  51. /* Indentation control.
  52. lf_indent_suppress suppresses indentation on the next line (current
  53. line if that has not yet been started) */
  54. extern void lf_indent_suppress (lf *file);
  55. extern void lf_indent (lf *file, int delta);
  56. /* Print generic text: */
  57. extern int lf_print__gnu_copyleft (lf *file);
  58. extern int lf_print__file_start (lf *file);
  59. extern int lf_print__this_file_is_empty (lf *file, const char *reason);
  60. extern int lf_print__file_finish (lf *file);
  61. extern int lf_print__internal_ref (lf *file);
  62. extern int lf_print__external_ref
  63. (lf *file, int line_nr, const char *file_name);
  64. extern int lf_print__line_ref (lf *file, line_ref *line);
  65. extern int lf_print__ucase_filename (lf *file);
  66. extern int lf_print__function_type
  67. (lf *file,
  68. const char *type, const char *prefix, const char *trailing_space);
  69. typedef int print_function (lf *file);
  70. extern int lf_print__function_type_function
  71. (lf *file,
  72. print_function * print_type,
  73. const char *prefix, const char *trailing_space);