blob: c159fc4cde7b68bb2eef02a9d772262e57ebf4c9 (
plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
---@meta
---#DES 'io'
---@class io*
---#DES 'io.stdin'
---@field stdin file*
---#DES 'io.stdout'
---@field stdout file*
---#DES 'io.stderr'
---@field stderr file*
io = {}
---@alias openmode
---|>'"r"' # ---#DESENUM 'openmode.r'
---| '"w"' # ---#DESENUM 'openmode.w'
---| '"a"' # ---#DESENUM 'openmode.a'
---| '"r+"' # ---#DESENUM 'openmode.r+'
---| '"w+"' # ---#DESENUM 'openmode.w+'
---| '"a+"' # ---#DESENUM 'openmode.a+'
---| '"rb"' # ---#DESENUM 'openmode.rb'
---| '"wb"' # ---#DESENUM 'openmode.wb'
---| '"ab"' # ---#DESENUM 'openmode.ab'
---| '"r+b"' # ---#DESENUM 'openmode.r+b'
---| '"w+b"' # ---#DESENUM 'openmode.w+b'
---| '"a+b"' # ---#DESENUM 'openmode.a+b'
---#DES 'io.close'
---@param file? file*
---@return boolean? suc
---@return exitcode? exitcode
---@return integer? code
function io.close(file) end
---#DES 'io.flush'
function io.flush() end
---#DES 'io.input'
---@overload fun():file*
---@param file string|file*
function io.input(file) end
---#DES 'io.lines'
---@param filename string?
---@vararg readmode
---@return fun():string|number
function io.lines(filename, ...) end
---#DES 'io.open'
---@param filename string
---@param mode openmode
---@return file*?
---@return string? errmsg
function io.open(filename, mode) end
---#DES 'io.output'
---@overload fun():file*
---@param file string|file*
function io.output(file) end
---@alias popenmode
---| '"r"' # ---#DESENUM 'popenmode.r'
---| '"w"' # ---#DESENUM 'popenmode.w'
---#DES 'io.popen'
---@param prog string
---@param mode? popenmode
---@return file*?
---@return string? errmsg
function io.popen(prog, mode) end
---#DES 'io.read'
---@vararg readmode
---@return string|number
---@return ...
function io.read(...) end
---#DES 'io.tmpfile'
---@return file*
function io.tmpfile() end
---@alias filetype
---| '"file"' # ---#DESENUM 'filetype.file'
---| '"closed file"' # ---#DESENUM 'filetype.closed file'
---| 'nil' # ---#DESENUM 'filetype.nil'
---#DES 'io.type'
---@param file file*
---@return filetype
function io.type(file) end
---#DES 'io.write'
---@return file*
---@return string? errmsg
function io.write(...) end
return io
|