From 6ad71878febbee577ed7e902ed80da14c96f8074 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 19 Aug 2017 11:19:28 -0400 Subject: [PATCH] Updated PHYSFS_Archiver with PHYSFS_EnumerateCallbackResult change. --- src/physfs.h | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/physfs.h b/src/physfs.h index cfe7c3b4..7c45b6f0 100644 --- a/src/physfs.h +++ b/src/physfs.h @@ -3544,23 +3544,26 @@ typedef struct PHYSFS_Archiver * you can dispose of it upon return from the callback. (dirname) is in * platform-independent notation. * If you have a failure, call PHYSFS_SetErrorCode() with whatever code - * seem appropriate and return -1. - * If the callback returns -1, please call - * PHYSFS_SetErrorCode(PHYSFS_ERR_APP_CALLBACK) and then return -1. - * If the callback returns 0, stop enumerating and return 0. Don't call - * the callback again in any circumstances. Don't set an error code in - * this case. - * Callbacks are (currently) only supposed to return -1, 0, or 1. Any - * other result has undefined behavior. - * As long as the callback returned 1 and you haven't experienced any - * errors of your own, keep enumerating until you're done and then return - * 1 without setting an error code. + * seem appropriate and return PHYSFS_ENUM_ERROR. + * If the callback returns PHYSFS_ENUM_ERROR, please call + * PHYSFS_SetErrorCode(PHYSFS_ERR_APP_CALLBACK) and then return + * PHYSFS_ENUM_ERROR as well. Don't call the callback again in any + * circumstances. + * If the callback returns PHYSFS_ENUM_STOP, stop enumerating and return + * PHYSFS_ENUM_STOP as well. Don't call the callback again in any + * circumstances. Don't set an error code in this case. + * Callbacks are only supposed to return a value from + * PHYSFS_EnumerateCallbackResult. Any other result has undefined + * behavior. + * As long as the callback returned PHYSFS_ENUM_OK and you haven't + * experienced any errors of your own, keep enumerating until you're done + * and then return PHYSFS_ENUM_OK without setting an error code. * * \warning PHYSFS_enumerate returns zero or non-zero (success or failure), * so be aware this function pointer returns different values! */ - int (*enumerate)(void *opaque, const char *dirname, - PHYSFS_EnumerateCallback cb, + PHYSFS_EnumerateCallbackResult (*enumerate)(void *opaque, + const char *dirname, PHYSFS_EnumerateCallback cb, const char *origdir, void *callbackdata); /**