diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-24 08:41:04 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-24 08:41:04 -0600 |
commit | 39d25ce64a888d84a743d2fd514e822cc4484797 (patch) | |
tree | 05d168b751f7be4a21ed6dcc9418bf231505e4b4 /apps/interpreters | |
parent | cc1c64575a35ae66574d706bd3d32f2526186eb8 (diff) | |
download | px4-nuttx-39d25ce64a888d84a743d2fd514e822cc4484797.tar.gz px4-nuttx-39d25ce64a888d84a743d2fd514e822cc4484797.tar.bz2 px4-nuttx-39d25ce64a888d84a743d2fd514e822cc4484797.zip |
BAS: Editor and shell commands are now configurable
Diffstat (limited to 'apps/interpreters')
-rw-r--r-- | apps/interpreters/bas/Kconfig | 14 | ||||
-rw-r--r-- | apps/interpreters/bas/bas_error.h | 1 | ||||
-rw-r--r-- | apps/interpreters/bas/bas_statement.c | 8 |
3 files changed, 19 insertions, 4 deletions
diff --git a/apps/interpreters/bas/Kconfig b/apps/interpreters/bas/Kconfig index 27c67ac70..844aaa1eb 100644 --- a/apps/interpreters/bas/Kconfig +++ b/apps/interpreters/bas/Kconfig @@ -72,5 +72,19 @@ config INTERPRETER_BAS_HAVE_FTRUNCATE ---help--- 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 diff --git a/apps/interpreters/bas/bas_error.h b/apps/interpreters/bas/bas_error.h index a39801ac6..328eeb081 100644 --- a/apps/interpreters/bas/bas_error.h +++ b/apps/interpreters/bas/bas_error.h @@ -184,5 +184,6 @@ #define BADFORMAT RUNTIME+19,_("Syntax error in print format") #define OUTOFMEMORY RUNTIME+20,_("Out of memory") #define RESTRICTED RUNTIME+21,_("Restricted") +#define NOTAVAILABLE RUNTIME+22,_("Feature not available") #endif /* __APPS_EXAMPLES_BAS_BAS_ERROR_H */ diff --git a/apps/interpreters/bas/bas_statement.c b/apps/interpreters/bas/bas_statement.c index 08bf46c65..051d66295 100644 --- a/apps/interpreters/bas/bas_statement.c +++ b/apps/interpreters/bas/bas_statement.c @@ -1070,7 +1070,7 @@ struct Value *stmt_DOcondition(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; struct Pc statementpc = g_pc; int status; @@ -1268,7 +1268,7 @@ struct Value *stmt_EDIT(struct Value *value) return (struct Value *)0; #else - return Value_new_ERROR(value, FORKFAILED, strerror(ENOSYS)); + return Value_new_ERROR(value, NOTAVAILABLE, strerror(ENOSYS)); #endif } @@ -5680,7 +5680,7 @@ struct Value *stmt_SELECTCASE(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; int status; @@ -5779,7 +5779,7 @@ struct Value *stmt_SHELL(struct Value *value) return (struct Value *)0; #else - return Value_new_ERROR(value, FORKFAILED, strerror(ENOSYS)); + return Value_new_ERROR(value, NOTAVAILABLE, strerror(ENOSYS)); #endif } |