def union_types(self) -> Iterator["Type"]: if self.cdata.base != self.UNION: return t = self.cdata while t.info.uni.count == 0: t = ffi.addressof(t.der.type) for i in range(t.info.uni.count): yield Type(self.context, t.info.uni.types[i])
def union_types(self): if self._type.base != self.UNION: return t = self._type while t.info.uni.count == 0: t = ffi.addressof(t.der.type) for i in range(t.info.uni.count): yield Type(self.context, t.info.uni.types[i])
def bits(self): if self._type.base != self.BITS: return t = self._type while t.info.bits.count == 0: t = ffi.addressof(t.der.type) for i in range(t.info.bits.count): b = t.info.bits.bit[i] yield c2str(b.name), c2str(b.dsc)
def enums(self): if self._type.base != self.ENUM: return t = self._type while t.info.enums.count == 0: t = ffi.addressof(t.der.type) for i in range(t.info.enums.count): e = t.info.enums.enm[i] yield c2str(e.name), c2str(e.dsc)
def bits(self) -> Iterator[Tuple[str, Optional[str]]]: if self.cdata.base != self.BITS: return t = self.cdata while t.info.bits.count == 0: t = ffi.addressof(t.der.type) for i in range(t.info.bits.count): b = t.info.bits.bit[i] yield c2str(b.name), c2str(b.dsc)
def enums(self) -> Iterator[Tuple[str, Optional[str]]]: if self.cdata.base != self.ENUM: return t = self.cdata while t.info.enums.count == 0: t = ffi.addressof(t.der.type) for i in range(t.info.enums.count): e = t.info.enums.enm[i] yield c2str(e.name), c2str(e.dsc)
def idents(self) -> Iterator[Tuple[str, Optional[str]]]: if self.cdata.base != self.IDENT: return t = self.cdata while t.info.ident.count == 0: t = ffi.addressof(t.der.type) for i in range(t.info.ident.count): e = t.info.ident.ref[i] yield c2str(e.name), c2str(e.dsc)
def candidate_idents(self) -> Iterator[Tuple[str, Optional[str]]]: if self.cdata.base != self.IDENT: return t = self.cdata while t.info.ident.count == 0: t = ffi.addressof(t.der.type) for i in range(t.info.ident.count): e = t.info.ident.ref[i] for s in range(e.der.number): x = e.der.set.s[s] if not x: continue yield "{}:{}".format(c2str(x.module.name), c2str(x.name)), c2str(x.dsc)
def type(self): return Type(self.context, ffi.addressof(self._leaflist.type))
def leafref_type(self): if self._type.base != self.LEAFREF: return None lref = self._type.info.lref return Type(self.context, ffi.addressof(lref.target.type))
def derived_type(self): if not self._type.der: return None return Type(self.context, ffi.addressof(self._type.der.type))
def leafref_type(self) -> Optional["Type"]: if self.cdata.base != self.LEAFREF: return None lref = self.cdata.info.lref return Type(self.context, ffi.addressof(lref.target.type))
def derived_type(self) -> Optional["Type"]: if not self.cdata.der: return None return Type(self.context, ffi.addressof(self.cdata.der.type))
def type(self) -> Type: return Type(self.context, ffi.addressof(self.cdata_leaflist.type))