/* * Wrap all zlib calls in this, so the physfs error state is set appropriately. */ static int zlib_err(int rc) { const char *str = zlib_error_string(rc); if (str != NULL) __PHYSFS_setError(str); return(rc); } /* zlib_err */
std::string MinizipUtils::zip_error_string(int ret) { switch (ret) { case ZIP_OK: //case ZIP_EOF: return "ZIP_OK or ZIP_EOF"; case ZIP_PARAMERROR: return "ZIP_PARAMERROR"; case ZIP_BADZIPFILE: return "ZIP_BADZIPFILE"; case ZIP_INTERNALERROR: return "ZIP_INTERNALERROR"; case ZIP_ERRNO: return strerror(errno); default: return zlib_error_string(ret); } }
std::string MinizipUtils::unz_error_string(int ret) { switch (ret) { case UNZ_OK: //case UNZ_EOF: return "UNZ_OK or UNZ_EOF"; case UNZ_END_OF_LIST_OF_FILE: return "UNZ_END_OF_LIST_OF_FILE"; case UNZ_PARAMERROR: return "UNZ_PARAMERROR"; case UNZ_BADZIPFILE: return "UNZ_BADZIPFILE"; case UNZ_INTERNALERROR: return "UNZ_INTERNALERROR"; case UNZ_CRCERROR: return "UNZ_CRCERROR"; case UNZ_ERRNO: return strerror(errno); default: return zlib_error_string(ret); } }