5 Author: Pekka Riikonen <priikone@silcnet.org>
7 Copyright (C) 2005 - 2006 Pekka Riikonen
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; version 2 of the License.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
26 int silc_stream_read(SilcStream stream, unsigned char *buf,
29 SilcStreamHeader h = stream;
30 return h->ops->read(stream, buf, buf_len);
33 int silc_stream_write(SilcStream stream, const unsigned char *data,
36 SilcStreamHeader h = stream;
37 return h->ops->write(stream, data, data_len);
40 SilcBool silc_stream_close(SilcStream stream)
42 SilcStreamHeader h = stream;
43 return h->ops->close(stream);
46 void silc_stream_destroy(SilcStream stream)
48 SilcStreamHeader h = stream;
49 h->ops->destroy(stream);
52 void silc_stream_set_notifier(SilcStream stream, SilcSchedule schedule,
53 SilcStreamNotifier notifier, void *context)
55 SilcStreamHeader h = stream;
56 h->ops->notifier(stream, schedule, notifier, context);
59 SilcSchedule silc_stream_get_schedule(SilcStream stream)
61 SilcStreamHeader h = stream;
62 return h->ops->get_schedule(stream);