int ok = hw_MakeVirtualFile(STRPTR dest, int len, struct hwMakeVFileInfo *mvf, struct hwTagList *tags);
dest
. The buffer size must be passed in len
. After this
function has succeeded, you can then pass the virtual file name to any of
Hollywood's functions which are able to handle virtual files, for example
hw_FOpen().
You also have to pass a pointer to a struct hwMakeVFileInfo
structure
to this function which contains the required information about the virtual file
that is to be composed. struct hwMakeVFileInfo
looks like this:
struct hwMakeVFileInfo { STRPTR RealFile; // [in] APTR MemoryBlock; // [in] STRPTR FileExt; // [in] DOSINT64 Offset; // [in] DOSINT64 Length; // [in] }; |
Here's a description of the individual structure members:
RealFile:
Offset
and Length
fields. If the virtual file should use a memory source,
set RealFile
to NULL
and use MemoryBlock
instead.
MemoryBlock:
Length
field.
If the virtual file should use a real file source, set MemoryBlock
to NULL
and use
RealFile
instead.
FileExt:
RealFile
or MemoryBlock
. You
must set it to an extension that the virtual file should use, e.g. "jpg". This is
used for internal hinting at the virtual file's contents. If the virtual file
doesn't have any particular extension because it is in a custom data format, pass
"bin" as FileExt
.
Offset:
RealFile
is non-NULL
. In that case, it specifies the byte
offset into RealFile
where the virtual file should start, i.e. the offset specified
in Offset
is equal to offset 0 inside the virtual file.
Length:
RealFile
and MemoryBlock
and it specifies the length of the
virtual file in bytes. This member must always be set.
This function is thread-safe.
NULL
for nowTrue
on success, False
otherwise