#include <pthread.h>
#include <stdint.h>
#include "citrusleaf/cf_base_types.h"
Go to the source code of this file.
Macros |
#define | VECTOR_ELEM_SZ(_v) ( _h->value_len ) |
#define | VECTOR_FLAG_BIGLOCK 0x01 |
#define | VECTOR_FLAG_INITZERO 0x02 |
#define | VECTOR_FLAG_BIGRESIZE 0x04 |
#define | VECTOR_REDUCE_DELETE (1) |
#define | cf_vector_define(__x, __value_len, __flags) uint8_t cf_vector##__x[1024]; cf_vector __x; cf_vector_init_smalloc(&__x, __value_len, cf_vector##__x, sizeof(cf_vector##__x), __flags); |
#define | cf_vector_define_clone(__source, __target) uint8_t cf_vector##__target[__source.len]; cf_vector __target; cf_vector_clone_stack(&__source, &__target, cf_vector##__target); |
#define | cf_vector_reset(__v) (__v)->len = 0; if ( (__v)->flags & VECTOR_FLAG_INITZERO) memset( (__v)->vector, 0, (__v)->alloc_len * (__v)->value_len); |
Functions |
cf_vector * | cf_vector_create (uint32_t value_len, uint32_t init_sz, unsigned int flags) |
int | cf_vector_init (cf_vector *v, uint32_t value_len, uint32_t init_sz, unsigned int flags) |
void | cf_vector_init_smalloc (cf_vector *v, uint32_t value_len, uint8_t *sbuf, int sbuf_sz, unsigned int flags) |
void | cf_vector_clone_stack (cf_vector *source, cf_vector *target, uint8_t *target_buf) |
int | cf_vector_set (cf_vector *v, uint32_t index, void *value) |
int | cf_vector_get (cf_vector *v, uint32_t index, void *value) |
void * | cf_vector_getp (cf_vector *v, uint32_t index) |
void * | cf_vector_getp_vlock (cf_vector *v, uint32_t index, pthread_mutex_t **vlock) |
int | cf_vector_append (cf_vector *v, void *value) |
int | cf_vector_append_unique (cf_vector *v, void *value) |
int | cf_vector_delete (cf_vector *v, uint32_t index) |
int | cf_vector_delete_range (cf_vector *v, uint32_t start_index, uint32_t end_index) |
void | cf_vector_compact (cf_vector *v) |
void | cf_vector_destroy (cf_vector *v) |
Macro Definition Documentation
#define cf_vector_reset |
( |
|
__v | ) |
(__v)->len = 0; if ( (__v)->flags & VECTOR_FLAG_INITZERO) memset( (__v)->vector, 0, (__v)->alloc_len * (__v)->value_len); |
#define VECTOR_ELEM_SZ |
( |
|
_v | ) |
( _h->value_len ) |
#define VECTOR_FLAG_BIGLOCK 0x01 |
#define VECTOR_FLAG_BIGRESIZE 0x04 |
#define VECTOR_FLAG_INITZERO 0x02 |
#define VECTOR_REDUCE_DELETE (1) |
Typedef Documentation
Function Documentation
int cf_vector_append |
( |
cf_vector * |
v, |
|
|
void * |
value |
|
) |
| |
int cf_vector_append_unique |
( |
cf_vector * |
v, |
|
|
void * |
value |
|
) |
| |
void cf_vector_clone_stack |
( |
cf_vector * |
source, |
|
|
cf_vector * |
target, |
|
|
uint8_t * |
target_buf |
|
) |
| |
cf_vector* cf_vector_create |
( |
uint32_t |
value_len, |
|
|
uint32_t |
init_sz, |
|
|
unsigned int |
flags |
|
) |
| |
int cf_vector_delete |
( |
cf_vector * |
v, |
|
|
uint32_t |
index |
|
) |
| |
int cf_vector_delete_range |
( |
cf_vector * |
v, |
|
|
uint32_t |
start_index, |
|
|
uint32_t |
end_index |
|
) |
| |
int cf_vector_get |
( |
cf_vector * |
v, |
|
|
uint32_t |
index, |
|
|
void * |
value |
|
) |
| |
void* cf_vector_getp |
( |
cf_vector * |
v, |
|
|
uint32_t |
index |
|
) |
| |
void* cf_vector_getp_vlock |
( |
cf_vector * |
v, |
|
|
uint32_t |
index, |
|
|
pthread_mutex_t ** |
vlock |
|
) |
| |
int cf_vector_init |
( |
cf_vector * |
v, |
|
|
uint32_t |
value_len, |
|
|
uint32_t |
init_sz, |
|
|
unsigned int |
flags |
|
) |
| |
void cf_vector_init_smalloc |
( |
cf_vector * |
v, |
|
|
uint32_t |
value_len, |
|
|
uint8_t * |
sbuf, |
|
|
int |
sbuf_sz, |
|
|
unsigned int |
flags |
|
) |
| |
int cf_vector_set |
( |
cf_vector * |
v, |
|
|
uint32_t |
index, |
|
|
void * |
value |
|
) |
| |