Class representing a file to be written on a C64 disk.
More...
#include <mkd64/diskfile.h>
Detailed Description
Class representing a file to be written on a C64 disk.
Friends And Related Function Documentation
typedef void(* DataDelete)(const void *owner, void *data) |
|
related |
void DiskFile_attachData |
( |
DiskFile * |
self, |
|
|
const void * |
owner, |
|
|
void * |
data, |
|
|
DataDelete |
deleter |
|
) |
| |
|
related |
Attach arbitrary data to this diskfile.
Each data owner should call this only once, otherwise the data from the previous call will be deleted and a warning is printed to stderr.
- Parameters
-
self | the diskfile |
owner | the owner of the data to attach |
data | the data to attach |
deleter | a callback that must free all memory of data when called |
size_t DiskFile_blocks |
( |
const DiskFile * |
self | ) |
|
|
related |
Get the size of the file in blocks.
this will only return a real value after the file was written to a disk image, before that it will just return 0.
- Parameters
-
- Returns
- the size in blocks
void * DiskFile_data |
( |
const DiskFile * |
self, |
|
|
const void * |
owner |
|
) |
| |
|
related |
Get attached data for a given owner.
- Parameters
-
self | the diskfile |
owner | the owner of the data |
- Returns
- pointer to the data, or 0 if no data for this owner was found
int DiskFile_fileNo |
( |
const DiskFile * |
self | ) |
|
|
related |
Get the number of the file.
Each file gets automatically a number when it is written to the disk image, so this can be used to determine the order in which files were written.
- Parameters
-
- Returns
- the file number
int DiskFile_interleave |
( |
const DiskFile * |
self | ) |
|
|
related |
Get interleave for this file.
- Parameters
-
- Returns
- the currently set interleave value
const char * DiskFile_name |
( |
const DiskFile * |
self | ) |
|
|
related |
Get the name of this file.
- Parameters
-
- Returns
- the (current) name of the file, see DiskFile_setName().
void DiskFile_setInterleave |
( |
DiskFile * |
self, |
|
|
int |
interleave |
|
) |
| |
|
related |
Set interleave for this file.
this sets an interleave value to be used when the file is written to a disk image. Modules may use this to set a default when they are told to handle the file, the user may later override it by specifying a -i parameter before the final -w. If this is never called, the file will be written to the disk image without interleave (consecutive sectors).
- Parameters
-
self | the diskfile |
interleave | the interleave value to set. |
void DiskFile_setName |
( |
DiskFile * |
self, |
|
|
const char * |
name |
|
) |
| |
|
related |
Set the name of this file.
mkd64 initially sets the file name to the name of the file loaded from the local system – or an empty string if no file was loaded. modules should call this exactly when they create some kind of "directory entry" for the file and set it to the name appearing in the directory. The file map feature will use this name for creating the map (list of files with start track/sector).
- Parameters
-
self | the diskfile |
name | the name to set for the file |
size_t DiskFile_size |
( |
const DiskFile * |
self | ) |
|
|
related |
Get the size of the file in bytes.
- Parameters
-
- Returns
- size in bytes, or 0 if no real file was read from the local system
The documentation for this class was generated from the following file: