gif_engine.h file
Typedefs
- using gif_allocator = void*(*)(void*pointer, size_t size)
- An allocator function type matching that of realloc.
- using gif_deallocator = void(*)(void*allocation)
- A deallocator function type matching that of free.
Functions
- 
              auto gif_parse(const void* buffer,
              size_t buffer_size,
              gif_details* details, gif_ allocator allocator) -> gif_ parse_ result 
- Parses the GIF file located at buffer.
- 
              auto gif_decode(gif_details* details, gif_ allocator allocator) -> gif_ decode_ result 
- Decodes the frame data parsed by gif_parse. 
- 
              void gif_free_details(const gif_details* details, gif_ deallocator deallocator) 
- Frees the gif_details struct populated by gif_ parse. 
- 
              auto gif_result_code_to_string(gif_result_ code code) -> const char* 
- Returns the string representation of gif_result_ code values. 
Function documentation
              gif_
            Parses the GIF file located at buffer.
This function will parse the contents of buffer in a way that makes OOB reads impossible, if the provided buffer and buffer_size arguments are valid. Because this function must allocate, the user can provide an allocator function using the allocator arguments, which is a pointer to a function with a signature matching that of realloc. The details argument is a pointer to a gif_
gif_details details; gif_parse_result result = gif_parse(buffer, buffer_size, &details, &realloc);
The code member of the returned gif_code is GIF_data member will hold the number of bytes remaining after the tail block in the buffer. Note that the number of bytes is a size_t value memcpy'd into this field, so you have to copy it out in a similar manner:
size_t leftover_bytes; memcpy(&leftover_bytes, &result.data, sizeof(size_t));
If the code member is GIF_allocator function to fail in a realloc context (i.e. when the first argument isn't NULL) will be returned in the data member as is.
This function is thread-safe.
              gif_
            Decodes the frame data parsed by gif_
This function is not yet implemented.
              void gif_free_details(const gif_
            Frees the gif_
This function should be called even if the gif_
              const char* gif_result_code_to_string(gif_
            Returns the string representation of gif_
The returned value will be NULL for unknown values.