OpenDir -- open a directory (V6.0)
APTR handle = OpenDir(STRPTR name, int mode, struct hwTagList *tags);
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:

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)

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)

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

Show TOC