Changeset: c26d2de9b7d3 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c26d2de9b7d3
Modified Files:
        clients/Tests/MAL-signatures.stable.out
        clients/Tests/MAL-signatures.stable.out.int128
        clients/Tests/exports.stable.out
        common/stream/ChangeLog
        common/stream/stream.c
        monetdb5/ChangeLog
        monetdb5/modules/atoms/streams.c
        monetdb5/modules/atoms/streams.h
        monetdb5/modules/atoms/streams.mal
Branch: default
Log Message:

Removed C functions socket_{r,w}stream and MAL functions 
streams.socket{Read,Write}{,Bytes}.


diffs (229 lines):

diff --git a/clients/Tests/MAL-signatures.stable.out 
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -8548,10 +8548,6 @@ Ready.
 [ "streams",   "openWriteBytes",       "command 
streams.openWriteBytes(filename:str):streams ",        
"mnstr_open_wstreamwrap;",      "open a file stream for writing"        ]
 [ "streams",   "readInt",      "command streams.readInt(s:streams):int ",      
"mnstr_readIntwrap;",   "read integer data from the stream"     ]
 [ "streams",   "readStr",      "command streams.readStr(s:streams):str ",      
"mnstr_read_stringwrap;",       "read string data from the stream"      ]
-[ "streams",   "socketRead",   "command streams.socketRead(skt:int, 
name:str):streams ",       "mnstr_socket_rastreamwrap;",   "open ascii socket 
stream for reading"  ]
-[ "streams",   "socketReadBytes",      "command 
streams.socketReadBytes(skt:int, name:str):streams ",  
"mnstr_socket_rstreamwrap;",    "open a socket stream for reading"      ]
-[ "streams",   "socketWrite",  "command streams.socketWrite(skt:int, 
name:str):streams ",      "mnstr_socket_wastreamwrap;",   "open ascii socket 
stream for writing"  ]
-[ "streams",   "socketWriteBytes",     "command 
streams.socketWriteBytes(skt:int, name:str):streams ", 
"mnstr_socket_wstreamwrap;",    "open a socket stream for writing"      ]
 [ "streams",   "writeInt",     "command streams.writeInt(s:streams, 
data:int):void ",  "mnstr_writeIntwrap;",  "write data on the stream"      ]
 [ "streams",   "writeStr",     "command streams.writeStr(s:streams, 
data:str):void ",  "mnstr_write_stringwrap;",      "write data on the stream"   
   ]
 [ "sysmon",    "pause",        "pattern sysmon.pause(id:int):void ",   
"SYSMONpause;", "Suspend a running query"       ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128 
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -10912,10 +10912,6 @@ Ready.
 [ "streams",   "openWriteBytes",       "command 
streams.openWriteBytes(filename:str):streams ",        
"mnstr_open_wstreamwrap;",      "open a file stream for writing"        ]
 [ "streams",   "readInt",      "command streams.readInt(s:streams):int ",      
"mnstr_readIntwrap;",   "read integer data from the stream"     ]
 [ "streams",   "readStr",      "command streams.readStr(s:streams):str ",      
"mnstr_read_stringwrap;",       "read string data from the stream"      ]
-[ "streams",   "socketRead",   "command streams.socketRead(skt:int, 
name:str):streams ",       "mnstr_socket_rastreamwrap;",   "open ascii socket 
stream for reading"  ]
-[ "streams",   "socketReadBytes",      "command 
streams.socketReadBytes(skt:int, name:str):streams ",  
"mnstr_socket_rstreamwrap;",    "open a socket stream for reading"      ]
-[ "streams",   "socketWrite",  "command streams.socketWrite(skt:int, 
name:str):streams ",      "mnstr_socket_wastreamwrap;",   "open ascii socket 
stream for writing"  ]
-[ "streams",   "socketWriteBytes",     "command 
streams.socketWriteBytes(skt:int, name:str):streams ", 
"mnstr_socket_wstreamwrap;",    "open a socket stream for writing"      ]
 [ "streams",   "writeInt",     "command streams.writeInt(s:streams, 
data:int):void ",  "mnstr_writeIntwrap;",  "write data on the stream"      ]
 [ "streams",   "writeStr",     "command streams.writeStr(s:streams, 
data:str):void ",  "mnstr_write_stringwrap;",      "write data on the stream"   
   ]
 [ "sysmon",    "pause",        "pattern sysmon.pause(id:int):void ",   
"SYSMONpause;", "Suspend a running query"       ]
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
@@ -2321,10 +2321,6 @@ int mnstr_readInt_wrap(int *data, Stream
 str mnstr_readIntwrap(int *ret, Stream *S);
 int mnstr_read_string(str *res, Stream *S);
 str mnstr_read_stringwrap(str *res, Stream *s);
-str mnstr_socket_rastreamwrap(Stream *S, int *socket, str *name);
-str mnstr_socket_rstreamwrap(Stream *S, int *socket, str *name);
-str mnstr_socket_wastreamwrap(Stream *S, int *socket, str *name);
-str mnstr_socket_wstreamwrap(Stream *S, int *socket, str *name);
 int mnstr_writeInt_wrap(Stream *S, int *data);
 str mnstr_writeIntwrap(void *ret, Stream *S, int *data);
 int mnstr_write_string(Stream *S, str data);
diff --git a/common/stream/ChangeLog b/common/stream/ChangeLog
--- a/common/stream/ChangeLog
+++ b/common/stream/ChangeLog
@@ -2,6 +2,7 @@
 # This file is updated with Maddlog
 
 * Mon Aug  7 2017 Sjoerd Mullender <sjo...@acm.org>
+- Removed functions socket_rstream and socket_wstream.
 - Removed functions append_wstream and append_wastream.
 - Removed functions mnstr_rstream and mnstr_wstream.
 
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -2341,45 +2341,6 @@ socket_open(SOCKET sock, const char *nam
 }
 
 stream *
-socket_rstream(SOCKET sock, const char *name)
-{
-       stream *s;
-
-#ifdef STREAM_DEBUG
-       fprintf(stderr, "socket_rstream " SSZFMT " %s\n", (ssize_t) sock, name);
-#endif
-       if ((s = socket_open(sock, name)) == NULL)
-               return NULL;
-       s->type = ST_BIN;
-       if (s->errnr == MNSTR_NO__ERROR &&
-           socket_read(s, (void *) &s->byteorder, sizeof(s->byteorder), 1) < 
1) {
-               socket_close(s);
-               s->errnr = MNSTR_OPEN_ERROR;
-       }
-       return s;
-}
-
-stream *
-socket_wstream(SOCKET sock, const char *name)
-{
-       stream *s;
-
-#ifdef STREAM_DEBUG
-       fprintf(stderr, "socket_wstream " SSZFMT " %s\n", (ssize_t) sock, name);
-#endif
-       if ((s = socket_open(sock, name)) == NULL)
-               return NULL;
-       s->access = ST_WRITE;
-       s->type = ST_BIN;
-       if (s->errnr == MNSTR_NO__ERROR &&
-           socket_write(s, (void *) &s->byteorder, sizeof(s->byteorder), 1) < 
1) {
-               socket_close(s);
-               s->errnr = MNSTR_OPEN_ERROR;
-       }
-       return s;
-}
-
-stream *
 socket_rastream(SOCKET sock, const char *name)
 {
        stream *s = NULL;
diff --git a/monetdb5/ChangeLog b/monetdb5/ChangeLog
--- a/monetdb5/ChangeLog
+++ b/monetdb5/ChangeLog
@@ -2,6 +2,8 @@
 # This file is updated with Maddlog
 
 * Mon Aug  7 2017 Sjoerd Mullender <sjo...@acm.org>
+- Removed MAL functions streams.socketRead, streams.socketReadBytes,
+  streams.socketWrite, and streams.socketWriteBytes.
 - Removed MAL functions streams.openRead(s:streams):streams and
   streams.openWrite(s:streams):streams.
 
diff --git a/monetdb5/modules/atoms/streams.c b/monetdb5/modules/atoms/streams.c
--- a/monetdb5/modules/atoms/streams.c
+++ b/monetdb5/modules/atoms/streams.c
@@ -87,75 +87,6 @@ str mnstr_open_wastreamwrap(Stream *S, s
 }
 
 str
-mnstr_socket_rstreamwrap(Stream *S, int *socket, str *name)
-{
-       stream *s;
-
-       if ((s = socket_rstream(*socket, *name)) == NULL || mnstr_errnr(s)) {
-               int errnr = mnstr_errnr(s);
-               if (s)
-                       mnstr_destroy(s);
-               throw(IO, "streams.open", "could not open socket: %s",
-                               strerror(errnr));
-       } else {
-               *(stream**)S = s;
-       }
-
-       return MAL_SUCCEED;
-}
-str
-mnstr_socket_wstreamwrap(Stream *S, int *socket, str *name)
-{
-       stream *s;
-
-       if ((s = socket_wstream(*socket, *name)) == NULL || mnstr_errnr(s)) {
-               int errnr = mnstr_errnr(s);
-               if (s)
-                       mnstr_destroy(s);
-               throw(IO, "streams.open", "could not open socket: %s",
-                               strerror(errnr));
-       } else {
-               *(stream**)S = s;
-       }
-
-       return MAL_SUCCEED;
-}
-str
-mnstr_socket_rastreamwrap(Stream *S, int *socket, str *name)
-{
-       stream *s;
-
-       if ((s = socket_rastream(*socket, *name)) == NULL || mnstr_errnr(s)) {
-               int errnr = mnstr_errnr(s);
-               if (s)
-                       mnstr_destroy(s);
-               throw(IO, "streams.open", "could not open socket: %s",
-                               strerror(errnr));
-       } else {
-               *(stream**)S = s;
-       }
-
-       return MAL_SUCCEED;
-}
-str
-mnstr_socket_wastreamwrap(Stream *S, int *socket, str *name)
-{
-       stream *s;
-
-       if ((s = socket_wastream(*socket, *name)) == NULL || mnstr_errnr(s)) {
-               int errnr = mnstr_errnr(s);
-               if (s)
-                       mnstr_destroy(s);
-               throw(IO, "streams.open", "could not open socket: %s",
-                               strerror(errnr));
-       } else {
-               *(stream**)S = s;
-       }
-
-       return MAL_SUCCEED;
-}
-
-str
 mnstr_write_stringwrap(void *ret, Stream *S, str *data)
 {
        stream *s = *(stream **)S;
diff --git a/monetdb5/modules/atoms/streams.h b/monetdb5/modules/atoms/streams.h
--- a/monetdb5/modules/atoms/streams.h
+++ b/monetdb5/modules/atoms/streams.h
@@ -41,9 +41,4 @@ mal_export str mnstr_open_rstreamwrap(St
 mal_export str mnstr_open_wstreamwrap(Stream *S, str *filename);
 mal_export str mnstr_open_rastreamwrap(Stream *S, str *filename);
 mal_export str mnstr_open_wastreamwrap(Stream *S, str *filename);
-
-mal_export str mnstr_socket_rstreamwrap(Stream *S, int *socket, str *name);
-mal_export str mnstr_socket_wstreamwrap(Stream *S, int *socket, str *name);
-mal_export str mnstr_socket_rastreamwrap(Stream *S, int *socket, str *name);
-mal_export str mnstr_socket_wastreamwrap(Stream *S, int *socket, str *name);
 #endif /*_STREAMS_H_*/
diff --git a/monetdb5/modules/atoms/streams.mal 
b/monetdb5/modules/atoms/streams.mal
--- a/monetdb5/modules/atoms/streams.mal
+++ b/monetdb5/modules/atoms/streams.mal
@@ -22,19 +22,6 @@ unsafe command openWrite( filename:str )
 address mnstr_open_wastreamwrap
 comment "open ascii file stream for writing";
 
-unsafe command socketReadBytes(skt:int,name:str):streams
-address mnstr_socket_rstreamwrap
-comment "open a socket stream for reading";
-unsafe command socketWriteBytes(skt:int,name:str):streams
-address mnstr_socket_wstreamwrap
-comment "open a socket stream for writing";
-unsafe command socketRead(skt:int,name:str):streams
-address mnstr_socket_rastreamwrap
-comment "open ascii socket stream for reading";
-unsafe command socketWrite(skt:int,name:str):streams
-address mnstr_socket_wastreamwrap
-comment "open ascii socket stream for writing";
-
 unsafe command blocked( s:streams ) :streams
 address open_block_streamwrap
 comment "open a block based stream";
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to