diff options
author | Tatsuya Kinoshita <tats@debian.org> | 2021-01-02 00:20:37 +0000 |
---|---|---|
committer | Tatsuya Kinoshita <tats@debian.org> | 2021-01-02 00:20:37 +0000 |
commit | 1d0ba25a660483da1272a31dd077ed94441e3d9f (patch) | |
tree | 1d8dee52cd1e3d340fe178a8193dc96c4496db84 /istream.h | |
parent | Merge branch 'cvstrunk' into upstream (diff) | |
download | w3m-1d0ba25a660483da1272a31dd077ed94441e3d9f.tar.gz w3m-1d0ba25a660483da1272a31dd077ed94441e3d9f.zip |
New upstream version 0.5.3+git20210102upstream/0.5.3+git20210102upstream
Diffstat (limited to 'istream.h')
-rw-r--r-- | istream.h | 17 |
1 files changed, 11 insertions, 6 deletions
@@ -2,13 +2,13 @@ #ifndef IO_STREAM_H #define IO_STREAM_H +#include "indep.h" #include <stdio.h> #ifdef USE_SSL #include <openssl/bio.h> #include <openssl/x509.h> #include <openssl/ssl.h> #endif -#include "Str.h" #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> @@ -20,7 +20,7 @@ struct stream_buffer { typedef struct stream_buffer *StreamBuffer; -struct file_handle { +struct io_file_handle { FILE *f; void (*close) (); }; @@ -36,7 +36,7 @@ union input_stream; struct ens_handle { union input_stream *is; - Str s; + struct growbuf gb; int pos; char encoding; }; @@ -53,7 +53,7 @@ struct base_stream { struct file_stream { struct stream_buffer stream; - struct file_handle *handle; + struct io_file_handle *handle; char type; char iseos; int (*read) (); @@ -119,9 +119,14 @@ extern InputStream newEncodedStream(InputStream is, char encoding); extern int ISclose(InputStream stream); extern int ISgetc(InputStream stream); extern int ISundogetc(InputStream stream); -extern Str StrISgets(InputStream stream); -extern Str StrmyISgets(InputStream stream); +extern Str StrISgets2(InputStream stream, char crnl); +#define StrISgets(stream) StrISgets2(stream, FALSE) +#define StrmyISgets(stream) StrISgets2(stream, TRUE) +void ISgets_to_growbuf(InputStream stream, struct growbuf *gb, char crnl); +#ifdef unused extern int ISread(InputStream stream, Str buf, int count); +#endif +int ISread_n(InputStream stream, char *dst, int bufsize); extern int ISfileno(InputStream stream); extern int ISeos(InputStream stream); #ifdef USE_SSL |