lf.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /* This file is part of the program psim.
  2. Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, see <http://www.gnu.org/licenses/>.
  13. */
  14. /* LF: Line Numbered Output Stream */
  15. #include "ansidecl.h"
  16. typedef struct _lf lf;
  17. typedef enum {
  18. lf_is_h,
  19. lf_is_c,
  20. lf_is_text,
  21. } lf_file_type;
  22. typedef enum {
  23. lf_include_references,
  24. lf_omit_references,
  25. } lf_file_references;
  26. /* Open the file NAME for writing. REAL_NAME is to be included in any
  27. line number outputs. The output of line number information can be
  28. suppressed with LINE_NUMBERS */
  29. extern lf *lf_open
  30. (const char *name,
  31. const char *real_name,
  32. lf_file_references file_references,
  33. lf_file_type type,
  34. const char *program);
  35. extern void lf_close
  36. (lf *file);
  37. /* Basic output functions */
  38. extern int lf_putchr
  39. (lf *file,
  40. const char ch);
  41. extern int lf_putstr
  42. (lf *file,
  43. const char *string);
  44. extern int lf_putint
  45. (lf *file,
  46. int decimal);
  47. extern int lf_putbin
  48. (lf *file,
  49. int decimal,
  50. int width);
  51. extern int lf_printf
  52. (lf *file,
  53. const char *fmt,
  54. ...) ATTRIBUTE_PRINTF_2;
  55. /* Indentation control.
  56. lf_indent_suppress suppresses indentation on the next line (current
  57. line if that has not yet been started) */
  58. extern void lf_indent_suppress
  59. (lf *file);
  60. extern void lf_indent
  61. (lf *file,
  62. int delta);
  63. /* Print generic text: */
  64. extern int lf_print__gnu_copyleft
  65. (lf *file);
  66. extern int lf_print__file_start
  67. (lf *file);
  68. extern int lf_print__this_file_is_empty
  69. (lf *file);
  70. extern int lf_print__file_finish
  71. (lf *file);
  72. extern int lf_print__internal_reference
  73. (lf *file);
  74. extern int lf_print__external_reference
  75. (lf *file,
  76. int line_nr,
  77. const char *file_name);
  78. extern int lf_print__ucase_filename
  79. (lf *file);
  80. /* Tab prefix is suppressed */
  81. extern int lf_print__c_code
  82. (lf *file,
  83. const char *code);
  84. extern int lf_print_function_type
  85. (lf *file,
  86. const char *type,
  87. const char *prefix,
  88. const char *trailing_space);