Go to the source code of this file.
Data Structures | |
struct | ArrayStruct |
Array. More... | |
Defines | |
#define | arrayCreate(n, type) uArrayCreate(n,sizeof(type)) |
Create an Array of n elements having type type. | |
#define | arrayDestroy(a) ((a) ? uArrayDestroy(a), a=NULL, 1 : 0) |
Destroy Array a. | |
#define | arrayMax(ar) ((ar)->max) |
Return the number of elements in the array. | |
Typedefs | |
typedef struct ArrayStruct * | Array |
Array. | |
Functions | |
void | arrayByteUniq (Array a) |
Remove byte-wise identical entries. | |
void | arrayClear (Array a) |
Clear contents of Array a. | |
Array | arrayCopy (Array a) |
Copies an Array a. | |
int | arrayDoublecmp (double *dp1, double *dp2) |
Comparison function for doubles (double). | |
int | arrayFind (Array a, void *s, int *ip, int(*order)(void *, void *)) |
Finds Entry s from Array a sorted in ascending order of order(). | |
int | arrayFindInsert (Array a, void *s, int *ip, int(*order)(void *, void *)) |
Try to find element s in Array a; insert it if not there. | |
int | arrayIntcmp (int *ip1, int *ip2) |
Comparison function for integers (int). | |
int | arrayIsEntry (Array a, int i, void *s) |
Check if s is an entry in a. | |
void | arrayMove (Array from, int start, int end, Array to) |
Move elements from an Array to another Array. | |
int | arrayNumber (void) |
Returns number of Arrays currently allocated. | |
int | arrayRemove (Array a, void *s, int(*order)(void *, void *)) |
Removes Entry s from Array a sorted in ascending order of order(). | |
int | arrayRemoveD (Array a, int i) |
Removes Entry with index i from Array a. | |
void | arraySort (Array a, int(*order)(void *, void *)) |
Sort an Array a according to order of order(). | |
int | arrayStrcmp (char **s1, char **s2) |
Comparison function for strings (char*). | |
void | arrayUniq (Array a, Array b, int(*order)(void *, void *)) |
Definition in file array.h.
void arrayByteUniq | ( | Array | a | ) |
Remove byte-wise identical entries.
[in] | a | Array sorted such that byte-wise identical entries are adjacent |
[out] | a | Byte-wise identical duplicates removed |
Use arrayUniq() for duplicate removal based on equality defined by order() function
int arrayFind | ( | Array | a, | |
void * | s, | |||
int * | ip, | |||
int(*)(void *, void *) | order | |||
) |
int arrayFindInsert | ( | Array | a, | |
void * | s, | |||
int * | ip, | |||
int(*)(void *, void *) | order | |||
) |
int arrayIsEntry | ( | Array | a, | |
int | i, | |||
void * | s | |||
) |
Move elements from an Array to another Array.
Move elements from[start..end] to to[m..m+end-start+1].
[in] | from | Array to cut elements out of |
[in] | start | Start index in 'from' |
[in] | end | End index in 'from' |
[in] | to | Array to append cut elements to. NULL if this is not needed (only a good idea if elements don't own memory via pointers). |
[out] | from | Elements removed; formerly used space. after end of data filled with binary zeros. |
[out] | to | If not NULL: moved elements from 'from' appended. |
int arrayRemove | ( | Array | a, | |
void * | s, | |||
int(*)(void *, void *) | order | |||
) |
[in] | a | Array sorted by the same order function that is specified as the second argument |
[in] | b | Array of same type as a, NULL ok (if one is not interested in getting the duplicates) |
[out] | a | All duplicates which are identical according to the specified order function are moved to b |
[out] | b | If not NULL: duplicates appended |