command: implement callable bytecode functions

This commit is contained in:
2026-05-30 19:52:50 +01:00
parent 96bf76aabc
commit 1710f705e9
3 changed files with 213 additions and 0 deletions
@@ -1,6 +1,8 @@
#ifndef BSHELL_COMMAND_FUNCTION_H_
#define BSHELL_COMMAND_FUNCTION_H_
#include <bshell/runtime/script-block.h>
#include <fx/collections/array.h>
#include <fx/macros.h>
FX_DECLS_BEGIN;
@@ -17,6 +19,14 @@ FX_TYPE_CLASS_DECLARATION_END(bshell_function)
extern fx_type_id bshell_function_get_type(void);
extern bshell_function *bshell_function_create(const char *name);
extern void bshell_function_add_positional_parameter(
bshell_function *func,
const char *name);
extern const char *bshell_function_get_name(const bshell_function *func);
extern const fx_array *bshell_function_get_positional_parameters(
const bshell_function *func);
extern bshell_scriptblock *bshell_function_get_body(bshell_function *func);
FX_DECLS_END;