1 /* symbol_table.c: routines for dealing with the TZX "generalised data"
2    symbol table structure
3    Copyright (c) 2007 Philip Kendall
4 
5    $Id: symbol_table.c 2890 2007-05-26 19:31:43Z zubzero $
6 
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 2 of the License, or
10    (at your option) any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License along
18    with this program; if not, write to the Free Software Foundation, Inc.,
19    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 
21    Author contact information:
22 
23    E-mail: philip-fuse@shadowmagic.org.uk
24 
25 */
26 
27 #include <config.h>
28 
29 #include "tape_block.h"
30 
31 libspectrum_dword
libspectrum_tape_generalised_data_symbol_table_symbols_in_block(const libspectrum_tape_generalised_data_symbol_table * table)32 libspectrum_tape_generalised_data_symbol_table_symbols_in_block( const libspectrum_tape_generalised_data_symbol_table *table )
33 {
34   return table->symbols_in_block;
35 }
36 
37 libspectrum_byte
libspectrum_tape_generalised_data_symbol_table_max_pulses(const libspectrum_tape_generalised_data_symbol_table * table)38 libspectrum_tape_generalised_data_symbol_table_max_pulses( const libspectrum_tape_generalised_data_symbol_table *table )
39 {
40   return table->max_pulses;
41 }
42 
43 libspectrum_word
libspectrum_tape_generalised_data_symbol_table_symbols_in_table(const libspectrum_tape_generalised_data_symbol_table * table)44 libspectrum_tape_generalised_data_symbol_table_symbols_in_table( const libspectrum_tape_generalised_data_symbol_table *table )
45 {
46   return table->symbols_in_table;
47 }
48 
49 libspectrum_tape_generalised_data_symbol*
libspectrum_tape_generalised_data_symbol_table_symbol(const libspectrum_tape_generalised_data_symbol_table * table,size_t which)50 libspectrum_tape_generalised_data_symbol_table_symbol( const libspectrum_tape_generalised_data_symbol_table *table, size_t which )
51 {
52   return &table->symbols[ which ];
53 }
54 
55 libspectrum_tape_generalised_data_symbol_edge_type
libspectrum_tape_generalised_data_symbol_type(const libspectrum_tape_generalised_data_symbol * symbol)56 libspectrum_tape_generalised_data_symbol_type( const libspectrum_tape_generalised_data_symbol *symbol )
57 {
58   return symbol->edge_type;
59 }
60 
61 libspectrum_word
libspectrum_tape_generalised_data_symbol_pulse(const libspectrum_tape_generalised_data_symbol * symbol,size_t which)62 libspectrum_tape_generalised_data_symbol_pulse( const libspectrum_tape_generalised_data_symbol *symbol, size_t which )
63 {
64   return symbol->lengths[ which ];
65 }
66 
67