| 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 | /* load a table into memory */ |
| 23 | |
| 24 | typedef struct _table table; |
| 25 | |
| 26 | typedef struct _table_model_entry table_model_entry; |
| 27 | struct _table_model_entry { |
| 28 | table_model_entry *next; |
| 29 | int line_nr; |
| 30 | int nr_fields; |
| 31 | char *fields[0]; /* User defined */ |
| 32 | }; |
| 33 | |
| 34 | typedef struct _table_assembler_entry table_assembler_entry; |
| 35 | struct _table_assembler_entry { |
| 36 | const char *format; |
| 37 | const char *condition; |
| 38 | const char *file_name; |
| 39 | int line_nr; |
| 40 | table_assembler_entry *next; |
| 41 | }; |
| 42 | |
| 43 | typedef struct _table_entry table_entry; |
| 44 | struct _table_entry { |
| 45 | int line_nr; |
| 46 | int nr_fields; |
| 47 | char *file_name; |
| 48 | table_assembler_entry *assembler; |
| 49 | table_model_entry *model_first; |
| 50 | table_model_entry *model_last; |
| 51 | char *annex; |
| 52 | char *fields[0]; /* User defined */ |
| 53 | }; |
| 54 | |
| 55 | |
| 56 | extern table *table_open |
| 57 | (const char *file_name, |
| 58 | int max_nr_fields, |
| 59 | int max_nr_model_fields); |
| 60 | |
| 61 | extern table_entry *table_entry_read |
| 62 | (table *file); |
| 63 | |
| 64 | extern void dump_table_entry |
| 65 | (table_entry *entry, |
| 66 | int indent); |
| 67 | |
| 68 | extern void table_entry_print_cpp_line_nr |
| 69 | (lf *file, |
| 70 | table_entry *entry); |