summaryrefslogtreecommitdiff
path: root/apps/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-15 21:01:37 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-01-15 21:01:37 +0000
commit9cc7477faf3e49678aa827a6bc1ab99e2812c4d8 (patch)
treea84eb181060b4367ba7278a829a2ce7f3a83ffa9 /apps/include
parentfa14e61b3b4bca193293aba75f7ee106cbe4dd69 (diff)
downloadnuttx-9cc7477faf3e49678aa827a6bc1ab99e2812c4d8.tar.gz
nuttx-9cc7477faf3e49678aa827a6bc1ab99e2812c4d8.tar.bz2
nuttx-9cc7477faf3e49678aa827a6bc1ab99e2812c4d8.zip
Implement redirection of output from NSH builtin commands to a file in a mounted volume
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5521 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'apps/include')
-rw-r--r--apps/include/apps.h41
1 files changed, 27 insertions, 14 deletions
diff --git a/apps/include/apps.h b/apps/include/apps.h
index 37599ac5c..f806d8aed 100644
--- a/apps/include/apps.h
+++ b/apps/include/apps.h
@@ -1,9 +1,16 @@
/****************************************************************************
* apps/include/apps.h
*
- * Copyright(C) 2011 Uros Platise. All rights reserved.
+ * Originally by:
+ *
+ * Copyright (C) 2011 Uros Platise. All rights reserved.
* Author: Uros Platise <uros.platise@isotel.eu>
*
+ * With subsequent updates, modifications, and general maintenance by:
+ *
+ * Copyright (C) 2012-2013 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -64,27 +71,27 @@ struct builtin_s
* Public Data
****************************************************************************/
+#undef EXTERN
+#if defined(__cplusplus)
+#define EXTERN extern "C"
+extern "C" {
+#else
+#define EXTERN extern
+#endif
+
/* The "bindir" is file system that supports access to the builtin applications.
* It is typically mounted under /bin.
*/
#ifdef CONFIG_APPS_BINDIR
-struct mountpt_operations;
-extern const struct mountpt_operations binfs_operations;
+EXTERN mountpt_operations;
+EXTERN const struct mountpt_operations binfs_operations;
#endif
/****************************************************************************
* Public Functions
****************************************************************************/
-#undef EXTERN
-#if defined(__cplusplus)
-#define EXTERN extern "C"
-extern "C" {
-#else
-#define EXTERN extern
-#endif
-
/****************************************************************************
* Name: builtin_isavail
*
@@ -129,8 +136,13 @@ EXTERN const char *builtin_getname(int index);
* New application is run in a separate task context (and thread).
*
* Input Parameter:
- * filename - Name of the linked-in binary to be started.
- * argv - Argument list
+ * filename - Name of the linked-in binary to be started.
+ * argv - Argument list
+ * redirfile - If output if redirected, this parameter will be non-NULL
+ * and will provide the full path to the file.
+ * oflags - If output is redirected, this parameter will provide the
+ * open flags to use. This will support file replacement
+ * of appending to an existing file.
*
* Returned Value:
* This is an end-user function, so it follows the normal convention:
@@ -139,7 +151,8 @@ EXTERN const char *builtin_getname(int index);
*
****************************************************************************/
-EXTERN int exec_builtin(FAR const char *appname, FAR const char **argv);
+EXTERN int exec_builtin(FAR const char *appname, FAR const char **argv,
+ FAR const char *redirfile, int oflags);
#undef EXTERN
#if defined(__cplusplus)