#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Compounds | |
struct | ccp4array_base_ |
Defines | |
#define | ccp4array_new(v) ccp4array_new_((ccp4_ptr*)(&v)) |
#define | ccp4array_new_size(v, s) ccp4array_new_size_((ccp4_ptr*)(&v),s,sizeof(*v)) |
#define | ccp4array_resize(v, s) ccp4array_resize_((ccp4_ptr*)(&v),s,sizeof(*v)) |
#define | ccp4array_reserve(v, s) ccp4array_reserve_((ccp4_ptr*)(&v),s,sizeof(*v)) |
#define | ccp4array_append(v, d) ccp4array_append_((ccp4_ptr*)(&v),(ccp4_constptr)(&d),sizeof(*v)) |
#define | ccp4array_append_n(v, d, n) ccp4array_append_n_((ccp4_ptr*)(&v),(ccp4_constptr)(&d),n,sizeof(*v)) |
#define | ccp4array_append_list(v, l, n) ccp4array_append_list_((ccp4_ptr*)(&v),(ccp4_constptr)l,n,sizeof(*v)) |
#define | ccp4array_insert(v, i, d) ccp4array_insert_((ccp4_ptr*)(&v),i,(ccp4_constptr)(&d),sizeof(*v)) |
#define | ccp4array_delete_ordered(v, i) ccp4array_delete_ordered_((ccp4_ptr*)(&v),i,sizeof(*v)) |
#define | ccp4array_delete(v, i) ccp4array_delete_((ccp4_ptr*)(&v),i,sizeof(*v)) |
#define | ccp4array_delete_last(v) ccp4array_delete_last_((ccp4_ptr*)(&v),sizeof(*v)) |
#define | ccp4array_size(v) ccp4array_size_((ccp4_constptr*)(&v)) |
#define | ccp4array_free(v) ccp4array_free_((ccp4_ptr*)(&v)) |
Typedefs | |
typedef const void * | ccp4_constptr |
typedef char * | ccp4_byteptr |
typedef void * | ccp4_ptr |
typedef ccp4array_base_ | ccp4array_base |
Functions | |
ccp4_ptr | ccp4array_new_ (ccp4_ptr *p) |
ccp4_ptr | ccp4array_new_size_ (ccp4_ptr *p, const int size, const size_t reclen) |
void | ccp4array_resize_ (ccp4_ptr *p, const int size, const size_t reclen) |
void | ccp4array_reserve_ (ccp4_ptr *p, const int size, const size_t reclen) |
void | ccp4array_append_ (ccp4_ptr *p, ccp4_constptr data, const size_t reclen) |
void | ccp4array_append_n_ (ccp4_ptr *p, ccp4_constptr data, const int n, const size_t reclen) |
void | ccp4array_append_list_ (ccp4_ptr *p, ccp4_constptr data, const int n, const size_t reclen) |
void | ccp4array_insert_ (ccp4_ptr *p, const int i, ccp4_constptr data, const size_t reclen) |
void | ccp4array_delete_ordered_ (ccp4_ptr *p, const int i, const size_t reclen) |
void | ccp4array_delete_ (ccp4_ptr *p, const int i, const size_t reclen) |
void | ccp4array_delete_last_ (ccp4_ptr *p, const size_t reclen) |
int | ccp4array_size_ (ccp4_constptr *p) |
void | ccp4array_free_ (ccp4_ptr *p) |
|
Macro to append an element to an array. This increments the size. Memory allocation only takes place if the new size is greater than the capacity.
|
|
Macro to append n elements from another list to an array. This increment the size by n. Memory allocation only takes place if the new size is greater than the capacity.
|
|
Macro to append n copies of an element to an array. This increments the size by n. Memory allocation only takes place if the new size is greater than the capacity.
|
|
Macro to delete element[i] of an array without preserving order. The last element is moved into the gap, and the size is decremented.
|
|
Macro to delete the last element of an array. This decrements the size.
|
|
Macro to delete element[i] of an array, preserving order. This decrements the size. All subsequent elements are moved down. As a result this method is slow.
|
|
Macro free the array. All memory, including the header, is freed.
|
|
Macro to insert an element before the element[i] of an array. This increments the size. All subsequent elements are moved up. As a result this method is slow.
|
|
Macro to allocate a new array. The array is allocated with a size and capacity of 0
|
|
Macro to allocate a new array with non-zero size. The array is allocated with a size of s and capacity of at least s
|
|
Macro to reserve space for an array. This forces a memory reallocation. The size of the array is unchanged, unless the new capacity is less than the current size, in which case the size is set to the new capacity. Unlike resize, the new allocation will be exactly the size of the array.
|
|
Macro to resize an array. This changes the size. Memory allocation only takes place if the new size is greater than the capacity. If that occurs, the new capacity will be slightly greater than the requested size, to allow room for expansion.
|
|
Macro to return the size of the array.
|
|
byte pointer type |
|
constant pointer type |
|
pointer type |
|
struct definition for the array pre-header |
|
See macro ccp4array_append |
|
See macro ccp4array_append_list |
|
See macro ccp4array_append_n |
|
See macro ccp4array_delete |
|
See macro ccp4array_delete_last |
|
See macro ccp4array_delete_ordered |
|
See macro ccp4array_free |
|
See macro ccp4array_insert |
|
See macro ccp4array_new |
|
See macro ccp4array_new_size |
|
See macro ccp4array_reserve |
|
See macro ccp4array_resize |
|
See macro ccp4array_size |