Differences From Artifact [677d5c6a56]:
- File src/stream.h — part of check-in [168ba16eda] at 2012-09-30 01:02:03 on branch trunk — Add cfw_stream_write_line(). (user: js, size: 2187) [annotate] [blame] [check-ins using]
To Artifact [bcb155f507]:
- File
src/stream.h
— part of check-in
[6893b9f5ab]
at
2012-09-30 01:34:46
on branch trunk
— Rename eof to at_end.
This is more fitting as end of file is not really true for a socket. (user: js, size: 2193) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
32 33 34 35 36 37 38 | #include "class.h" #include "object.h" #include "string.h" struct cfw_stream_ops { ssize_t (*read)(void*, void*, size_t); bool (*write)(void*, const void*, size_t); | | | | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | #include "class.h" #include "object.h" #include "string.h" struct cfw_stream_ops { ssize_t (*read)(void*, void*, size_t); bool (*write)(void*, const void*, size_t); bool (*at_end)(void*); void (*close)(void*); }; typedef struct CFWStream { CFWObject obj; struct cfw_stream_ops *ops; char *cache; size_t cache_len; } CFWStream; extern CFWClass *cfw_stream; extern ssize_t cfw_stream_read(void*, void*, size_t); extern CFWString* cfw_stream_read_line(void*); extern bool cfw_stream_write(void*, const void*, size_t); extern bool cfw_stream_write_string(void*, const char*); extern bool cfw_stream_write_line(void*, const char*); extern bool cfw_stream_at_end(void*); extern void cfw_stream_close(void*); #endif |