From f1404aa9484e1a38b0924f74ac8b5796faf5c77a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 12 Nov 2018 01:28:46 +0100 Subject: Add primitive FIFO and hook it up to sys$pipe(). It's now possible to do this in bash: cat kernel.map | fgrep List This is very cool! :^) --- LibC/stdio.cpp | 1 - LibC/termcap.cpp | 15 ++++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'LibC') diff --git a/LibC/stdio.cpp b/LibC/stdio.cpp index 86adf972eb..d53eb50311 100644 --- a/LibC/stdio.cpp +++ b/LibC/stdio.cpp @@ -45,7 +45,6 @@ void __stdio_init() int setvbuf(FILE* stream, char* buf, int mode, size_t size) { - fprintf(stderr, "setvbuf(%p [fd=%d], %p, %d, %u)\n", stream, stream->fd, buf, mode, size); if (mode != _IONBF && mode != _IOLBF && mode != _IOFBF) { errno = EINVAL; return -1; diff --git a/LibC/termcap.cpp b/LibC/termcap.cpp index 9dbd7a7dc3..d422d47697 100644 --- a/LibC/termcap.cpp +++ b/LibC/termcap.cpp @@ -5,6 +5,8 @@ #include #include +//#define TERMCAP_DEBUG + extern "C" { char PC; @@ -13,7 +15,9 @@ char* BC; int tgetent(char* bp, const char* name) { +#ifdef TERMCAP_DEBUG fprintf(stderr, "tgetent: bp=%p, name='%s'\n", bp, name); +#endif if (!strcmp(name, "ansi")) { PC = '\0'; BC = const_cast("\033[D"); @@ -60,7 +64,9 @@ void ensure_caps() char* tgetstr(char* id, char** area) { ensure_caps(); - fprintf(stderr, "tgetstr: id='%s', area=%p", id, area); +#ifdef TERMCAP_DEBUG + fprintf(stderr, "tgetstr: id='%s'\n", id); +#endif auto it = caps->find(id); if (it != caps->end()) { char* ret = *area; @@ -74,7 +80,9 @@ char* tgetstr(char* id, char** area) int tgetflag(char* id) { +#ifdef TERMCAP_DEBUG fprintf(stderr, "tgetflag: '%s'\n", id); +#endif auto it = caps->find(id); if (it != caps->end()) return 1; @@ -83,11 +91,12 @@ int tgetflag(char* id) int tgetnum(char* id) { +#ifdef TERMCAP_DEBUG fprintf(stderr, "tgetnum: '%s'\n", id); +#endif auto it = caps->find(id); - if (it != caps->end()) { + if (it != caps->end()) return atoi((*it).value); - } assert(false); } -- cgit v1.2.3