robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
ba70404c55
master
1#pragma once 2 3#include <stddef.h> 4#include <stdint.h> 5 6// Max possible length: bytecode + 8 int/float bytes 7// Ext objects are maximum 8=3+5 (nested uint32 payload) 8#define MPACK_ITEM_SIZE 9 9 10typedef struct packer_buffer_t PackerBuffer ; 11 12// Must ensure at least MPACK_ITEM_SIZE of space. 13typedef void (* PackerBufferFlush )(PackerBuffer * self ); 14 15struct packer_buffer_t { 16char * startptr ; 17char * ptr ; 18char * endptr ; 19 20// these are free to be used by packer_flush for any purpose, if want 21void * anydata ; 22int64_t anyint ; 23PackerBufferFlush packer_flush ; 24};