A file requester should respect the current directory of the caller when processing the request and should leave it unchanged. It should also the user to specify relative path names as well as fully qualified ones. (Both of these issues have to be specially coded when using the Windows common file dialogue.)
2.2. Activation Parameters
The host sets up the local data with the type of request and the initial
filename and path, if any. The `reqType' request type is one of the FREQ_*
values defined below. GENERIC might be either a load or a save. A
possible title for this request is passed in `title'. The `fileType' string
is set by the host as a hint about the type of file being requested. Some
possible values might be "Scenes," "Objects," "Images," etc. A null pointer
indicates no particular file type. The
initial path is set in the `path' string and the initial filename is set
in `baseName', either of which may be empty strings. All three character
pointers must point to buffers at least `bufLen'
characters long, a value the host must also set.
When the activation function returns, the user has made a choice. If they canceled the request, `result' will be false. If not, the full file name is in `fullName' and path and base names have been updated to reflect the full name.
typedef struct { int reqType, result; const char *title; const char *fileType; char *path; char *baseName; char *fullName; int bufLen; } FileReq_Local; #define FREQ_GENERIC 0 #define FREQ_LOAD 1 #define FREQ_SAVE 2 . . .
. . . typedef const char *FileTypeFunc (const char *);