Mkd64 module API  1.3b
API for creating own mkd64 modules
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
IModule Interface Reference

Runtime interface for mkd64 modules. More...

#include <mkd64/imodule.h>

Public Attributes

const char *(* id )(void)
 Get id of the module, for runtime identification.
void(* free )(IModule *self)
 Delete the current module instance.
void(* initImage )(IModule *self, Image *image)
 Initialize the module, called whenever the module is loaded.
int(* globalOption )(IModule *self, char opt, const char *arg)
 Handle a global cmdline option.
int(* fileOption )(IModule *self, DiskFile *file, char opt, const char *arg)
 Handle a file cmdline option.
Track *(* getTrack )(IModule *self, int track)
 Get extra tracks, if provided by the module.
void(* fileWritten )(IModule *self, DiskFile *file, const BlockPosition *start)
 Called after a file was written to the disk image.
void(* statusChanged )(IModule *self, const BlockPosition *pos)
 Called after the status of any block changed.
int(* requestReservedBlock )(IModule *self, const BlockPosition *pos)
 Called when someone else wants a block reserved by this module.
void(* imageComplete )(IModule *self)
 Called after all files were written to the image.

Detailed Description

Runtime interface for mkd64 modules.

Examples:
module.c.

Member Data Documentation

int(* IModule::fileOption)(IModule *self, DiskFile *file, char opt, const char *arg)

Handle a file cmdline option.

May be left unimplemented.

Parameters
selfthe module instance
filethe file concerned by the option
optthe option
argthe option argument
Returns
1 if the options is recognized by the module, 0 otherwise
void(* IModule::fileWritten)(IModule *self, DiskFile *file, const BlockPosition *start)

Called after a file was written to the disk image.

May be left unimplemented. Use this e.g. to write directory entries

Parameters
selfthe module instance
filethe file that was just written
startthe starting track/sector position where the file was written
void(* IModule::free)(IModule *self)

Delete the current module instance.

Parameters
selfthe module instance
Track*(* IModule::getTrack)(IModule *self, int track)

Get extra tracks, if provided by the module.

May be left unimplemented.

Parameters
selfthe module instance
trackthe number of the track to get
Returns
the track to the given number, or 0 if this module doesn't provide this track number
int(* IModule::globalOption)(IModule *self, char opt, const char *arg)

Handle a global cmdline option.

May be left unimplemented.

Parameters
selfthe module instance
optthe option
argthe option argument
Returns
1 if the options is recognized by the module, 0 otherwise
const char*(* IModule::id)(void)

Get id of the module, for runtime identification.

Returns
the module id
void(* IModule::imageComplete)(IModule *self)

Called after all files were written to the image.

May be left unimplemented. Use this e.g. to suggest better options or to print some stats to stdout.

Parameters
selfthe module instance
void(* IModule::initImage)(IModule *self, Image *image)

Initialize the module, called whenever the module is loaded.

May be left unimplemented.

Parameters
selfthe module instance
imagethe image to work on
int(* IModule::requestReservedBlock)(IModule *self, const BlockPosition *pos)

Called when someone else wants a block reserved by this module.

May be left unimplemented. This has the same result as always returning 0, all requests will be rejected.

Parameters
selfthe module instance
posthe position of the reserved block requested
Returns
1 if it is ok to give away this block, 0 otherwise.
void(* IModule::statusChanged)(IModule *self, const BlockPosition *pos)

Called after the status of any block changed.

May be left unimplemented. Use this e.g. to write allocation maps

Parameters
selfthe module instance
posthe position of the block that changed its status

The documentation for this interface was generated from the following file: