C Array Manipulation
[C Data Manipulation]


Functions

int hps_array_create (array_t **array)
 Creates a C array_t object for storing an array.
int hps_array_build (array_t **array, void *data, int type, int nb,...)
 Creates a C array_t object from a C array of any dimension.
int hps_array_destroy (array_t **array)
 Destroys a C array_t object.
int hps_array_get (array_t *array, hpobj_t **obj, int nb,...)
 Gets an element from an array.
int hps_array_add (array_t *array, hpobj_t *obj)
 Adds an element to the end of a array.
int hps_array_add_type (array_t *array, int type, void *data)
 Adds an element of the specified type to the end of an array.
int hps_array_add_int (array_t *array, long long value)
 Adds an integer to the end of a array.
int hps_array_add_uint (array_t *array, unsigned long long value)
 Adds an unsigned integer to the end of a array.
int hps_array_add_real (array_t *array, double value)
 Adds a real to the end of a array.
int hps_array_add_complex (array_t *array, complex_t *value)
 Adds a complex to the end of a array.
int hps_array_add_str (array_t *array, char *value)
 Adds a string to the end of a array.
int hps_array_add_list (array_t *array, list_t *value)
 Adds a list to the end of a array.
int hps_array_add_array (array_t *array, array_t *value)
 Adds an array to the end of a array.
int hps_array_add_ident (array_t *array, char *value)
 Adds an ident to the end of a array.

Function Documentation

int hps_array_add array_t array,
hpobj_t obj
 

Adds an element to the end of a array.

This function adds a C hpobj_t object at the end of the specified array.

Parameters:
array The array to which the object has to be added
obj The object to add
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the list or object parameter is incorrect, HPS_OK otherwise

int hps_array_add_array array_t array,
array_t value
 

Adds an array to the end of a array.

This function adds an array element which value is provided at the end of the specified array.

Parameters:
array The array to which the object has to be added
value The array to add
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the array or object parameter is incorrect, HPS_OK otherwise

int hps_array_add_complex array_t array,
complex_t value
 

Adds a complex to the end of a array.

This function adds a complex element which value is provided at the end of the specified array.

Parameters:
array The array to which the object has to be added
value The pointer to the complex value
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the array or object parameter is incorrect, HPS_OK otherwise

int hps_array_add_ident array_t array,
char *  value
 

Adds an ident to the end of a array.

This function adds an ident element which value is provided at the end of the specified array.

Parameters:
array The array to which the object has to be added
value The ident to add
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the array or object parameter is incorrect, HPS_OK otherwise

int hps_array_add_int array_t array,
long long  value
 

Adds an integer to the end of a array.

This function adds an integer element which value is provided at the end of the specified array.

Parameters:
array The array to which the object has to be added
value The integer value
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the array or object parameter is incorrect, HPS_OK otherwise

int hps_array_add_list array_t array,
list_t value
 

Adds a list to the end of a array.

This function adds a list element which value is provided at the end of the specified array.

Parameters:
array The array to which the object has to be added
value The list to add
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the array or object parameter is incorrect, HPS_OK otherwise

int hps_array_add_real array_t array,
double  value
 

Adds a real to the end of a array.

This function adds a real element which value is provided at the end of the specified array.

Parameters:
array The array to which the object has to be added
value The real value
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the array or object parameter is incorrect, HPS_OK otherwise

int hps_array_add_str array_t array,
char *  value
 

Adds a string to the end of a array.

This function adds a string element which value is provided at the end of the specified array.

Parameters:
array The array to which the object has to be added
value The string value
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the array or object parameter is incorrect, HPS_OK otherwise

int hps_array_add_type array_t array,
int  type,
void *  data
 

Adds an element of the specified type to the end of an array.

This function adds an element (described by its type and a pointer to its data) at the end of the specified array.

Parameters:
array The array to which the object has to be added
type The type of the element to add
data The pointer to the data of the element to add
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the list or object parameter is incorrect, HPS_OK otherwise

int hps_array_add_uint array_t array,
unsigned long long  value
 

Adds an unsigned integer to the end of a array.

This function adds an unsigned integer element which value is provided at the end of the specified array.

Parameters:
array The array to which the object has to be added
value The unsigned integer value
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate the element, HPS_ERROR_PAR if the array or object parameter is incorrect, HPS_OK otherwise

int hps_array_build array_t **  array,
void *  data,
int  type,
int  nb,
  ...
 

Creates a C array_t object from a C array of any dimension.

This function creates an array and fills it with the content of the C array passed as argument

Parameters:
array A pointer to the array to create
data The C array
type The element type of the C array
nb The number of dimensions of the C array
... The size of each dimension of the C array
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate, HPS_OK otherwise

int hps_array_create array_t **  array  ) 
 

Creates a C array_t object for storing an array.

This function creates an array that can be later filled unsing hp_array_add... functions.

Parameters:
array A pointer to the array to create
Returns:
HPS_ERROR_ARM_MEMORY if unable to allocate, HPS_OK otherwise

int hps_array_destroy array_t **  array  ) 
 

Destroys a C array_t object.

This function destroys recursively an array.

Parameters:
array A pointer to the array to destroy
Returns:
HPS_ERROR_PAR if any parameter error, HPS_OK otherwise

int hps_array_get array_t array,
hpobj_t **  obj,
int  nb,
  ...
 

Gets an element from an array.

This function gets an element identified by its indices from an array. Th numebr od indices is passd as a parameter, as well as the list of indices.

Parameters:
array A pointer to the array to destroy
obj A pointer to the object to get
nb The number of indices that are passed after
... The indices as a list of int
Returns:
HPS_ERROR_PAR if any parameter error, HPS_OK otherwise


Generated on Sat Sep 16 18:23:57 2006 for HPStack by  doxygen 1.4.5