mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
WIP: Compiles but still very broken
This commit is contained in:
@@ -1,18 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "toy_common.h"
|
||||
|
||||
#include "toy_module.h"
|
||||
#include "toy_bucket.h"
|
||||
|
||||
typedef enum Toy_FunctionType {
|
||||
TOY_FUNCTION_MODULE,
|
||||
TOY_FUNCTION_CUSTOM,
|
||||
TOY_FUNCTION_NATIVE,
|
||||
} Toy_FunctionType;
|
||||
|
||||
typedef struct Toy_FunctionModule {
|
||||
typedef struct Toy_FunctionBytecode {
|
||||
Toy_FunctionType type;
|
||||
Toy_Module module;
|
||||
} Toy_FunctionModule;
|
||||
unsigned char* code;
|
||||
} Toy_FunctionBytecode;
|
||||
|
||||
typedef struct Toy_FunctionNative {
|
||||
Toy_FunctionType type;
|
||||
@@ -21,8 +20,8 @@ typedef struct Toy_FunctionNative {
|
||||
|
||||
typedef union Toy_Function_t {
|
||||
Toy_FunctionType type;
|
||||
Toy_FunctionModule module;
|
||||
Toy_FunctionBytecode bytecode;
|
||||
Toy_FunctionNative native;
|
||||
} Toy_Function;
|
||||
|
||||
TOY_API Toy_Function* Toy_createModuleFunction(Toy_Bucket** bucketHandle, Toy_Module module);
|
||||
TOY_API Toy_Function* Toy_createFunctionFromBytecode(Toy_Bucket** bucketHandle, unsigned char* bytecode);
|
||||
|
||||
Reference in New Issue
Block a user