Differences From Artifact [4ca19651ff]:
- File src/stream.c — part of check-in [e21a39f7dc] at 2012-09-29 22:10:17 on branch trunk — Add stream. (user: js, size: 2422) [annotate] [blame] [check-ins using]
To Artifact [1f3d504a05]:
- File
src/stream.c
— part of check-in
[17c1d8f6b0]
at
2012-09-29 22:34:49
on branch trunk
— Add tcpsocket.
TODO:
* check for getaddrinfo() in configure
* fallback if getaddrinfo() is unavailable (user: js, size: 2472) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
42 43 44 45 46 47 48 49 50 51 52 | cfw_stream_close(ptr); } ssize_t cfw_stream_read(void *ptr, void *buf, size_t len) { CFWStream *stream = ptr; if (stream == NULL || stream->ops == NULL) return -1; | > | > > > | 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 | cfw_stream_close(ptr); } ssize_t cfw_stream_read(void *ptr, void *buf, size_t len) { CFWStream *stream = ptr; ssize_t ret; if (stream == NULL || stream->ops == NULL) return -1; if ((ret = stream->ops->read(stream, buf, len)) < -1) ret = -1; return ret; } bool cfw_stream_write(void *ptr, const void *buf, size_t len) { CFWStream *stream = ptr; |
︙ | ︙ |