From d3e25094e63318676ae198ce259fad73a68c21c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 17 Dec 2018 11:14:58 +0800 Subject: =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/libs/lua53/file.lni | 145 ++++++++++++++++++++++++++++++++++ server/libs/lua53/io.lni | 188 ++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 324 insertions(+), 9 deletions(-) create mode 100644 server/libs/lua53/file.lni (limited to 'server') diff --git a/server/libs/lua53/file.lni b/server/libs/lua53/file.lni new file mode 100644 index 00000000..29d4a950 --- /dev/null +++ b/server/libs/lua53/file.lni @@ -0,0 +1,145 @@ + + +type = 'function' +[[.parent]] +type = 'object' +name = 'FILE*' + +[close] +[[.returns]] +name = 'suc' +type = 'boolean' +default = 'true' +optional = 'after' +[[.returns]] +name = 'type' +type = 'string' +[[.returns]] +name = 'code' +[[.enums]] +type = 'type' +enum = 'exit' +[[.enums]] +type = 'type' +enum = 'signal' + +[flush] + +[lines] +[[.args]] +name = 'mode' +type = '...' +default = 'l' +[[.returns]] +type = 'function' +returns = { + 1 = { + name = 'c', + type = {'string', 'number'}, + } +} +[[.enums]] +name = 'mode' +enum = 'n' +[[.enums]] +name = 'mode' +enum = 'n' +[[.enums]] +name = 'mode' +enum = 'i' +[[.enums]] +name = 'mode' +enum = 'a' +[[.enums]] +name = 'mode' +enum = 'l' +[[.enums]] +name = 'mode' +enum = 'L' +[[.enums]] +name = 'mode' +code = 'number' + +[read] +[[.args]] +name = 'mode' +type = '...' +default = 'l' +[[.returns]] +type = {'string', 'number'} +[[.enums]] +name = 'mode' +enum = 'n' +[[.enums]] +name = 'mode' +enum = 'n' +[[.enums]] +name = 'mode' +enum = 'i' +[[.enums]] +name = 'mode' +enum = 'a' +[[.enums]] +name = 'mode' +enum = 'l' +[[.enums]] +name = 'mode' +enum = 'L' +[[.enums]] +name = 'mode' +code = 'number' + +[seek] +[[.args]] +name = 'whence' +type = 'string' +default = 'cur' +optional = 'after' +[[.args]] +name = 'offset' +type = 'integer' +default = 0 +optional = 'self' +[[.returns]] +name = 'offset' +type = 'integer' +[[.returns]] +name = 'errmsg' +type = 'string' +optional = 'self' +[[.enums]] +name = 'whence' +enum = 'set' +[[.enums]] +name = 'whence' +enum = 'cur' +[[.enums]] +name = 'whence' +enum = 'end' + +[setvbuf] +[[.args]] +name = 'mode' +type = 'string' +[[.args]] +name = 'size' +type = 'integer' +[[.enums]] +name = 'mode' +enum = 'no' +[[.enums]] +name = 'mode' +enum = 'full' +[[.enums]] +name = 'mode' +enum = 'line' + +[write] +[[.args]] +type = '...' +[[.returns]] +type = 'FILE*' +[[.returns]] +name = 'errmsg' +type = 'string' +optional = 'self' diff --git a/server/libs/lua53/io.lni b/server/libs/lua53/io.lni index e49993bb..a5325cd4 100644 --- a/server/libs/lua53/io.lni +++ b/server/libs/lua53/io.lni @@ -18,17 +18,187 @@ name = 'io' [stdin] type = 'FILE*' +[stdout] +type = 'FILE*' + +[stderr] +type = 'FILE*' + [close] -[[.parent]] -type = 'global' -name = 'table' -[[.parent]] -type = 'library' -name = 'table' -[[.parent]] -type = 'object' -name = 'FILE*' [[.args]] +name = 'file' type = 'FILE*' +optional = 'self' +[[.returns]] +name = 'suc' +type = 'boolean' +default = 'true' +optional = 'after' +[[.returns]] +name = 'type' +type = 'string' +[[.returns]] +name = 'code' +[[.enums]] +type = 'type' +enum = 'exit' +[[.enums]] +type = 'type' +enum = 'signal' + +[flush] + +[input] +[[.args]] name = 'file' +type = {'string', 'FILE*'} +optional = 'self' +[[.returns]] +type = 'FILE*' + +[lines] +[[.args]] +name = 'filename' +type = 'string' +optional = 'after' +[[.args]] +name = 'mode' +type = '...' +default = 'l' +[[.returns]] +type = 'function' +returns = { + 1 = { + name = 'c', + type = {'string', 'number'}, + } +} +[[.enums]] +name = 'mode' +enum = 'n' +[[.enums]] +name = 'mode' +enum = 'n' +[[.enums]] +name = 'mode' +enum = 'i' +[[.enums]] +name = 'mode' +enum = 'a' +[[.enums]] +name = 'mode' +enum = 'l' +[[.enums]] +name = 'mode' +enum = 'L' +[[.enums]] +name = 'mode' +code = 'number' + +[open] +[[.args]] +name = 'filename' +type = 'string' +[[.args]] +name = 'mode' +type = 'string' +optional = 'self' +default = 'r' +[[.returns]] +type = 'FILE*' +[[.enums]] +name = 'mode' +enum = 'r' +[[.enums]] +name = 'mode' +enum = 'w' +[[.enums]] +name = 'mode' +enum = 'a' +[[.enums]] +name = 'mode' +enum = 'r+' +[[.enums]] +name = 'mode' +enum = 'w+' +[[.enums]] +name = 'mode' +enum = 'a+' + +[output:input] + +[popen] +[[.args]] +name = 'prog' +type = 'string' +[[.args]] +name = 'mode' +type = 'string' +optional = 'self' +default = 'r' +[[.enums]] +name = 'mode' +enum = 'r' +[[.enums]] +name = 'mode' +enum = 'w' + +[read] +[[.args]] +name = 'mode' +type = '...' +default = 'l' +[[.returns]] +type = {'string', 'number'} +[[.enums]] +name = 'mode' +enum = 'n' +[[.enums]] +name = 'mode' +enum = 'n' +[[.enums]] +name = 'mode' +enum = 'i' +[[.enums]] +name = 'mode' +enum = 'a' +[[.enums]] +name = 'mode' +enum = 'l' +[[.enums]] +name = 'mode' +enum = 'L' +[[.enums]] +name = 'mode' +code = 'number' + +[tmpfile] +[[.returns]] +type = 'FILE*' + +[type] +[[.args]] +name = 'obj' +type = 'FILE*' +[[.returns]] +name = 'type' +type = 'string' +[[.enums]] +name = 'type' +enum = 'file' +[[.enums]] +name = 'type' +enum = 'closed file' +[[.enums]] +name = 'type' +code = 'nil' + +[write] +[[.args]] +type = '...' +[[.returns]] +type = 'FILE*' +[[.returns]] +name = 'errmsg' +type = 'string' optional = 'self' -- cgit v1.2.3