blob: 37be4205ef88a5a3aedbce3dbf48b188ce99b2c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
local ffi = require 'ffi'
local sundown = {}
-- Compat function from https://github.com/stevedonovan/Penlight/blob/master/lua/pl/compat.lua
if not package.searchpath then
local sep = package.config:sub(1,1)
function package.searchpath (mod,path)
mod = mod:gsub('%.',sep)
for m in path:gmatch('[^;]+') do
local nm = m:gsub('?',mod)
local f = io.open(nm,'r')
if f then f:close(); return nm end
end
end
end
sundown.C = ffi.load(package.searchpath('libsundown', package.cpath))
return sundown
|