RetroLinker
Linker for several 8-bit, 16-bit and 32-bit formats
|
AppleSingle & AppleDouble. More...
#include <macos.h>
Classes | |
class | Entry |
Public Member Functions | |
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< 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. | |
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. | |
void | WriteFile (Linker::Writer &wr) override |
Stores data in memory to file. | |
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) |
void | GenerateFile (std::string filename, Linker::Module &module) override |
The main function that handles processing, calculating and generating the final image. | |
std::string | GetDefaultExtension (Linker::Module &module) override |
Provides a default filename for the output file. | |
Public Member Functions inherited from Linker::OutputFormat | |
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 (Linker::Module &module, std::string filename) |
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 |
Public Member Functions inherited from Linker::Format | |
Format (offset_t file_offset=0) | |
virtual void | Clear () |
Resets all fields to their default values, deallocate memory. | |
virtual void | Dump (Dumper::Dumper &dump) |
Display file contents in a nice manner. | |
Public Attributes | |
format_type | type |
unsigned | version |
hfs_type | home_file_system |
std::vector< std::shared_ptr< Entry > > | entries |
Public Attributes inherited from Linker::Format | |
offset_t | file_offset |
Protected Member Functions | |
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 () |
AppleSingle & AppleDouble.
On classic Macintosh systems, each file has two associated parts called forks: the data fork and the resource fork. Classic 68000 applications store all the executable data in the resource fork, which is usually not transferred to non-Macintosh platforms. The AppleSingle and AppleDouble formats provide a way to store both the data and resource fork, or the resource fork, as a separate file, alongside other metadata, which is essential when storing it on a non-Macintosh system.
This container format was first invented for the A/UX Apple UNIX system. It has two versions, and version 2 is used most commonly. See also Apple::AppleSingleDouble::ResourceFork.
|
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 Linker::OutputFormat.
|
overridevirtual |
Whether the format supports resources.
Formats such as NE, LE/LX, PE and the Macintosh classic support including resources in the final binary. To simplify writing resources, the ELF parser permits incorporating them directly in the binary image as $$RSRC$_<type>$<id>.
Reimplemented from Linker::OutputFormat.
|
overridevirtual |
The main function that handles processing, calculating and generating the final image.
Reimplemented from Linker::OutputFormat.
Reimplemented in Apple::MacBinary.
|
overridevirtual |
Provides a default filename for the output file.
Typically a.out or some other extension, such as a.exe.
Reimplemented from Linker::OutputFormat.
|
overridevirtual |
Processes the module object and initializes format fields.
Reimplemented from Linker::OutputFormat.
|
overridevirtual |
Loads file into memory.
Implements Linker::Format.
|
overridevirtual |
Selects a script file to use for linking.
Reimplemented from Linker::OutputFormat.
|
overridevirtual |
Sets the way memory is organized, typically modifying a built-in script.
Reimplemented from Linker::OutputFormat.
|
overridevirtual |
Passes command line parameters as settings over to format object.
Reimplemented from Linker::OutputFormat.
|
overridevirtual |