runtime: implement a bshell_command sub-class for calling native commands
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#ifndef BSHELL_COMMAND_NATIVE_COMMAND_H_
|
||||
#define BSHELL_COMMAND_NATIVE_COMMAND_H_
|
||||
|
||||
#include <fx/macros.h>
|
||||
|
||||
FX_DECLS_BEGIN;
|
||||
|
||||
struct bshell_runtime;
|
||||
|
||||
#define BSHELL_TYPE_NATIVE_COMMAND (bshell_native_command_get_type())
|
||||
|
||||
FX_DECLARE_TYPE(bshell_native_command);
|
||||
|
||||
FX_TYPE_CLASS_DECLARATION_BEGIN(bshell_native_command)
|
||||
FX_TYPE_CLASS_DECLARATION_END(bshell_native_command)
|
||||
|
||||
extern fx_type_id bshell_native_command_get_type(void);
|
||||
|
||||
extern bshell_native_command *bshell_native_command_create(const char *path);
|
||||
|
||||
FX_DECLS_END;
|
||||
|
||||
#endif
|
||||
@@ -10,6 +10,12 @@ struct bshell_runtime;
|
||||
|
||||
enum bshell_command_position;
|
||||
|
||||
enum bshell_cmdcall_type {
|
||||
BSHELL_CMDCALL_NONE = 0,
|
||||
BSHELL_CMDCALL_CMDLET,
|
||||
BSHELL_CMDCALL_NATIVE,
|
||||
};
|
||||
|
||||
#define BSHELL_TYPE_CMDCALL (bshell_cmdcall_get_type())
|
||||
|
||||
FX_DECLARE_TYPE(bshell_cmdcall);
|
||||
@@ -21,6 +27,9 @@ extern fx_type_id bshell_cmdcall_get_type(void);
|
||||
|
||||
FX_TYPE_DEFAULT_CONSTRUCTOR(bshell_cmdcall, BSHELL_TYPE_CMDCALL);
|
||||
|
||||
extern enum bshell_cmdcall_type bshell_cmdcall_get_target_type(
|
||||
const bshell_cmdcall *cmdcall);
|
||||
|
||||
extern enum bshell_status bshell_cmdcall_push_arg(
|
||||
bshell_cmdcall *cmdcall,
|
||||
fx_value arg);
|
||||
|
||||
Reference in New Issue
Block a user