Class representing a track on a C64 disk.
More...
#include <mkd64/track.h>
Related Functions |
(Note that these are not member functions.)
|
| size_t | Track_objectSize (void) |
| | Get object size for a track.
|
| Track * | Track_init (Track *self, int tracknum, size_t num_sectors) |
| | Initialize a track instance.
|
| void | Track_done (Track *self) |
| | Delete a track instance.
|
| BlockStatus | Track_blockStatus (const Track *self, int sector) |
| | Get the block status of the block in a given sector.
|
| size_t | Track_numSectors (const Track *self) |
| | Get number of sectors on this track.
|
| int | Track_freeSectors (const Track *self, BlockStatus mask) |
| | Get number of free sectors on this track.
|
| int | Track_reserveBlock (Track *self, int sector, IModule *by) |
| | Reserve the block in a given sector.
|
| int | Track_allocateBlock (Track *self, int sector) |
| | Allocate the block in a given sector.
|
| int | Track_allocateFirstFreeFrom (Track *self, int sector, int considerReserved) |
| | Allocate first available block from a given start sector.
|
| Block * | Track_block (const Track *self, int sector) |
| | Get the block object at a given sector number.
|
Detailed Description
Class representing a track on a C64 disk.
Friends And Related Function Documentation
| int Track_allocateBlock |
( |
Track * |
self, |
|
|
int |
sector |
|
) |
| |
|
related |
Allocate the block in a given sector.
ATTENTION: This does not check anything. Make sure you never allocate a block that is currently reserved by some other module. If you need a reserved block, ask for it using block_unReserve()!
- Parameters
-
| self | the track |
| sector | the sector number |
- Returns
- 1 on success, 0 otherwise
| int Track_allocateFirstFreeFrom |
( |
Track * |
self, |
|
|
int |
sector, |
|
|
int |
considerReserved |
|
) |
| |
|
related |
Allocate first available block from a given start sector.
This is a convenience function to find and allocate the next available sector by searching sequentially from a given sector number, mostly useful while implementing a custom IBlockAllocator.
- Parameters
-
| self | the track |
| sector | the number of the sector to try first |
| considerReserved | if 1, try unreserving any reserved but not yet allocated sector. |
- Returns
- the sector number of the newly allocated block, or -1 if no available block was found.
| Block * Track_block |
( |
const Track * |
self, |
|
|
int |
sector |
|
) |
| |
|
related |
Get the block object at a given sector number.
- Parameters
-
| self | the track |
| sector | the sector number |
- Returns
- the block object, or 0 if no block at the given sector number exists
Get the block status of the block in a given sector.
- Parameters
-
| self | the track |
| sector | the sector number |
- Returns
- the block status
| void Track_done |
( |
Track * |
self | ) |
|
|
related |
Delete a track instance.
This frees all memory allocated by this track and the blocks contained in it
- Parameters
-
Get number of free sectors on this track.
- Parameters
-
| self | the track |
| mask | a mask of BlockStatus values to be considered "free" in addition to blocks with the "BS_NONE" status. E.g. specify "BS_RESERVED" here to include reserved blocks, that are not allocated yet. |
- Returns
- the number of free sectors
| Track * Track_init |
( |
Track * |
self, |
|
|
int |
tracknum, |
|
|
size_t |
num_sectors |
|
) |
| |
|
related |
Initialize a track instance.
- Parameters
-
| self | the track |
| tracknum | the number of this track on the disk image |
| num_sectors | the number of sectors to use on this track |
- Returns
- a new track instance
| size_t Track_numSectors |
( |
const Track * |
self | ) |
|
|
related |
Get number of sectors on this track.
- Parameters
-
- Returns
- the number of sectors
| size_t Track_objectSize |
( |
void |
| ) |
|
|
related |
Get object size for a track.
- Returns
- size of a track instance
| int Track_reserveBlock |
( |
Track * |
self, |
|
|
int |
sector, |
|
|
IModule * |
by |
|
) |
| |
|
related |
Reserve the block in a given sector.
- Parameters
-
| self | the track |
| sector | the sector number |
| by | the module reserving the block |
- Returns
- 1 on success, 0 otherwise
The documentation for this class was generated from the following file: