

FSResult FS_ARCHIVE_PROC_FUNC(FSFile *p_file, FSCommandType command /* = FS_COMMAND_READDIR */);
Operating specifications for the archive command FS_COMMAND_READDIR are shown below:
This command takes as a command argument the variablearg.readdirthat is stored inp_file. This variable is defined innitro/fs/file.has shown below: typedef struct { FSDirEntry *p_entry; BOOL skip_string; } FSReadDirInfo;
Argument content is listed below:
| Arguments | Content |
| p_entry | Pointer to the FSDirEntry structure that stores directory information.Command results are stored in the memory that is indicated by this pointer. |
| skip_string | If this value is not FALSE, the name string does not have to be stored in the name buffer of p_entry. (It can be stored as well.) |
p_fileis a handle that always holds directory position information inprop.dir. Based onp_file'sprog.dirvariable, the command makes the following settings: It correctly sets each variable in theFSDirEntrystructure that is identfied by thep_entryargument. If the next directory entry indicated by p_file is file information, it setsp_entry->is_directoryto 0, and sets the file ID inp_entry->file_id. These set values are used by subsequentFS_COMMAND_OPENFILEFASTcommands. If the next directory entry indicated by p_file is directory information, it setsp_entry->is_directoryto 1, and sets the directory position inp_entry->dir_id. These set values are used by subsequentFS_COMMAND_SEEKDIRcommands. In either case, ifp_entry->skip_stringis FALSE, it will store the file name or directory name, including the terminating '\0' inp_entry->name. It will also set the length of the name inp_entry->name_len. If the next directory entry information is invalid, or if the directory position is a terminator, the command does nothing. Otherwise, after setting the above, it will advance to the nextp_filedirectory position information. Subsequently, this information is used by theFS_COMMAND_SEEKDIRandFS_COMMAND_READDIRcommands.
The command sets values based on the following determinants:
| p_entry->is_directory | If the next directory is a file, 0; if it is a directory, 1. |
| p_entry->file_id | File ID (only if the next directory entry is a file) Index is set as prop.dir.index. |
| p_entry->dir_id | Directory position (only if the next directory entry is a directory) The top is set by index = 0, pos = 0. |
| p_entry->name_len | Name string length of the next directory entry. |
| p_entry->name | Name string of the next directory entry. |
As long as the archive's FNT conforms to the NitroROM format (determined by using the archive read callback function), this information is acquired from the FNT entry block that is indicated by prop.dir.pos.pos.
IfFS_RESULT_SUCCESSis returned by the command, then the current directory entry has been properly stored at the address indicated by the argumentp_entry. If anything else is returned, it is determined that the end of the diretory entries was reached, or the listing was stopped due to some type of error.
In either case, this command can be called again later forp_file.
FS_ReadDir(indirectly from the defaultFS_FINDPATHcommand)FS_ChangeDirFS_OpenFileFS_ConvertPathToFileID(indirectly from the defaultFS_GETPATHcommand)FS_GetPathNameFS_GetPathLength
FSArchive
FS_ARCHIVE_PROC_FUNC
FS_COMMAND_*
FS_SetArchiveProc
2004/07/28 Revised "if skip_string is not FALSE" to "if skip_string is FALSE"
2004/07/12 Initial Version
CONFIDENTIAL