configparser

INI File Parser

Functions

FunctionDescription
_ini_byte_atInternal byte reader.
_ini_copyInternal: copy bytes from src+off to dst, length len.
_ini_eqInternal: compare two byte ranges for equality.
_ini_skip_wsInternal: skip whitespace at pos. Returns new pos.
_ini_skip_lineInternal: skip to end of line. Returns pos after newline.
_ini_add_entryInternal: add one entry. Val info passed via h[11], h[12].
_ini_parse_sectionInternal: parse section header. Sets h[9], h[10]. Returns pos after line.
_ini_trim_endInternal: trim trailing whitespace. Returns new end position.
_ini_parse_kvInternal: parse key=value line. Returns pos after line.
ini_parseParse INI data from buf. Returns handle.
ini_parse_fullAlias for compatibility.
ini_countNumber of entries in the INI handle.
ini_getGet value for section+key. Copies to out, returns length. -1 if not found.
ini_get_i64Get value as i64. Returns 0 if not found. Parses directly from data buffer to…
ini_has_sectionCheck if section exists. Returns 1 if found, 0 otherwise.
ini_setSet a value for section+key. Overwrites if exists, appends if new. Val and vl…
_ini_write_section_kvsInternal: write section’s key=value pairs.
ini_writeWrite INI data to out buffer. Returns length written.

Details

_ini_byte_at

fn _ini_byte_at(buf: &i8, idx: i64) -> i64

Internal byte reader.

_ini_copy

fn _ini_copy(dst: &i8, src: &i8, off: i64, len: i64) -> i64

Internal: copy bytes from src+off to dst, length len.

_ini_eq

fn _ini_eq(a: &i8, aoff: i64, alen: i64, b: &i8, boff: i64, blen: i64) -> i64

Internal: compare two byte ranges for equality.

_ini_skip_ws

fn _ini_skip_ws(buf: &i8, pos: i64, len: i64) -> i64

Internal: skip whitespace at pos. Returns new pos.

_ini_skip_line

fn _ini_skip_line(buf: &i8, pos: i64, len: i64) -> i64

Internal: skip to end of line. Returns pos after newline.

_ini_add_entry

fn _ini_add_entry(h: &i64, sec_off: i64, sec_len: i64, key_off: i64, key_len: i64) -> i64

Internal: add one entry. Val info passed via h[11], h[12].

_ini_parse_section

fn _ini_parse_section(h: &i64, buf: &i8, pos: i64, len: i64) -> i64

Internal: parse section header. Sets h[9], h[10]. Returns pos after line.

_ini_trim_end

fn _ini_trim_end(buf: &i8, start: i64, end_pos: i64) -> i64

Internal: trim trailing whitespace. Returns new end position.

_ini_parse_kv

fn _ini_parse_kv(h: &i64, buf: &i8, pos: i64, len: i64) -> i64

Internal: parse key=value line. Returns pos after line.

ini_parse

fn ini_parse(buf: &i8, len: i64) -> &i64

Parse INI data from buf. Returns handle.

ini_parse_full

fn ini_parse_full(buf: &i8, len: i64) -> &i64

Alias for compatibility.

ini_count

fn ini_count(h: &i64) -> i64

Number of entries in the INI handle.

ini_get

fn ini_get(h: &i64, sec: &i8, slen: i64, key: &i8, klen: i64, out: &i8) -> i64

Get value for section+key. Copies to out, returns length. -1 if not found.

ini_get_i64

fn ini_get_i64(h: &i64, sec: &i8, slen: i64, key: &i8, klen: i64) -> i64

Get value as i64. Returns 0 if not found. Parses directly from data buffer to avoid alloc_pages overlap.

ini_has_section

fn ini_has_section(h: &i64, sec: &i8, slen: i64) -> i64

Check if section exists. Returns 1 if found, 0 otherwise.

ini_set

fn ini_set(h: &i64, sec: &i8, slen: i64, key: &i8, klen: i64) -> i64

Set a value for section+key. Overwrites if exists, appends if new. Val and vlen passed via h[11], h[12] to avoid 7-arg limit.

_ini_write_section_kvs

fn _ini_write_section_kvs(h: &i64, out: &i8, pos: i64, data: &i8, sec_off: i64, sec_len: i64) -> i64

Internal: write section’s key=value pairs.

ini_write

fn ini_write(h: &i64, out: &i8, max: i64) -> i64

Write INI data to out buffer. Returns length written.