liba 0.1.15
An algorithm library based on C/C++
|
basic vector library More...
#include "a.h"
Go to the source code of this file.
Data Structures | |
struct | a_vec |
instance structure for basic vector More... | |
Macros | |
#define | A_VEC_PTR(T, ctx) |
#define | A_VEC_AT_(T, ctx, idx) |
#define | A_VEC_AT(T, ctx, idx) |
#define | A_VEC_IDX(T, ctx, idx) |
#define | A_VEC_TOP_(T, ctx) |
#define | A_VEC_TOP(T, ctx) |
#define | A_VEC_END_(T, ctx) |
#define | A_VEC_END(T, ctx) |
#define | A_VEC_PUSH_SORT(T, ctx, key, cmp) |
#define | A_VEC_SEARCH(T, ctx, obj, cmp) |
#define | A_VEC_INSERT(T, ctx, idx) |
#define | A_VEC_REMOVE(T, ctx, idx) |
#define | A_VEC_PUSH_FORE(T, ctx) |
#define | A_VEC_PUSH_BACK(T, ctx) |
#define | A_VEC_PULL_FORE(T, ctx) |
#define | A_VEC_PULL_BACK(T, ctx) |
#define | A_VEC_PUSH(T, ctx) |
#define | A_VEC_PULL(T, ctx) |
#define | a_vec_forenum(i, ctx) |
iterate over a vector | |
#define | a_vec_forenum_reverse(i, ctx) |
iterate over a vector in reverse | |
#define | a_vec_foreach(T, P, it, ctx) |
iterate over a vector | |
#define | a_vec_foreach_reverse(T, P, it, ctx) |
iterate over a vector in reverse | |
Typedefs | |
typedef struct a_vec | a_vec |
instance structure for basic vector | |
Functions | |
void * | a_vec_ptr (a_vec const *ctx) |
access address of vector for a pointer to vector structure | |
size_t | a_vec_siz (a_vec const *ctx) |
access size of a element for a pointer to vector structure | |
size_t | a_vec_num (a_vec const *ctx) |
access number of element for a pointer to vector structure | |
size_t | a_vec_mem (a_vec const *ctx) |
access memory of element for a pointer to vector structure | |
void * | a_vec_at_ (a_vec const *ctx, size_t idx) |
access specified element for a pointer to vector structure | |
void * | a_vec_at (a_vec const *ctx, size_t idx) |
access specified element for a pointer to vector structure | |
void * | a_vec_idx (a_vec const *ctx, ptrdiff_t idx) |
access specified element for a pointer to vector structure | |
void * | a_vec_top_ (a_vec const *ctx) |
access top element for a pointer to vector structure | |
void * | a_vec_top (a_vec const *ctx) |
access top element for a pointer to vector structure | |
void * | a_vec_end_ (a_vec const *ctx) |
access end pointer for a pointer to vector structure | |
void * | a_vec_end (a_vec const *ctx) |
access end pointer for a pointer to vector structure | |
a_vec * | a_vec_new (size_t size) |
allocate a pointer to vector structure from memory | |
void | a_vec_die (a_vec *ctx, void(*dtor)(void *)) |
deallocate a pointer to vector structure | |
void | a_vec_ctor (a_vec *ctx, size_t size) |
constructor for vector structure | |
void | a_vec_dtor (a_vec *ctx, void(*dtor)(void *)) |
destructor for vector structure | |
int | a_vec_copy (a_vec *ctx, a_vec const *obj, int(*dup)(void *, void const *)) |
initialize a pointer to vector structure by copying | |
void | a_vec_move (a_vec *ctx, a_vec *obj) |
initialize a pointer to vector structure by moving | |
void | a_vec_edit (a_vec *ctx, size_t size, void(*dtor)(void *)) |
edit size of a element for a pointer to vector structure | |
int | a_vec_make (a_vec *ctx, size_t num, void(*dtor)(void *)) |
modify element number for a pointer to string structure | |
void | a_vec_drop (a_vec *ctx, void(*dtor)(void *)) |
drop all the elements for a pointer to vector structure | |
void | a_vec_swap (a_vec const *ctx, size_t lhs, size_t rhs) |
swap elements lhs and rhs for a pointer to vector structure | |
void | a_vec_sort (a_vec const *ctx, int(*cmp)(void const *, void const *)) |
sort all elements for a pointer to vector structure | |
void | a_vec_sort_fore (a_vec const *ctx, int(*cmp)(void const *, void const *)) |
insert sort foremost element for a pointer to vector structure | |
void | a_vec_sort_back (a_vec const *ctx, int(*cmp)(void const *, void const *)) |
insert sort backmost element for a pointer to vector structure | |
void * | a_vec_push_sort (a_vec *ctx, void const *key, int(*cmp)(void const *, void const *)) |
push an element into the vector and sort it | |
void * | a_vec_search (a_vec const *ctx, void const *obj, int(*cmp)(void const *, void const *)) |
search the given element in this vector | |
void * | a_vec_insert (a_vec *ctx, size_t idx) |
insert an element into the vector | |
void * | a_vec_remove (a_vec *ctx, size_t idx) |
remove an element from the vector | |
void * | a_vec_push_fore (a_vec *ctx) |
push an element into the vector forward | |
void * | a_vec_push_back (a_vec *ctx) |
push an element into the vector backward | |
void * | a_vec_pull_fore (a_vec *ctx) |
pull an element from the vector forward | |
void * | a_vec_pull_back (a_vec *ctx) |
pull an element from the vector backward | |
void * | a_vec_push (a_vec *ctx) |
push an element into the vector | |
void * | a_vec_pull (a_vec *ctx) |
pull an element from the vector | |
basic vector library