RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
|
MacBinary is an alternative format to AppleSingle for representing a Macintosh file on a non-Macintosh filesystem. More...
#include <macos.h>
Public Types | |
enum | version_t { MACBIN1 , MACBIN1_GETINFO , MACBIN2 = 0x11 , MACBIN3 = 0x12 } |
![]() | |
enum | format_type { SINGLE , DOUBLE } |
enum | hfs_type { HFS_UNDEFINED , HFS_Macintosh , HFS_ProDOS , HFS_MSDOS , HFS_UNIX , HFS_VAX_VMS } |
enum | { ID_DataFork = 1 , ID_ResourceFork , ID_RealName , ID_Comment , ID_IconBW , ID_IconColor , ID_FileInfo , ID_FileDatesInfo , ID_FinderInfo , ID_MacintoshFileInfo , ID_ProDOSFileInfo , ID_MSDOSFileInfo , ID_AFPShortName , ID_AFPFileInfo , ID_AFPDirectoryID } |
Public Member Functions | |
MacBinary (version_t version=MACBIN3) | |
MacBinary (version_t version, version_t minimum_version) | |
MacBinary (AppleSingleDouble &apple, version_t version, version_t minimum_version) | |
void | CRC_Initialize () const |
void | CRC_Step (uint8_t byte=0) const |
void | Skip (Linker::Writer &wr, size_t count) const |
void | WriteData (Linker::Writer &wr, size_t count, const void *data) const |
void | WriteData (Linker::Writer &wr, size_t count, std::string text) const |
void | WriteWord (Linker::Writer &wr, size_t bytes, uint64_t value) const |
void | WriteHeader (Linker::Writer &wr) const |
void | CalculateValues () override |
Intermediate step between processing module and generating output file to set up headers and management sections It is expected that after a module is processed, additional steps are required to evaluate the final values of the fields. | |
offset_t | WriteFile (Linker::Writer &wr) const override |
Stores data in memory to file. | |
void | Dump (Dumper::Dumper &dump) const override |
Display file contents in a nice manner. | |
void | GenerateFile (std::string filename, Linker::Module &module) override |
The main function that handles processing, calculating and generating the final image. | |
![]() | |
void | ReadFile (Linker::Reader &rd) override |
Loads file into memory. | |
bool | FormatSupportsResources () const override |
Whether the format supports resources. | |
AppleSingleDouble (format_type type, unsigned version, hfs_type home_file_system) | |
AppleSingleDouble (format_type type, hfs_type home_file_system) | |
AppleSingleDouble (format_type type, unsigned version=2) | |
AppleSingleDouble (AppleSingleDouble &other, format_type type) | |
AppleSingleDouble (AppleSingleDouble &other) | |
void | SetOptions (std::map< std::string, std::string > &options) override |
Passes command line parameters as settings over to format object. | |
void | SetModel (std::string model) override |
Sets the way memory is organized, typically modifying a built-in script. | |
void | SetLinkScript (std::string script_file, std::map< std::string, std::string > &options) override |
Selects a script file to use for linking. | |
std::shared_ptr< const Entry > | FindEntry (uint32_t id) const |
std::shared_ptr< Entry > | FindEntry (uint32_t id) |
void | SetCreationDate (uint32_t CreationDate) |
void | SetModificationDate (uint32_t ModificationDate) |
void | SetBackupDate (uint32_t BackupDate) |
void | SetAccessDate (uint32_t AccessDate) |
void | SetMacintoshAttributes (uint32_t Attributes) |
void | SetProDOSAccess (uint16_t Access) |
void | SetProDOSFileType (uint16_t FileType) |
void | SetProDOSAUXType (uint32_t AUXType) |
void | SetMSDOSAttributes (uint16_t Attributes) |
uint32_t | GetCreationDate () |
uint32_t | GetModificationDate () |
uint32_t | GetMacintoshAttributes () |
void | ProcessModule (Linker::Module &module) override |
Processes the module object and initializes format fields. | |
std::string | PrefixFilename (std::string prefix, std::string filename) |
std::string | PrefixFilename (std::string prefix, std::string filename, size_t limit) |
std::string | ReplaceExtension (std::string filename, std::string extension, size_t limit) |
std::string | GetUNIXDoubleFilename (std::string filename) |
std::string | GetMacOSXDoubleFilename (std::string filename) |
std::string | GetProDOSDoubleFilename (std::string filename) |
std::string | GetMSDOSDoubleFilename (std::string filename) |
std::string | GetDefaultExtension (Linker::Module &module) const override |
Provides a default filename for the output file. | |
![]() | |
virtual bool | AddSupplementaryOutputFormat (std::string subformat) |
If the output format actually drives multiple output formats (resource file, apple double, etc.), specify multiple types, return false if unknown. | |
std::optional< std::string > | FetchOption (std::map< std::string, std::string > &options, std::string name) |
Convenience method to look up option by name. | |
std::string | FetchOption (std::map< std::string, std::string > &options, std::string name, std::string default_value) |
Convenience method to look up option by name, returning default value if name is missing. | |
std::optional< offset_t > | FetchIntegerOption (std::map< std::string, std::string > &options, std::string name) |
Convenience method to look up option by name and convert it to integer. | |
virtual std::string | GetDefaultExtension (Module &module, std::string filename) const |
Appends a default extension to the filename. | |
virtual bool | FormatSupportsSegmentation () const |
Whether the format supports multiple segments. | |
virtual bool | FormatIs16bit () const |
Whether the format is 16-bit or not. | |
virtual bool | FormatIsLinear () const |
Whether the address space is linear or segmented. | |
virtual bool | FormatSupportsLibraries () const |
Whether the format supports libraries. | |
virtual unsigned | FormatAdditionalSectionFlags (std::string section_name) const |
![]() | |
Format (offset_t file_offset=0) | |
virtual void | Clear () |
Resets all fields to their default values, deallocate memory. | |
offset_t | ImageSize () const override |
Retrieves size of stored data. | |
offset_t | WriteFile (Writer &wr, offset_t count, offset_t offset=0) const override |
Writes data of non-zero filled sections. | |
![]() | |
virtual std::shared_ptr< const ActualImage > | AsImage () const |
Retrieves a randomly accessible image. | |
std::shared_ptr< ActualImage > | AsImage () |
Retrieves a randomly accessible image. | |
Public Attributes | |
version_t | version |
version_t | minimum_version |
uint16_t | secondary_header_size = 0 |
uint16_t | crc = 0 |
uint8_t | attributes = 0 |
uint32_t | creation = 0 |
uint32_t | modification = 0 |
std::string | generated_file_name |
![]() | |
format_type | type = DOUBLE |
unsigned | version = 2 |
hfs_type | home_file_system = HFS_UNDEFINED |
std::vector< std::shared_ptr< Entry > > | entries |
![]() | |
offset_t | file_offset |
Static Public Attributes | |
static uint16_t | crc_step [256] |
Additional Inherited Members | |
![]() | |
std::shared_ptr< Entry > | GetFileDatesInfo () |
std::shared_ptr< Entry > | GetMacintoshFileInfo () |
std::shared_ptr< Entry > | GetAUXFileInfo () |
std::shared_ptr< Entry > | GetProDOSFileInfo () |
std::shared_ptr< Entry > | GetMSDOSFileInfo () |
std::shared_ptr< Entry > | GetDataFork () |
std::shared_ptr< Entry > | GetResourceFork () |
std::shared_ptr< Entry > | GetFinderInfo () |
MacBinary is an alternative format to AppleSingle for representing a Macintosh file on a non-Macintosh filesystem.
|
overridevirtual |
Intermediate step between processing module and generating output file to set up headers and management sections It is expected that after a module is processed, additional steps are required to evaluate the final values of the fields.
Reimplemented from Apple::AppleSingleDouble.
|
overridevirtual |
Display file contents in a nice manner.
Reimplemented from Apple::AppleSingleDouble.
|
overridevirtual |
The main function that handles processing, calculating and generating the final image.
Reimplemented from Apple::AppleSingleDouble.
|
overridevirtual |
Stores data in memory to file.
Reimplemented from Apple::AppleSingleDouble.