From ce05175372a9ddca1a225db0765ace1127a39293 Mon Sep 17 00:00:00 2001 From: Nicholas Date: Fri, 12 Nov 2021 09:22:01 -0800 Subject: chore: simplified organizational structure --- sys/libfmt/open.c | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 sys/libfmt/open.c (limited to 'sys/libfmt/open.c') diff --git a/sys/libfmt/open.c b/sys/libfmt/open.c deleted file mode 100644 index 8aadef5..0000000 --- a/sys/libfmt/open.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "internal.h" - -static int -flush(fmt·State *io) -{ - int n, fd; - - fd = (uintptr)io->file; - n = io->buffer.cur - io->buffer.beg; - if(n && write(fd, io->buffer.beg, n) != n) - return -1; - - io->buffer.cur = io->buffer.beg; - return io->n; -} - -int -fmt·open(int fd, int len, char *buf, fmt·State *io) -{ - io->buffer.beg = buf; - io->buffer.cur = buf; - io->buffer.end = buf+len; - io->flush = flush; - io->file = (void*)(uintptr)fd; - io->flag = 0; - io->n = 0; - /* no heap needed */ - io->heap = nil; - io->mem = (mem·Reallocator){ 0 }; - - fmt·setlocale(io, nil, nil, nil); - - return 0; -} -- cgit v1.2.1