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.
- a pointer to a mscabd_cabinet structure, or NULL
- See also:
- close(), open(), last_error()