diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-11 17:37:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2007-03-11 17:37:47 +0000 |
commit | 6877a8efaf6edad7dcff6412c1eb03973d080247 (patch) | |
tree | 700904d10859106a5fe5d49650d3ff89d9e5ea94 /nuttx/lib | |
parent | 8404d53e7285cad8c64992658a84a3d6809cef27 (diff) | |
download | px4-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')
-rw-r--r-- | nuttx/lib/lib_fgets.c | 25 | ||||
-rw-r--r-- | nuttx/lib/lib_gets.c | 4 |
2 files changed, 15 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 */ diff --git a/nuttx/lib/lib_gets.c b/nuttx/lib/lib_gets.c index 8574a6691..db2145cfa 100644 --- a/nuttx/lib/lib_gets.c +++ b/nuttx/lib/lib_gets.c @@ -41,6 +41,8 @@ #include <limits.h> #include <string.h> +#if CONFIG_NFILE_STREAMS > 0 + /************************************************************ * Definitions ************************************************************/ @@ -120,3 +122,5 @@ char *gets(char *s) } return ret; } + +#endif /* CONFIG_NFILE_STREAMS */ |