def parse_typedef(self, c_include_path: str, alias: str, c_type: str): if c_type in ("void*", "void *"): self.repo.add_opaque_class(OpaqueClass( basename=rstrip(alias, 't'), c_name=alias, vala_name=self.naming.struct(alias), c_header=c_include_path, c_type='void')) else: bare_c_type = utils.bare_c_type(c_type) self.repo.add_typedef(Typedef( c_name=alias, vala_name=self.naming.typedef(alias), c_type=bare_c_type, c_header=c_include_path))
def typedef(self, name: str) -> str: """Generate Vala name for typedef's alias.""" return camel_case(rstrip(lstrip(name, self.strip_prefix.lower() + "_"), '_t'))
def camel_case(self, name: str) -> str: return camel_case(rstrip(lstrip(name, self.strip_prefix.lower() + "_"), '_t'))
def enum(self, name: str) -> str: """Generate Vala name for enum names (not members).""" return camel_case(rstrip(lstrip(name, self.strip_prefix.lower() + "_"), '_t'))