cucon/parray.h: Array of Pointers
[Linear Containers (lists, stacks, arrays)]

Data Structures

struct  cucon_parray

Functions

void cucon_parray_init_empty (cucon_parray_t arr)
cucon_parray_t cucon_parray_new_empty (void)
void cucon_parray_init_size (cucon_parray_t arr, size_t size)
cucon_parray_t cucon_parray_new_size (size_t size)
void cucon_parray_init_fill (cucon_parray_t arr, size_t size, void *ptr)
cucon_parray_t cucon_parray_new_fill (size_t size, void *ptr)
void cucon_parray_swap (cucon_parray_t arr0, cucon_parray_t arr1)
size_t cucon_parray_size (cucon_parray_t arr)
cu_ptr_ptr_t cucon_parray_ref_at (cucon_parray_t arr, size_t index)
void * cucon_parray_at (cucon_parray_t arr, size_t index)
void cucon_parray_set_at (cucon_parray_t arr, size_t index, void *ptr)
void cucon_parray_resize_gp (cucon_parray_t arr, size_t size)
void cucon_parray_resize_gpmax (cucon_parray_t arr, size_t size)
void cucon_parray_resize_exact (cucon_parray_t arr, size_t size)
void cucon_parray_resize_exactmax (cucon_parray_t arr, size_t size)
void cucon_parray_resize_gp_fill (cucon_parray_t arr, size_t size, void *ptr)
void cucon_parray_resize_gpmax_fill (cucon_parray_t arr, size_t size, void *ptr)
void cucon_parray_resize_exact_fill (cucon_parray_t arr, size_t size, void *ptr)
void cucon_parray_resize_exactmax_fill (cucon_parray_t arr, size_t size, void *ptr)
void cucon_parray_append_gp (cucon_parray_t arr, void *elt)
void cucon_parray_fill_all (cucon_parray_t arr, void *ptr)
void cucon_parray_fill_range (cucon_parray_t arr, size_t start, size_t end, void *ptr)
void ** cucon_parray_begin (cucon_parray_t arr)
void ** cucon_parray_end (cucon_parray_t arr)

Detailed Description

This is mostly a light wrapper around cucon/array.h, with sizes and indices scaled for pointer-typed elements.

See also:
cucon/array.h: Generic Array
cucon/bitarray.h: Array of Bits

Function Documentation

void cucon_parray_append_gp ( cucon_parray_t  arr,
void *  elt 
)

Append elt to arr, extending the capacity in geometric progression.

void* cucon_parray_at ( cucon_parray_t  arr,
size_t  index 
)

Get component index of arr.

void** cucon_parray_begin ( cucon_parray_t  arr  ) 

A pointer to the start of the internal array.

See also:
cucon_parray_end
void** cucon_parray_end ( cucon_parray_t  arr  ) 

A pointer past the end of the internal array.

See also:
cucon_parray_begin
void cucon_parray_fill_all ( cucon_parray_t  arr,
void *  ptr 
)

Set all elements of arr to ptr.

void cucon_parray_fill_range ( cucon_parray_t  arr,
size_t  start,
size_t  end,
void *  ptr 
)

Set elements of arr from start up to but not including end to ptr.

void cucon_parray_init_empty ( cucon_parray_t  arr  ) 

Initialises arr to as empty array.

void cucon_parray_init_fill ( cucon_parray_t  arr,
size_t  size,
void *  ptr 
)

Construct a arr as an array of size elements all equal to ptr.

void cucon_parray_init_size ( cucon_parray_t  arr,
size_t  size 
)

Initialises arr to an array of size uninitialised pointers.

cucon_parray_t cucon_parray_new_empty ( void   ) 

Returns an empty array.

cucon_parray_t cucon_parray_new_fill ( size_t  size,
void *  ptr 
)

Returns an array of size elements all equal to ptr.

cucon_parray_t cucon_parray_new_size ( size_t  size  ) 

Returns an array of size uninitialised pointers.

cu_ptr_ptr_t cucon_parray_ref_at ( cucon_parray_t  arr,
size_t  index 
)

Pointer to entry at index in arr.

Precondition:
arr is least index + 1 long.

void cucon_parray_resize_exact ( cucon_parray_t  arr,
size_t  size 
)

Resize arr to size, changing the capacity to match the size. If you are growing an array, cucon_array_resize_gp gives better amortised time-complexity.

void cucon_parray_resize_exact_fill ( cucon_parray_t  arr,
size_t  size,
void *  ptr 
)

Perform cucon_parray_resize_exact and set any new elements to ptr.

void cucon_parray_resize_exactmax ( cucon_parray_t  arr,
size_t  size 
)

Resize arr to size, increasing capacity to match the size if necesary. This call never decrease the capacity. If you are growing an array, cucon_array_resize_gpmax gives better amortised time-complexity.

void cucon_parray_resize_exactmax_fill ( cucon_parray_t  arr,
size_t  size,
void *  ptr 
)

Perform cucon_parray_resize_exactmax and set any new elements to ptr.

void cucon_parray_resize_gp ( cucon_parray_t  arr,
size_t  size 
)

Resize arr to size, changing the capacity in geometric progression if necessary.

void cucon_parray_resize_gp_fill ( cucon_parray_t  arr,
size_t  size,
void *  ptr 
)

Perform cucon_parray_resize_gp and set any new elements to ptr.

void cucon_parray_resize_gpmax ( cucon_parray_t  arr,
size_t  size 
)

Resize arr to size, increasing capacity geometrically if necessary. This call never decrease the capacity.

void cucon_parray_resize_gpmax_fill ( cucon_parray_t  arr,
size_t  size,
void *  ptr 
)

Perform cucon_parray_resize_gpmax and set any new elements to ptr.

void cucon_parray_set_at ( cucon_parray_t  arr,
size_t  index,
void *  ptr 
)

Set component index of arr to ptr.

size_t cucon_parray_size ( cucon_parray_t  arr  ) 

The size of arr.

void cucon_parray_swap ( cucon_parray_t  arr0,
cucon_parray_t  arr1 
)

Swap the values of arr0 and arr1.

Generated 2009-11-23 for culibs-0.25 using Doxygen. Maintained by Petter Urkedal.