27 #include <aerospike/as_val.h>
28 #include <aerospike/as_util.h>
30 #include <citrusleaf/alloc.h>
36 #define AS_STREAM_END ((void *) 0)
42 struct as_stream_hooks_s;
47 typedef enum as_stream_status_e {
60 typedef struct as_stream_s {
76 const struct as_stream_hooks_s *
hooks;
86 typedef struct as_stream_hooks_s {
128 if ( !stream )
return stream;
130 stream->
free =
false;
132 stream->
hooks = hooks;
149 if ( !stream )
return stream;
153 stream->
hooks = hooks;
169 if ( stream && stream->
free ) {
189 return (stream ? stream->
data : NULL);
217 return stream != NULL && stream->
hooks != NULL && stream->
hooks->read;
247 return stream != NULL && stream->
hooks != NULL && stream->
hooks->write;
void as_stream_free(void *ptr)
static as_stream * as_stream_init(as_stream *stream, void *data, const as_stream_hooks *hooks)
static as_stream * as_stream_new(void *data, const as_stream_hooks *hooks)
static as_stream_status as_stream_write(const as_stream *stream, as_val *value)
const struct as_stream_hooks_s * hooks
static as_val * as_stream_read(const as_stream *stream)
static bool as_stream_writable(const as_stream *stream)
static void * as_stream_source(const as_stream *stream)
static bool as_stream_readable(const as_stream *stream)
static void as_stream_destroy(as_stream *stream)
void * as_stream_malloc(size_t size)
#define as_util_hook(hook, default, object, args...)