Re: [hackers] [sbase][PATCH] Add implementation of tac(1)

2024-03-07 Thread Roberto E. Vargas Caballero
Hi, As this is a topic more about sbase/ubase organization more than about patches I am going to move the discussion to the dev mailing list. Please, answer there instead of here in hackers. Regards,

Re: [hackers] [sbase][PATCH] Add implementation of tac(1)

2024-03-07 Thread Roberto E. Vargas Caballero
Hi, I was thinking about what to do with these patches adding new commands. They raised a concern about what should be the scope of sbase. The idea of sbase was to provide a minimal portable POSIX base, while having ubase for the POSIX commands that cannot be implemented in a portable way.

Re: [hackers] [sbase][PATCH] Add implementation of tac(1)

2024-03-05 Thread Eric Pruitt
On Sun, Mar 03, 2024 at 12:34:16AM +0100, Elie Le Vaillant wrote: > +static void > +tac(FILE *fp) > +{ > + struct linebuf buf = EMPTY_LINEBUF; > + struct line line; > + getlines(fp, ); > + > + if (buf.nolf) { > + /* If the last line is not LF-terminated, the > +

Re: [hackers] [sbase][PATCH] Add implementation of tac(1)

2024-03-04 Thread Eolien55
Eric Pruitt wrote: > I think there should be separate implementations for seekable vs > non-seekable files to avoid buffering the entire contents of > the file in memory unnecessarily. In fact, performance could be also improved for non-seekable files by forcing a seekable context, ie. use a

[hackers] [sbase][PATCH] Add implementation of tac(1)

2024-03-02 Thread Elie Le Vaillant
--- .gitignore | 1 + Makefile | 1 + README | 1 + libutil/getlines.c | 3 +- tac.1 | 22 +++ tac.c | 68 ++ text.h | 3 +- 7 files changed, 97 insertions(+), 2

[hackers] [sbase][PATCH] Add implementation of tac(1)

2024-02-26 Thread Elie Le Vaillant
--- .gitignore | 1 + Makefile | 1 + README | 1 + libutil/getlines.c | 3 +- tac.1 | 22 +++ tac.c | 68 ++ text.h | 3 +- 7 files changed, 97 insertions(+), 2