| 1 | /* This file is part of the program psim. |
| 2 | |
| 3 | Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au> |
| 4 | |
| 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 2 of the License, or |
| 8 | (at your option) any later version. |
| 9 | |
| 10 | This program is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | GNU General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU General Public License |
| 16 | along with this program; if not, write to the Free Software |
| 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 18 | |
| 19 | */ |
| 20 | |
| 21 | |
| 22 | /* LF: Line Numbered Output Stream */ |
| 23 | |
| 24 | typedef struct _lf lf; |
| 25 | |
| 26 | |
| 27 | #if !defined (__attribute__) && (!defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)) |
| 28 | #define __attribute__(arg) |
| 29 | #endif |
| 30 | |
| 31 | /* Open the file NAME for writing. REAL_NAME is to be included in any |
| 32 | line number outputs. The output of line number information can be |
| 33 | suppressed with LINE_NUMBERS */ |
| 34 | extern lf *lf_open |
| 35 | (char *name, |
| 36 | char *real_name, |
| 37 | int number_lines); |
| 38 | |
| 39 | extern void lf_close |
| 40 | (lf *file); |
| 41 | |
| 42 | |
| 43 | /* Suppress indentation for the next new line (current if not yet |
| 44 | started) */ |
| 45 | extern void lf_indent_suppress |
| 46 | (lf *file); |
| 47 | |
| 48 | extern void lf_putchr |
| 49 | (lf *file, |
| 50 | const char ch); |
| 51 | |
| 52 | extern void lf_putstr |
| 53 | (lf *file, |
| 54 | const char *string); |
| 55 | |
| 56 | extern void lf_putint |
| 57 | (lf *file, |
| 58 | int decimal); |
| 59 | |
| 60 | extern void lf_printf |
| 61 | (lf *file, |
| 62 | const char *fmt, |
| 63 | ...) __attribute__((format(printf, 2, 3))); |
| 64 | |
| 65 | extern void lf_print_lf_c_line_nr |
| 66 | (lf *file); |
| 67 | |
| 68 | extern void lf_indent |
| 69 | (lf *file, |
| 70 | int delta); |
| 71 | |
| 72 | extern void lf_print_copyleft |
| 73 | (lf *file); |
| 74 | |
| 75 | extern void lf_print_binary |
| 76 | (lf *file, |
| 77 | int decimal, |
| 78 | int width); |
| 79 | |
| 80 | /* it is assumed that each line of code is prefixed by a tab character |
| 81 | that should be suppressed */ |
| 82 | extern void lf_print_c_code |
| 83 | (lf *file, |
| 84 | char *code); |
| 85 | |
| 86 | |
| 87 | extern void lf_print_c_line_nr |
| 88 | (lf *file, |
| 89 | int line_nr, |
| 90 | char *file_name); |