# tape_accessors.txt: simple accessors for libspectrum_tape_block
# Copyright (c) 2003 Philip Kendall

# $Id: tape_accessors.txt,v 1.3 2003/07/17 14:01:26 pak21 Exp $

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 49 Temple Place, Suite 330, Boston, MA 02111-1307 USA

# Author contact information:

# E-mail: pak21-fuse@srcf.ucam.org
# Postal address: 15 Crescent Road, Wokingham, Berks, RG40 2DB, England

# FILE FORMAT
#
# Each stanza defines one function. First line is overall information
# about the function:
#
# return_type		name			indexed	default
#
# will create a function
#
# 'return_type' libspectrum_tape_block_'name'( libspectrum_tape_block *block )
#
# After that, each indented line specifies which values to return for
# each block type:
#
#	block type	member_name
#
# will cause the function to return block->types.'type'.'member_name'
# if passed a 'type' block. 'member_name' defaults to 'name' if not
# specified.
#
# If the block is not of the types listed, 'default' will be returned,
# and an error reported via 'libspectrum_print_error()'.
#
# Finally, if 'indexed' is non-zero, the function will take an extra
# parameter 'index' of type size_t and will return
# block->types.'type'.'member_name'[ index ] instead.

libspectrum_dword	bit_length		0	-1
	raw_data

libspectrum_dword	bit0_length		0	-1
	pure_data
	turbo

libspectrum_dword	bit1_length		0	-1
	pure_data
	turbo

size_t			bits_in_last_byte	0	-1
	pure_data
	raw_data
	turbo

size_t			count			0	-1
	pure_tone	pulses
	pulses
	loop_start
	select
	archive_info
	hardware

libspectrum_byte*	data			0	NULL
	custom
	pure_data
	raw_data
	rom
	turbo

size_t			data_length		0	-1
       custom		length
       pure_data	length
       raw_data		length
       rom		length
       turbo		length

int			ids			1	-1
	archive_info
	hardware

int			offset			0	0
	jump

int			offsets			1	0
	select

libspectrum_dword	pause			0	-1
	message		time
	pause		length
	pure_data
	raw_data
	rom
	turbo

libspectrum_dword	pilot_length		0	-1
	turbo

size_t			pilot_pulses		0	-1
	turbo

libspectrum_dword	pulse_length		0	-1
	pure_tone	length

libspectrum_dword	pulse_lengths		1	-1
	pulses		lengths

libspectrum_tape_state_type	state		0	LIBSPECTRUM_TAPE_STATE_INVALID
	pure_data
	raw_data
	rom
	turbo

libspectrum_dword	sync1_length		0	-1
	turbo

libspectrum_dword	sync2_length		0	-1
	turbo

libspectrum_byte*	text			0	NULL
	group_start	name
	comment
	message
	custom		description

libspectrum_byte*	texts			1	NULL
	archive_info	strings
	select		descriptions

int			types			1	-1
	hardware

int			values			1	-1
	hardware
