group Unified Array

Description

This group is to ferite array's what the String group is to ferite strings.

group attributes
function ferite_uarray_create() - Create a new empty array
function ferite_uarray_destroy() - Destroy the array and free up any memory
function ferite_uarray_add() - Add a variable to the array
function ferite_uarray_get_index() - Get a variable from the array based upon an index
function ferite_uarray_get_from_string() - Get the variable from the array based upon a string
function ferite_uarray_delete_from_string() - Delete a value from the array based upon a string
function ferite_uarray_get() - Get a variable from an array based upon the value of a FeriteVariable
function ferite_uarray_del_var() - Delete a value from an array based upon the value of a FeriteVariable
function ferite_uarray_del_index() - Delete a value from an array based upon an index
function ferite_uarray_dup() - Duplicate an array
function ferite_uarray_to_str() - Create a FeriteString based upon the contents of an array
function ferite_uarray_push() - Push a value onto the end array like a stack
function ferite_uarray_unshift() - Shift a value onto the front of the array
function ferite_uarray_pop() - Pop a value off the end of the array and return it
function ferite_uarray_shift() - Shift a value off the front of the array
function ferite_uarray_cmp() - Compare two scripts

Functions

function ferite_uarray_create Click to go up to the list
Create a new empty array
Declaration:
    FeriteUnifiedArray *ferite_uarray_create()
Returns:
    A newly allocated FeriteUnifiedArray structure

function ferite_uarray_destroy Click to go up to the list
Destroy the array and free up any memory
Declaration:
    void ferite_uarray_destroy( FeriteScript *script, FeriteUnifiedArray *array )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to delete

function ferite_uarray_add Click to go up to the list
Add a variable to the array
Declaration:
    void ferite_uarray_add( FeriteScript *script, FeriteUnifiedArray *array, FeriteVariable *var, char *id, int pos )
Description:
The hash id can be NULL - in which case the variable wont be hashed. If it isn't NULL the variable gets added to the array and also hashed in aswell. The variable can either be placed at the beginning or at the end of the array. Use either FE_ARRAY_ADD_AT_END or FE_ARRAY_ADD_AT_START to place the variable at the end or start respectively.
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to add to
    Parameter #3: FeriteVariable *var - The variable to add
    Parameter #4: char *id - The hash id
    Parameter #5: int pos - The position in the array where the variable should be put

function ferite_uarray_get_index Click to go up to the list
Get a variable from the array based upon an index
Declaration:
    FeriteVariable *ferite_uarray_get_index( FeriteScript *script, FeriteUnifiedArray *array, int index )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to get the variable from
    Parameter #3: int index - The index to obtained
Returns:
    The variable if it exists, or NULL otherwise

function ferite_uarray_get_from_string Click to go up to the list
Get the variable from the array based upon a string
Declaration:
    FeriteVariable *ferite_uarray_get_from_string( FeriteScript *script, FeriteUnifiedArray *array, char *id )
Parameters:
    Parameter #1: FeriteScript *script - The Script
    Parameter #2: FeriteUnifiedArray *array - The array to extract the variable from
    Parameter #3: char *id - The name of the variable to get out of the array
Returns:
    The variable if it exists or NULL otherwise

function ferite_uarray_delete_from_string Click to go up to the list
Delete a value from the array based upon a string
Declaration:
    FeriteVariable *ferite_uarray_delete_from_string( FeriteScript *script, FeriteUnifiedArray *array, char *id )
Parameters:
    Parameter #1: FeriteScript *script - The Script
    Parameter #2: FeriteUnifiedArray *array - The array to delete the variable from
    Parameter #3: char *id - The name of the variable to delete out of the array
Returns:
    The variable that has been deleted

function ferite_uarray_get Click to go up to the list
Get a variable from an array based upon the value of a FeriteVariable
Declaration:
    FeriteVariable *ferite_uarray_get( FeriteScript *script, FeriteUnifiedArray *array, FeriteVariable *var )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to get the value from
    Parameter #3: FeriteVariable *var - The variable to take the value from
Returns:
    The variable if it exists or NULL otherwise

function ferite_uarray_del_var Click to go up to the list
Delete a value from an array based upon the value of a FeriteVariable
Declaration:
    void ferite_uarray_del_var( FeriteScript *script, FeriteUnifiedArray *array, FeriteVariable *index )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to delete the value from
    Parameter #3: FeriteVariable *var - The variable to take the value from

function ferite_uarray_del_index Click to go up to the list
Delete a value from an array based upon an index
Declaration:
    void ferite_uarray_del_index( FeriteScript *script, FeriteUnifiedArray *array, int index )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to delete from
    Parameter #3: int index - The index to delete

function ferite_uarray_dup Click to go up to the list
Duplicate an array
Declaration:
    FeriteUnifiedArray *ferite_uarray_dup( FeriteScript *script, FeriteUnifiedArray *array, void *(*ddup)(FeriteScript*,FeriteVariable *data,void*dup) )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to duplicate
    Parameter #3: void *dup - A function to call to duplicate the variables
Returns:
    A copy of the array

function ferite_uarray_to_str Click to go up to the list
Create a FeriteString based upon the contents of an array
Declaration:
    FeriteString *ferite_uarray_to_str( FeriteScript *script, FeriteUnifiedArray *array)
Description:
This is useful for converting an array to a string to write to disk, or print out. The function will recusre and handle inbuild arrays correctly.
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to covert
Returns:
    The string version of the array

function ferite_uarray_push Click to go up to the list
Push a value onto the end array like a stack
Declaration:
    void ferite_uarray_push( FeriteScript *script, FeriteUnifiedArray *array, FeriteVariable *var )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to push the value onto
    Parameter #3: FeriteVariable *var - The variable to push onto the array

function ferite_uarray_unshift Click to go up to the list
Shift a value onto the front of the array
Declaration:
    void ferite_uarray_unshift( FeriteScript *script, FeriteUnifiedArray *array, FeriteVariable *var )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to shift the value onto
    Parameter #3: FeriteVariable *var - The variable to shift onto the array

function ferite_uarray_pop Click to go up to the list
Pop a value off the end of the array and return it
Declaration:
    FeriteVariable *ferite_uarray_pop( FeriteScript *script, FeriteUnifiedArray *array )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to pop a value off the end

function ferite_uarray_shift Click to go up to the list
Shift a value off the front of the array
Declaration:
    FeriteVariable *ferite_uarray_shift( FeriteScript *script, FeriteUnifiedArray *array )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *array - The array to shift a value off the front

function ferite_uarray_cmp Click to go up to the list
Compare two scripts
Declaration:
    int ferite_uarray_cmp( FeriteScript *script, FeriteUnifiedArray *left, FeriteUnifiedArray *right )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteUnifiedArray *left - The first array
    Parameter #3: FeriteUnifiedArray *right - The second array

Automatically generated at 8:45pm, Wednesday 08 January 2003 by feritedoc.