No matching definitions.

template/env

src/template/env.tur
defn

env-new

(env-new :)

create a new empty Env handle.

An Env handle to be freed by env-free.

(let [e (env-new)] (env-free e))

Since: 0.1.0

defn

env-set

(env-set [env : int key : cstr val : cstr] :)

set or shadow a scalar string binding in the env.

envEnv handle from env-new
keyvariable name (NUL-terminated)
valstring value (NUL-terminated)
(env-set e "title" "Hello")

Since: 0.1.0

defn

env-set-list

(env-set-list [env : int key : cstr vals : int] :)

set or shadow a list-valued binding in the env.

envEnv handle from env-new
keyvariable name (NUL-terminated)
valscons list of cstr values (0 for nil)
(env-set-list e "items" (cons "a" (cons "b" 0)))

Since: 0.1.0

defn

env-get

(env-get [env : int key : cstr] :)

look up a key, returning the first (scalar) value.

envEnv handle
keyvariable name

The bound cstr, or the empty string if no binding exists.

(env-get e "title")  ; => "Hello"

Since: 0.1.0

defn

env-has?

(env-has? [env : int key : cstr] :)

check whether a binding exists for `key`.

envEnv handle
keyvariable name

true if some binding is present, false otherwise.

(env-has? e "title")  ; => true

Since: 0.1.0

defn

env-get-list-len

(env-get-list-len [env : int key : cstr] :)

number of values bound to `key`.

envEnv handle
keyvariable name

Length of the bound list (1 for scalar, 0 if missing).

(env-get-list-len e "items")  ; => 3

Since: 0.1.0

defn

env-get-list-at

(env-get-list-at [env : int key : cstr i : int] :)

fetch the i-th value bound to `key`.

envEnv handle
keyvariable name
izero-based index

The i-th value, or "" if out of range.

(env-get-list-at e "items" 1)  ; => "b"

Since: 0.1.0

defn

env-push-scalar

(env-push-scalar [env : int key : cstr val : cstr] :)

push a single scalar binding (for renderer scopes).

defn

env-push-list

(env-push-list [env : int key : cstr vals : int] :)

push a list binding (for renderer scopes).

defn

env-pop

(env-pop [env : int] :)

remove the top binding from the env stack.

defn

env-free

(env-free [env : int] :)

release all storage associated with an Env handle.

envEnv handle returned by env-new
(env-free e)

Since: 0.1.0