|
Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- «.build» (to "build")
-- «.test» (to "test")
package="peek"
version="0.0.1-0"
source = {
url = "http://www.tecgraf.puc-rio.br/~lhf/ftp/lua//5.0/lposix.tar.gz",
md5 = "f22871247e444412a901d179028a0d82",
dir = "posix"
}
description = {
summary = "peek.",
detailed = [[
peek
]],
homepage = "http://angg.twu.net/peek/",
license = "GPL3"
}
dependencies = {
"lua >= 5.1"
}
build = {
-- type = "module",
type = "builtin",
modules = {
peek = "peek.c"
},
}
--[[
# «build» (to ".build")
# http://luarocks.org/en/Creating_a_rock
# http://luarocks.org/en/Rockspec_format
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/peek/
rm -fv peek.o peek.so
~/usrc/luarocks/bin/luarocks make peek-0.0.1-0.rockspec \
|& tee olm-peek
# (find-angg "peek/olm-peek")
ls -laF
cd ~/peek/
rm -fv peek.o peek.so
make peek.o peek.so
# «test» (to ".test")
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
-- (find-angg "peek/peek.c" "init")
-- (find-angg "LUA/lua50init.lua" "loadpeek")
DIR = getenv("HOME").."/peek"
-- assert(package.loadlib(DIR.."/peek.so", "peek_init"))()
assert(package.loadlib(DIR.."/peek.so", "luaopen_peek"))()
buf = malloc_(20)
poke_(buf, "abcd")
PP(peek_(buf+2, 2)) --> "cd"
--
-- Tests for toptr:
-- strtohex uses: (find-angg "LUA/lua50init.lua" "map" "mapconcat")
oaddr = function (o) return tonumber(tostring(o):match("0x(.*)"), 16) end
hex = function (n) return string.format("%x", n) end
hex2 = function (n) return string.format("%02x", n) end
strtohex = function (str, sep)
return mapconcat(hex2, {str:byte(1, #str)}, sep or "")
end
-- strtohex(" !@#$")
-- strtohex(" !@#$", "_")
opeek = function (o, len) return strtohex(peek_(oaddr(o), len or 20), "_") end
= print
= toptr_(print)
= hex(toptr_(print))
= opeek(print)
= opeek(opeek)
= opeek({})
= opeek(debug)
--]]
-- Local Variables:
-- coding: raw-text-unix
-- ee-anchor-format: "«%s»"
-- End: