-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdirent.nelua
20 lines (20 loc) · 1.08 KB
/
dirent.nelua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
## cinclude '<dirent.h>'
global dirent: type <cimport,nodecl,ctypedef> = @record{
d_ino: culong,
d_off: clong,
d_reclen: cushort,
d_type: cuchar,
d_name: [256]cchar
}
global DIR: type <cimport,nodecl,forwarddecl> = @record{}
global function closedir(dirp: *DIR): cint <cimport,nodecl> end
global function opendir(name: cstring): *DIR <cimport,nodecl> end
global function fdopendir(fd: cint): *DIR <cimport,nodecl> end
global function readdir(dirp: *DIR): *dirent <cimport,nodecl> end
global function readdir_r(dirp: *DIR, entry: *dirent, result: **dirent): cint <cimport,nodecl> end
global function rewinddir(dirp: *DIR): void <cimport,nodecl> end
global function seekdir(dirp: *DIR, pos: clong): void <cimport,nodecl> end
global function telldir(dirp: *DIR): clong <cimport,nodecl> end
global function dirfd(dirp: *DIR): cint <cimport,nodecl> end
global function scandir(dir: cstring, namelist: ***dirent, selector: function(*dirent): cint, cmp: function(**dirent, **dirent): cint): cint <cimport,nodecl> end
global function alphasort(e1: **dirent, e2: **dirent): cint <cimport,nodecl> end