diff options
author | Lyrthras <defelixanne@gmail.com> | 2022-11-09 13:37:48 +0800 |
---|---|---|
committer | Lyrthras <defelixanne@gmail.com> | 2022-11-09 13:50:01 +0800 |
commit | 12fd3692599d69d0904e8a2d19773186bda65c9d (patch) | |
tree | c62911c64fcd202e02084c793e191c3dd1c50e9e /meta/template | |
parent | e7f8bc78843c03c677668a676f124902b2b889a2 (diff) | |
download | lua-language-server-12fd3692599d69d0904e8a2d19773186bda65c9d.zip |
fix ffi meta
Diffstat (limited to 'meta/template')
-rw-r--r-- | meta/template/ffi.lua | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/meta/template/ffi.lua b/meta/template/ffi.lua index 0d726c1e..2ca83dd5 100644 --- a/meta/template/ffi.lua +++ b/meta/template/ffi.lua @@ -2,13 +2,17 @@ ---@meta ---@class ffi.namespace*: table +---@field [string] function ----@class ffi.cdecl*: string ---@class ffi.ctype*: userdata +---@overload fun(init?: any, ...): ffi.cdata* +---@overload fun(nelem?: integer, init?: any, ...): ffi.cdata* local ctype + +---@class ffi.cdecl*: string ---@class ffi.cdata*: userdata ----@alias ffi.ct* ffi.cdecl*|ffi.ctype*|ffi.cdata* ----@class ffi.cb*: userdata +---@alias ffi.ct* ffi.ctype*|ffi.cdecl*|ffi.cdata* +---@class ffi.cb*: ffi.cdata* local cb ---@class ffi.VLA*: userdata ---@class ffi.VLS*: userdata @@ -20,8 +24,9 @@ local cb ---@field arch string local ffi = {} ----@param def string -function ffi.cdef(def) end +---@param def string +---@param params? any +function ffi.cdef(def, params, ...) end ---@param name string ---@param global? boolean @@ -29,6 +34,7 @@ function ffi.cdef(def) end ---@nodiscard function ffi.load(name, global) end +---@overload fun(ct: ffi.ct*, init: any, ...) ---@param ct ffi.ct* ---@param nelem? integer ---@param init? any @@ -36,19 +42,16 @@ function ffi.load(name, global) end ---@nodiscard function ffi.new(ct, nelem, init, ...) end ----@param nelem? integer ----@param init? any ----@return ffi.cdata* cdata -function ffi.ctype(nelem, init, ...) end - ----@param ct ffi.ct* +---@param ct ffi.ct* +---@param params? any ---@return ffi.ctype* ctype ---@nodiscard -function ffi.typeof(ct) end +function ffi.typeof(ct, params, ...) end ---@param ct ffi.ct* ---@param init any ---@return ffi.cdata* cdata +---@nodiscard function ffi.cast(ct, init) end ---@param ct ffi.ct* |