summaryrefslogtreecommitdiff
path: root/nuttx/lib/lib_fgets.c
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-11 17:37:47 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-03-11 17:37:47 +0000
commit6877a8efaf6edad7dcff6412c1eb03973d080247 (patch)
tree700904d10859106a5fe5d49650d3ff89d9e5ea94 /nuttx/lib/lib_fgets.c
parent8404d53e7285cad8c64992658a84a3d6809cef27 (diff)
downloadpx4-nuttx-6877a8efaf6edad7dcff6412c1eb03973d080247.tar.gz
px4-nuttx-6877a8efaf6edad7dcff6412c1eb03973d080247.tar.bz2
px4-nuttx-6877a8efaf6edad7dcff6412c1eb03973d080247.zip
task_create now accepts variable number of arguments; 8051 bringup changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@56 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib/lib_fgets.c')
-rw-r--r--nuttx/lib/lib_fgets.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/nuttx/lib/lib_fgets.c b/nuttx/lib/lib_fgets.c
index 3076859f0..27f9ecdcd 100644
--- a/nuttx/lib/lib_fgets.c
+++ b/nuttx/lib/lib_fgets.c
@@ -42,6 +42,8 @@
#include <ctype.h>
#include <debug.h>
+#if CONFIG_NFILE_STREAMS > 0
+
/************************************************************
* Definitions
************************************************************/
@@ -71,24 +73,16 @@
************************************************************/
/************************************************************
- * Global Function Prototypes
+ * Public Data
************************************************************/
/************************************************************
- * Global Constant Data
+ * Private Data
************************************************************/
-/************************************************************
- * Global Variables
- ************************************************************/
+/* <esc>[K is the VT100 command erases to the end of the line. */
-/************************************************************
- * Private Constant Data
- ************************************************************/
-
-/************************************************************
- * Private Variables
- ************************************************************/
+static const char g_erasetoeol[] = "\033[K";
/************************************************************
* Private Functions
@@ -122,7 +116,7 @@ static inline void _lib_consoleputc(int ch)
************************************************************/
#ifdef CONFIG_FGETS_ECHO
-static inline void _lib_consoleputs(char *s)
+static inline void _lib_consoleputs(const char *s)
{
(void)write(1, s, strlen(s));
}
@@ -182,7 +176,7 @@ char *fgets(FAR char *s, int n, FILE *stream)
if (console)
{
- _lib_consoleputs("\033[K");
+ _lib_consoleputs(g_erasetoeol);
}
#endif
@@ -239,6 +233,7 @@ char *fgets(FAR char *s, int n, FILE *stream)
/* Echo the backspace character on the console */
_lib_consoleputc(ch);
+ _lib_consoleputs(g_erasetoeol);
}
#endif
}
@@ -324,3 +319,5 @@ char *fgets(FAR char *s, int n, FILE *stream)
}
}
+
+#endif /* CONFIG_NFILE_STREAMS */