APTR handle = FOpen(STRPTR name, int mode, struct hwTagList *tags);
FOpen()implementation has to check whether your plugin wants to handle this file or not. If your plugin wants to handle this file, your
FOpen()implementation needs to open it and return a handle to Hollywood. Otherwise
NULL. The handle returned by this function is an opaque data type only your plugin knows about. Hollywood will pass this handle to you whenever it wants to do IO on this file.
The second parameter specifies whether Hollywood wants to open this file for reading and/or writing. It can be one of the following values:
FOpen()must fail if file doesn't exist.
FOpen()has to create it first.
Additionally, Hollywood will pass a tag list to your implementation in parameter 3. This tag list can contain the following items:
pDatamember of this tag will be set to a pointer to a
ULONG. You may then set one or more of the following flags in this
ULONGto inform Hollywood about the properties of this file. The following flags are currently recognized:
HWFOPENFLAGS_NOSEEKseveral file format handlers which depend on the seek functionality might stop working. Plugins may choose to work-around this problem by setting the
HWFOPENMODE_EMULATESEEKflag when calling hw_FOpen(). See hw_FOpen for details.
HWCLAFAFLAGS_CHUNKLOADERflag to indicate that your file adapter supports opening of virtual files that do not exist physically but only as parts of other files, you can use this tag to find out the path to the real file that contains the virtual file. If Hollywood passes the
HWFOPENTAG_CHUNKFILEtag to your
pDatamember will be set to a string containing the path to the real file Hollywood wants you to open, but keep in mind that Hollywood wants you to look at a part of this file only. This part is described by the
HWFOPENTAG_CHUNKLENGTHtags which are always passed alongside
HWFOPENTAG_CHUNKOFFSETspecifies the offset where the virtual file inside the file passed in
HWFOPENTAG_CHUNKLENGTHspecifies its length. Your file adapter implementation must remap all accesses to the virtual file to the physical file specified in
HWFOPENTAG_CHUNKFILEthen, i.e. if the user calls FSeek() to seek to the beginning of the file, your implementation of FSeek() must actually seek to the position specified in
HWFOPENTAG_CHUNKOFFSETand so on. You only need to implement support for
HWFOPENTAG_CHUNKFILEif you set
HWSTATLKMODE_CONTAINERin FStat(). Otherwise, it's not necessary to implement
HWFOPENTAG_CHUNKFILE. See FStat for details.
HWFOPENTAG_CHUNKFILEexcept that the
pDatamember of this tag doesn't point to a string containing a file path but to a memory block containing the data of the virtual file. You can look at the
HWFOPENTAG_CHUNKLENGTHto find out the size of the memory block.
HWFOPENTAG_CHUNKOFFSETis not used for this tag. See above for more information.
HWFOPENTAG_CHUNKFILEis set, the
iDatamember of this tag will be set to the starting offset of the virtual file inside the physical file specified in
HWFOPENTAG_CHUNKMEMORYis set, the
iDatamember of this tag will be set to the length of the virtual file in bytes.
This function must be implemented in a thread-safe manner.
NULLif your plugin doesn't want to handle this file