#include <cafe/zipfile.h>

int ZIPFILE_Find(ZIPPED_DIR *apDir, char const *apFileName, ZIPPED_FILE **apRetFilePtr);


apDir Pointer to the ZIPPED_DIR to start the search from. If this is the root DIR in the archive you are permitted to have a slash character at the start of the spec. Otherwise you should not have a slash character there.
apFileName Filename or subdirectory+filename of the file to find. Case insensitive search is used.
apRetFilePtr Pointer to pointer to receive address of the ZIPPED_FILE entry (if found).

Return Values

Returns zero for success or an error code to indicate failure.

ERRCODE_ZIPFILE_FILENOTFOUNDThe directory (if specified) was found, but the file was not.
ERRCODE_ZIPFILE_PATHNOTFOUNDA directory specified as part of the path was not found.
ERRCODE_ZIPFILE_ARGAnd argument passed to the function was not valid.


This is a helper function that can locate a file that is in a directory or subdirectory contained in a ZIPFILE manifest.

Demonstration of use in Cafe

There is a demonstration of usage of the helper library in the demo folder:


Do Not Call From

Multiple threads This function is not thread-safe.

See Also

ZIPFILE helper library and demo
zlib Overview

Revision History

2011/10/19 Added Examplemake.
2011/03/11 Initial version.