X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=genwrap.py;h=e614ab71ac34f2c237ad4f1571572490577ba602;hb=7c57338619688bc07f394ad82f75471aefbecc59;hp=ec239853875a386fdca9a4961b733a77622177c5;hpb=53c5f5f90611ce35d13f7051b26ac482d1336fc5;p=gldbg.git diff --git a/genwrap.py b/genwrap.py index ec23985..e614ab7 100755 --- a/genwrap.py +++ b/genwrap.py @@ -138,8 +138,6 @@ class Function: self.csize = "%d*sizeof(%s)"%(self.size, self.base_ctype) elif self.size.startswith("COMPSIZE("): self.csize = self.func.compsize(self.size[9:-1], self.base_ctype) - elif self.size=="" and (self.type=="charARB" or self.type=="Char"): - self.csize = "strlen" else: s = self.func.get_param(self.size.split('*')[0]) if (s.type=="SizeI" or s.type.endswith("Int32") or s.type.startswith("BufferSize")) and s.kind=="value": @@ -197,7 +195,7 @@ class Function: sys.stderr.write("Compsize '%s' for function '%s' failed: Parameter '%s' has unknown type '%s'\n"%(size, self.name, param.name, param.type)) return if not have_type: - res += "*sizeof(%s)"%param.ctype + res += "*sizeof(%s)"%btype return res def finalize(self): @@ -211,6 +209,7 @@ class Function: class Template: def __init__(self, fn): self.sections = [] + self.handcode = [] literal = True text = "" @@ -221,6 +220,10 @@ class Template: text = "" text += line[1:]+"\n" literal = True + elif line[0]=='!': + parts = line[1:].split() + if parts[0]=="handcode": + self.handcode.append(parts[1]) else: if literal and text: self.add_section(text, literal) @@ -248,6 +251,8 @@ class Template: print sect else: for func in functions: + if func.name in self.handcode: + continue globals = { "w": self.write, "wl": self.writeln,