code wiki / (root) / nx_file_result.nx

nx_file_result.nx

buildroot/runtime/nx_file_result.nx

1934 B56 linesdepth 4pulls 4 transitivereach 11 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_file_result.nx -- Result-wrapped file read. sys_read_file returns null on failure -- a sentinel. This wrapper returns *NxResult so callers get a proper error code (NX_ERR_FILE_ NOT_FOUND) instead of "is this null?" inspection. Convention: result.value holds *u8 cast to nx_int (file buffer); callers cast back via `as *u8`. Length stored in out parameter.

dependencies 4 imports · 8 importers

nx_syscalls.nx nx_runtime.nx nx_tier.nx nx_result.nx nx_file_result.nx nx_avatar_solve_test.nx nx_casc_runner_test.nx nx_file_result_test.nx nx_smtlib_parse.nx nx_tptp_load.nx nx_tptp_load_any.nx nx_tptp_load_test.nx nx_tptp_write_test.nx

imports: nx_syscalls.nxnx_runtime.nxnx_tier.nxnx_result.nx

imported by: nx_avatar_solve_test.nxnx_casc_runner_test.nxnx_file_result_test.nxnx_smtlib_parse.nxnx_tptp_load.nxnx_tptp_load_any.nxnx_tptp_load_test.nxnx_tptp_write_test.nx

structs

none

consts

none

functions

23func nx_read_file_result(path: *u8, out_len: *i64) -> *NxResult
31func nx_count_lines_result(path: *u8) -> *NxResult