diff options
author | sanine <sanine.not@pm.me> | 2023-02-22 17:35:17 -0600 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-02-22 17:35:17 -0600 |
commit | b5f0a45d9b10ebab8610ba235bc46f69fd58e2a2 (patch) | |
tree | 8fef6c14a2d5c1ad316cbc072af3d313908350d2 /util | |
parent | 353d60d3ebc353aef474633e7064067a2ef343ce (diff) |
begin cglm bind refactor
Diffstat (limited to 'util')
-rwxr-xr-x[-rw-r--r--] | util/bind.lua | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/util/bind.lua b/util/bind.lua index 1309e4e..e90af9d 100644..100755 --- a/util/bind.lua +++ b/util/bind.lua @@ -1,3 +1,24 @@ +#!/usr/bin/lua5.1 + local b = require 'generate-binding' -print(b.bind(arg[1])) + +if arg[1] == "-f" then + local signatures = {} + local f = io.open(arg[2]) + for line in f:lines() do + if string.match(line, "[^%s]") then + table.insert(signatures, line) + end + end + f:close() + + f = io.open(arg[2] .. ".bind", "w") + for _, sig in ipairs(signatures) do + f:write(b.bind(sig)) + f:write("\n\n\n") + end + f:close() +else + print(b.bind(arg[1])) +end |