## tmpl-scope tmpl-scope |

## Functions

TmplScope * | tmpl_scope_new ()
TmplScope * | tmpl_scope_new_with_parent ()
TmplScope * | tmpl_scope_ref ()
void | tmpl_scope_unref ()
TmplSymbol * | tmpl_scope_peek ()
TmplSymbol * | tmpl_scope_get ()
void | tmpl_scope_set ()

## Description

## Functions

### tmpl_scope_new ()

    TmplScope *
    tmpl_scope_new (void);

Creates a new scope to contain variables and custom expressions,

#### Returns

A newly created TmplScope.

[transfer full]

### tmpl_scope_new_with_parent ()

    TmplScope *
    tmpl_scope_new_with_parent (TmplScope *parent);

Creates a new scope to contain variables and custom expressions, If `parent` is set, the parent scope will be inherited.

#### Parameters

parent | An optional parent scope. | [nullable]

#### Returns

A newly created TmplScope.

[transfer full]

### tmpl_scope_ref ()

    TmplScope *
    tmpl_scope_ref (TmplScope *self);

### tmpl_scope_unref ()

    void
    tmpl_scope_unref (TmplScope *self);

### tmpl_scope_peek ()

    TmplSymbol *
    tmpl_scope_peek (TmplScope *self,
                     const gchar *name);

If the symbol could not be found, `NULL` is returned.

#### Returns

A TmplSymbol or `NULL`.

[transfer none][nullable]

### tmpl_scope_get ()

    TmplSymbol *
    tmpl_scope_get (TmplScope *self,
                    const gchar *name);

If the symbol could not be found, it will be allocated.

#### Returns

A TmplSymbol.

[transfer none]

### tmpl_scope_set ()

    void
    tmpl_scope_set (TmplScope *self,
                    const gchar *name,
                    TmplSymbol *symbol);

If the symbol already exists, it will be overwritten.

If `symbol` is `NULL`, the symbol will be removed from scope.

#### Parameters

self | A TmplScope |
name | the name of the symbol |
symbol | An TmplSymbol or `NULL`. | [nullable][transfer none]

## Types and Values