1 | /* |
2 | * This Source Code Form is subject to the terms of the Mozilla Public |
3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. |
5 | * |
6 | * Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V. |
7 | */ |
8 | |
9 | #ifndef _STREAMS_H_ |
10 | #define _STREAMS_H_ |
11 | |
12 | #include "mal.h" |
13 | #include "stream_socket.h" |
14 | |
15 | typedef ptr Stream; |
16 | typedef ptr Bstream; |
17 | |
18 | mal_export int mnstr_write_string(Stream *S, str data); |
19 | mal_export int mnstr_writeInt_wrap(Stream *S, int *data); |
20 | mal_export int mnstr_readInt_wrap(int *data, Stream *S); |
21 | mal_export int mnstr_read_string(str *res, Stream *S); |
22 | mal_export int mnstr_flush_stream(Stream *S); |
23 | mal_export int mnstr_close_stream(Stream *S); |
24 | mal_export int open_block_stream(Stream *S, Stream *is); |
25 | mal_export int bstream_create_wrap(Bstream *BS, Stream *S, int *bufsize); |
26 | mal_export int bstream_destroy_wrap(Bstream *BS); |
27 | mal_export int bstream_read_wrap(int *res, Bstream *BS, int *size); |
28 | mal_export str mnstr_write_stringwrap(void *ret, Stream *S, str *data); |
29 | mal_export str mnstr_writeIntwrap(void *ret, Stream *S, int *data); |
30 | mal_export str mnstr_readIntwrap(int *ret, Stream *S); |
31 | mal_export str mnstr_read_stringwrap(str *res, Stream *s); |
32 | mal_export str mnstr_flush_streamwrap(void *ret, Stream *s); |
33 | mal_export str mnstr_close_streamwrap(void *ret, Stream *s); |
34 | mal_export str open_block_streamwrap(Stream *S, Stream *is); |
35 | mal_export str bstream_create_wrapwrap(Bstream *Bs, Stream *S, int *bufsize); |
36 | mal_export str bstream_destroy_wrapwrap(void *ret, Bstream *BS); |
37 | mal_export str bstream_read_wrapwrap(int *res, Bstream *BS, int *size); |
38 | |
39 | mal_export str mnstr_open_rstreamwrap(Stream *S, str *filename); |
40 | mal_export str mnstr_open_wstreamwrap(Stream *S, str *filename); |
41 | mal_export str mnstr_open_rastreamwrap(Stream *S, str *filename); |
42 | mal_export str mnstr_open_wastreamwrap(Stream *S, str *filename); |
43 | #endif /*_STREAMS_H_*/ |
44 | |