WFS_ExecuteRomServerThread

Syntax

#include <nitro/wfs.h>

void WFS_ExecuteRomServerThread(WFSServerContext *context, FSFile *file, BOOL sharedFS);

Arguments

context Pointer to the WFSServerContext structure.
file An FSFile object that represents an opened SRL file that holds the file system to be registered.
Specify NULL to register the file system of the parent (server) itself.
sharedFS Flag indicating whether to share the file system with children.
If TRUE is specified, a mixed file system will be created wherein only the overlay from file will be added to file system of the parent (server) itself. If NULL is specified for file, this argument is ignored. (Always interpreted as TRUE.)

Return Values

TRUE is returned, if registration of the ROM file table and generation of the internal thread succeed; FALSE is returned if either of them fails.

Description

The specified SRL file file table is registered using standard settings and an internal thread is automatically generated in response to the read request.
If this function is called successfully, a thread with priority 15 is generated and its execution continues until the WFS_EndServer function is called. Because this thread is generated automatically in response to a read request from a child (client), WFS_EVENT_SERVER_SEGMENT_REQUEST event notification is not generated.
If no special processing is required to set the file table or respond to a read request, a parent (server) process can be much more easily implemented using this function rather than the WFS_RegisterServerTable function.

This function supports three standard registration patterns frequently used when using the MB library and WFS library together.
Possible combinations of each argument and their main application are given below.

filesharedFSTypeUsage
Effective FilesFALSEStand-alone type Effective when the configuration of the download program to be distributed has no relationship with the parent (server).
This is good for creating simple, self-contained, stand-alone download programs.
TRUEFS Shared Type Effective when the configuration of the download program to be distributed differs from the parent (server), but the contents of the file system are nearly identical.
This allows the ROM size to be kept to a minimum because it is not necessary to prepare duplicate data for the download program.
NULL-Clone boot type Effective when the configuration of the download program to be distributed is a clone boot of the parent (server) itself.

Be sure to use the WFS_RegisterServerTable function if you want to register a file table using customized settings unlike any listed here. Use either this function or the WFS_RegisterServerTable function, as their use is mutually exclusive.

See Also

WFS_EVENT_SERVER_SEGMENT_REQUEST,
WFS_RegisterServerTable

Revision History

2007/06/14 Initial version.


CONFIDENTIAL