Stream Interface
To use the stream interface, you will need to create an instance via one of the implementations.
Definition at line 56 of file as_stream.h.
#include "as_stream.h"
Data Fields | |
void * | data |
bool | free |
const struct as_stream_hooks_s * | hooks |
Related Functions | |
(Note that these are not member functions.) | |
static void | as_stream_destroy (as_stream *stream) |
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_val * | as_stream_read (const as_stream *stream) |
static bool | as_stream_readable (const as_stream *stream) |
static void * | as_stream_source (const as_stream *stream) |
static bool | as_stream_writable (const as_stream *stream) |
static as_stream_status | as_stream_write (const as_stream *stream, as_val *value) |
|
related |
Destroy the as_stream and associated resources.
stream | The stream to destroy. |
Definition at line 162 of file as_stream.h.
|
related |
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 122 of file as_stream.h.
|
related |
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 142 of file as_stream.h.
Reads a value from the stream
stream | The stream to be read. |
Definition at line 197 of file as_stream.h.
|
related |
Is the stream readable? Tests whether the stream has a read function.
stream | The stream to test. |
Definition at line 211 of file as_stream.h.
|
related |
Get the source for the stream
stream | The stream to get the source from |
Definition at line 183 of file as_stream.h.
|
related |
Is the stream writable? Tests whether the stream has a write function.
stream | The stream to test. |
Definition at line 241 of file as_stream.h.
|
related |
Write a value to the stream
stream | The stream to write to. |
value | The element to write to the stream. |
Definition at line 226 of file as_stream.h.
void* as_stream::data |
Context data for the stream.
Definition at line 67 of file as_stream.h.
bool as_stream::free |
Specifies whether the cf_free() can be used on this stream.
Definition at line 62 of file as_stream.h.
const struct as_stream_hooks_s* as_stream::hooks |
Hooks for the stream
Definition at line 72 of file as_stream.h.