File: env.lua

package info (click to toggle)
lua-torch-sundown 0~20160829-g17ea705-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 324 kB
  • ctags: 310
  • sloc: ansic: 3,543; sh: 75; makefile: 9
file content (20 lines) | stat: -rw-r--r-- 550 bytes parent folder | download | duplicates (2)
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