code wiki / (root) / nx_path.nx

nx_path.nx

buildroot/runtime/nx_path.nx

7646 B234 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tooltopic path
docsdependenciesstructsconstsfunctions

about

nx_path.nx -- POSIX path utilities (basename, dirname, join, normalize, ext). The toolchain front-ends (nx_toolchain, nxc_native_wrap, nxld, nxasm) all need to manipulate paths: derive output filenames from input filenames (foo.nx -> foo.s -> foo.o -> foo.elf), strip directory prefixes for log lines, build search paths. Today each tool inlines its own ad-hoc string scanning. This module centralises the operations under a clean API. Conventions match POSIX (forward slashes, "." and ".." segments). Windows backslash paths are out of scope -- nxc2 normalises them at the input layer.

dependencies 2 imports · 0 importers

syscalls.nx runtime.nx nx_path.nx

imports: syscalls.nxruntime.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_path_basename strlen nx_path_last_slash strlen ↻ nx_path_copy_z nx_path_dirname nx_path_last_slash ↻ nx_path_copy_z ↻ nx_path_replace_ext strlen ↻ nx_path_last_dot strlen ↻ nx_path_last_slash ↻ nx_path_join strlen ↻ nx_path_ext nx_path_last_dot ↻ strlen ↻ nx_path_copy_z ↻

structs

none

consts

none

functions

27func nx_path_last_slash(s: *u8) -> i64
40func nx_path_last_dot(s: *u8) -> i64
59func nx_path_copy_z(dst: *u8, src: *u8, n: i64) -> *u8
75func nx_path_basename(p: *u8, out: *u8) -> *u8
90func nx_path_dirname(p: *u8, out: *u8) -> *u8
107func nx_path_join(a: *u8, b: *u8, out: *u8) -> *u8
called by 1: main calls 1: strlen
136func nx_path_replace_ext(p: *u8, new_ext: *u8, out: *u8) -> *u8
called by 1: main calls 2: strlennx_path_last_dot
159func nx_path_ext(p: *u8, out: *u8) -> *u8
175func main() -> i64