Name
OpenDir -- open a directory (V6.0)
Synopsis
APTR handle = OpenDir(STRPTR name, int mode, struct hwTagList *tags);
Function
This function is called for every directory that Hollywood opens. Your OpenDir() implementation has to check whether your plugin wants to handle this directory or not. If your plugin wants to handle this directory, your OpenDir() implementation needs to open it and return a handle back to Hollywood. Otherwise OpenDir() must return 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 get the next object from this directory.

The mode argument is currently unused.

The tag list that Hollywood may pass to OpenDir() can contain the following items:

HWOPENDIRTAG_USERTAGS:
If this is set, pData will point to a struct hwUserTagList containing a list of user tags passed by the Hollywood script. User tags are a way of passing additional information from Hollywood scripts to plugin functions. See User tags for details. (V10.0)

HWOPENDIRTAG_FORMAT:
This tag can be used to pass a directory format string back to Hollywood. pData will point to a pointer to a string pointer, i.e. STRPTR*. Your plugin can set pData to a null-terminated string containing a format description of the directory. Hollywood scripts will then be able to get this format name by querying the #ATTRFORMAT attribute on #DIRECTORY. Note that the string pointer you write to pData must stay valid for as long as the directory is open. (V10.0)

Inputs
name
directory to open
mode
reserved for future use (currently 0)
tags
tag list containing further options or NULL
Results
handle
handle to refer to this directory later or NULL if your plugin doesn't want to handle this directory

Show TOC