Changeset: e8d7a3a33e6a for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=e8d7a3a33e6a
Modified Files:
        clients/Tests/exports.stable.out
        common/stream/bz2_stream.c
        common/stream/gz_stream.c
        common/stream/lz4_stream.c
        common/stream/stream.c
        common/stream/stream.h
        common/stream/xz_stream.c
Branch: makelibstreamgreatagain
Log Message:

Fixes for various testweb issues


diffs (262 lines):

diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -2663,8 +2663,11 @@ char *buffer_get_buf(buffer *b);
 void buffer_init(buffer *restrict b, char *restrict buf, size_t size);
 stream *buffer_rastream(buffer *restrict b, const char *restrict name);
 stream *buffer_wastream(buffer *restrict b, const char *restrict name);
+stream *bz2_stream(stream *inner, int preset);
 stream *callback_stream(void *restrict priv, ssize_t (*read)(void *restrict 
priv, void *restrict buf, size_t elmsize, size_t cnt), void (*close)(void 
*priv), void (*destroy)(void *priv), const char *restrict name);
 void close_stream(stream *s);
+stream *compressed_stream(stream *inner, int preset);
+stream *create_text_stream(stream *s);
 stream *file_rastream(FILE *restrict fp, const char *restrict name);
 stream *file_rstream(FILE *restrict fp, const char *restrict name);
 stream *file_wastream(FILE *restrict fp, const char *restrict name);
