Go to the source code of this file.
◆ AS_STREAM_END
#define AS_STREAM_END ((void *) 0) |
◆ as_stream_status
Stream Status Codes
Enumerator |
---|
AS_STREAM_OK | |
AS_STREAM_ERR | |
Definition at line 43 of file as_stream.h.
◆ as_stream_destroy()
static void as_stream_destroy |
( |
as_stream * | stream | ) |
|
|
inlinestatic |
Destroy the as_stream and associated resources.
- Parameters
-
stream | The stream to destroy. |
Definition at line 160 of file as_stream.h.
◆ as_stream_free()
◆ as_stream_init()
Initializes a stack allocated as_stream for a given source and hooks.
- Parameters
-
stream | The stream to initialize. |
data | The source feeding the stream |
hooks | The hooks that interface with the source |
- Returns
- On success, the initialized stream. Otherwise NULL.
Definition at line 122 of file as_stream.h.
◆ as_stream_malloc()
AS_EXTERN void * as_stream_malloc |
( |
size_t | size | ) |
|
Wrapper functions to ensure each CF allocation-related function call has a unique line.
◆ as_stream_new()
Creates a new heap allocated as_stream for a given source and hooks.
- Parameters
-
data | The source feeding the stream |
hooks | The hooks that interface with the source |
- Returns
- On success, a new stream. Otherwise NULL.
Definition at line 142 of file as_stream.h.
◆ as_stream_read()
Reads a value from the stream
- Parameters
-
stream | The stream to be read. |
- Returns
- the element read from the stream or STREAM_END
Definition at line 195 of file as_stream.h.
◆ as_stream_readable()
static bool as_stream_readable |
( |
const as_stream * | stream | ) |
|
|
inlinestatic |
Is the stream readable? Tests whether the stream has a read function.
- Parameters
-
stream | The stream to test. |
- Returns
- true if the stream can be read from
Definition at line 209 of file as_stream.h.
◆ as_stream_source()
static void * as_stream_source |
( |
const as_stream * | stream | ) |
|
|
inlinestatic |
Get the source for the stream
- Parameters
-
stream | The stream to get the source from |
- Returns
- pointer to the source of the stream
Definition at line 181 of file as_stream.h.
◆ as_stream_writable()
static bool as_stream_writable |
( |
const as_stream * | stream | ) |
|
|
inlinestatic |
Is the stream writable? Tests whether the stream has a write function.
- Parameters
-
stream | The stream to test. |
- Returns
- true if the stream can be written to.
Definition at line 239 of file as_stream.h.
◆ as_stream_write()
Write a value to the stream
- Parameters
-
stream | The stream to write to. |
value | The element to write to the stream. |
- Returns
- AS_STREAM_OK on success, otherwise is failure.
Definition at line 224 of file as_stream.h.