+ ptype = proto.getElementsByTagName("ptype")
+ if ptype:
+ func.return_type = get_text_contents(ptype[0])
+ else:
+ for c in proto.childNodes:
+ if c.nodeType==xml.dom.Node.TEXT_NODE and c.data.strip():
+ func.return_type = c.data.strip()
+ break
+
+ params = cmd.getElementsByTagName("param")
+ for p in params:
+ func.params.append(get_text_contents(p))
+
+ enums = get_nested_elements(root, "enums/enum")
+ for en in enums:
+ name = en.getAttribute("name")
+ enum = things.get(name)
+ if not enum:
+ enum = Enum(name)
+ things[name] = enum
+
+ enum.value = int(en.getAttribute("value"), 16)
+