commit 5e1620f451e18659038ee547fb0e2e4dedc99b12
parent e247b0cba247a06b478e752df7ca44a0c07b681e
Author: Jack Mordaunt <jackmordaunt.dev@gmail.com>
Date: Sun, 20 Sep 2026 16:02:46 -0300
scan: widen file-private helpers to the package
A file-private symbol is one the language server will not follow from another
file, and these are read from other files more often than they are hidden from
them. target_windows.odin already marked its helpers package-private; the one
beside them that did not was the one I had added.
Nothing here becomes visible outside its package. The mirror files keep sharing
names such as can_open, since their build tags already make only one of them real.
Diffstat:
4 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/fill.odin b/fill.odin
@@ -101,7 +101,7 @@ and the tree restated, which is how a watcher learns its totals have to start ov
The root is named inside the projection rather than afterwards: the table calls it
".", and a watcher has been known to catch the dot.
*/
-@(private = "file")
+@(private)
fill_mft :: proc(f: ^Fill) {
p: ntfs.Projection
p.root_name = scan.top(f.target)
@@ -145,7 +145,7 @@ fill_mft :: proc(f: ^Fill) {
scan.restate(f.tree)
}
-@(private = "file")
+@(private)
fill_mft_read :: proc(f: ^Fill) {
f.mft_err = ntfs.read_mft(f.target.volume, &f.table, f.opts)
sync.atomic_store(&f.reading, false)
@@ -153,7 +153,7 @@ fill_mft_read :: proc(f: ^Fill) {
// Walk directories straight into the tree. Nothing is restated: a walk reaches a child
// through its parent, so a node is final when it is written, watched or not.
-@(private = "file")
+@(private)
fill_walk :: proc(f: ^Fill) {
root := scan.location(f.target, context.allocator)
defer delete(root)
diff --git a/rollup.odin b/rollup.odin
@@ -74,7 +74,7 @@ Every node on the way up must be settled, not merely present: an unsettled one i
rooted at itself for now and would look like the top of the tree. Returning false
leaves it uncharged, which is the whole of what has to be remembered about it.
*/
-@(private = "file")
+@(private)
charge :: proc(r: ^Rollup, t: ^scan.Tree, i: u32) -> bool {
n := scan.node(t, i)
flags := scan.node_flags(n)
@@ -108,12 +108,12 @@ charge :: proc(r: ^Rollup, t: ^scan.Tree, i: u32) -> bool {
return true
}
-@(private = "file")
+@(private)
marked :: proc(b: []u64, i: u32) -> bool {
return b[i >> 6] & (1 << uint(i & 63)) != 0
}
-@(private = "file")
+@(private)
mark :: proc(b: []u64, i: u32) {
b[i >> 6] |= 1 << uint(i & 63)
}
diff --git a/scan/target_other.odin b/scan/target_other.odin
@@ -80,7 +80,7 @@ resolve :: proc(
// Whether a volume opens for raw reading. Unix keeps that answer in the device's
// permissions and the groups held rather than in the process, so opening it is the
// only test that covers every reason it might be refused.
-@(private = "file")
+@(private)
can_open :: proc(path: string) -> bool {
if path == "" {
return false
@@ -100,7 +100,7 @@ Every one of these writes its name into the boot sector, at one of two offsets:
OEM field for the NTFS family, and the type field further in for FAT. Reading 512
bytes is enough to tell them apart, and enough to say that none of them match.
*/
-@(private = "file")
+@(private)
signature :: proc(path: string) -> (Filesystem, Error) {
f, open_err := os.open(path, {.Read})
if open_err != nil {
@@ -143,7 +143,7 @@ there.
The longest mount point that prefixes the path wins, which is what makes a filesystem
mounted inside another resolve to the inner one. Names are returned owned.
*/
-@(private = "file")
+@(private)
mounted_at :: proc(
path: string,
allocator := context.allocator,
@@ -189,12 +189,12 @@ mounted_at :: proc(
}
}
-@(private = "file")
+@(private)
PROC_MOUNTS :: "/proc/mounts"
// Whether `path` lies at or below `mount`. A prefix is not enough: /home does not
// cover /home2, only /home and what is under it.
-@(private = "file")
+@(private)
covers :: proc(mount, path: string) -> bool {
if !strings.has_prefix(path, mount) {
return false
@@ -203,7 +203,7 @@ covers :: proc(mount, path: string) -> bool {
}
// The mount table escapes the characters that would otherwise end a field.
-@(private = "file")
+@(private)
unescape :: proc(s: string, allocator := context.allocator) -> string {
if !strings.contains(s, `\`) {
return s
@@ -225,7 +225,7 @@ unescape :: proc(s: string, allocator := context.allocator) -> string {
// Only the filesystems a reader here could specialise for are named; everything else
// is walkable and nothing more.
-@(private = "file")
+@(private)
filesystem_from_name :: proc(name: string) -> Filesystem {
switch name {
case "ntfs", "ntfs3":
diff --git a/scan/target_windows.odin b/scan/target_windows.odin
@@ -148,7 +148,7 @@ answers all of those at once and costs one handle.
FILE_SHARE_WRITE is required: the volume is mounted and in use, so asking to exclude
writers would fail for a reason that has nothing to do with permission.
*/
-@(private = "file")
+@(private)
can_open :: proc(path: string) -> bool {
if path == "" {
return false