source/parse/parse.c file

Enums

enum gif_extension_type { GIF_GRAPHICS_CONTROL_EXTENSION = 0xF9, GIF_APPLICATION_EXTENSION = 0xFF, GIF_COMMENT_EXTENSION = 0xFE, GIF_TEXT_EXTENSION = 0x01 }
enum gif_block_type { GIF_EXTENSION_BLOCK = 0x21, GIF_IMAGE_DESCRIPTOR_BLOCK = 0x2C, GIF_TAIL_BLOCK = 0x3B }

Typedefs

using gif_extension_type = enum gif_extension_type
using gif_block_type = enum gif_block_type

Functions

static auto is_gif_file(gif_parse_state*const state) -> compare_result
static auto is_gif_version_supported(gif_parse_state*const state) -> compare_result
static auto read_descriptor(gif_parse_state*const state) -> gif_result_code
static auto skip_block(const uint8_t**const current, size_t*const remaining) -> bool
static auto ensure_frame_data(gif_parse_state*const state, const size_t frame_index) -> gif_result_code
static auto read_graphics_control_extension(gif_parse_state*const state, const size_t frame_index) -> gif_result_code
_Static_assert(sizeof(netscape_identifier) = =8U, "The application identifier must be 8 bytes long")
_Static_assert(sizeof(netscape_auth_code) = =3U, "The application auth code must be 3 bytes long")
static auto read_application_extension(gif_parse_state*const state) -> gif_result_code
static auto read_extension_block(gif_parse_state*const state, const size_t frame_index, bool*const seen_graphics_control_extension) -> gif_result_code
static auto is_frame_size_invalid(const gif_frame_descriptor*const descriptor) -> bool
static auto is_frame_out_of_bounds(const gif_descriptor*const descriptor, const gif_frame_descriptor* frame_descriptor) -> bool
static auto read_image_descriptor_block(gif_parse_state*const state, const size_t frame_index) -> gif_result_code
auto gif_parse_impl(gif_parse_state*const state) -> gif_result_code

Variables

static const uint8_t magic
static const uint8_t gif_version
static const uint8_t netscape_identifier
static const uint8_t netscape_auth_code

Defines

#define CHECK_STATE_REMAINING(value)
#define LOGICAL_SCREEN_DESCRIPTOR_SIZE
#define GIF_FRAME_VECTOR_GROWTH
#define GIF_GRAPHICS_CONTROL_EXTENSION_SIZE
#define GIF_APPLICATION_EXTENSION_SIZE
#define GIF_NETSCAPE_SUBBLOCK_SIZE
#define GIF_NETSCAPE_SUBBLOCK_ID
#define CONST_CHECK_UN(buffer, code)
#define GIF_IMAGE_DESCRIPTOR_SIZE
#define FRAME_CHECK(boolean, code)
#define CONST_CHECK(predicate, fail_code)