diff options
Diffstat (limited to 'types/lfs.d.tl')
-rw-r--r-- | types/lfs.d.tl | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/types/lfs.d.tl b/types/lfs.d.tl new file mode 100644 index 00000000..12535ca4 --- /dev/null +++ b/types/lfs.d.tl | |||
@@ -0,0 +1,82 @@ | |||
1 | local record lfs | ||
2 | |||
3 | enum FileMode | ||
4 | "file" | ||
5 | "directory" | ||
6 | "link" | ||
7 | "socket" | ||
8 | "named pipe" | ||
9 | "char device" | ||
10 | "block device" | ||
11 | "other" | ||
12 | end | ||
13 | |||
14 | record Attributes | ||
15 | dev: number | ||
16 | ino: number | ||
17 | mode: FileMode | ||
18 | nlink: number | ||
19 | uid: number | ||
20 | gid: number | ||
21 | rdev: number | ||
22 | access: number | ||
23 | modification: number | ||
24 | change: number | ||
25 | size: number | ||
26 | permissions: string | ||
27 | blocks: number | ||
28 | blksize: number | ||
29 | end | ||
30 | |||
31 | enum OpenFileMode | ||
32 | "binary" | ||
33 | "text" | ||
34 | end | ||
35 | |||
36 | enum LockMode | ||
37 | "r" | ||
38 | "w" | ||
39 | end | ||
40 | |||
41 | record Lock | ||
42 | free: function() | ||
43 | end | ||
44 | |||
45 | dir: function(string): function(): string | ||
46 | |||
47 | chdir: function(string): boolean, string | ||
48 | |||
49 | lock_dir: function(string, number): Lock, string | ||
50 | |||
51 | -- returns number on success, really!? this should be fixed in the lfs library | ||
52 | link: function(string, string, boolean): number, string | ||
53 | |||
54 | mkdir: function(string): boolean, string | ||
55 | |||
56 | rmdir: function(string): boolean, string | ||
57 | |||
58 | setmode: function(string, OpenFileMode): boolean, string | ||
59 | |||
60 | currentdir: function(): string | ||
61 | |||
62 | attributes: function(string): Attributes | ||
63 | attributes: function(string, string): string | ||
64 | attributes: function(string, string): number | ||
65 | attributes: function(string, string): FileMode | ||
66 | attributes: function(string, Attributes): Attributes | ||
67 | |||
68 | symlinkattributes: function(string): Attributes | ||
69 | symlinkattributes: function(string, string): string | ||
70 | symlinkattributes: function(string, string): number | ||
71 | symlinkattributes: function(string, string): FileMode | ||
72 | symlinkattributes: function(string, Attributes): Attributes | ||
73 | |||
74 | touch: function(string, number, number): boolean, string | ||
75 | |||
76 | -- TODO: FILE needs to be renamed to io.FILE in tl itself | ||
77 | lock: function(FILE, LockMode, number, number): boolean, string | ||
78 | unlock: function(FILE, number, number): boolean, string | ||
79 | |||
80 | end | ||
81 | |||
82 | return lfs | ||