Changeset: b5960202ebed for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b5960202ebed
Modified Files:
common/stream/stream.c
gdk/gdk.h
gdk/gdk_atoms.c
gdk/gdk_bat.c
gdk/gdk_bbp.c
gdk/gdk_delta.c
gdk/gdk_delta.h
gdk/gdk_heap.c
gdk/gdk_imprints.c
gdk/gdk_posix.c
gdk/gdk_private.h
gdk/gdk_storage.c
gdk/gdk_system.c
gdk/gdk_system.h
gdk/gdk_utils.c
sql/server/rel_dump.c
Branch: Oct2014
Log Message:
All debug output in GDK and the stream library goes to stderr.
diffs (truncated from 2117 to 300 lines):
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -201,7 +201,7 @@ mnstr_read(stream *s, void *buf, size_t
if (s == NULL || buf == NULL)
return -1;
#ifdef STREAM_DEBUG
- printf("read %s " SZFMT " " SZFMT "\n", s->name ? s->name :
"<unnamed>", elmsize, cnt);
+ fprintf(stderr, "read %s " SZFMT " " SZFMT "\n", s->name ? s->name :
"<unnamed>", elmsize, cnt);
#endif
assert(s->access == ST_READ);
if (s->errnr)
@@ -220,7 +220,7 @@ mnstr_readline(stream *s, void *buf, siz
if (s == NULL || buf == NULL)
return -1;
#ifdef STREAM_DEBUG
- printf("readline %s " SZFMT "\n", s->name ? s->name : "<unnamed>",
maxcnt);
+ fprintf(stderr, "readline %s " SZFMT "\n", s->name ? s->name :
"<unnamed>", maxcnt);
#endif
assert(s->access == ST_READ);
if (s->errnr)
@@ -277,7 +277,7 @@ mnstr_write(stream *s, const void *buf,
if (s == NULL || buf == NULL)
return -1;
#ifdef STREAM_DEBUG
- printf("write %s " SZFMT " " SZFMT "\n", s->name ? s->name :
"<unnamed>", elmsize, cnt);
+ fprintf(stderr, "write %s " SZFMT " " SZFMT "\n", s->name ? s->name :
"<unnamed>", elmsize, cnt);
#endif
assert(s->access == ST_WRITE);
if (s->errnr)
@@ -301,7 +301,7 @@ mnstr_close(stream *s)
{
if (s) {
#ifdef STREAM_DEBUG
- printf("close %s\n", s->name ? s->name : "<unnamed>");
+ fprintf(stderr, "close %s\n", s->name ? s->name : "<unnamed>");
#endif
(*s->close) (s);
}
@@ -312,7 +312,7 @@ mnstr_destroy(stream *s)
{
if (s) {
#ifdef STREAM_DEBUG
- printf("destroy %s\n", s->name ? s->name : "<unnamed>");
+ fprintf(stderr, "destroy %s\n", s->name ? s->name :
"<unnamed>");
#endif
(*s->destroy) (s);
}
@@ -333,7 +333,7 @@ mnstr_flush(stream *s)
if (s == NULL)
return -1;
#ifdef STREAM_DEBUG
- printf("flush %s\n", s->name ? s->name : "<unnamed>");
+ fprintf(stderr, "flush %s\n", s->name ? s->name : "<unnamed>");
#endif
assert(s->access == ST_WRITE);
if (s->errnr)
@@ -350,7 +350,7 @@ mnstr_fsync(stream *s)
if (s == NULL)
return -1;
#ifdef STREAM_DEBUG
- printf("fsync %s (%d)\n", s->name ? s->name : "<unnamed>", s->errnr);
+ fprintf(stderr, "fsync %s (%d)\n", s->name ? s->name : "<unnamed>",
s->errnr);
#endif
assert(s->access == ST_WRITE);
if (s->errnr)
@@ -366,7 +366,7 @@ mnstr_fgetpos(stream *s, lng *p)
if (s == NULL || p == NULL)
return -1;
#ifdef STREAM_DEBUG
- printf("fgetpos %s\n", s->name ? s->name : "<unnamed>");
+ fprintf(stderr, "fgetpos %s\n", s->name ? s->name : "<unnamed>");
#endif
if (s->errnr)
return -1;
@@ -381,7 +381,7 @@ mnstr_fsetpos(stream *s, lng p)
if (s == NULL)
return -1;
#ifdef STREAM_DEBUG
- printf("fsetpos %s\n", s->name ? s->name : "<unnamed>");
+ fprintf(stderr, "fsetpos %s\n", s->name ? s->name : "<unnamed>");
#endif
if (s->errnr)
return -1;
@@ -439,7 +439,7 @@ mnstr_set_byteorder(stream *s, char bige
if (s == NULL)
return;
#ifdef STREAM_DEBUG
- printf("mnstr_set_byteorder %s\n", s->name ? s->name : "<unnamed>");
+ fprintf(stderr, "mnstr_set_byteorder %s\n", s->name ? s->name :
"<unnamed>");
#endif
assert(s->access == ST_READ);
s->type = ST_BIN;
@@ -466,7 +466,7 @@ mnstr_rstream(stream *s)
if (s == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("mnstr_rstream %s\n", s->name ? s->name : "<unnamed>");
+ fprintf(stderr, "mnstr_rstream %s\n", s->name ? s->name : "<unnamed>");
#endif
assert(s->access == ST_READ);
s->type = ST_BIN;
@@ -481,7 +481,7 @@ mnstr_wstream(stream *s)
if (s == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("mnstr_wstream %s\n", s->name ? s->name : "<unnamed>");
+ fprintf(stderr, "mnstr_wstream %s\n", s->name ? s->name : "<unnamed>");
#endif
assert(s->access == ST_WRITE);
s->type = ST_BIN;
@@ -560,7 +560,7 @@ create_stream(const char *name)
s->timeout_func = NULL;
s->update_timeout = NULL;
#ifdef STREAM_DEBUG
- printf("create_stream %s -> " PTRFMT "\n", name ? name : "<unnamed>",
PTRFMTCAST s);
+ fprintf(stderr, "create_stream %s -> " PTRFMT "\n", name ? name :
"<unnamed>", PTRFMTCAST s);
#endif
return s;
}
@@ -1253,7 +1253,7 @@ open_rstream(const char *filename)
if (filename == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("open_rstream %s\n", filename);
+ fprintf(stderr, "open_rstream %s\n", filename);
#endif
ext = get_extention(filename);
@@ -1286,7 +1286,7 @@ open_wstream_(const char *filename, char
if (filename == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("open_wstream %s\n", filename);
+ fprintf(stderr, "open_wstream %s\n", filename);
#endif
ext = get_extention(filename);
@@ -1331,7 +1331,7 @@ open_rastream(const char *filename)
if (filename == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("open_rastream %s\n", filename);
+ fprintf(stderr, "open_rastream %s\n", filename);
#endif
ext = get_extention(filename);
@@ -1355,7 +1355,7 @@ open_wastream_(const char *filename, cha
if (filename == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("open_wastream %s\n", filename);
+ fprintf(stderr, "open_wastream %s\n", filename);
#endif
ext = get_extention(filename);
@@ -1899,7 +1899,7 @@ socket_rstream(SOCKET sock, const char *
stream *s;
#ifdef STREAM_DEBUG
- printf("socket_rstream " SSZFMT " %s\n", (ssize_t) sock, name);
+ fprintf(stderr, "socket_rstream " SSZFMT " %s\n", (ssize_t) sock, name);
#endif
if ((s = socket_open(sock, name)) == NULL)
return NULL;
@@ -1918,7 +1918,7 @@ socket_wstream(SOCKET sock, const char *
stream *s;
#ifdef STREAM_DEBUG
- printf("socket_wstream " SSZFMT " %s\n", (ssize_t) sock, name);
+ fprintf(stderr, "socket_wstream " SSZFMT " %s\n", (ssize_t) sock, name);
#endif
if ((s = socket_open(sock, name)) == NULL)
return NULL;
@@ -1938,7 +1938,7 @@ socket_rastream(SOCKET sock, const char
stream *s = NULL;
#ifdef STREAM_DEBUG
- printf("socket_rastream " SSZFMT " %s\n", (ssize_t) sock, name);
+ fprintf(stderr, "socket_rastream " SSZFMT " %s\n", (ssize_t) sock,
name);
#endif
if ((s = socket_open(sock, name)) != NULL)
s->type = ST_ASCII;
@@ -1951,7 +1951,7 @@ socket_wastream(SOCKET sock, const char
stream *s;
#ifdef STREAM_DEBUG
- printf("socket_wastream " SSZFMT " %s\n", (ssize_t) sock, name);
+ fprintf(stderr, "socket_wastream " SSZFMT " %s\n", (ssize_t) sock,
name);
#endif
if ((s = socket_open(sock, name)) == NULL)
return NULL;
@@ -2146,7 +2146,7 @@ udp_rastream(const char *hostname, int p
if (hostname == NULL || name == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("udp_rawastream %s %s\n", hostname, name);
+ fprintf(stderr, "udp_rawastream %s %s\n", hostname, name);
#endif
s = udp_create(name);
if (s == NULL)
@@ -2167,7 +2167,7 @@ udp_wastream(const char *hostname, int p
if (hostname == NULL || name == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("udp_wastream %s %s\n", hostname, name);
+ fprintf(stderr, "udp_wastream %s %s\n", hostname, name);
#endif
s = udp_create(name);
if (s == NULL)
@@ -2209,7 +2209,7 @@ file_rstream(FILE *fp, const char *name)
if (fp == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("file_rstream %s\n", name);
+ fprintf(stderr, "file_rstream %s\n", name);
#endif
if ((s = file_stream(name)) == NULL)
return NULL;
@@ -2234,7 +2234,7 @@ file_wstream(FILE *fp, const char *name)
if (fp == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("file_wstream %s\n", name);
+ fprintf(stderr, "file_wstream %s\n", name);
#endif
if ((s = file_stream(name)) == NULL)
return NULL;
@@ -2260,7 +2260,7 @@ file_rastream(FILE *fp, const char *name
if (fp == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("file_rastream %s\n", name);
+ fprintf(stderr, "file_rastream %s\n", name);
#endif
if ((s = file_stream(name)) == NULL)
return NULL;
@@ -2277,7 +2277,7 @@ file_wastream(FILE *fp, const char *name
if (fp == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("file_wastream %s\n", name);
+ fprintf(stderr, "file_wastream %s\n", name);
#endif
if ((s = file_stream(name)) == NULL)
return NULL;
@@ -2567,7 +2567,7 @@ iconv_rstream(stream *ss, const char *ch
if (ss == NULL || charset == NULL || name == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("iconv_rstream %s %s\n", charset, name);
+ fprintf(stderr, "iconv_rstream %s %s\n", charset, name);
#endif
cd = iconv_open("utf-8", charset);
if (cd == (iconv_t) - 1)
@@ -2591,7 +2591,7 @@ iconv_wstream(stream *ss, const char *ch
if (ss == NULL || charset == NULL || name == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("iconv_wstream %s %s\n", charset, name);
+ fprintf(stderr, "iconv_wstream %s %s\n", charset, name);
#endif
cd = iconv_open(charset, "utf-8");
if (cd == (iconv_t) - 1)
@@ -2768,7 +2768,7 @@ buffer_rastream(buffer *b, const char *n
if (b == NULL || name == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("buffer_rastream %s\n", name);
+ fprintf(stderr, "buffer_rastream %s\n", name);
#endif
if ((s = create_stream(name)) == NULL)
return NULL;
@@ -2789,7 +2789,7 @@ buffer_wastream(buffer *b, const char *n
if (b == NULL || name == NULL)
return NULL;
#ifdef STREAM_DEBUG
- printf("buffer_wastream %s\n", name);
+ fprintf(stderr, "buffer_wastream %s\n", name);
#endif
if ((s = create_stream(name)) == NULL)
return NULL;
@@ -2872,13 +2872,13 @@ bs_write(stream *ss, const void *buf, si
{
unsigned i;
- printf("W %s %u \"", ss->name, s->nr);
+ fprintf(stderr, "W %s %u \"", ss->name, s->nr);
for (i = 0; i < s->nr; i++)
if (' ' <= s->buf[i] && s->buf[i] < 127)
- putchar(s->buf[i]);
+ putc(s->buf[i], stderr);
else
- printf("\\%03o", s->buf[i]);
- printf("\"\n");
+ fprintf(stderr, "\\%03o",
s->buf[i]);
+ fprintf(stderr, "\"\n");
}
#endif
/* since the block is at max BLOCK (8K) - 2 size we can
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list