summaryrefslogtreecommitdiff
path: root/apps/nshlib/nsh.h
diff options
context:
space:
mode:
Diffstat (limited to 'apps/nshlib/nsh.h')
-rw-r--r--apps/nshlib/nsh.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/apps/nshlib/nsh.h b/apps/nshlib/nsh.h
index 1d89af3aa..fe85f34ce 100644
--- a/apps/nshlib/nsh.h
+++ b/apps/nshlib/nsh.h
@@ -340,6 +340,24 @@
# endif
#endif
+/* Argument list size
+ *
+ * argv[0]: The command name.
+ * argv[1]: The beginning of argument (up to CONFIG_NSH_MAXARGUMENTS)
+ * argv[argc-3]: Possibly '>' or '>>'
+ * argv[argc-2]: Possibly <file>
+ * argv[argc-1]: Possibly '&' (if pthreads are enabled)
+ * argv[argc]: NULL terminating pointer
+ *
+ * Maximum size is CONFIG_NSH_MAXARGUMENTS+5
+ */
+
+#ifndef CONFIG_NSH_DISABLEBG
+# define MAX_ARGV_ENTRIES (CONFIG_NSH_MAXARGUMENTS+5)
+#else
+# define MAX_ARGV_ENTRIES (CONFIG_NSH_MAXARGUMENTS+4)
+#endif
+
/* strerror() produces much nicer output but is, however, quite large and
* will only be used if CONFIG_NSH_STRERROR is defined. Note that the strerror
* interface must also have been enabled with CONFIG_LIBC_STRERROR.
@@ -487,6 +505,7 @@ extern const char g_loginfailure[];
extern const char g_nshprompt[];
extern const char g_nshsyntax[];
extern const char g_fmtargrequired[];
+extern const char g_fmtnomatching[];
extern const char g_fmtarginvalid[];
extern const char g_fmtargrange[];
extern const char g_fmtcmdnotfound[];
@@ -551,6 +570,8 @@ int nsh_parse(FAR struct nsh_vtbl_s *vtbl, char *cmdline);
/* Application interface */
+int nsh_command(FAR struct nsh_vtbl_s *vtbl, int argc, char *argv[]);
+
#ifdef CONFIG_NSH_BUILTIN_APPS
int nsh_builtin(FAR struct nsh_vtbl_s *vtbl, FAR const char *cmd,
FAR char **argv, FAR const char *redirfile, int oflags);