Go to the source code of this file.
|
| enum | cvx_flags {
CVX_FLAG_OK = 0
, CVX_FLAG_VTAB = 1
, CVX_FLAG_WRONG_TAG = 2
, CVX_FLAG_ALLOC = 3
,
CVX_FLAG_EMPTY = 4
, CVX_FLAG_FULL = 5
, CVX_FLAG_RANGE = 6
, CVX_FLAG_NOT_FOUND = 7
,
CVX_FLAG_INVALID = 8
, CVX_FLAG_DUPLICATE = 9
, CVX_FLAG_ERROR = 10
} |
| | buffer_iterator.h More...
|
| |
| enum | cvx_heap_order { CVX_MAX_HEAP = 1
, CVX_MIN_HEAP = -1
} |
| | enum cvx_heap_order More...
|
| |
◆ cvx_container
◆ cvx_flags
buffer_iterator.h
Status
[x] concept [x] v1 [ ] tests [ ] refine [ ] stabilize
The implementation of the buffer iterator can be tuned depending on what the underlying data structure needs.
This is the basic interface: for (struct iterator it = init_iter(&arr); !iter_at_end(&it); iter_next(&it)) { char *key = iter_key(&it); int value = iter_value(&it); ... }
User defined macro options
- SPARSE(item): a function-like macro that receives and item and checks if this is just a "hole" or an actual item
- CIRCULAR: if enabled, the pointer wraps around the buffer's capacity
Other macros
- EMBEDDED: Used by other data structures to automatically implement an iterator. When this is enabled, it changes the input macros and prefixes them all with "IT_".
Status and error flags for the CVX library.
Error Handling
| Enumerator |
|---|
| CVX_FLAG_OK | No errors.
|
| CVX_FLAG_VTAB | Required vtab function was not provided.
|
| CVX_FLAG_WRONG_TAG | Tags are checked so you don't pass the wrong struct to a function.
|
| CVX_FLAG_ALLOC | Allocation failed.
|
| CVX_FLAG_EMPTY | Operation can not proceed because the container is empty.
|
| CVX_FLAG_FULL | When a container that doesn't resize is full.
|
| CVX_FLAG_RANGE | Index out of range.
|
| CVX_FLAG_NOT_FOUND | Key or value not found.
|
| CVX_FLAG_INVALID | Invalid argument or operation.
|
| CVX_FLAG_DUPLICATE | Duplicate key or value.
|
| CVX_FLAG_ERROR | Generic error, or unknown error.
|
◆ cvx_heap_order
enum cvx_heap_order
Defines the two possible heaps:
- Max Heap has the greatest element at the top
- Min Heap has the smallest element at the top
| Enumerator |
|---|
| CVX_MAX_HEAP | |
| CVX_MIN_HEAP | |
◆ bi_at_end()
◆ bi_at_start()
◆ bi_backward()
◆ bi_end()
| struct buffer_iterator bi_end |
( |
TVal * |
buffer, |
|
|
size_t |
capacity, |
|
|
size_t |
count |
|
) |
| |
◆ bi_forward()
◆ bi_go_to()
◆ bi_index()
◆ bi_next()
◆ bi_prev()
◆ bi_start()
| struct buffer_iterator bi_start |
( |
TVal * |
buffer, |
|
|
size_t |
capacity, |
|
|
size_t |
count |
|
) |
| |
◆ bi_to_end()
◆ bi_to_start()
◆ bi_value()