32#define AS_STREAM_END ((void *) 0)
38struct as_stream_hooks_s;
43typedef enum as_stream_status_e {
43typedef enum as_stream_status_e {
…};
56typedef struct as_stream_s {
72 const struct as_stream_hooks_s *
hooks;
56typedef struct as_stream_s {
…};
82typedef struct as_stream_hooks_s {
82typedef struct as_stream_hooks_s {
…};
124 if ( !stream )
return stream;
126 stream->
free =
false;
128 stream->
hooks = hooks;
145 if ( !stream )
return stream;
149 stream->
hooks = hooks;
163 if ( stream && stream->
free ) {
183 return (stream ? stream->
data : NULL);
211 return stream != NULL && stream->
hooks != NULL && stream->
hooks->read;
241 return stream != NULL && stream->
hooks != NULL && stream->
hooks->write;
AS_EXTERN void * as_stream_malloc(size_t size)
AS_EXTERN void as_stream_free(void *ptr)
#define as_util_hook(hook, default, object,...)
static bool as_stream_readable(const as_stream *stream)
static as_stream_status as_stream_write(const as_stream *stream, as_val *value)
static void as_stream_destroy(as_stream *stream)
static void * as_stream_source(const as_stream *stream)
const struct as_stream_hooks_s * hooks
static as_stream * as_stream_new(void *data, const as_stream_hooks *hooks)
static as_stream * as_stream_init(as_stream *stream, void *data, const as_stream_hooks *hooks)
static bool as_stream_writable(const as_stream *stream)
static as_val * as_stream_read(const as_stream *stream)