|
cbmimage
|
Classes | |
| struct | cbmimage_fileimage_s |
| Type that describes a CBM disk image on which to operate. More... | |
| struct | cbmimage_i_d40_d64_d71_image_settings_s |
| Image specific settings for D40, D64 and D71 images . More... | |
| struct | cbmimage_i_d81_image_settings_s |
| Image specific settings for D81 images . More... | |
| struct | cbmimage_i_d80_d82_image_settings_s |
| Image specific settings for D80 and D82 images . More... | |
| struct | cbmimage_i_d1m_d2m_d4m_image_settings_s |
| Image specific settings for CMD D1M, D2M and D4M images . More... | |
| struct | cbmimage_i_dnp_image_settings_s |
| Image specific settings for CMD DNP images . More... | |
| struct | cbmimage_image_settings_s |
| Image specific settings for all types of images . More... | |
| struct | cbmimage_image_parameter_s |
| Parameter of the image . More... | |
Typedefs | |
| typedef enum cbmimage_imagetype_e | cbmimage_imagetype |
| The type of the libcbmimage image. | |
| typedef struct cbmimage_fileimage_s | cbmimage_fileimage |
| Type that describes a CBM disk image on which to operate. | |
| typedef struct cbmimage_i_d40_d64_d71_image_settings_s | cbmimage_i_d40_d64_d71_image_settings |
| Image specific settings for D40, D64 and D71 images . | |
| typedef struct cbmimage_i_d81_image_settings_s | cbmimage_i_d81_image_settings |
| Image specific settings for D81 images . | |
| typedef struct cbmimage_i_d80_d82_image_settings_s | cbmimage_i_d80_d82_image_settings |
| Image specific settings for D80 and D82 images . | |
| typedef struct cbmimage_i_d1m_d2m_d4m_image_settings_s | cbmimage_i_d1m_d2m_d4m_image_settings |
| Image specific settings for CMD D1M, D2M and D4M images . | |
| typedef struct cbmimage_i_dnp_image_settings_s | cbmimage_i_dnp_image_settings |
| Image specific settings for CMD DNP images . | |
| typedef struct cbmimage_image_settings_s | cbmimage_image_settings |
| Image specific settings for all types of images . | |
| typedef struct cbmimage_image_parameter_s | cbmimage_image_parameter |
| Parameter of the image . | |
Enumerations | |
| enum | cbmimage_imagetype_e { TYPE_UNKNOWN , TYPE_D40 , TYPE_D64 , TYPE_D64_40TRACK , TYPE_D64_40TRACK_SPEEDDOS , TYPE_D64_40TRACK_DOLPHIN , TYPE_D64_40TRACK_PROLOGIC , TYPE_D64_42TRACK , TYPE_D71 , TYPE_D81 , TYPE_D80 , TYPE_D82 , TYPE_CMD_D1M , TYPE_CMD_D2M , TYPE_CMD_D4M , TYPE_CMD_NATIVE , TYPE_LAST } |
| The type of the libcbmimage image. More... | |
Functions | |
| void | cbmimage_i_create_last_block (cbmimage_fileimage *image) |
| static cbmimage_fileimage * | cbmimage_i_fileimage_create (const uint8_t *buffer, size_t size, const char *filename, cbmimage_imagetype imagetype_hint) |
| cbmimage_imagetype | cbmimage_image_guesstype (const uint8_t *buffer, size_t size, int *extra_errormap) |
| cbmimage_imagetype | cbmimage_image_file_guesstype (const char *filename) |
| cbmimage_fileimage * | cbmimage_image_open (const uint8_t *buffer, size_t size, cbmimage_imagetype imagetype_hint) |
| open an in-memory CBM image | |
| cbmimage_fileimage * | cbmimage_image_openfile (const char *filename, cbmimage_imagetype imagetype_hint) |
| open a CBM image from a file | |
| void | cbmimage_image_readfile (cbmimage_fileimage *image, const char *filename) |
| read a file and store it in a given CBM image | |
| void | cbmimage_image_writefile (cbmimage_fileimage *image, const char *filename) |
| write the CBM image to a file | |
| void | cbmimage_image_close (cbmimage_fileimage *image) |
| close a CBM image | |
| void | cbmimage_image_fat_dump (cbmimage_fileimage *image, int trackformat) |
| dump a FAT structure of the image | |
| const void * | cbmimage_image_get_raw (cbmimage_fileimage *image) |
| get a pointer to the raw image contents | |
| size_t | cbmimage_image_get_raw_size (cbmimage_fileimage *image) |
| get the size of the raw image contents | |
| const char * | cbmimage_get_imagetype_name (cbmimage_fileimage *image) |
| get the image type as string | |
| const char * | cbmimage_get_filename (cbmimage_fileimage *image) |
| get the file name of the image | |
| uint16_t | cbmimage_get_max_track (cbmimage_fileimage *image) |
| get the maximum tracks of the image | |
| uint16_t | cbmimage_get_max_sectors (cbmimage_fileimage *image) |
| get the maximum sectors on a track of the image | |
| uint16_t | cbmimage_get_max_lba (cbmimage_fileimage *image) |
| get the maximum LBA of the image | |
| uint16_t | cbmimage_get_bytes_in_block (cbmimage_fileimage *image) |
| get the number of blocks in a block of the image | |
| uint16_t | cbmimage_get_sectors_in_track (cbmimage_fileimage *image, uint16_t track) |
| get the number of sectors on a specific track of the image | |
Image specific settings for CMD D1M, D2M and D4M images .
this type contains data that is specific to the D1M, D2M or D4M images
Image specific settings for D40, D64 and D71 images .
this type contains data that is specific to the D64, D71 and D40 images (which are almost identical)
The main contents are sectors_in_track and track_lba_start. Because these images contain different number of sectors on a track, it is easier to handle it via these arrays instead of calculating it every time it is needed
Image specific settings for D80 and D82 images .
this type contains data that is specific to the D80 and D82 images (which are almost identical)
The main contents are sectors_in_track and track_lba_start. Because these images contain different number of sectors on a track, it is easier to handle it via these arrays instead of calculating it every time it is needed
| typedef struct cbmimage_i_d81_image_settings_s cbmimage_i_d81_image_settings |
Image specific settings for D81 images .
this type contains data that is specific to the D81 images
| typedef struct cbmimage_i_dnp_image_settings_s cbmimage_i_dnp_image_settings |
Image specific settings for CMD DNP images .
this type contains data that is specific to the DNP images
| typedef struct cbmimage_image_parameter_s cbmimage_image_parameter |
Parameter of the image .
this type contains data that is specific to the image at hand.
It is an own type, so the user cannot accidentially access it.
This type is subject to change and not part of the API.
| typedef struct cbmimage_image_settings_s cbmimage_image_settings |
Image specific settings for all types of images .
this type contains data that is specific to each image type, but that is needed from all types.
This type is subject to change and not part of the API.
| typedef enum cbmimage_imagetype_e cbmimage_imagetype |
The type of the libcbmimage image.
libcbmimage can handle different types of disk images. This enum contains all the type the libcbmimage can process.
| enum cbmimage_imagetype_e |
The type of the libcbmimage image.
libcbmimage can handle different types of disk images. This enum contains all the type the libcbmimage can process.
| uint16_t cbmimage_get_bytes_in_block | ( | cbmimage_fileimage * | image | ) |
get the number of blocks in a block of the image
| [in] | image | pointer to the image data |
Most CBM images contain 256 (= 0x100) bytes in each block. Note however that the functions are generic, so thus assumption does not need to hold true.
In fact, some image types (namely, D81, D1M, D2M, D4M) only give the illusion that the floppy handles 256 byte blocks. The physical blocks have different sizes (512 and 1024 byte blocks)!
In the future, some image types might present options to address the blocks in these other numberings.
| const char * cbmimage_get_filename | ( | cbmimage_fileimage * | image | ) |
get the file name of the image
| [in] | image | pointer to the image data |
| const char * cbmimage_get_imagetype_name | ( | cbmimage_fileimage * | image | ) |
get the image type as string
| [in] | image | pointer to the image data |
| uint16_t cbmimage_get_max_lba | ( | cbmimage_fileimage * | image | ) |
get the maximum LBA of the image
| [in] | image | pointer to the image data |
| uint16_t cbmimage_get_max_sectors | ( | cbmimage_fileimage * | image | ) |
get the maximum sectors on a track of the image
| [in] | image | pointer to the image data |
| uint16_t cbmimage_get_max_track | ( | cbmimage_fileimage * | image | ) |
get the maximum tracks of the image
| [in] | image | pointer to the image data |
| uint16_t cbmimage_get_sectors_in_track | ( | cbmimage_fileimage * | image, |
| uint16_t | track ) |
get the number of sectors on a specific track of the image
| [in] | image | pointer to the image data |
| [in] | track | the track number for which to obtain the number of sectors |
| void cbmimage_i_create_last_block | ( | cbmimage_fileimage * | image | ) |
store the last block into the image settings structure
It is important to know the last block for some internal tests.
| [in] | image | pointer to the image data |
|
static |
create an image data structure
Internal helper for cbmimage_image_open() and cbmimage_image_openfile(). Create image data structure after all (filename and file data or memory data) are known.
| [in] | buffer | pointer to the raw image data |
| [in] | size | the size of the buffer |
| [in] | filename | pointer to the name of the file that was opened |
| [in] | imagetype_hint | If the type of the image is known, specify it here; otherwise, use TYPE_UNKNOWN. |
| void cbmimage_image_close | ( | cbmimage_fileimage * | image | ) |
close a CBM image
Upon close, all resources are freed
| [in] | image | pointer to the image data |
| void cbmimage_image_fat_dump | ( | cbmimage_fileimage * | image, |
| int | trackformat ) |
dump a FAT structure of the image
| [in] | image | pointer to the image data |
| [in] | trackformat |
|
| cbmimage_imagetype cbmimage_image_file_guesstype | ( | const char * | filename | ) |
guess the image type of an image file
Internal helper for cbmimage_image_open() and cbmimage_image_openfile().
| [in] | filename | pointer to the name of the file that should be opened |
| const void * cbmimage_image_get_raw | ( | cbmimage_fileimage * | image | ) |
get a pointer to the raw image contents
| [in] | image | pointer to the image data |
| size_t cbmimage_image_get_raw_size | ( | cbmimage_fileimage * | image | ) |
get the size of the raw image contents
| [in] | image | pointer to the image data |
| cbmimage_imagetype cbmimage_image_guesstype | ( | const uint8_t * | buffer, |
| size_t | size, | ||
| int * | extra_errormap ) |
guess the image type of an image
Internal helper for cbmimage_image_open() and cbmimage_image_openfile().
| [in] | buffer | pointer to the raw image data |
| [in] | size | the size of the buffer |
| [in] | extra_errormap |
|
| cbmimage_fileimage * cbmimage_image_open | ( | const uint8_t * | buffer, |
| size_t | size, | ||
| cbmimage_imagetype | imagetype_hint ) |
open an in-memory CBM image
| [in] | buffer | pointer to the raw image data |
| [in] | size | the size of the buffer |
| [in] | imagetype_hint | If the type of the image is known, specify it here; otherwise, use TYPE_UNKNOWN. |
| cbmimage_fileimage * cbmimage_image_openfile | ( | const char * | filename, |
| cbmimage_imagetype | imagetype_hint ) |
open a CBM image from a file
| [in] | filename | pointer to the name of the file that should be opened |
| [in] | imagetype_hint | If the type of the image is known, specify it here; otherwise, use TYPE_UNKNOWN. |
| void cbmimage_image_readfile | ( | cbmimage_fileimage * | image, |
| const char * | filename ) |
read a file and store it in a given CBM image
| [in] | image | pointer to the image data |
| [in] | filename | pointer to the name of the file that should be opened |
| void cbmimage_image_writefile | ( | cbmimage_fileimage * | image, |
| const char * | filename ) |
write the CBM image to a file
| [in] | image | pointer to the image data |
| [in] | filename | pointer to the name of the file that should be opened |