diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2021-11-19 11:55:15 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2021-11-19 12:37:05 +0000 |
commit | c240b835fe6e3774237b6d968ddb405c8085690f (patch) | |
tree | 301142c95943c9a83b0e00778c89e2d0032940c2 /include | |
parent | 15670d3d0e3dcf9db168244428cab8e43460251a (diff) | |
download | libnsgif-c240b835fe6e3774237b6d968ddb405c8085690f.tar.gz |
GIF: Unify insufficient data error codes.
There is no difference in what the client needs to do.
If there are displayable frames, they can display them.
Otherwise more data is needed.
Internally only `GIF_INSUFFICIENT_DATA` is used now.
To remove the `GIF_INSUFFICIENT_FRAME_DATA` could make existing
client applications fail to compile, so it is left as an alias
to the same value.
At some point the API will be changed drastically, but for now
I want existing applications to still build.
Diffstat (limited to 'include')
-rw-r--r-- | include/libnsgif.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/include/libnsgif.h b/include/libnsgif.h index 5bd26b4..309e2f0 100644 --- a/include/libnsgif.h +++ b/include/libnsgif.h @@ -23,9 +23,9 @@ typedef enum { GIF_WORKING = 1, GIF_OK = 0, - GIF_INSUFFICIENT_FRAME_DATA = -1, + GIF_INSUFFICIENT_DATA = -1, + GIF_INSUFFICIENT_FRAME_DATA = GIF_INSUFFICIENT_DATA, GIF_FRAME_DATA_ERROR = -2, - GIF_INSUFFICIENT_DATA = -3, GIF_DATA_ERROR = -4, GIF_INSUFFICIENT_MEMORY = -5, GIF_FRAME_NO_DISPLAY = -6, @@ -166,11 +166,9 @@ void gif_create(gif_animation *gif, gif_bitmap_callback_vt *bitmap_callbacks); * * \return Error return value. * - GIF_FRAME_DATA_ERROR for GIF frame data error - * - GIF_INSUFFICIENT_FRAME_DATA for insufficient data to process - * any more frames + * - GIF_INSUFFICIENT_DATA reached unexpected end of source data * - GIF_INSUFFICIENT_MEMORY for memory error * - GIF_DATA_ERROR for GIF error - * - GIF_INSUFFICIENT_DATA for insufficient data to do anything * - GIF_OK for successful decoding * - GIF_WORKING for successful decoding if more frames are expected */ @@ -181,9 +179,8 @@ gif_result gif_initialise(gif_animation *gif, size_t size, const uint8_t *data); * * \return Error return value. * - GIF_FRAME_DATA_ERROR for GIF frame data error - * - GIF_INSUFFICIENT_FRAME_DATA for insufficient data to complete the frame * - GIF_DATA_ERROR for GIF error (invalid frame header) - * - GIF_INSUFFICIENT_DATA for insufficient data to do anything + * - GIF_INSUFFICIENT_DATA reached unexpected end of source data * - GIF_INSUFFICIENT_MEMORY for insufficient memory to process * - GIF_OK for successful decoding */ |