group Namespaces

Description

Namespaces provide a significant portion of the structure of a compiled ferite script. There is always the main namespace within each script where global variables, top level functions, classes and namespaces are stored.

group attributes
function ferite_register_namespace() - Create a new namespace and place it in the given namespace
function ferite_register_ns_function() - Register a function within the namespace
function ferite_register_ns_variable() - Register a variable within a namespace
function ferite_register_ns_class() - Register the class within the namespace
function ferite_delete_namespace() - Completely free up all elements within the namespace
function ferite_namespace_element_exists() - See if an element exists within the namespace (not recursive)
function ferite_delete_namespace_element_from_namespace() - Delete an element from the namespace
function ferite_rename_namespace_element() - Delete an element from the namespace
function ferite_find_namespace() - Recusively look in a namespace for an element
function ferite_namespace_dup() - Duplicate a namespace

Functions

function ferite_register_namespace Click to go up to the list
Create a new namespace and place it in the given namespace
Declaration:
    FeriteNamespace *ferite_register_namespace( FeriteScript *script, char *name, FeriteNamespace *parent )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: char *name - The name of the new namespace
    Parameter #3: FeriteNamespace *parent - The namespace in which to put the new namespace
Returns:
    The newly created namespace

function ferite_register_ns_function Click to go up to the list
Register a function within the namespace
Declaration:
    FeriteFunction *ferite_register_ns_function( FeriteScript *script, FeriteNamespace *ns, FeriteFunction *f )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteNamespace *ns - The namespace in which to register the function
    Parameter #3: FeriteFunction *f - The function to register
Returns:
    It simply returns the function that has been registered

function ferite_register_ns_variable Click to go up to the list
Register a variable within a namespace
Declaration:
    FeriteVariable *ferite_register_ns_variable( FeriteScript *script, FeriteNamespace *ns, FeriteVariable *var )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteNamespace *ns - The namespace in which to register the variable
    Parameter #3: FeriteVariable *v - The variable to register
Returns:
    It simply returns the variable that has been registered

function ferite_register_ns_class Click to go up to the list
Register the class within the namespace
Declaration:
    FeriteClass *ferite_register_ns_class( FeriteScript *script, FeriteNamespace *ns, FeriteClass *classt )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteNamespace *ns - The namespace in which to reigster the class
    Parameter #3: FeriteClass *classt - The class to register
Returns:
    It simply returns the class that has been registered

function ferite_delete_namespace Click to go up to the list
Completely free up all elements within the namespace
Declaration:
    int ferite_delete_namespace( FeriteScript *script, FeriteNamespace *ns )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteNamespace *ns - The namespace to delete
Returns:
    Always 1

function ferite_namespace_element_exists Click to go up to the list
See if an element exists within the namespace (not recursive)
Declaration:
    FeriteNamespaceBucket *ferite_namespace_element_exists( FeriteScript *script, FeriteNamespace *ns, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteNamespace *ns - The namespace to look into
    Parameter #3: char *name - The name of the element to look for
Returns:
    The FeriteNamespaceBucket for the name or NULL if it does not exist

function ferite_delete_namespace_element_from_namespace Click to go up to the list
Delete an element from the namespace
Declaration:
    int ferite_delete_namespace_element_from_namespace( FeriteScript *script, FeriteNamespace *ns, char *name )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteNamespace *ns - The namespace to look into
    Parameter #3: char *name - The name of the element to delete
Returns:
    FE_TRUE if an element is deleted, FE_FALSE otherwise

function ferite_rename_namespace_element Click to go up to the list
Delete an element from the namespace
Declaration:
    int ferite_rename_namespace_element( FeriteScript *script, FeriteNamespace *ns, char *from, char *to )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteNamespace *ns - The namespace to look into
    Parameter #3: char *from - The name of the element to rename
    Parameter #4: char *to - The name to rename to
Returns:
    FE_TRUE if an element is deleted, FE_FALSE otherwise

function ferite_find_namespace Click to go up to the list
Recusively look in a namespace for an element
Declaration:
    FeriteNamespaceBucket *ferite_find_namespace( FeriteScript *script, FeriteNamespace *parent, char *obj, int type )
Description:
The type dictates what is returned. No type is specified (0) then if any element is found then it will be returned. If a type is specified then it is checked to see if the bucket is of the correct type, if so it is returned, if not NULL is returned.

The types are FENS_VAR, FENS_FNC, FENS_CLS, or FENS_NS.
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteNamespace *parent - The namespace to look in
    Parameter #3: char *obj - The name to locate
    Parameter #4: int type - The type to look for
Returns:
    The namespace bucket if it is found otherwise NULL

function ferite_namespace_dup Click to go up to the list
Duplicate a namespace
Declaration:
    FeriteNamespace *ferite_namespace_dup( FeriteScript *script, FeriteNamespace *ns, FeriteNamespace *container )
Parameters:
    Parameter #1: FeriteScript *script - The script
    Parameter #2: FeriteNamespace *ns - The namespace to duplicate
    Parameter #3: FeriteNamespace *container - The container of the new namespace
Returns:
    The new namespace

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