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
15typedef ptr Stream;
16typedef ptr Bstream;
17
18mal_export int mnstr_write_string(Stream *S, str data);
19mal_export int mnstr_writeInt_wrap(Stream *S, int *data);
20mal_export int mnstr_readInt_wrap(int *data, Stream *S);
21mal_export int mnstr_read_string(str *res, Stream *S);
22mal_export int mnstr_flush_stream(Stream *S);
23mal_export int mnstr_close_stream(Stream *S);
24mal_export int open_block_stream(Stream *S, Stream *is);
25mal_export int bstream_create_wrap(Bstream *BS, Stream *S, int *bufsize);
26mal_export int bstream_destroy_wrap(Bstream *BS);
27mal_export int bstream_read_wrap(int *res, Bstream *BS, int *size);
28mal_export str mnstr_write_stringwrap(void *ret, Stream *S, str *data);
29mal_export str mnstr_writeIntwrap(void *ret, Stream *S, int *data);
30mal_export str mnstr_readIntwrap(int *ret, Stream *S);
31mal_export str mnstr_read_stringwrap(str *res, Stream *s);
32mal_export str mnstr_flush_streamwrap(void *ret, Stream *s);
33mal_export str mnstr_close_streamwrap(void *ret, Stream *s);
34mal_export str open_block_streamwrap(Stream *S, Stream *is);
35mal_export str bstream_create_wrapwrap(Bstream *Bs, Stream *S, int *bufsize);
36mal_export str bstream_destroy_wrapwrap(void *ret, Bstream *BS);
37mal_export str bstream_read_wrapwrap(int *res, Bstream *BS, int *size);
38
39mal_export str mnstr_open_rstreamwrap(Stream *S, str *filename);
40mal_export str mnstr_open_wstreamwrap(Stream *S, str *filename);
41mal_export str mnstr_open_rastreamwrap(Stream *S, str *filename);
42mal_export str mnstr_open_wastreamwrap(Stream *S, str *filename);
43#endif /*_STREAMS_H_*/
44