linecache

Random Access to Text Lines in Files

Functions

FunctionDescription
_lc_byte_atInternal byte reader helper.
_lc_openInternal: read file via syscalls.
_lc_readInternal: read from fd.
_lc_closeInternal: close fd.
linecache_openOpen a file and index its lines. Layout: [0]=line_count, [1]=data_ptr, [2]=da…
linecache_getlineGet a line by number (1-based). Returns length, -1 if out of range.
linecache_countReturn total number of lines.
linecache_closeRelease linecache (no-op in Jda — no GC, no free).

Details

_lc_byte_at

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

Internal byte reader helper.

_lc_open

fn _lc_open(path: &i8) -> i64

Internal: read file via syscalls.

_lc_read

fn _lc_read(fd: i64, buf: &i8, max: i64) -> i64

Internal: read from fd.

_lc_close

fn _lc_close(fd: i64) -> i64

Internal: close fd.

linecache_open

fn linecache_open(path: &i8) -> &i64

Open a file and index its lines. Layout: [0]=line_count, [1]=data_ptr, [2]=data_len, [3]=offsets_ptr, [4]=lengths_ptr

linecache_getline

fn linecache_getline(lc: &i64, lineno: i64, out: &i8) -> i64

Get a line by number (1-based). Returns length, -1 if out of range.

linecache_count

fn linecache_count(lc: &i64) -> i64

Return total number of lines.

linecache_close

fn linecache_close(lc: &i64) -> i64

Release linecache (no-op in Jda — no GC, no free).