Something went wrong. Try again.
An experimental alternative to Rust sans-io that enables the direct style
Something went wrong. Try again.
486 B · 22 lines
Lua
at experiments
1234567891011121314151617181920212223--- Status and error codes as they cross the ABI. Non-negative is a status,-- negative is an error. The union of both cdylibs' codes; each uses a subset.local M = { AWAITING = 0, COMPLETE = 1, STALLED = 2, BUSY = -1, FINISHED = -2, PANICKED = -4, BAD_HANDLE = -5, BAD_INPUT = -6,}
local names = {}for name, code in pairs(M) do names[code] = name endnames[0] = "AWAITING"
function M.describe(code) return names[code] or ("code " .. tostring(code))end
return M