Gdome2 Reference Manual
<<< Previous Page | Home | Up |

# Module Tree Garbage Collector

## Name

Module Tree Garbage Collector -- Structures and APIs

## Synopsis

    int         gdome_treegc_livenodes          (GdomeNode *node);
    void        gdome_treegc_adjust             (GdomeNode *node,
                                                 int adj);
    void        gdome_treegc_insertSubtree      (GdomeNode *node);
    void        gdome_treegc_removeSubtree      (GdomeNode *node);
    void        gdome_treegc_addRef             (GdomeNode *node);
    void        gdome_treegc_delRef             (GdomeNode *node);

## Description

This is module is internally used to manage the number of gdome2 live references. Externally you can use this module to test the number of live references in your Document with gdome_treegc_livenodes() function.

## Details

### gdome_treegc_livenodes ()

    int         gdome_treegc_livenodes          (GdomeNode *node);

`node` : | a node in the Document main tree
Returns : | the number of live nodes in the Document main tree.

### gdome_treegc_adjust ()

    void        gdome_treegc_adjust             (GdomeNode *node,
                                                 int adj);

Adjust the number of live nodes in the Document main tree. If `adj` is positive, increases livenodes field else decreases it.

`node` : | a node of the Document main tree
`adj` : | the number of live node we want to add

### gdome_treegc_insertSubtree ()

    void        gdome_treegc_insertSubtree      (GdomeNode *node);

Increase the livenodes field of the Document main tree with the number of live nodes present in the specified subtree.

`node` : | the root node of the subtree to insert in the document

### gdome_treegc_removeSubtree ()

    void        gdome_treegc_removeSubtree      (GdomeNode *node);

Decrease the livenodes field of the Document main tree with the number of live nodes present in the specifed subtree.

`node` : | the root node of the subtree to remove from the document

### gdome_treegc_addRef ()

    void        gdome_treegc_addRef             (GdomeNode *node);

Increase the livenodes field if the specified node is attached to the main doc tree or if it is a Notation or a Entity Declaration node.

`node` : | the node to add to the document

### gdome_treegc_delRef ()

    void        gdome_treegc_delRef             (GdomeNode *node);

Decrease the livenodes field if the specified node id attached to the main doc tree or if it is a Notation or a Entity Declaration node.

`node` : | the node to remove from the document

<<< Previous Page | Home | Up |
Module Private List |