From 7b466345af0d3a7dc5622617ce443a90c64e34a4 Mon Sep 17 00:00:00 2001 From: Alex AUVOLAT Date: Sat, 19 May 2012 09:23:48 +0200 Subject: Added ANSI support, minimal readline-like library. --- src/user/lib/include/readline.h | 16 ++++++++++++++++ src/user/lib/include/stdio.h | 4 ++-- src/user/lib/include/tce/syscall.h | 4 ++-- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 src/user/lib/include/readline.h (limited to 'src/user/lib/include') diff --git a/src/user/lib/include/readline.h b/src/user/lib/include/readline.h new file mode 100644 index 0000000..53193d7 --- /dev/null +++ b/src/user/lib/include/readline.h @@ -0,0 +1,16 @@ +#ifndef DEF_READLINE_H +#define DEF_READLINE_H + +#include + +char* freadln(FILE f); // minimal line-reading function. user must free the returned value. + +typedef struct _rdln_hist { + int max; + int n; + char **str; +} readline_history; +char* readline(FILE f, readline_history *h); + +#endif + diff --git a/src/user/lib/include/stdio.h b/src/user/lib/include/stdio.h index 6c3a974..099746e 100644 --- a/src/user/lib/include/stdio.h +++ b/src/user/lib/include/stdio.h @@ -2,6 +2,7 @@ #define DEF_STDIO_H #include +#include extern FILE term; @@ -14,8 +15,7 @@ void fprint_int(FILE f, int number); void fprint_hex(FILE f, unsigned number); void fprintf(FILE f, char *s, ...); -void vsfprintf(FILE f, char *s, va_list arg); +void vfprintf(FILE f, char *s, va_list arg); -char* freadln(FILE f); #endif diff --git a/src/user/lib/include/tce/syscall.h b/src/user/lib/include/tce/syscall.h index 1811422..c182f40 100644 --- a/src/user/lib/include/tce/syscall.h +++ b/src/user/lib/include/tce/syscall.h @@ -19,8 +19,8 @@ int proc_priv(); void* sbrk(size_t size); void brk(void* ptr); -int run(char* file, char** args); -int waitpid(int pid); +int run(char* file, char** args, FILE zero_fd); +int waitpid(int pid, int block); FILE open(char* filename, int mode); FILE open_relative(FILE root, char* filename, int mode); -- cgit v1.2.3