/* * Copyright (C) 2023 Kovid Goyal * * Distributed under terms of the GPL3 license. */ #pragma once #include #include #define BYTE_LOADER_T unsigned long long typedef struct ByteLoader { BYTE_LOADER_T m; unsigned sz_of_next_load, digits_left, num_left; const uint8_t *next_load_at; } ByteLoader; uint8_t byte_loader_peek(const ByteLoader *self); void byte_loader_init(ByteLoader *self, const uint8_t *buf, unsigned int sz); uint8_t byte_loader_next(ByteLoader *self); uint8_t* find_either_of_two_bytes(uint8_t *haystack, const size_t sz, const uint8_t a, const uint8_t b);