erb
Template Engine
Functions
| Function | Description |
|---|---|
_erb_copy | |
_erb_streq | |
erb_vars_new | Create variable map. |
erb_vars_set | Set a variable in the map. |
_erb_lookup | Internal: lookup variable value. Returns value length, copies to out. |
erb_render | Render template with variable substitution. Replaces <%= name %> with variabl… |
erb_escape_html | HTML-escape string (&, <, >, “, ‘). Returns output length. |
Details
_erb_copy
fn _erb_copy(dst: &i8, doff: i64, src: &i8, soff: i64, n: i64)_erb_streq
fn _erb_streq(a: &i8, aoff: i64, alen: i64, b: &i8, boff: i64, blen: i64) -> i64erb_vars_new
fn erb_vars_new() -> &i64Create variable map.
erb_vars_set
fn erb_vars_set(vars: &i64, key: &i8, klen: i64, val: &i8, vlen: i64)Set a variable in the map.
_erb_lookup
fn _erb_lookup(vars: &i64, name: &i8, noff: i64, nlen: i64, out: &i8) -> i64Internal: lookup variable value. Returns value length, copies to out.
erb_render
fn erb_render(tmpl: &i8, tlen: i64, vars: &i64, out: &i8, max: i64) -> i64Render template with variable substitution. Replaces <%= name %> with variable value from vars map. Returns output length.
erb_escape_html
fn erb_escape_html(src: &i8, slen: i64, out: &i8) -> i64HTML-escape string (&, <, >, “, ‘). Returns output length.