From a3ad64dbfa9760f8fd2f0c8b15d6e4d19dcbe004 Mon Sep 17 00:00:00 2001 From: Victor Bombi Date: Fri, 9 Oct 2020 16:24:18 +0200 Subject: [PATCH 1/3] cpp2ffi: ftemplate_list functions where left out from comments changes --- generator/cpp2ffi.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/cpp2ffi.lua b/generator/cpp2ffi.lua index 80714ed..41cf849 100644 --- a/generator/cpp2ffi.lua +++ b/generator/cpp2ffi.lua @@ -1225,7 +1225,7 @@ function M.Parser() if self.ftemplate_list then for iT,vT in ipairs(self.ftemplate_list[ttype]) do local funT = fun:gsub(ttype,vT) - self:parseFunction(stname,funT,namespace,it.locat) + self:parseFunction(stname,{item=funT},namespace,it.locat) end end else From e35d99e4324d3636232ba2624ca5b24c6cbf6bed Mon Sep 17 00:00:00 2001 From: Victor Bombi Date: Fri, 9 Oct 2020 16:43:01 +0200 Subject: [PATCH 2/3] cpp2ffi: add skipped table for functions not wrapped but not manually created --- generator/cpp2ffi.lua | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/generator/cpp2ffi.lua b/generator/cpp2ffi.lua index 41cf849..7a454d9 100644 --- a/generator/cpp2ffi.lua +++ b/generator/cpp2ffi.lua @@ -724,6 +724,9 @@ local function parseFunction(self,stname,itt,namespace,locat) if self.get_manuals(defT) then defT.manual = true end + if self.get_skipped(defT) then + defT.skipped = true + end if ret then defT.ret = clean_spaces(ret:gsub("&","*")) defT.retref = ret:match("&") @@ -928,6 +931,7 @@ function M.Parser() par.typedefs_dict = {} par.cname_overloads = {} par.manuals = {} + par.skipped = {} par.UDTs = {} function par:insert(line,loca) @@ -946,6 +950,9 @@ function M.Parser() function par.get_manuals(def) return par.manuals[def.ov_cimguiname] or par.manuals[def.cimguiname] end + function par.get_skipped(def) + return par.skipped[def.ov_cimguiname] or par.skipped[def.cimguiname] + end function par:take_lines(cmd_line,names,compiler) local pipe,err = io.popen(cmd_line,"r") if not pipe then @@ -1792,7 +1799,7 @@ local function func_implementation(FP) local def = cimf[t.signature] assert(def) local manual = FP.get_manuals(def) - if not manual and not def.templated then + if not manual and not def.templated and not FP.get_skipped(def) then if def.constructor then assert(def.stname ~= "","constructor without struct") local empty = def.args:match("^%(%)") --no args @@ -1859,7 +1866,7 @@ local function func_header_generate_funcs(FP) local def = cimf[t.signature] assert(def,t.signature..t.cimguiname) local manual = FP.get_manuals(def) - if not manual and not def.templated then + if not manual and not def.templated and not FP.get_skipped(def) then local addcoment = "" --def.comment or "" local empty = def.args:match("^%(%)") --no args From ddc93fb07fea05a22c367c1f15c933431102889e Mon Sep 17 00:00:00 2001 From: Victor Bombi Date: Fri, 9 Oct 2020 16:47:28 +0200 Subject: [PATCH 3/3] update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 67a53d4..3906663 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Notes: * call_args : a string with the argument names separated by commas for calling imgui function * defaults : a collection in which key is argument name and value is the default value. * manual : will be true if this function is hand-written (not generated) + * skipped : will be true if this function is not generated (and not hand-written) * isvararg : is set if some argument is a vararg * constructor : is set if the function is a constructor for a class. * destructor : is set if the function is a destructor for a class but not just a default destructor.