![]() |
#include <stdlib.h>
#include <aerospike/as_val.h>
#include <aerospike/as_util.h>
#include <citrusleaf/alloc.h>
Go to the source code of this file.
Data Structures | |
struct | as_stream |
struct | as_stream_hooks |
Macros | |
#define | AS_STREAM_END ((void *) 0) |
Enumerations | |
enum | as_stream_status { AS_STREAM_OK = 0, AS_STREAM_ERR = 1, AS_STREAM_OK = 0, AS_STREAM_ERR = 1, AS_STREAM_OK = 0, AS_STREAM_ERR = 1 } |
Functions | |
void | as_stream_destroy (as_stream *stream) |
void | as_stream_free (void *ptr) |
as_stream * | as_stream_init (as_stream *stream, void *data, const as_stream_hooks *hooks) |
void * | as_stream_malloc (size_t size) |
as_stream * | as_stream_new (void *data, const as_stream_hooks *hooks) |
as_val * | as_stream_read (const as_stream *stream) |
bool | as_stream_readable (const as_stream *stream) |
void * | as_stream_source (const as_stream *stream) |
bool | as_stream_writable (const as_stream *stream) |
as_stream_status | as_stream_write (const as_stream *stream, as_val *value) |
#define AS_STREAM_END ((void *) 0) |
Definition at line 36 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
enum as_stream_status |
Stream Status Codes
Enumerator | |
---|---|
AS_STREAM_OK | |
AS_STREAM_ERR | |
AS_STREAM_OK | |
AS_STREAM_ERR | |
AS_STREAM_OK | |
AS_STREAM_ERR |
Definition at line 47 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
|
inline |
Destroy the as_stream and associated resources.
stream | The stream to destroy. |
Definition at line 166 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
References as_stream_free(), as_util_hook, and as_stream::free.
void as_stream_free | ( | void * | ptr) |
|
inline |
Initializes a stack allocated as_stream for a given source and hooks.
stream | The stream to initialize. |
data | The source feeding the stream |
hooks | The hooks that interface with the source |
Definition at line 126 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
References data, as_stream::data, as_stream::free, and as_stream::hooks.
void* as_stream_malloc | ( | size_t | size) |
Wrapper functions to ensure each CF allocation-related function call has a unique line.
|
inline |
Creates a new heap allocated as_stream for a given source and hooks.
data | The source feeding the stream |
hooks | The hooks that interface with the source |
Definition at line 146 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
References as_stream_malloc(), data, as_stream::data, as_stream::free, and as_stream::hooks.
Reads a value from the stream
stream | The stream to be read. |
Definition at line 201 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
References as_util_hook.
|
inline |
Is the stream readable? Tests whether the stream has a read function.
stream | The stream to test. |
Definition at line 215 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
References as_stream::hooks.
|
inline |
Get the source for the stream
stream | The stream to get the source from |
Definition at line 187 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
References as_stream::data.
|
inline |
Is the stream writable? Tests whether the stream has a write function.
stream | The stream to test. |
Definition at line 245 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
References as_stream::hooks.
|
inline |
Write a value to the stream
stream | The stream to write to. |
value | The element to write to the stream. |
Definition at line 230 of file modules/common/target/Linux-x86_64/include/aerospike/as_stream.h.
References AS_STREAM_ERR, and as_util_hook.