xref: /inferno-os/module/readdir.m (revision 46439007cf417cbd9ac8049bb4122c890097a0fa)
1Readdir: module
2{
3	PATH:	con	"/dis/lib/readdir.dis";
4
5	# sortkey is one of NAME, ATIME, MTIME, SIZE, or NONE
6	# possibly with DESCENDING or'd in
7
8	NAME, ATIME, MTIME, SIZE, NONE: con iota;
9	DESCENDING:	con (1<<5);
10
11	init:	fn(path: string, sortkey: int): (array of ref Sys->Dir, int);
12	readall:	fn(fd: ref Sys->FD, sortkey: int): (array of ref Sys->Dir, int);
13	sortdir:fn(a: array of ref Sys->Dir, key: int): (array of ref Sys->Dir, int);
14
15	# COMPACT can be or'd into sortkey to preserve only the first
16	# (by depth) of a group of duplicate names in a union
17
18	COMPACT:	con (1<<4);
19};
20