-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathstat.nelua
73 lines (73 loc) · 3.52 KB
/
stat.nelua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
## cinclude '<sys/stat.h>'
global timespec: type <cimport,nodecl,ctypedef> = @record{
tv_sec: ctime_t,
tv_nsec: clong
}
global stat_t: type <cimport,nodecl,ctypedef'stat'> = @record{
st_dev: culong,
st_ino: culong,
st_nlink: culong,
st_mode: cuint,
st_uid: cuint,
st_gid: cuint,
__pad0: cint,
st_rdev: culong,
st_size: clong,
st_blksize: clong,
st_blocks: clong,
st_atim: timespec,
st_mtim: timespec,
st_ctim: timespec,
__glibc_reserved: [3]clong
}
global function stat(file: cstring, buf: *stat_t): cint <cimport,nodecl> end
global function fstat(fd: cint, buf: *stat_t): cint <cimport,nodecl> end
global function fstatat(fd: cint, file: cstring, buf: *stat_t, flag: cint): cint <cimport,nodecl> end
global function lstat(file: cstring, buf: *stat_t): cint <cimport,nodecl> end
global function chmod(file: cstring, mode: cuint): cint <cimport,nodecl> end
global function fchmod(fd: cint, mode: cuint): cint <cimport,nodecl> end
global function fchmodat(fd: cint, file: cstring, mode: cuint, flag: cint): cint <cimport,nodecl> end
global function umask(mask: cuint): cuint <cimport,nodecl> end
global function mkdir(path: cstring, mode: cuint): cint <cimport,nodecl> end
global function mkdirat(fd: cint, path: cstring, mode: cuint): cint <cimport,nodecl> end
global function mknod(path: cstring, mode: cuint, dev: culong): cint <cimport,nodecl> end
global function mknodat(fd: cint, path: cstring, mode: cuint, dev: culong): cint <cimport,nodecl> end
global function mkfifo(path: cstring, mode: cuint): cint <cimport,nodecl> end
global function mkfifoat(fd: cint, path: cstring, mode: cuint): cint <cimport,nodecl> end
global function utimensat(fd: cint, path: cstring, times: *timespec, flags: cint): cint <cimport,nodecl> end
global function futimens(fd: cint, times: *timespec): cint <cimport,nodecl> end
global S_IFMT: cuint <cimport,nodecl,const>
global S_IFDIR: cuint <cimport,nodecl,const>
global S_IFCHR: cuint <cimport,nodecl,const>
global S_IFBLK: cuint <cimport,nodecl,const>
global S_IFREG: cuint <cimport,nodecl,const>
global S_IFIFO: cuint <cimport,nodecl,const>
global S_IFLNK: cuint <cimport,nodecl,const>
global S_IFSOCK: cuint <cimport,nodecl,const>
global S_ISUID: cuint <cimport,nodecl,const>
global S_ISGID: cuint <cimport,nodecl,const>
global S_ISVTX: cuint <cimport,nodecl,const>
global S_IRUSR: cuint <cimport,nodecl,const>
global S_IWUSR: cuint <cimport,nodecl,const>
global S_IXUSR: cuint <cimport,nodecl,const>
global S_IRWXU: cuint <cimport,nodecl,const>
global S_IREAD: cuint <cimport,nodecl,const>
global S_IWRITE: cuint <cimport,nodecl,const>
global S_IEXEC: cuint <cimport,nodecl,const>
global S_IRGRP: cuint <cimport,nodecl,const>
global S_IWGRP: cuint <cimport,nodecl,const>
global S_IXGRP: cuint <cimport,nodecl,const>
global S_IRWXG: cuint <cimport,nodecl,const>
global S_IROTH: cuint <cimport,nodecl,const>
global S_IWOTH: cuint <cimport,nodecl,const>
global S_IXOTH: cuint <cimport,nodecl,const>
global S_IRWXO: cuint <cimport,nodecl,const>
global S_BLKSIZE: cuint <comptime> = 512
global function S_ISFIFO(mode: cuint): boolean <cimport, nodecl> end
global function S_ISCHR(mode: cuint): boolean <cimport, nodecl> end
global function S_ISDIR(mode: cuint): boolean <cimport, nodecl> end
global function S_ISLNK(mode: cuint): boolean <cimport, nodecl> end
global function S_ISFIFO(mode: cuint): boolean <cimport, nodecl> end
global function S_ISBLK(mode: cuint): boolean <cimport, nodecl> end
global function S_ISREG(mode: cuint): boolean <cimport, nodecl> end
global function S_ISSOCK(mode: cuint): boolean <cimport, nodecl> end