toml
Subset TOML Parser
Functions
| Function | Description |
|---|---|
_toml_byte_at | Internal byte reader. |
_toml_eq | Internal: compare bytes. |
_toml_skip_ws | Internal: skip whitespace. |
_toml_skip_line | Internal: skip to end of line. |
_toml_store | Internal: store bytes to data_buf, return offset where stored. |
_toml_store_dotted | Internal: store a dotted key (table.key) to data_buf. |
_toml_add | Internal: add entry. |
_toml_parse_int | Internal: parse integer from buf at off with given length. |
_toml_trim_end | Internal: trim trailing ws. Returns new end pos. |
_toml_parse_table | Internal: parse table header. Returns pos after line. |
_toml_store_key | Internal: store key (dotted if table is set). Returns stored key offset and s… |
_toml_parse_quoted | Internal: parse a quoted string value. Returns pos after closing quote. |
_toml_parse_unquoted | Internal: parse an unquoted value. Returns pos after line. |
_toml_parse_kv | Internal: parse key=value line. Returns pos after line. |
toml_parse | Parse TOML data. Returns handle. |
toml_count | Number of entries. |
_toml_find | Internal: find entry by key. Returns index or -1. |
toml_get_str | Get string value for key. Copies to out, returns length. -1 if not found. |
toml_get_i64 | Get integer value for key. Returns 0 if not found. |
toml_get_bool | Get boolean value for key. Returns 0 or 1. Returns -1 if not found. |
Details
_toml_byte_at
fn _toml_byte_at(buf: &i8, idx: i64) -> i64Internal byte reader.
_toml_eq
fn _toml_eq(a: &i8, aoff: i64, alen: i64, b: &i8, boff: i64, blen: i64) -> i64Internal: compare bytes.
_toml_skip_ws
fn _toml_skip_ws(buf: &i8, pos: i64, len: i64) -> i64Internal: skip whitespace.
_toml_skip_line
fn _toml_skip_line(buf: &i8, pos: i64, len: i64) -> i64Internal: skip to end of line.
_toml_store
fn _toml_store(h: &i64, src: &i8, off: i64, slen: i64) -> i64Internal: store bytes to data_buf, return offset where stored.
_toml_store_dotted
fn _toml_store_dotted(h: &i64, buf: &i8, toff: i64, tlen: i64, koff: i64, klen: i64) -> i64Internal: store a dotted key (table.key) to data_buf.
_toml_add
fn _toml_add(h: &i64, key_off: i64, key_len: i64, val_off: i64, val_len: i64, vtype: i64) -> i64Internal: add entry.
_toml_parse_int
fn _toml_parse_int(buf: &i8, off: i64, plen: i64) -> i64Internal: parse integer from buf at off with given length.
_toml_trim_end
fn _toml_trim_end(buf: &i8, start: i64, end_pos: i64) -> i64Internal: trim trailing ws. Returns new end pos.
_toml_parse_table
fn _toml_parse_table(h: &i64, buf: &i8, pos: i64, len: i64) -> i64Internal: parse table header. Returns pos after line.
_toml_store_key
fn _toml_store_key(h: &i64, buf: &i8, key_start: i64, key_end: i64, key_len_out: &i64) -> i64Internal: store key (dotted if table is set). Returns stored key offset and sets key_len_out[0].
_toml_parse_quoted
fn _toml_parse_quoted(h: &i64, buf: &i8, pos: i64, len: i64, key_start: i64, key_end: i64) -> i64Internal: parse a quoted string value. Returns pos after closing quote.
_toml_parse_unquoted
fn _toml_parse_unquoted(h: &i64, buf: &i8, pos: i64, len: i64, key_start: i64, key_end: i64) -> i64Internal: parse an unquoted value. Returns pos after line.
_toml_parse_kv
fn _toml_parse_kv(h: &i64, buf: &i8, pos: i64, len: i64) -> i64Internal: parse key=value line. Returns pos after line.
toml_parse
fn toml_parse(buf: &i8, len: i64) -> &i64Parse TOML data. Returns handle.
toml_count
fn toml_count(h: &i64) -> i64Number of entries.
_toml_find
fn _toml_find(h: &i64, key: &i8, klen: i64) -> i64Internal: find entry by key. Returns index or -1.
toml_get_str
fn toml_get_str(h: &i64, key: &i8, klen: i64, out: &i8) -> i64Get string value for key. Copies to out, returns length. -1 if not found.
toml_get_i64
fn toml_get_i64(h: &i64, key: &i8, klen: i64) -> i64Get integer value for key. Returns 0 if not found.
toml_get_bool
fn toml_get_bool(h: &i64, key: &i8, klen: i64) -> i64Get boolean value for key. Returns 0 or 1. Returns -1 if not found.