cbmimage
Loading...
Searching...
No Matches
cbmimage.h
Go to the documentation of this file.
1
7#ifndef CBMIMAGE_H
8#define CBMIMAGE_H 1
9
10#include <stddef.h>
11#include <stdint.h>
12
13/* BAM handling */
14
26
27
38
52#define CBMIMAGE_TS_INIT(_track, _sector) \
53 { .track = (_track), .sector = (_sector) }
54
71#define CBMIMAGE_TS_SET(_ts, _track, _sector) \
72 do { (_ts).track = (_track); (_ts).sector = (_sector); } while (0)
73
86#define CBMIMAGE_TS_CLEAR(_ts) \
87 CBMIMAGE_TS_SET((_ts), 0, 0)
88
96typedef uint16_t cbmimage_lba;
97
108
110
127#define CBMIMAGE_BLOCK_INIT(_track, _sector, _lba) \
128 { .lba = (_lba), .ts = CBMIMAGE_TS_INIT((_track), (_sector)) }
129
146#define CBMIMAGE_BLOCK_INIT_FROM_TS(_track, _sector) \
147 CBMIMAGE_BLOCK_INIT((_track), (_sector), 0)
148
163#define CBMIMAGE_BLOCK_INIT_FROM_LBA(_lba) \
164 CBMIMAGE_INIT_BLOCK(0, 0, (_lba))
165
188#define CBMIMAGE_BLOCK_SET_FROM_TS(_image, _block, _track, _sector) \
189 do { \
190 CBMIMAGE_TS_SET((_block).ts, (_track), (_sector)); \
191 cbmimage_blockaddress_init_from_ts((_image), &(_block)); \
192 } while (0)
193
213#define CBMIMAGE_BLOCK_SET_FROM_LBA(_image, _block, _lba) \
214 do { \
215 (_block).lba = (_lba); \
216 cbmimage_blockaddress_init_from_lba((_image), &(_block)); \
217 } while (0)
218
219/* directory handling */
220
225typedef
234
235 DIR_TYPE_PART_OFFSET = 0x100,
236 DIR_TYPE_PART_NO = DIR_TYPE_PART_OFFSET,
237 DIR_TYPE_PART_CMD_NATIVE = DIR_TYPE_PART_OFFSET + 0x01,
238 DIR_TYPE_PART_D64 = DIR_TYPE_PART_OFFSET + 0x02,
239 DIR_TYPE_PART_D71 = DIR_TYPE_PART_OFFSET + 0x03,
240 DIR_TYPE_PART_D81 = DIR_TYPE_PART_OFFSET + 0x04,
241 DIR_TYPE_PART_SYSTEM = DIR_TYPE_PART_OFFSET + 0xFF,
243
267
274typedef
276
279
282
286 const char text[24];
287
289
311
320typedef
322
325
328
332 unsigned int is_locked : 1;
333
338 unsigned int is_closed : 1;
339
341 unsigned int has_datetime : 1;
342
344 unsigned int is_geos : 1;
345
347 unsigned int geos_is_vlir : 1;
348
350 unsigned int is_valid : 1;
351
357
363
366
368 uint16_t block_count;
369
370
372 uint16_t year;
373
375 uint8_t month;
376
378 uint8_t day;
379
381 uint8_t hour;
382
384 uint8_t minute;
385
386
389
392
394
395/* disk image handling */
396
426
427/* disk image handling */
428
431
454
462typedef
463struct cbmimage_loop_s {
464
467
469 void * map;
470
472 size_t map_size;
473
477 uint8_t bufferarray[];
478
480
481
506
507/* FAT handling */
508
519typedef
522 uint16_t lba;
523
525
553
554/* file handling */
555
587
588
629
630
631cbmimage_imagetype cbmimage_image_guesstype (const uint8_t * buffer, size_t size, int * extra_errormap);
633cbmimage_fileimage * cbmimage_image_open (const uint8_t * buffer, size_t size, cbmimage_imagetype);
635void cbmimage_image_readfile (cbmimage_fileimage *, const char * filename);
636void cbmimage_image_writefile (cbmimage_fileimage *, const char * filename);
641
644
649uint16_t cbmimage_get_sectors_in_track (cbmimage_fileimage *, uint16_t track);
650
651int cbmimage_blockaddress_ts_exists (cbmimage_fileimage *, uint8_t track, uint8_t sector);
655int cbmimage_blockaddress_init_from_ts_value (cbmimage_fileimage *, cbmimage_blockaddress * block, uint8_t track, uint8_t sector);
660
661int cbmimage_read_block (cbmimage_fileimage *, cbmimage_blockaddress block, void * buffer, size_t buffersize);
662int cbmimage_write_block (cbmimage_fileimage *, cbmimage_blockaddress block, void * buffer, size_t buffersize);
663
664int cbmimage_read_next_block (cbmimage_fileimage *, cbmimage_blockaddress * block, void * buffer, size_t buffersize);
665
671int cbmimage_blockaccessor_set_to_ts (cbmimage_blockaccessor * accessor, uint8_t track, uint8_t sector);
672int cbmimage_blockaccessor_set_to_lba (cbmimage_blockaccessor * accessor, uint16_t lba);
676
680int cbmimage_bam_get_free_on_track (cbmimage_fileimage * image, uint8_t track);
681
687char * cbmimage_dir_extract_name (cbmimage_dir_header_name *, char * name, size_t len);
692
697
699
700cbmimage_file * cbmimage_file_open_by_name(const char * filename);
703int cbmimage_file_read_next_block(cbmimage_file * file, uint8_t * buffer, size_t buffer_size);
704
709typedef void cbmimage_print_function_type(const char * text);
711
717void cbmimage_fat_dump (cbmimage_fat *, int linear);
719
728uint8_t * cbmimage_chain_get_data (cbmimage_chain * chain);
729
730#endif // #ifndef CBMIMAGE_H
const cbmimage_blockaddress cbmimage_block_unused
Definition of an empty cbmimage_blockaddress.
Definition blockaddress.c:24
struct cbmimage_file_s cbmimage_file
file handling data
int cbmimage_blockaddress_ts_exists(cbmimage_fileimage *, uint8_t track, uint8_t sector)
check if T/S is valid
Definition blockaddress.c:44
int cbmimage_blockaddress_lba_exists(cbmimage_fileimage *, uint16_t lba)
check if LBA is valid
Definition blockaddress.c:77
void cbmimage_print_function_type(const char *text)
Type for a print() style callback.
Definition cbmimage.h:709
int cbmimage_write_block(cbmimage_fileimage *, cbmimage_blockaddress block, void *buffer, size_t buffersize)
write a block to the image by copying it from the provided buffer
Definition readwriteblock.c:212
int cbmimage_read_next_block(cbmimage_fileimage *, cbmimage_blockaddress *block, void *buffer, size_t buffersize)
read the next block from the image and copy it into the provided buffer
Definition readwriteblock.c:281
int cbmimage_read_block(cbmimage_fileimage *, cbmimage_blockaddress block, void *buffer, size_t buffersize)
read a block from the image and copy it into the provided buffer
Definition readwriteblock.c:150
struct cbmimage_blockaddress_s cbmimage_blockaddress
Address on drive.
int cbmimage_blockaddress_advance(cbmimage_fileimage *, cbmimage_blockaddress *block)
advance a block address, going to the next block
Definition blockaddress.c:456
int cbmimage_blockaddress_init_from_lba_value(cbmimage_fileimage *, cbmimage_blockaddress *block, uint16_t lba)
initialize a block address when LBA is given
Definition blockaddress.c:342
struct cbmimage_track_sector_s cbmimage_track_sector
Address on floppy: Track/Sector variant.
int cbmimage_blockaddress_add(cbmimage_fileimage *, cbmimage_blockaddress *blockresult, cbmimage_blockaddress block_adder)
add two block address together
Definition blockaddress.c:522
uint16_t cbmimage_lba
Address on floppy: LBA variant.
Definition cbmimage.h:96
int cbmimage_blockaddress_init_from_ts(cbmimage_fileimage *, cbmimage_blockaddress *block)
initialize a block address from its T/S specification
Definition blockaddress.c:159
int cbmimage_blockaddress_advance_in_track(cbmimage_fileimage *, cbmimage_blockaddress *block)
advance a block address, going to the next block in the same track
Definition blockaddress.c:488
int cbmimage_blockaddress_init_from_ts_value(cbmimage_fileimage *, cbmimage_blockaddress *block, uint8_t track, uint8_t sector)
initialize a block address when T/S are given
Definition blockaddress.c:303
int cbmimage_blockaddress_init_from_lba(cbmimage_fileimage *, cbmimage_blockaddress *block)
initialize a block address from its T/S specification
Definition blockaddress.c:256
int cbmimage_get_blocks_free(cbmimage_fileimage *)
get the count of blocks free
Definition bam.c:548
int cbmimage_bam_check_consistency(cbmimage_fileimage *)
check the consistency of a BAM
Definition bam.c:501
cbmimage_BAM_state_e
state of the BAM
Definition cbmimage.h:19
int cbmimage_bam_get_free_on_track(cbmimage_fileimage *image, uint8_t track)
get the blocks free on a specific track
Definition bam.c:588
enum cbmimage_BAM_state_e cbmimage_BAM_state
state of the BAM
cbmimage_BAM_state cbmimage_bam_get(cbmimage_fileimage *, cbmimage_blockaddress block)
get the unused/used state of a block in the BAM
Definition bam.c:454
@ BAM_FREE
BAM state of block is "free", but the block contains some data.
Definition cbmimage.h:22
@ BAM_REALLY_FREE
BAM state of block is "free", and the block does not contain any data.
Definition cbmimage.h:21
@ BAM_DOES_NOT_EXIST
the block does not exist
Definition cbmimage.h:24
@ BAM_UNKNOWN
BAM state of block is unknown.
Definition cbmimage.h:20
@ BAM_USED
BAM state of block is "used".
Definition cbmimage.h:23
int cbmimage_blockaccessor_get_next_block(cbmimage_blockaccessor *accessor, cbmimage_blockaddress *block_next)
get the next block of this accessor if we follow the chain
Definition blockaccessor.c:312
int cbmimage_blockaccessor_set_to_ts(cbmimage_blockaccessor *accessor, uint8_t track, uint8_t sector)
set a block accessor for a specific T/S
Definition blockaccessor.c:204
int cbmimage_blockaccessor_set_to_lba(cbmimage_blockaccessor *accessor, uint16_t lba)
set a block accessor for a specific LBA
Definition blockaccessor.c:234
int cbmimage_blockaccessor_set_to(cbmimage_blockaccessor *accessor, cbmimage_blockaddress block)
set a block accessor for a specific block
Definition blockaccessor.c:160
cbmimage_blockaccessor * cbmimage_blockaccessor_create_from_lba(cbmimage_fileimage *image, uint16_t lba)
create a block accessor for a specific LBA
Definition blockaccessor.c:114
cbmimage_blockaccessor * cbmimage_blockaccessor_create_from_ts(cbmimage_fileimage *image, uint8_t track, uint8_t sector)
create a block accessor for a specific T/S
Definition blockaccessor.c:80
int cbmimage_blockaccessor_follow(cbmimage_blockaccessor *accessor)
follow the block chain of a block accessor to the next block
Definition blockaccessor.c:363
struct cbmimage_blockaccessor_s cbmimage_blockaccessor
cbmimage block accessor data structure
cbmimage_blockaccessor * cbmimage_blockaccessor_create(cbmimage_fileimage *image, cbmimage_blockaddress block)
create a block accessor for a specific block
Definition blockaccessor.c:39
void cbmimage_blockaccessor_close(cbmimage_blockaccessor *accessor)
close a block accessor, freeing its resources
Definition blockaccessor.c:137
int cbmimage_blockaccessor_advance(cbmimage_blockaccessor *accessor)
advance a block accessor to the next block
Definition blockaccessor.c:269
int cbmimage_print_set_function(cbmimage_print_function_type print_function)
set the callback for output from the library
Definition cbprint.c:31
cbmimage_chain * cbmimage_chain_start(cbmimage_fileimage *, cbmimage_blockaddress)
start the chain processing for a file chain
Definition chain.c:77
void cbmimage_chain_close(cbmimage_chain *chain)
close the chain structure
Definition chain.c:116
struct cbmimage_chain_s cbmimage_chain
type to describe a chain that is followed
int cbmimage_chain_is_loop(cbmimage_chain *chain)
check if this chain has fallen into a loop
Definition chain.c:222
int cbmimage_chain_is_done(cbmimage_chain *chain)
check if this chain has been processed competely
Definition chain.c:201
int cbmimage_chain_advance(cbmimage_chain *chain)
advance to the next block of this chain
Definition chain.c:149
uint8_t * cbmimage_chain_get_data(cbmimage_chain *chain)
get a pointer to the data of the current block in this chain
Definition chain.c:286
cbmimage_blockaddress cbmimage_chain_get_next(cbmimage_chain *chain)
get the address of the next block in this chain
Definition chain.c:263
int cbmimage_chain_last_result(cbmimage_chain *chain)
check if this chain has been processed competely
Definition chain.c:180
cbmimage_blockaddress cbmimage_chain_get_current(cbmimage_chain *chain)
get the address of the current block in this chain
Definition chain.c:242
char * cbmimage_dir_extract_name(cbmimage_dir_header_name *, char *name, size_t len)
extract the name of a directory entry as a C string
Definition dir.c:515
int cbmimage_dir_chdir(cbmimage_dir_entry *)
perform a chdir to a partition marked by a directory entry
Definition dir.c:591
void cbmimage_dir_get_header_close(cbmimage_dir_header *)
free the resources from a cbmimage_dir_get_header()
Definition dir.c:69
cbmimage_dir_header * cbmimage_dir_get_header(cbmimage_fileimage *)
get the header entry
Definition dir.c:31
cbmimage_dir_entry * cbmimage_dir_get_first(cbmimage_fileimage *)
get the first (non-empty) directory entry
Definition dir.c:354
void cbmimage_dir_get_close(cbmimage_dir_entry *)
free the resources from a cbmimage_dir_get_first()
Definition dir.c:449
enum cbmimage_geos_filetype_e cbmimage_geos_filetype
The GEOS type of a directory entry cbmimage_dir_entry_s.
int cbmimage_dir_get_next(cbmimage_dir_entry *)
get the next (non-empty) directory entry
Definition dir.c:399
enum cbmimage_dir_type_e cbmimage_dir_type
The type of a directory entry cbmimage_dir_entry_s.
int cbmimage_dir_chdir_close(cbmimage_fileimage *)
"close a chdir"; that is, go back to the parent directory
Definition dir.c:645
int cbmimage_dir_is_deleted(cbmimage_dir_entry *)
check if the directory entry points to a deleted file
Definition dir.c:483
struct cbmimage_dir_header_s cbmimage_dir_header
A directory header.
struct cbmimage_dir_header_name_s cbmimage_dir_header_name
The name of a directory header or directory entry.
int cbmimage_dir_get_is_valid(cbmimage_dir_entry *)
get the next (non-empty) directory entry
Definition dir.c:429
cbmimage_geos_filetype_e
The GEOS type of a directory entry cbmimage_dir_entry_s.
Definition cbmimage.h:250
cbmimage_dir_type_e
The type of a directory entry cbmimage_dir_entry_s.
Definition cbmimage.h:226
struct cbmimage_dir_entry_s cbmimage_dir_entry
A directory entry.
@ GEOS_FILETYPE_APPLICATION
a file for a GEOS application
Definition cbmimage.h:257
@ GEOS_FILETYPE_APPLICATION_DATA
some user-created document from a GEOS application or desk accessory
Definition cbmimage.h:258
@ GEOS_FILETYPE_ASSEMBLER
an assembler file
Definition cbmimage.h:253
@ GEOS_FILETYPE_DATA_FILE
a data file
Definition cbmimage.h:254
@ GEOS_FILETYPE_SYSTEM_FILE
a system file
Definition cbmimage.h:255
@ GEOS_FILETYPE_PRINTER_DRIVER
a GEOS printer driver
Definition cbmimage.h:260
@ GEOS_FILETYPE_BASIC
a BASIC file
Definition cbmimage.h:252
@ GEOS_FILETYPE_TEMPORARY
a GEOS temporary file. Will be deleted on termination of the program
Definition cbmimage.h:264
@ GEOS_FILETYPE_FONT_FILE
a GEOS font
Definition cbmimage.h:259
@ GEOS_FILETYPE_DESK_ACCESSORY
a file for a GEOS desk accessory
Definition cbmimage.h:256
@ GEOS_FILETYPE_INPUT_DRIVER
a GEOS input driver
Definition cbmimage.h:261
@ GEOS_FILETYPE_AUTO_EXECUTE_FILE
a GEOS auto-execute file
Definition cbmimage.h:265
@ GEOS_FILETYPE_SYSTEM_BOOT_FILE
a GEOS system boot file
Definition cbmimage.h:263
@ GEOS_FILETYPE_NON_GEOS
no GEOS file
Definition cbmimage.h:251
@ GEOS_FILETYPE_DISK_DRIVER
a GEOS disk driver or disk device
Definition cbmimage.h:262
@ DIR_TYPE_SEQ
this directory entry is for a SEQuential file
Definition cbmimage.h:228
@ DIR_TYPE_REL
this directory entry is for a RELative file
Definition cbmimage.h:231
@ DIR_TYPE_PART1581
this directory entry is for a 1581 style partition file (D81, D1M, D2M, D4M only)
Definition cbmimage.h:232
@ DIR_TYPE_DEL
this directory entry is for a file that is deleted
Definition cbmimage.h:227
@ DIR_TYPE_USR
this directory entry is for a USeR file
Definition cbmimage.h:230
@ DIR_TYPE_CMD_NATIVE
this directory entry is for a CMD NATive partition (D1M, D2M, D4M only)
Definition cbmimage.h:233
@ DIR_TYPE_PRG
this directory entry is for a PRogRamm file
Definition cbmimage.h:229
void cbmimage_fat_close(cbmimage_fat *)
close a FAT structure
Definition fat.c:66
int cbmimage_fat_clear(cbmimage_fat *, cbmimage_blockaddress block)
set a block in the FAT to unused
Definition fat.c:174
int cbmimage_fat_is_used(cbmimage_fat *, cbmimage_blockaddress block)
check if a block in the FAT is marked as used
Definition fat.c:273
struct cbmimage_fat_entry_s cbmimage_fat_entry
cbmimage One entry of the FAT structure
cbmimage_fat * cbmimage_fat_create(cbmimage_fileimage *image)
create a FAT structure
Definition fat.c:37
void cbmimage_fat_dump(cbmimage_fat *, int linear)
dump a FAT structure
Definition fat.c:294
int cbmimage_fat_set(cbmimage_fat *, cbmimage_blockaddress block, cbmimage_blockaddress target)
set a block in the FAT to a target in the FAT
Definition fat.c:137
cbmimage_blockaddress cbmimage_fat_get(cbmimage_fat *, cbmimage_blockaddress block)
get the target of a block in the FAT
Definition fat.c:233
struct cbmimage_fat_s cbmimage_fat
cbmimage FAT structure
cbmimage_file * cbmimage_file_open_by_dir_entry(cbmimage_dir_entry *dir_entry)
open a file on the cbmimage that has already een enumerated
Definition file.c:61
cbmimage_file * cbmimage_file_open_by_name(const char *filename)
open a file on the cbmimage where the name is known
Definition file.c:33
int cbmimage_file_read_next_block(cbmimage_file *file, uint8_t *buffer, size_t buffer_size)
read a block from the file
Definition file.c:151
void cbmimage_file_close(cbmimage_file *file)
close a file
Definition file.c:113
uint16_t cbmimage_get_max_track(cbmimage_fileimage *)
get the maximum tracks of the image
Definition getters.c:135
uint16_t cbmimage_get_max_sectors(cbmimage_fileimage *)
get the maximum sectors on a track of the image
Definition getters.c:165
void cbmimage_image_fat_dump(cbmimage_fileimage *, int linear)
dump a FAT structure of the image
Definition fileimage.c:500
void cbmimage_image_readfile(cbmimage_fileimage *, const char *filename)
read a file and store it in a given CBM image
Definition fileimage.c:411
cbmimage_fileimage * cbmimage_image_openfile(const char *filename, cbmimage_imagetype)
open a CBM image from a file
Definition fileimage.c:372
struct cbmimage_fileimage_s cbmimage_fileimage
Type that describes a CBM disk image on which to operate.
const char * cbmimage_get_imagetype_name(cbmimage_fileimage *)
get the image type as string
Definition getters.c:83
cbmimage_imagetype cbmimage_image_guesstype(const uint8_t *buffer, size_t size, int *extra_errormap)
Definition fileimage.c:278
size_t cbmimage_image_get_raw_size(cbmimage_fileimage *)
get the size of the raw image contents
Definition getters.c:56
cbmimage_fileimage * cbmimage_image_open(const uint8_t *buffer, size_t size, cbmimage_imagetype)
open an in-memory CBM image
Definition fileimage.c:345
const char * cbmimage_get_filename(cbmimage_fileimage *)
get the file name of the image
Definition getters.c:107
uint16_t cbmimage_get_max_lba(cbmimage_fileimage *)
get the maximum LBA of the image
Definition getters.c:183
uint16_t cbmimage_get_sectors_in_track(cbmimage_fileimage *, uint16_t track)
get the number of sectors on a specific track of the image
Definition getters.c:248
enum cbmimage_imagetype_e cbmimage_imagetype
The type of the libcbmimage image.
void cbmimage_image_close(cbmimage_fileimage *)
close a CBM image
Definition fileimage.c:470
void cbmimage_image_writefile(cbmimage_fileimage *, const char *filename)
write the CBM image to a file
Definition fileimage.c:440
const void * cbmimage_image_get_raw(cbmimage_fileimage *)
get a pointer to the raw image contents
Definition getters.c:30
uint16_t cbmimage_get_bytes_in_block(cbmimage_fileimage *)
get the number of blocks in a block of the image
Definition getters.c:214
cbmimage_imagetype cbmimage_image_file_guesstype(const char *filename)
Definition fileimage.c:313
cbmimage_imagetype_e
The type of the libcbmimage image.
Definition cbmimage.h:404
@ TYPE_D81
1581 3,5" file format
Definition cbmimage.h:414
@ TYPE_CMD_D4M
CMD FD4000 3,2 MB file format.
Definition cbmimage.h:422
@ TYPE_D71
1571 5,25" DS file format
Definition cbmimage.h:413
@ TYPE_D64_42TRACK
1541 5,25" SS file format with 42 tracks
Definition cbmimage.h:412
@ TYPE_UNKNOWN
the image type is unknown. In this case, libcbmimage tries to determine the type itself.
Definition cbmimage.h:405
@ TYPE_D64_40TRACK_PROLOGIC
1541 5,25" SS file format with 40 tracks, Prologic DOS variant
Definition cbmimage.h:411
@ TYPE_D64
2031/1540/1541/1570 5,25" SS file format
Definition cbmimage.h:407
@ TYPE_D64_40TRACK_SPEEDDOS
1541 5,25" SS file format with 40 tracks, SPEED DOS variant
Definition cbmimage.h:409
@ TYPE_D82
8250 5,25" DS file format
Definition cbmimage.h:416
@ TYPE_D64_40TRACK_DOLPHIN
1541 5,25" SS file format with 40 tracks, Dolphin DOS variant
Definition cbmimage.h:410
@ TYPE_D80
8050 5,25" SS file format
Definition cbmimage.h:415
@ TYPE_LAST
not a type, just an end marker
Definition cbmimage.h:424
@ TYPE_CMD_D2M
CMD FD2000/FD4000 1,6 MB file format.
Definition cbmimage.h:421
@ TYPE_CMD_D1M
CMD FD2000/FD4000 800 KB file format.
Definition cbmimage.h:420
@ TYPE_D64_40TRACK
1541 5,25" SS file format with 40 tracks
Definition cbmimage.h:408
@ TYPE_D40
2040/3040 5,25" SS format (similar to D64, but 20 sectors on track 18-24)
Definition cbmimage.h:406
@ TYPE_CMD_NATIVE
CMD Native Partition file format.
Definition cbmimage.h:423
struct cbmimage_loop_s cbmimage_loop
cbmimage loop detector struct
int cbmimage_loop_check(cbmimage_loop *, cbmimage_blockaddress block)
check if a block is marked as used/visited
Definition loop.c:136
cbmimage_loop * cbmimage_loop_create(cbmimage_fileimage *)
create a loop detector data structure
Definition loop.c:28
void cbmimage_loop_close(cbmimage_loop *)
free a loop detector data structure
Definition loop.c:60
int cbmimage_loop_mark(cbmimage_loop *, cbmimage_blockaddress block)
mark a block as used/visited
Definition loop.c:84
int cbmimage_validate(cbmimage_fileimage *)
validate the disk (and the bam)
Definition validate.c:916
cbmimage block accessor data structure
Definition cbmimage.h:494
cbmimage_blockaddress block
the (current) block address of the block of this accessor
Definition cbmimage.h:500
uint8_t * data
pointer to the data buffer where the block resides
Definition cbmimage.h:503
cbmimage_fileimage * image
the image which this accessor handles
Definition cbmimage.h:497
Address on drive.
Definition cbmimage.h:104
cbmimage_lba lba
LBA style address.
Definition cbmimage.h:106
cbmimage_track_sector ts
Track/Sector style address.
Definition cbmimage.h:105
type to describe a chain that is followed
Definition cbmimage.h:560
cbmimage_blockaddress block_start
Definition cbmimage.h:568
cbmimage_fileimage * image
Definition cbmimage.h:562
unsigned int is_loop
Definition cbmimage.h:576
cbmimage_loop * loop_detector
Definition cbmimage.h:580
cbmimage_blockaccessor * block_accessor
Definition cbmimage.h:584
unsigned int is_done
Definition cbmimage.h:572
A directory entry.
Definition cbmimage.h:321
uint16_t rel_recordlength
if type is DIR_TYPE_REL, this is the record length of the REL file
Definition cbmimage.h:365
cbmimage_blockaddress rel_sidesector_block
Definition cbmimage.h:362
cbmimage_blockaddress start_block
Definition cbmimage.h:356
cbmimage_blockaddress geos_infoblock
if is_geos is 1, this contains a pointer to the GEOS infoblock
Definition cbmimage.h:388
cbmimage_dir_type type
type of this directory entry (DEL, SRQ, PRG, USR, REL, ...)
Definition cbmimage.h:327
uint16_t year
if has_datetime is 1, the year of the file creation or last modification.
Definition cbmimage.h:372
unsigned int geos_is_vlir
if is_geos and this is set to 1, this is a GEOS VLIR file
Definition cbmimage.h:347
unsigned int is_valid
if the directory entry is valid, this is 1
Definition cbmimage.h:350
cbmimage_geos_filetype geos_filetype
if is_geos is 1, this is the GEOS filtype
Definition cbmimage.h:391
uint8_t hour
if has_datetime is 1, the hour of the file creation or last modification.
Definition cbmimage.h:381
uint16_t block_count
the count of occupied blocks on disk
Definition cbmimage.h:368
uint8_t minute
if has_datetime is 1, the minute of the file creation or last modification.
Definition cbmimage.h:384
cbmimage_dir_header_name name
the name of the image with some extra info
Definition cbmimage.h:324
unsigned int is_locked
Definition cbmimage.h:332
uint8_t day
if has_datetime is 1, the day of the file creation or last modification.
Definition cbmimage.h:378
unsigned int is_geos
if set to 1, this is a GEOS file
Definition cbmimage.h:344
uint8_t month
if has_datetime is 1, the month of the file creation or last modification.
Definition cbmimage.h:375
unsigned int is_closed
Definition cbmimage.h:338
unsigned int has_datetime
if set to 1, this file has valid year, month, day, hour and minute entries
Definition cbmimage.h:341
The name of a directory header or directory entry.
Definition cbmimage.h:275
const char text[24]
Definition cbmimage.h:286
int length
Definition cbmimage.h:281
int end_index
Definition cbmimage.h:278
A directory header.
Definition cbmimage.h:299
unsigned int is_geos
if set to 1, this is a GEOS file
Definition cbmimage.h:308
uint16_t free_block_count
the count of free blocks on this image
Definition cbmimage.h:305
cbmimage_dir_header_name name
the name of the image with some extra info
Definition cbmimage.h:302
cbmimage One entry of the FAT structure
Definition cbmimage.h:520
uint16_t lba
the LBA of where the next block resides
Definition cbmimage.h:522
cbmimage FAT structure
Definition cbmimage.h:536
cbmimage_fat_entry * entry
the FAT entries for each LBA block inside of this image.
Definition cbmimage.h:539
cbmimage_fileimage * image
the image data
Definition cbmimage.h:542
size_t elements
the number of elements in this FAT
Definition cbmimage.h:545
uint8_t bufferarray[]
Definition cbmimage.h:550
file handling data
Definition cbmimage.h:597
uint16_t block_current_remain
remaining byte in the current block that are still unread
Definition cbmimage.h:615
uint16_t block_current_offset
offset as read pointer into the current block
Definition cbmimage.h:612
cbmimage_loop * loop_detector
loop detector
Definition cbmimage.h:606
cbmimage_fileimage * image
the fileimage to which this file belongs
Definition cbmimage.h:600
uint16_t bytes_in_block
the number of bytes in a block
Definition cbmimage.h:618
int error
!= 0 if an error occurred
Definition cbmimage.h:621
cbmimage_dir_entry * dir_entry
a directory entry which described this file
Definition cbmimage.h:603
uint8_t bufferarray[]
Definition cbmimage.h:626
cbmimage_chain * chain
the file chain that follows this file
Definition cbmimage.h:609
Type that describes a CBM disk image on which to operate.
Definition cbmimage.h:437
struct cbmimage_image_settings_s * global_settings
internal information: the settings of the image itself (w/o subdirs)
Definition cbmimage.h:443
struct cbmimage_image_settings_s * settings
internal information; do not change or access
Definition cbmimage.h:440
uint8_t bufferarray[]
Definition cbmimage.h:451
struct cbmimage_image_parameter_s * parameter
internal parameter of this image
Definition cbmimage.h:446
Parameter of the image .
Definition internal.h:787
Image specific settings for all types of images .
Definition internal.h:635
cbmimage loop detector struct
Definition cbmimage.h:463
size_t map_size
Definition cbmimage.h:472
cbmimage_fileimage * image
the fileimage to which this loop detector belongs
Definition cbmimage.h:466
uint8_t bufferarray[]
Definition cbmimage.h:477
void * map
Definition cbmimage.h:469
Address on floppy: Track/Sector variant.
Definition cbmimage.h:34
uint8_t track
the track of the block; if track is 0, this T/S is invalid
Definition cbmimage.h:35
uint8_t sector
the sector of the block
Definition cbmimage.h:36