Files
bshell/bshell.runtime/include/bshell/command/command.h
T
wash edfb3e24a3 bshell: re-organise build into three separate components
bshell: the front-end binary
bshell.runtime: contains the parser, compiler, and classes needed to run bshell scripts
bshell.core: contains the builtin commandlets and aliases
2026-05-25 10:33:29 +01:00

63 lines
1.7 KiB
C

#ifndef BSHELL_COMMAND_COMMAND_H_
#define BSHELL_COMMAND_COMMAND_H_
#include <fx/macros.h>
#include <fx/reflection/type.h>
#include <fx/string.h>
#include <fx/value.h>
FX_DECLS_BEGIN;
struct bshell_runtime;
#define BSHELL_TYPE_COMMAND (bshell_command_get_type())
FX_DECLARE_TYPE(bshell_command);
FX_TYPE_CLASS_DECLARATION_BEGIN(bshell_command)
const char *c_command_type;
enum bshell_status (
*c_get_callable_name)(const bshell_command *, fx_string *);
enum bshell_status (
*c_get_callable_name_static)(const fx_type *, fx_string *);
enum bshell_status (
*c_get_description)(const bshell_command *, fx_string *);
enum bshell_status (
*c_get_description_static)(const fx_type *, fx_string *);
enum bshell_status (*c_begin_processing)(bshell_command *);
enum bshell_status (*c_process_record)(
bshell_command *,
FX_TYPE_FWDREF(bshell_pipeline) * pipeline,
struct bshell_runtime *);
enum bshell_status (*c_end_processing)(bshell_command *);
FX_TYPE_CLASS_DECLARATION_END(bshell_command)
extern fx_type_id bshell_command_get_type(void);
extern bshell_command *bshell_command_find_static(const char *callable_name);
extern void bshell_command_set_args(
bshell_command *cmd,
fx_value *args,
size_t nr_args);
extern void bshell_command_set_args_reverse(
bshell_command *cmd,
fx_value *args,
size_t nr_args);
extern const fx_value *bshell_command_get_arg(
bshell_command *cmd,
size_t index);
extern enum bshell_status bshell_command_begin_processing(
bshell_command *command);
extern enum bshell_status bshell_command_process_record(
bshell_command *command,
FX_TYPE_FWDREF(bshell_pipeline) * pipeline,
struct bshell_runtime *rt);
extern enum bshell_status bshell_command_end_processing(
bshell_command *command);
FX_DECLS_END;
#endif