group General

Description

These are general functions that are critical to the operation of ferite within another application. This includes the initialisation and deinitialisation of the ferite engine aswell as tools to extract the data of parameter lists.

group contents
Functions
function ferite_deinit() - Shuts the ferite engine down, clears the garbage collector and frees up unused memory
function ferite_get_parameter(FeriteVariable,int) - Get the nth parameter from the parameter list
function ferite_get_parameter_count(FeriteVariable) - Returns the number of paramters within a list
function ferite_get_parameters(FeriteVariable,int,...) - Get the ferite variables from a list and put them into pointers to real C variables
function ferite_get_required_parameter_list_size(FeriteScript,FeriteFunction) - Given a pointer to a function, this will return the expected number of parameters.
function ferite_init(int,char) - First call to the ferite engine to initialise it
function ferite_set_script_argc(int,char) - Set the argv array that scripts can access

Functions

function ferite_deinit Click to go up to the list
Shuts the ferite engine down, clears the garbage collector and frees up unused memory
Declaration:
    int ferite_deinit()
Description:
Use this when the engine is no longer needed. Once this is called you must not call any other ferite engine functions. If you wish to re-use ferite after calling this function it is necessary to call ferite_init() again.

function ferite_get_parameter Click to go up to the list
Get the nth parameter from the parameter list
Declaration:
    void *ferite_get_parameter( FeriteVariable **list, int num )
Description:
This function will make sure that there isn't an 'out-of-bounds' fault on the parameter array. If you are confident of the parameter size it is suggested that you just access the parameter directly.
Parameters:
    Parameter #1: FeriteVariable **list - The list
    Parameter #2: int num - The variable to get

function ferite_get_parameter_count Click to go up to the list
Returns the number of paramters within a list
Declaration:
    int ferite_get_parameter_count( FeriteVariable **list )
Description:
This method is useful for obtaining the number of variables passed to the function. It is suggested that this method is used rather than any other as it will allow for underneath changes without breaking existing code.
Parameters:
    Parameter #1: FeriteVariable **list - The list of variables passed to the function calling this method

function ferite_get_parameters Click to go up to the list
Get the ferite variables from a list and put them into pointers to real C variables
Warning!
Numbers can be either double or long so these need to be handled carefully
Declaration:
    int ferite_get_parameters( FeriteVariable **list, int num_args, ... )
Description:
This method is very useful for translation from the internal variable format to a standard C variable.
Parameters:
    Parameter #1: FeriteVariable **list - The list of variables passed to the function calling this method
    Parameter #2: int num_args - The number of arguments you wish to extract from the list
    Parameter #3: ... Pointers - to the real C variables
Example:

char *str;
FeriteClass *klass;
ferite_get_parameters( params, 2, &str, &klass );

function ferite_get_required_parameter_list_size Click to go up to the list
Given a pointer to a function, this will return the expected number of parameters.
Declaration:
    int ferite_get_required_parameter_list_size( FeriteScript *script, FeriteFunction *function )
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteFunction *function - The function to check
Returns:
    int The expected count.

function ferite_init Click to go up to the list
First call to the ferite engine to initialise it
Declaration:
    int ferite_init( int argc, char **argv )
Description:
This must be called to allow the engine to work. Without it, things go really rather wrong. You can pass arguments into the scripts and control the engine.

--fe-use-classic - this will tell ferite to use malloc/free rather than the jedi memory manager
--fe-debug - tell ferite to dump debug out to stdout, warning: this will produce a lot of output, ferite also has to be compiled with debugging support.
--fe-show-mem-use - tell ferite to dump to stdout a set of memory statistics, this is useful for detecting leaks

This function can be called multiple times without fear - it will only set things up if they are needed.
Parameters:
    Parameter #1: int argc - Number of arguments
    Parameter #2: char **argc - Standard array of pointers
Returns:
     1 if ferite engine is already initialised.

function ferite_set_script_argc Click to go up to the list
Set the argv array that scripts can access
Declaration:
    void ferite_set_script_argv( int argc, char **argv )
Description:
The 'argv' array within scripts is used to pass values from outside thee script to the inside - much like the way arguments are passed to a C program. This function will iterate through the arguments and add them to the globally scoped argv variable. When a script is compiled, the array will be copied for that script. This means that it is possible to change the arguments to new scripts but not existingly compiled scripts.
Parameters:
    Parameter #1: int argc - The number of arguments
    Parameter #2: char **argv - The arguments

Automatically generated at 12:07PM, Wednesday 25 May 2005 by feritedoc.