diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-31 18:12:51 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-31 18:12:51 -0400 |
| commit | 8c5bf8c7467cf28da2ac5de4f2eaa966f02b2b48 (patch) | |
| tree | 759150e002a4237cabea5469973323eb7d0cbe7c /scratch | |
| parent | e38589f265a276d431113efcef6fdb157120ce68 (diff) | |
wip: Messing around w/ ffi for some stuff
Diffstat (limited to 'scratch')
| -rw-r--r-- | scratch/nvim_ffi.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scratch/nvim_ffi.lua b/scratch/nvim_ffi.lua new file mode 100644 index 0000000..3a48ada --- /dev/null +++ b/scratch/nvim_ffi.lua @@ -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)))) + + |
