Files
Toy/source/toy_module_bundle.h
Kayne Ruse 470836a390 Renamed Toy_ModuleBuilder to Toy_ModuleCompiler
I also noticed that Toy_ModuleBundle isn't being used right now.
2025-02-08 00:23:19 +11:00

22 lines
749 B
C

#pragma once
#include "toy_common.h"
#include "toy_ast.h"
#include "toy_module.h"
typedef struct Toy_ModuleBundle {
unsigned char* ptr;
unsigned int capacity;
unsigned int count;
} Toy_ModuleBundle;
//create a bundle
TOY_API void Toy_initModuleBundle(Toy_ModuleBundle* bundle);
TOY_API void Toy_appendModuleBundle(Toy_ModuleBundle* bundle, Toy_Ast* ast); //TODO: raw bytes
TOY_API void Toy_freeModuleBundle(Toy_ModuleBundle* bundle);
//load module bundle with external data (makes an internal copy)
TOY_API void Toy_bindModuleBundle(Toy_ModuleBundle* bundle, unsigned char* ptr, unsigned int size);
TOY_API Toy_Module Toy_extractModuleFromBundle(Toy_ModuleBundle* bundle, unsigned char index);
//NOTE: 'Toy_ModuleBundle' isn't used anywhere?