def _pointer(): # A pointer to a function type is a Func. try: if args[0][0] == 'FUNCTIONTYPE': return 'Func' except IndexError: pass try: return self.get_ooc_type(translate(args[0])) + '*' except WTFError: # That might work well for unknown types. # TODO: print a message to stderr return 'Pointer'
def get_opaque_types(self): """ yield tags of opaque (i.e. unknown) types. """ for obj in self.objects.copy().itervalues(): # only handle typedefs ... if obj['class'] == 'Typedef': # get the first, typedef tag tag = obj['target'] while '(' in tag: mod, args = parse_string(tag) # is it wrapping a struct or union that is unknown? if (mod in ('STRUCT', 'UNION') and tag not in self.objects): # then it's opaque. yield tag break # proceed. tag = translate(args[0])
def _ignore(): return self.get_ooc_type(translate(args[0]))
def _array(): # TODO: that looks incorrect. return self.get_ooc_type(translate(args[0])) + '*'
def _const(): return 'const %s' % self.get_ooc_type(translate(args[0]))