@@ -2672,14 +2675,17 @@ stream *file_wstream(FILE *restrict fp, 
 FILE *getFile(stream *s);
 int getFileNo(stream *s);
 size_t getFileSize(stream *s);
+stream *gz_stream(stream *inner, int preset);
 stream *iconv_rstream(stream *restrict ss, const char *restrict charset, const 
char *restrict name);
 stream *iconv_wstream(stream *restrict ss, const char *restrict charset, const 
char *restrict name);
 bool isa_block_stream(const stream *s);
+stream *lz4_stream(stream *inner, int preset);
 void mnstr_clearerr(stream *s);
 void mnstr_close(stream *s);
 void mnstr_destroy(stream *s);
-int mnstr_errnr(const stream *s);
+mnstr_error_kind mnstr_errnr(const stream *s);
 char *mnstr_error(const stream *s);
+const char *mnstr_error_kind_name(mnstr_error_kind k);
 int mnstr_fgetpos(stream *restrict s, fpos_t *restrict p);
 int mnstr_flush(stream *s);
 int mnstr_fsetpos(stream *restrict s, fpos_t *restrict p);
@@ -2690,6 +2696,7 @@ int mnstr_init(void);
 int mnstr_isalive(const stream *s);
 bool mnstr_isbinary(const stream *s);
 char *mnstr_name(const stream *s);
+const char *mnstr_peek_error(const stream *s);
 int mnstr_printf(stream *restrict s, _In_z_ _Printf_format_string_ const char 
*restrict format, ...) __attribute__((__format__(__printf__, 2, 3)));
 ssize_t mnstr_read(stream *restrict s, void *restrict buf, size_t elmsize, 
size_t cnt);
 int mnstr_readBte(stream *restrict s, int8_t *restrict val);
@@ -2732,6 +2739,7 @@ stream *socket_rstream(SOCKET socket, co
 stream *socket_wstream(SOCKET socket, const char *name);
 stream *stream_blackhole_create(void);
 stream *stream_fwf_create(stream *restrict s, size_t num_fields, size_t 
*restrict widths, char filler);
+stream *xz_stream(stream *inner, int preset);
 
 
 # 21:41:06 >  
diff --git a/common/stream/bz2_stream.c b/common/stream/bz2_stream.c
--- a/common/stream/bz2_stream.c
+++ b/common/stream/bz2_stream.c
@@ -90,6 +90,7 @@ work(inner_state_t *inner_state, pump_ac
                break;
        default:
                assert(0 /* unknown action */);
+               return PUMP_ERROR;
        }
 
        int ret = inner_state->work(&inner_state->strm, a);
@@ -243,31 +244,31 @@ bz2_stream(stream *inner, int preset)
 {
        (void) inner;
        (void) preset;
-       mnstr_set_open_error(url, 0, "BZIP2 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(inner->name, 0, "BZIP2 support has been left out 
of this MonetDB");
        return NULL;
 }
 
 stream *open_bzrstream(const char *filename)
 {
-       mnstr_set_open_error(url, 0, "BZIP2 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "BZIP2 support has been left out of 
this MonetDB");
        return NULL;
 }
 
 stream *open_bzwstream(const char *filename, const char *mode)
 {
-       mnstr_set_open_error(url, 0, "BZIP2 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "BZIP2 support has been left out of 
this MonetDB");
        return NULL;
 }
 
 stream *open_bzrastream(const char *filename)
 {
-       mnstr_set_open_error(url, 0, "BZIP2 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "BZIP2 support has been left out of 
this MonetDB");
        return NULL;
 }
 
 stream *open_bzwastream(const char *filename, const char *mode)
 {
-       mnstr_set_open_error(url, 0, "BZIP2 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "BZIP2 support has been left out of 
this MonetDB");
        return NULL;
 }
 
diff --git a/common/stream/gz_stream.c b/common/stream/gz_stream.c
--- a/common/stream/gz_stream.c
+++ b/common/stream/gz_stream.c
@@ -85,6 +85,7 @@ work(inner_state_t *inner_state, pump_ac
                break;
        default:
                assert(0 /* unknown action */);
+               return PUMP_ERROR;
        }
 
        int ret = inner_state->indeflate(&inner_state->strm, a);
@@ -230,30 +231,30 @@ gz_stream(stream *inner, int preset)
 {
        (void) inner;
        (void) preset;
-       mnstr_set_open_error(url, 0, "GZ support has been left out of this 
MonetDB");
+       mnstr_set_open_error(inner->name, 0, "GZ support has been left out of 
this MonetDB");
        return NULL;
 }
 stream *open_gzrstream(const char *filename)
 {
-       mnstr_set_open_error(url, 0, "GZ support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "GZ support has been left out of this 
MonetDB");
        return NULL;
 }
 
 stream *open_gzwstream(const char *filename, const char *mode)
 {
-       mnstr_set_open_error(url, 0, "GZ support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "GZ support has been left out of this 
MonetDB");
        return NULL;
 }
 
 stream *open_gzrastream(const char *filename)
 {
-       mnstr_set_open_error(url, 0, "GZ support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "GZ support has been left out of this 
MonetDB");
        return NULL;
 }
 
 stream *open_gzwastream(const char *filename, const char *mode)
 {
-       mnstr_set_open_error(url, 0, "GZ support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "GZ support has been left out of this 
MonetDB");
        return NULL;
 }
 
diff --git a/common/stream/lz4_stream.c b/common/stream/lz4_stream.c
--- a/common/stream/lz4_stream.c
+++ b/common/stream/lz4_stream.c
@@ -365,13 +365,14 @@ lz4_stream(stream *inner, int preset)
 {
        (void) inner;
        (void) preset;
-       mnstr_set_open_error(url, 0, "LZ4 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(inner->name, 0, "LZ4 support has been left out of 
this MonetDB");
        return NULL;
 }
+
 stream *open_lz4rstream(const char *filename)
 {
        (void) filename;
-       mnstr_set_open_error(url, 0, "LZ4 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "LZ4 support has been left out of 
this MonetDB");
        return NULL;
 }
 
@@ -379,14 +380,14 @@ stream *open_lz4wstream(const char *file
 {
        (void) filename;
        (void) mode;
-       mnstr_set_open_error(url, 0, "LZ4 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "LZ4 support has been left out of 
this MonetDB");
        return NULL;
 }
 
 stream *open_lz4rastream(const char *filename)
 {
        (void) filename;
-       mnstr_set_open_error(url, 0, "LZ4 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "LZ4 support has been left out of 
this MonetDB");
        return NULL;
 }
 
@@ -394,7 +395,7 @@ stream *open_lz4wastream(const char *fil
 {
        (void) filename;
        (void) mode;
-       mnstr_set_open_error(url, 0, "LZ4 support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "LZ4 support has been left out of 
this MonetDB");
        return NULL;
 }
 
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -89,6 +89,7 @@ get_tl_error_buf(void)
                pthread_setspecific(tl_error_key, p);
                struct tl_error_buf *second_attempt = 
pthread_getspecific(tl_error_key);
                assert(p == second_attempt /* maybe mnstr_init has not been 
called? */);
+               (void) second_attempt; // suppress warning if asserts disabled
        }
        return p;
 }
@@ -388,7 +389,7 @@ mnstr_error(const stream *s)
                return NULL;
 }
 
-char*
+const char*
 mnstr_peek_error(const stream *s)
 {
        if (s == NULL) {
diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -89,7 +89,7 @@ typedef enum mnstr_error_kind {
 } mnstr_error_kind;
 
 stream_export char *mnstr_error(const stream *s);
-stream_export char* mnstr_peek_error(const stream *s);
+stream_export const char* mnstr_peek_error(const stream *s);
 stream_export mnstr_error_kind mnstr_errnr(const stream *s);
 stream_export const char *mnstr_error_kind_name(mnstr_error_kind k);
 stream_export void mnstr_clearerr(stream *s);
diff --git a/common/stream/xz_stream.c b/common/stream/xz_stream.c
--- a/common/stream/xz_stream.c
+++ b/common/stream/xz_stream.c
@@ -213,30 +213,30 @@ xz_stream(stream *inner, int preset)
 {
        (void) inner;
        (void) preset;
-       mnstr_set_open_error(url, 0, "XZ/LZMA support has been left out of this 
MonetDB");
+       mnstr_set_open_error(inner->name, 0, "XZ/LZMA support has been left out 
of this MonetDB");
        return NULL;
 }
 stream *open_xzrstream(const char *filename)
 {
-       mnstr_set_open_error(url, 0, "XZ/LZMA support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "XZ/LZMA support has been left out of 
this MonetDB");
        return NULL;
 }
 
 stream *open_xzwstream(const char *filename, const char *mode)
 {
-       mnstr_set_open_error(url, 0, "XZ/LZMA support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "XZ/LZMA support has been left out of 
this MonetDB");
        return NULL;
 }
 
 stream *open_xzrastream(const char *filename)
 {
-       mnstr_set_open_error(url, 0, "XZ/LZMA support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "XZ/LZMA support has been left out of 
this MonetDB");
        return NULL;
 }
 
 stream *open_xzwastream(const char *filename, const char *mode)
 {
-       mnstr_set_open_error(url, 0, "XZ/LZMA support has been left out of this 
MonetDB");
+       mnstr_set_open_error(filename, 0, "XZ/LZMA support has been left out of 
this MonetDB");
        return NULL;
 }
 
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to