cp_vector_create(3)

cp_vector(3) libcprops - cp_vector cp_vector(3)

NAME

cp_vector_create, cp_vector_create_by_option - create a vector object

SYNOPSIS

#include <cprops/vector.h>

cp_vector *cp_vector_create(int size);

cp_vector *cp_vector_create_by_option(int size, int mode, cp_copy_fn copy_item, cp_destructor_fn free_item);

cp_vector *cp_vector_wrap(void **data, int len, int mode);

DESCRIPTION

cp_vector_create_by_option creates a vector with initial storage for size items with the given mode, using copy_item to copy items on insertion if mode has the COLLECTION_MODE_COPY bit set, and free_item to release items if mode has the COLLECTION_MODE_DEEP bit set.

cp_vector_create is equivalent to

cp_vector_create_by_mode(size, COLLECTION_MODE_MULTIPLE_VALUES, 

NULL, NULL)

cp_vector_wrap creates a cp_vector object with the given data parameter as its content, setting the initial size to size and the operation mode to mode.

RETURN VALUE

a newly created cp_vector on success or NULL on failure.

SEE ALSO

cp_vector_destroy(3), cp_vector_destroy_custom(3)

MARCH 2006 libcprops.0.0.12