From d502fce7d4db492690e39c72fc029aa05a65057d Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Sat, 19 May 2012 16:38:56 +0200 Subject: More improvements in FWIK - more strings, Dir class, ... --- src/user/lib/libc/include/readline.h | 1 + src/user/lib/libc/include/stdio.h | 1 - src/user/lib/libc/std/readline.c | 4 ++++ src/user/lib/libc/std/stdio.c | 6 ++++-- 4 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/user/lib/libc') diff --git a/src/user/lib/libc/include/readline.h b/src/user/lib/libc/include/readline.h index 910ad9a..1ec5baa 100644 --- a/src/user/lib/libc/include/readline.h +++ b/src/user/lib/libc/include/readline.h @@ -13,6 +13,7 @@ typedef struct _rdln_hist { #ifdef __cplusplus extern "C" { namespace libc { #endif +char *readln(); char* freadln(FILE f); // minimal line-reading function. user must free the returned value. char* freadline(FILE f, readline_history *h); #ifdef __cplusplus diff --git a/src/user/lib/libc/include/stdio.h b/src/user/lib/libc/include/stdio.h index f19ce60..72d355a 100644 --- a/src/user/lib/libc/include/stdio.h +++ b/src/user/lib/libc/include/stdio.h @@ -12,7 +12,6 @@ extern FILE term; void print(const char *s); void printf(const char *s, ...); -char *readln(); void fprint(FILE f, const char *s); void fprintf(FILE f, const char *s, ...); diff --git a/src/user/lib/libc/std/readline.c b/src/user/lib/libc/std/readline.c index c2237b6..ab13189 100644 --- a/src/user/lib/libc/std/readline.c +++ b/src/user/lib/libc/std/readline.c @@ -35,6 +35,10 @@ char* freadln(FILE f) { } } +char* readln() { + return freadln(term); +} + // ** READLINE diff --git a/src/user/lib/libc/std/stdio.c b/src/user/lib/libc/std/stdio.c index 23ec989..196c554 100644 --- a/src/user/lib/libc/std/stdio.c +++ b/src/user/lib/libc/std/stdio.c @@ -4,14 +4,16 @@ #include FILE term = 0; -void print(const char *s) { fprint(term, s); } +void print(const char *s) { + fprint(term, s); +} + void printf(const char *format, ...) { va_list ap; va_start(ap, format); vfprintf(term, format, ap); va_end(ap); } -char* readln() { return freadln(term); } void fprint(FILE f, const char *s) { write(f, 0, strlen(s), s); -- cgit v1.2.3