diff options
author | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-23 23:58:30 +0330 |
---|---|---|
committer | A404M <ahmadmahmoudiprogrammer@gmail.com> | 2025-05-23 23:58:30 +0330 |
commit | 3c9aea642e3b2f4083705f1cd42fa911d35ee696 (patch) | |
tree | d990b2ffdb63161a9aef7cce20e5714461f86085 /src/runner/runner.h | |
parent | 093c3bece426686b175db9ddaecd6abc8908fd87 (diff) |
add way to call C functions
Diffstat (limited to 'src/runner/runner.h')
-rw-r--r-- | src/runner/runner.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/runner/runner.h b/src/runner/runner.h index 789f0a9..00322c6 100644 --- a/src/runner/runner.h +++ b/src/runner/runner.h @@ -1,6 +1,7 @@ #pragma once #include "compiler/ast-tree.h" +#include <ffi.h> void runnerVariableSetValue(AstTreeVariable *variable, AstTree *value); void runnerVariableSetValueWihtoutConstCheck(AstTreeVariable *variable, @@ -15,6 +16,9 @@ AstTree *runAstTreeFunction(AstTree *tree, AstTree **arguments, AstTree *runAstTreeBuiltin(AstTree *tree, AstTreeScope *scope, AstTree **arguments); +AstTree *runAstTreeCFunction(AstTree *tree, AstTree **arguments, + size_t arguments_size); + AstTree *runExpression(AstTree *expr, AstTreeScope *scope, bool *shouldRet, bool isLeft, bool isComptime, u32 *breakCount, bool *shouldContinue); @@ -27,4 +31,6 @@ bool discontinue(bool shouldRet, u32 breakCount); AstTree *toRawValue(AstTree *value); -AstTree *castTo(AstTree *value,AstTree *to); +AstTree *castTo(AstTree *value, AstTree *to); + +ffi_type *toFFIType(AstTree *type); |