group Functions

Description

Various functions to deal with functions.

group attributes
function ferite_create_external_function() - Allocate a FeriteFunction structure and set it up for use as a native function
function ferite_function_get() - Find a function in the top level namespace of a script
function ferite_function_get_compiled_code() - Find a function in the top level namespace of a script and return it's opcode data
function ferite_delete_function_list() - Delete a list of FeriteFunction's - on most occasions this is only deleteing on function
function ferite_function_to_external() - Convert an internal function to an external one
function ferite_delete_function_hash() - Delete a hash aswell as cleaning up all functions
function ferite_check_params() - Check the parameters against the function signiture and see if they match
function ferite_function_dup() - Duplicate a function

Functions

function ferite_create_external_function Click to go up to the list
Allocate a FeriteFunction structure and set it up for use as a native function
Declaration:
    FeriteFunction *ferite_create_external_function( FeriteScript *script, char *name, void *(*funcPtr)(FeriteScript *, FeriteFunction*, FeriteVariable **), char *description )
Description:
The description is pretty straight forward - it is simply a sequence of characters eg "oosna" They mean the following:
  • n - number
  • s - string
  • a - array
  • o - object
  • v - void
  • . - variable argument list

This means that the function will only actually ever be called with the correct parameters.
Parameters:
    Parameter #1: FeriteScript *script - The script it is being used within
    Parameter #2: char *name - The name of the function to be created
    Parameter #3: void *funcPtr - A pointer to the native c function handling it
    Parameter #4: char *description - A description of the functions signiture
Returns:
    A pointer to a FeriteFunction structure

function ferite_function_get Click to go up to the list
Find a function in the top level namespace of a script
Declaration:
    FeriteFunction *ferite_function_get( FeriteScript *script, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The script to search
    Parameter #2: char *name - The name of the function
Returns:
    A pointer to the function on success, NULL on fail

function ferite_function_get_compiled_code Click to go up to the list
Find a function in the top level namespace of a script and return it's opcode data
Declaration:
    FeriteOp **ferite_function_get_compiled_code( FeriteScript *script, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The script to search
    Parameter #2: char *name - The name of the function
Returns:
    A pointer to the function's opcode on success, NULL on fail

function ferite_delete_function_list Click to go up to the list
Delete a list of FeriteFunction's - on most occasions this is only deleteing on function
Declaration:
    void ferite_delete_function_list( FeriteScript *script, FeriteFunction *func )
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteFuncion *func - The top function in the list

function ferite_function_to_external Click to go up to the list
Convert an internal function to an external one
Declaration:
    void ferite_function_to_external( FeriteScript *script, FeriteFunction *func )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteFunction *func - The function to convert

function ferite_delete_function_hash Click to go up to the list
Delete a hash aswell as cleaning up all functions
Declaration:
    void ferite_delete_function_hash( FeriteScript *script, FeriteHash *hash )
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteHash *hash - The hash to be deleted

function ferite_check_params Click to go up to the list
Check the parameters against the function signiture and see if they match
Declaration:
    int ferite_check_params( FeriteScript *script, FeriteVariable **params, FeriteParameterRecord **signature )
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteVariable **params - The parameters to be checked
    Parameter #3: FeriteParameterRecord **signature - The funcions signature
Returns:
    0 on fail, 1 on success

function ferite_function_dup Click to go up to the list
Duplicate a function
Declaration:
    FeriteFunction *ferite_function_dup( FeriteScript *script, FeriteFunction *function, FeriteClass *container )
Parameters:
    Parameter #1: FeriteScript *script - The current script
    Parameter #2: FeriteFunction *function - The function to duplicated
    Parameter #3: FeriteClass *container - The class the function is part of [if it is part of a class]
Returns:
    The new function

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