ecoli_vec - Man Page
Name
ecoli_vec — Vectors
— Helpers for vectors manipulation.
Synopsis
Typedefs
typedef void(* ec_vec_elt_free_t) (void *ptr)
typedef void(* ec_vec_elt_copy_t) (void *dst, void *src)
Functions
struct ec_vec * ec_vec (size_t elt_size, size_t size, ec_vec_elt_copy_t copy, ec_vec_elt_free_t free)
int ec_vec_add_by_ref (struct ec_vec *vec, void *ptr)
int ec_vec_add_ptr (struct ec_vec *vec, void *elt)
int ec_vec_add_u8 (struct ec_vec *vec, uint8_t elt)
int ec_vec_add_u16 (struct ec_vec *vec, uint16_t elt)
int ec_vec_add_u32 (struct ec_vec *vec, uint32_t elt)
int ec_vec_add_u64 (struct ec_vec *vec, uint64_t elt)
int ec_vec_get (void *ptr, const struct ec_vec *vec, size_t idx)
struct ec_vec * ec_vec_dup (const struct ec_vec *vec)
struct ec_vec * ec_vec_ndup (const struct ec_vec *vec, size_t off, size_t len)
void ec_vec_free (struct ec_vec *vec)
Detailed Description
Helpers for vectors manipulation.
The ec_vec API provide helpers to manipulate vectors of objects of any kind.
Typedef Documentation
typedef void(* ec_vec_elt_free_t) (void *ptr)
Custom free callback.
If NULL, default does nothing
Definition at line 26 of file ecoli_vec.h.
typedef void(* ec_vec_elt_copy_t) (void *dst, void *src)
Custom copy callback
If NULL, default is: memcpy(dst, src, vec->elt_size)
Definition at line 33 of file ecoli_vec.h.
Function Documentation
struct ec_vec * ec_vec (size_t elt_size, size_t size, ec_vec_elt_copy_t copy, ec_vec_elt_free_t free)
Create a new vector.
int ec_vec_add_by_ref (struct ec_vec * vec, void * ptr)
Add reference to a vector.
int ec_vec_add_ptr (struct ec_vec * vec, void * elt)
Add opaque element to a vector.
int ec_vec_add_u8 (struct ec_vec * vec, uint8_t elt)
Add uint8_t value to a vector.
int ec_vec_add_u16 (struct ec_vec * vec, uint16_t elt)
Add uint16_t value to a vector.
int ec_vec_add_u32 (struct ec_vec * vec, uint32_t elt)
Add uint32_t value to a vector.
int ec_vec_add_u64 (struct ec_vec * vec, uint64_t elt)
Add uint64_t value to a vector.
int ec_vec_get (void * ptr, const struct ec_vec * vec, size_t idx)
Get element located at an offset.
struct ec_vec * ec_vec_dup (const struct ec_vec * vec)
Duplicate a vector.
struct ec_vec * ec_vec_ndup (const struct ec_vec * vec, size_t off, size_t len)
Duplicate a portion of a vector.
void ec_vec_free (struct ec_vec * vec)
Free a vector and all its contents.
Author
Generated automatically by Doxygen for Libecoli from the source code.
Referenced By
The man pages ec_vec(3), ec_vec_add_by_ref(3), ec_vec_add_ptr(3), ec_vec_add_u16(3), ec_vec_add_u32(3), ec_vec_add_u64(3), ec_vec_add_u8(3), ec_vec_dup(3), ec_vec_elt_copy_t(3), ec_vec_elt_free_t(3), ec_vec_free(3), ec_vec_get(3) and ec_vec_ndup(3) are aliases of ecoli_vec(3).