From 12e09f9f85ac48ff891adf92f3b2c9a5fea27273 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Sat, 4 Dec 2021 14:10:21 -0800 Subject: Chore(REMOVE): finished deprecation of old io functions. The old methods were simple wrappers of C standard library functions. We've moved (painfully) over to a new interface that allows for files to live on the stack. All users of the functionality are ported over. --- include/base/io.h | 56 ++++++++++++++++++------------------------------------- 1 file changed, 18 insertions(+), 38 deletions(-) (limited to 'include/base/io.h') diff --git a/include/base/io.h b/include/base/io.h index 5c8fdd9..541159f 100644 --- a/include/base/io.h +++ b/include/base/io.h @@ -69,26 +69,6 @@ enum ExecOK = X_OK, }; -/* XXX(deprecated): file handling */ - -typedef FILE io·Stream; -typedef struct stat io·Stat; - -io·Stream *io·open(byte *name, byte *mode); -int io·fd(io·Stream *s); -int io·stat(io·Stream *s, io·Stat *buf); -int io·close(io·Stream *s); -byte io·getbyte(io·Stream *s); -int io·ungetbyte(io·Stream *s, byte c); -int io·read(io·Stream *s, int sz, int n, void *buf); -int io·readln(io·Stream *s, int n, byte *buf); -int io·putbyte(io·Stream *s, byte c); -int io·putstring(io·Stream *s, string str); -int io·write(io·Stream *s, int sz, int n, void *buf); -int io·flush(io·Stream *s); -int io·seek(io·Stream *s, long off, int whence); -long io·tell(io·Stream *s); - /* buffered i/o */ typedef struct io·Header io·Header; typedef struct io·Buffer io·Buffer; @@ -128,30 +108,30 @@ struct io·Buffer uchar bytes[io·BufLen+io·BufUngets]; }; -int bio·open(char *path, int flag, io·Buffer *io); -int bio·openfd(int fd, int flag, io·Buffer *io); -int bio·close(io·Header *io); +int io·open(char *path, int flag, io·Buffer *io); +int io·openfd(int fd, int flag, io·Buffer *io); +int io·close(io·Header *io); -int bio·init(io·Buffer *io, int fd, int mode); -int bio·initcap(io·Header *io, int fd, int mode, int cap, uchar *buf); +int io·init(io·Buffer *io, int fd, int mode); +int io·initcap(io·Header *io, int fd, int mode, int cap, uchar *buf); -int bio·flush(io·Header *io); -intptr bio·read(io·Header *io, intptr len, void *buf); -void *bio·readuntil(io·Header *io, int delim); -void *bio·readline(io·Header *io, int null); -intptr bio·write(io·Header *io, intptr len, void *buf); +int io·flush(io·Header *io); +intptr io·read(io·Header *io, intptr len, void *buf); +void *io·readuntil(io·Header *io, int delim); +void *io·readline(io·Header *io, int null); +intptr io·write(io·Header *io, intptr len, void *buf); -int bio·getc(io·Header *io); -rune bio·getr(io·Header *io); +int io·getc(io·Header *io); +rune io·getr(io·Header *io); -int bio·ungetc(io·Header *io); -rune bio·ungetr(io·Header *io); +int io·ungetc(io·Header *io); +rune io·ungetr(io·Header *io); -int bio·seek(io·Header *io, intptr offset, int whence, intptr *pos); -intptr bio·offset(io·Header *io); +int io·seek(io·Header *io, intptr offset, int whence, intptr *pos); +intptr io·offset(io·Header *io); -int bio·print(io·Header *io, char *fmt, ...); -int bio·vprint(io·Header *io, char *fmt, va_list args); +int io·print(io·Header *io, char *fmt, ...); +int io·vprint(io·Header *io, char *fmt, va_list args); /* basic os helpers */ /* XXX: find a better location for this */ -- cgit v1.2.1