As Hollywood can deal with virtual files as well as with files linked into other
files like applets or executables there are some things to attend to when writing
plugins that deal with files. If you want your plugin to support all these Hollywood-specific
extensions you must make sure that you only use IO functions provided by Hollywood
in the DOSBase
pointer to deal with files. If you use functions like fopen()
from
the ANSI C library instead, your plugin will only work with normal files that are
physically existent on a system drive.
For example, when writing plugins that provide loaders for additional file formats like
images, sounds, or videos it can often happen that the filename that is passed to your
plugin is a specially formatted specification that Hollywood uses to load files that have
been linked to applets or executables. If you do not use Hollywood's IO functions to
open this file, your plugin won't be able to load files that have been linked to applets
or executables. This can be quite annoying for the end-user because the ability to
link data files into applets and executables is a key functionality of Hollywood and
thus your plugin should strive to be compatible with it. If you use fopen()
instead,
it will just fail whenever your function is passed a specially formatted specification
to open one of Hollywood's virtual files.
If your plugin has to use IO functions from the C runtime for some particular reason
and you are unable to use the functions from DOSBase
instead, you can translate
virtual file specifications into physical files using the hw_TranslateFileName()
or hw_TranslateFileNameExt() APIs. See hw_TranslateFileName for details.