psArray.h File Reference


Detailed Description

Contains basic array definitions and operations.

This file defines the basic type for a array struct and functions useful in manupulating arrays.

Author:
Robert DeSonia, MHPCC

Ross Harman, MHPCC

Version:
Revision
1.45
Name
Date:
Date
2007/01/23 22:47:23
Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii

Definition in file psArray.h.

#include "psType.h"
#include "psCompare.h"

Include dependency graph for psArray.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  psArray
 An array to support primitive types. More...

Defines

#define P_PSARRAY_SET_NALLOC(vec, n)   *(long*)&vec->nalloc = n
#define PS_ASSERT_ARRAY_NON_NULL(NAME, RETURNVAL)   PS_ASSERT_GENERAL_ARRAY_NON_NULL(NAME, return RETURNVAL)
#define PS_ASSERT_GENERAL_ARRAY_NON_NULL(NAME, CLEANUP)
#define PS_ASSERT_ARRAY_NON_EMPTY(NAME, RETURNVAL)   PS_ASSERT_GENERAL_ARRAY_NON_EMPTY(NAME, return RETURNVAL)
#define PS_ASSERT_GENERAL_ARRAY_NON_EMPTY(NAME, CLEANUP)
#define PS_ASSERT_ARRAYS_SIZE_EQUAL(ARRAY1, ARRAY2, RVAL)
#define PS_ASSERT_ARRAY_SIZE(ARRAY, SIZE, RVAL)

Functions

bool psMemCheckArray (psPtr ptr)
 Checks the type of a particular pointer.
psArraypsArrayAlloc (long nalloc)
 Allocate an array, set the length to the number of allocated elements.
psArraypsArrayAllocEmpty (long nalloc)
 Allocate an array, set the length to zero.
psArraypsArrayRealloc (psArray *array, long nalloc)
 Reallocate an array.
psArraypsArrayAdd (psArray *array, long delta, psPtr data)
 Add an element to the end the array, expanding the array storage if necessary.
bool psArrayRemoveData (psArray *array, const psPtr data)
 Remove an element from the array by it's pointer.
bool psArrayRemoveIndex (psArray *array, long index)
 Remove an element from the array.
void psArrayElementsFree (psArray *array)
 Deallocate/Dereference elements of an array.
psArraypsArraySort (psArray *array, psComparePtrFunc func)
 Sort the array according to an external compare function.
bool psArraySet (psArray *array, long position, psPtr data)
 Set an element in the array.
psPtr psArrayGet (const psArray *array, long position)
 Get an element from the array.
long psArrayLength (const psArray *array)
 Get the number of elements in use from a specified psArray.


Generated on Fri Feb 2 22:24:39 2007 for pslib by  doxygen 1.5.1