From b5f0a45d9b10ebab8610ba235bc46f69fd58e2a2 Mon Sep 17 00:00:00 2001 From: sanine Date: Wed, 22 Feb 2023 17:35:17 -0600 Subject: begin cglm bind refactor --- util/bind.lua | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) mode change 100644 => 100755 util/bind.lua (limited to 'util') diff --git a/util/bind.lua b/util/bind.lua old mode 100644 new mode 100755 index 1309e4e..e90af9d --- 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 -- cgit v1.2.1