group Script Helpers

Provided By: ferite_script.c

Description

Various functions for creating, loading and deleting script objects

group contents
Functions
function ferite_duplicate_script(FeriteScript) - Duplicate a script object
function ferite_new_script() - This will allocate a new script and set it up ready for use.
function ferite_script_attach_data(FeriteScript,char,void,FeriteAttachedDataCleanup) - Attach data to the script object
function ferite_script_being_deleted(FeriteScript) - Find out if the script in question is being deleted.
function ferite_script_clean(FeriteScript) - Clean a script structure of all non-error/warning reporting structures
function ferite_script_delete(FeriteScript) - Delete a script object - it calls ferite_script_clean() first so you dont need to
function ferite_script_fetch_data(FeriteScript,char) - Fetch data from the script object.
function ferite_script_load(FeriteScript,char) - Load the text of a script so that it may be compiled.
function ferite_script_remove_data(FeriteScript,char) - Remove data from the script object.

Functions

function ferite_duplicate_script Click to go up to the list
Duplicate a script object
Declaration:
    FeriteScript *ferite_duplicate_script( FeriteScript *script )
Parameters:
    Parameter #1: FeriteScript *script - The script to make a copy of
Returns:
    A brand new script object that can be executed and used as if it had been compiled

function ferite_new_script Click to go up to the list
This will allocate a new script and set it up ready for use.
Declaration:
    FeriteScript *ferite_new_script()
Returns:
    A pointer to the script

function ferite_script_attach_data Click to go up to the list
Attach data to the script object
Declaration:
    int ferite_script_attach_data( FeriteScript *script, char *key, void *data, FeriteAttachedDataCleanup cleanup )
Parameters:
    Parameter #1: FeriteScript *script - The script to attach data to
    Parameter #2: char *key - The name of the data
    Parameter #3: void *data - The data to attach
    Parameter #4: FeriteAttachedDataCleanup cleanup - A pointer to the function to be run when the data is removed. If NULL, no function will be called.
Returns:
    A integer id that will represent the data

function ferite_script_being_deleted Click to go up to the list
Find out if the script in question is being deleted.
Declaration:
    int ferite_script_being_deleted( FeriteScript *script )
Description:
This function is often useful for making decisions within a native destructor.
Parameters:
    Parameter #1: FeriteScript *script - The script to check
Returns:
    FE_TRUE if the script is being deleted, FE_FALSE otherwise

function ferite_script_clean Click to go up to the list
Clean a script structure of all non-error/warning reporting structures
Declaration:
    int ferite_script_clean( FeriteScript *script )
Parameters:
    Parameter #1: FeriteScript *script - A pointer to the script to be cleaned
Returns:
    Returns 0 on fail and 1 on success

function ferite_script_delete Click to go up to the list
Delete a script object - it calls ferite_script_clean() first so you dont need to
Declaration:
    int ferite_script_delete( FeriteScript *script )
Parameters:
    Parameter #1: FeriteScript *script - The script to delete
Returns:
    1 on success, 0 on fail

function ferite_script_fetch_data Click to go up to the list
Fetch data from the script object.
Declaration:
    int ferite_script_fetch_data( FeriteScript *script, char *key )
Parameters:
    Parameter #1: FeriteScript *script - The script to attach data to
    Parameter #2: char *key - The name of the data
Returns:
    A pointer to the data if it exists, NULL otherwise

function ferite_script_load Click to go up to the list
Load the text of a script so that it may be compiled.
Declaration:
    int ferite_script_load( FeriteScript *script, char *filename )
Parameters:
    Parameter #1: FeriteScript *script - The script to load the text into
    Parameter #2: char *filename - The name of the script to load.
Returns:
    Returns 0 on fail and 1 on success

function ferite_script_remove_data Click to go up to the list
Remove data from the script object.
Declaration:
    int ferite_script_remove_data( FeriteScript *script, char *key )
Description:
This will remove the attached data and, if present, call the cleanup function.
Parameters:
    Parameter #1: FeriteScript *script - The script to attach data to
    Parameter #2: char *key - The name of the data
Returns:
    True if the data was deleted, false otherwise.

Automatically generated at 10:58AM, Saturday 14 August 2010 by feritedoc.