Go to the source code of this file.
#define AS_STREAM_END ((void *) 0) |
Stream Status Codes
Enumerator |
---|
AS_STREAM_OK |
|
AS_STREAM_ERR |
|
Definition at line 43 of file as_stream.h.
static void as_stream_destroy |
( |
as_stream * |
stream | ) |
|
|
inlinestatic |
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.
References data, as_stream::data, as_stream::free, and as_stream::hooks.
AS_EXTERN void* as_stream_malloc |
( |
size_t |
size | ) |
|
Wrapper functions to ensure each CF allocation-related function call has a unique line.
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 197 of file as_stream.h.
References as_util_hook.
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 211 of file as_stream.h.
References as_stream::hooks.
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 183 of file as_stream.h.
References as_stream::data.
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 241 of file as_stream.h.
References as_stream::hooks.
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 226 of file as_stream.h.
References AS_STREAM_ERR, and as_util_hook.