Logo Search packages:      
Sourcecode: cabextract version File versions  Download package

struct mscabd_cabinet*(* mscab_decompressor::search)(struct mscab_decompressor *self, char *filename) [read]

Searches a regular file for embedded cabinets.

This opens a normal file with the given filename and will search the entire file for embedded cabinet files

If any cabinets are found, the equivalent of open() is called on each potential cabinet file at the offset it was found. All successfully open()ed cabinets are kept in a list.

The first cabinet found will be returned directly as the result of this method. Any further cabinets found will be chained in a list using the mscabd_cabinet::next field.

In the case of an error occuring anywhere other than the simulated open(), NULL is returned and the error code is available from last_error().

If no error occurs, but no cabinets can be found in the file, NULL is returned and last_error() returns MSPACK_ERR_OK.

The filename pointer should be considered in use until close() is called on the cabinet.

close() should only be called on the result of search(), not on any subsequent cabinets in the mscabd_cabinet::next chain.

self a self-referential pointer to the mscab_decompressor instance being called
filename the filename of the file to search for cabinets. This is passed directly to mspack_system::open().
a pointer to a mscabd_cabinet structure, or NULL
See also:
close(), open(), last_error()

Generated by  Doxygen 1.6.0   Back to index