BAS: Editor and shell commands are now configurable
This commit is contained in:
parent
249ae54510
commit
053162a7c5
@ -72,5 +72,19 @@ config INTERPRETER_BAS_HAVE_FTRUNCATE
|
|||||||
---help---
|
---help---
|
||||||
NuttX does not currently support the ftruncate interface
|
NuttX does not currently support the ftruncate interface
|
||||||
|
|
||||||
|
config EXAMPLES_BAS_SHELL
|
||||||
|
bool "Shell support"
|
||||||
|
default n
|
||||||
|
depends on ARCH_HAVE_VFORK && EXPERIMENTAL
|
||||||
|
---help---
|
||||||
|
Support execution of shell commands from BASIC.
|
||||||
|
|
||||||
|
config EXAMPLES_BAS_EDITOR
|
||||||
|
bool "Editor support"
|
||||||
|
default n
|
||||||
|
depends on EXAMPLES_BAS_SHELL && ARCH_HAVE_VFORK && EXPERIMENTAL
|
||||||
|
---help---
|
||||||
|
Support execution of an editor from BASIC.
|
||||||
|
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@ -184,5 +184,6 @@
|
|||||||
#define BADFORMAT RUNTIME+19,_("Syntax error in print format")
|
#define BADFORMAT RUNTIME+19,_("Syntax error in print format")
|
||||||
#define OUTOFMEMORY RUNTIME+20,_("Out of memory")
|
#define OUTOFMEMORY RUNTIME+20,_("Out of memory")
|
||||||
#define RESTRICTED RUNTIME+21,_("Restricted")
|
#define RESTRICTED RUNTIME+21,_("Restricted")
|
||||||
|
#define NOTAVAILABLE RUNTIME+22,_("Feature not available")
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_BAS_BAS_ERROR_H */
|
#endif /* __APPS_EXAMPLES_BAS_BAS_ERROR_H */
|
||||||
|
@ -1070,7 +1070,7 @@ struct Value *stmt_DOcondition(struct Value *value)
|
|||||||
|
|
||||||
struct Value *stmt_EDIT(struct Value *value)
|
struct Value *stmt_EDIT(struct Value *value)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ARCH_HAVE_VFORK
|
#if defined(CONFIG_EXAMPLES_BAS_EDITOR) && defined(CONFIG_EXAMPLES_BAS_SHELL) && defined(CONFIG_ARCH_HAVE_VFORK)
|
||||||
long int line;
|
long int line;
|
||||||
struct Pc statementpc = g_pc;
|
struct Pc statementpc = g_pc;
|
||||||
int status;
|
int status;
|
||||||
@ -1268,7 +1268,7 @@ struct Value *stmt_EDIT(struct Value *value)
|
|||||||
|
|
||||||
return (struct Value *)0;
|
return (struct Value *)0;
|
||||||
#else
|
#else
|
||||||
return Value_new_ERROR(value, FORKFAILED, strerror(ENOSYS));
|
return Value_new_ERROR(value, NOTAVAILABLE, strerror(ENOSYS));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5680,7 +5680,7 @@ struct Value *stmt_SELECTCASE(struct Value *value)
|
|||||||
|
|
||||||
struct Value *stmt_SHELL(struct Value *value)
|
struct Value *stmt_SHELL(struct Value *value)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ARCH_HAVE_VFORK
|
#if defined(CONFIG_EXAMPLES_BAS_SHELL) && defined(CONFIG_ARCH_HAVE_VFORK)
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
@ -5779,7 +5779,7 @@ struct Value *stmt_SHELL(struct Value *value)
|
|||||||
|
|
||||||
return (struct Value *)0;
|
return (struct Value *)0;
|
||||||
#else
|
#else
|
||||||
return Value_new_ERROR(value, FORKFAILED, strerror(ENOSYS));
|
return Value_new_ERROR(value, NOTAVAILABLE, strerror(ENOSYS));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user