wip: Messing around w/ ffi for some stuff

This commit is contained in:
TJ DeVries
2020-08-31 18:12:51 -04:00
parent e38589f265
commit 8c5bf8c746
4 changed files with 63 additions and 12 deletions

15
scratch/nvim_ffi.lua Normal file
View File

@@ -0,0 +1,15 @@
local ffi = require("ffi")
-- ffi.load("/home/tj/build/neovim/build/include/eval/funcs.h.generated.h")
ffi.cdef [[
typedef unsigned char char_u;
char_u *shorten_dir(char_u *str);
]]
local text = "scratch/file.lua"
local c_str = ffi.new("char[?]", #text)
ffi.copy(c_str, text)
print(vim.inspect(ffi.string(ffi.C.shorten_dir(c_str))))