]> git.tdb.fi Git - gldbg.git/blobdiff - genwrap.py
Print the contents of arrays and references
[gldbg.git] / genwrap.py
index e614ab71ac34f2c237ad4f1571572490577ba602..1ee97cef332853da9e6c8ffb0d5033e7ae980b7f 100755 (executable)
@@ -125,11 +125,11 @@ class Function:
                        if self.kind=="value":
                                if self.base_ctype.startswith("const "):
                                        self.base_ctype = self.base_ctype[6:]
-                               self.io = iomap[self.base_ctype]
                        else:
                                if self.direction=="in":
                                        self.ctype = "const "+self.ctype
                                self.ctype = self.ctype+" *"
+                       self.io = iomap[self.base_ctype]
 
                def derive_csize(self):
                        if self.kind=="array" and self.size is not None:
@@ -138,6 +138,8 @@ 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=="pname":
+                                       self.csize = "paramsize(pname)*sizeof(%s)"%self.base_ctype
                                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":
@@ -185,7 +187,7 @@ class Function:
                                have_type = True
                        elif cn.endswith("Format"):
                                res += "formatsize(%s)"%param.name
-                       elif cn.endswith(("Parameter", "ParameterPName", "ParameterName")) or cn=="GetPName":
+                       elif param.name=="pname" or cn.endswith("Parameter"):
                                res += "paramsize(%s)"%param.name
                        elif cn=="MapTarget":
                                res += "mapsize(%s)"%param.name