liba 0.1.15
An algorithm library based on C/C++
|
basic buffer library More...
#include "a.h"
Go to the source code of this file.
Data Structures | |
struct | a_buf |
instance structure for basic buffer More... | |
Macros | |
#define | A_BUF_PTR(T, ctx) |
#define | A_BUF_AT_(T, ctx, idx) |
#define | A_BUF_AT(T, ctx, idx) |
#define | A_BUF_IDX(T, ctx, idx) |
#define | A_BUF_TOP_(T, ctx) |
#define | A_BUF_TOP(T, ctx) |
#define | A_BUF_END(T, ctx) |
#define | A_BUF_PUSH_SORT(T, ctx, key, cmp) |
#define | A_BUF_SEARCH(T, ctx, obj, cmp) |
#define | A_BUF_INSERT(T, ctx, idx) |
#define | A_BUF_REMOVE(T, ctx, idx) |
#define | A_BUF_PUSH_FORE(T, ctx) |
#define | A_BUF_PUSH_BACK(T, ctx) |
#define | A_BUF_PULL_FORE(T, ctx) |
#define | A_BUF_PULL_BACK(T, ctx) |
#define | A_BUF_PUSH(T, ctx) |
#define | A_BUF_PULL(T, ctx) |
#define | a_buf_forenum(i, ctx) |
iterate over a buffer | |
#define | a_buf_forenum_reverse(i, ctx) |
iterate over a buffer in reverse | |
#define | a_buf_foreach(T, P, it, ctx) |
iterate over a buffer | |
#define | a_buf_foreach_reverse(T, P, it, ctx) |
iterate over a buffer in reverse | |
Typedefs | |
typedef struct a_buf | a_buf |
instance structure for basic buffer | |
Functions | |
void * | a_buf_ptr (a_buf const *ctx) |
access address of buffer for a pointer to buffer structure | |
size_t | a_buf_siz (a_buf const *ctx) |
access size of a element for a pointer to buffer structure | |
size_t | a_buf_num (a_buf const *ctx) |
access number of element for a pointer to buffer structure | |
size_t | a_buf_mem (a_buf const *ctx) |
access memory of element for a pointer to buffer structure | |
void * | a_buf_at_ (a_buf const *ctx, size_t idx) |
access specified element for a pointer to buffer structure | |
void * | a_buf_at (a_buf const *ctx, size_t idx) |
access specified element for a pointer to buffer structure | |
void * | a_buf_idx (a_buf const *ctx, ptrdiff_t idx) |
access specified element for a pointer to buffer structure | |
void * | a_buf_top_ (a_buf const *ctx) |
access top element for a pointer to buffer structure | |
void * | a_buf_top (a_buf const *ctx) |
access top element for a pointer to buffer structure | |
void * | a_buf_end (a_buf const *ctx) |
access end pointer for a pointer to buffer structure | |
void | a_buf_ctor (a_buf *ctx, void *ptr, size_t siz, size_t num) |
constructor for buffer structure | |
void | a_buf_dtor (a_buf *ctx, void(*dtor)(void *)) |
destructor for buffer structure | |
void | a_buf_move (a_buf *ctx, a_buf *obj) |
initialize a pointer to buffer structure by moving | |
void | a_buf_drop (a_buf *ctx, void(*dtor)(void *)) |
drop all the elements for a pointer to buffer structure | |
void | a_buf_swap (a_buf const *ctx, size_t lhs, size_t rhs) |
swap elements lhs and rhs for a pointer to buffer structure | |
void | a_buf_sort (a_buf const *ctx, int(*cmp)(void const *, void const *)) |
sort all elements for a pointer to buffer structure | |
void | a_buf_sort_fore (a_buf const *ctx, int(*cmp)(void const *, void const *)) |
insert sort foremost element for a pointer to buffer structure | |
void | a_buf_sort_back (a_buf const *ctx, int(*cmp)(void const *, void const *)) |
insert sort backmost element for a pointer to buffer structure | |
void * | a_buf_push_sort (a_buf *ctx, void const *key, int(*cmp)(void const *, void const *)) |
push an element into the buffer and sort it | |
void * | a_buf_search (a_buf const *ctx, void const *obj, int(*cmp)(void const *, void const *)) |
search the given element in this buffer | |
void * | a_buf_insert (a_buf *ctx, size_t idx) |
insert an element into the buffer | |
void * | a_buf_remove (a_buf *ctx, size_t idx) |
remove an element from the buffer | |
void * | a_buf_push_fore (a_buf *ctx) |
push an element into the buffer forward | |
void * | a_buf_push_back (a_buf *ctx) |
push an element into the buffer backward | |
void * | a_buf_pull_fore (a_buf *ctx) |
pull an element from the buffer forward | |
void * | a_buf_pull_back (a_buf *ctx) |
pull an element from the buffer backward | |
void * | a_buf_push (a_buf *ctx) |
push an element into the buffer | |
void * | a_buf_pull (a_buf *ctx) |
pull an element from the buffer | |
basic buffer library