diff options
author | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-19 09:23:48 +0200 |
---|---|---|
committer | Alex AUVOLAT <alexis211@gmail.com> | 2012-05-19 09:23:48 +0200 |
commit | 7b466345af0d3a7dc5622617ce443a90c64e34a4 (patch) | |
tree | f276b6bf391ccfe8ec3a2cb62a7f70964249621f /src/user/lib/include | |
parent | ac10c1a29c44b0cb29960cd0f792c7361bc430ce (diff) | |
download | TCE-7b466345af0d3a7dc5622617ce443a90c64e34a4.tar.gz TCE-7b466345af0d3a7dc5622617ce443a90c64e34a4.zip |
Added ANSI support, minimal readline-like library.
Diffstat (limited to 'src/user/lib/include')
-rw-r--r-- | src/user/lib/include/readline.h | 16 | ||||
-rw-r--r-- | src/user/lib/include/stdio.h | 4 | ||||
-rw-r--r-- | src/user/lib/include/tce/syscall.h | 4 |
3 files changed, 20 insertions, 4 deletions
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 <stdio.h> + +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 <stdarg.h> +#include <tce/syscall.h> 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); |