]> git.cworth.org Git - apitrace/blob - specs/stdapi.py
Handle REFIIDs on functions too.
[apitrace] / specs / stdapi.py
1 ##########################################################################
2 #
3 # Copyright 2008-2010 VMware, Inc.
4 # All Rights Reserved.
5 #
6 # Permission is hereby granted, free of charge, to any person obtaining a copy
7 # of this software and associated documentation files (the "Software"), to deal
8 # in the Software without restriction, including without limitation the rights
9 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 # copies of the Software, and to permit persons to whom the Software is
11 # furnished to do so, subject to the following conditions:
12 #
13 # The above copyright notice and this permission notice shall be included in
14 # all copies or substantial portions of the Software.
15 #
16 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 # THE SOFTWARE.
23 #
24 ##########################################################################/
25
26 """C basic types"""
27
28
29 import debug
30
31
32 class Type:
33     """Base class for all types."""
34
35     __tags = set()
36
37     def __init__(self, expr, tag = None):
38         self.expr = expr
39
40         # Generate a default tag, used when naming functions that will operate
41         # on this type, so it should preferrably be something representative of
42         # the type.
43         if tag is None:
44             if expr is not None:
45                 tag = ''.join([c for c in expr if c.isalnum() or c in '_'])
46             else:
47                 tag = 'anonynoums'
48         else:
49             for c in tag:
50                 assert c.isalnum() or c in '_'
51
52         # Ensure it is unique.
53         if tag in Type.__tags:
54             suffix = 1
55             while tag + str(suffix) in Type.__tags:
56                 suffix += 1
57             tag += str(suffix)
58
59         assert tag not in Type.__tags
60         Type.__tags.add(tag)
61
62         self.tag = tag
63
64     def __str__(self):
65         """Return the C/C++ type expression for this type."""
66         return self.expr
67
68     def visit(self, visitor, *args, **kwargs):
69         raise NotImplementedError
70
71     def mutable(self):
72         '''Return a mutable version of this type.
73
74         Convenience wrapper around MutableRebuilder.'''
75         visitor = MutableRebuilder()
76         return visitor.visit(self)
77
78
79 class _Void(Type):
80     """Singleton void type."""
81
82     def __init__(self):
83         Type.__init__(self, "void")
84
85     def visit(self, visitor, *args, **kwargs):
86         return visitor.visitVoid(self, *args, **kwargs)
87
88 Void = _Void()
89
90
91 class Literal(Type):
92     """Class to describe literal types.
93
94     Types which are not defined in terms of other types, such as integers and
95     floats."""
96
97     def __init__(self, expr, kind):
98         Type.__init__(self, expr)
99         self.kind = kind
100
101     def visit(self, visitor, *args, **kwargs):
102         return visitor.visitLiteral(self, *args, **kwargs)
103
104
105 class Const(Type):
106
107     def __init__(self, type):
108         # While "const foo" and "foo const" are synonymous, "const foo *" and
109         # "foo * const" are not quite the same, and some compilers do enforce
110         # strict const correctness.
111         if isinstance(type, String) or type is WString:
112             # For strings we never intend to say a const pointer to chars, but
113             # rather a point to const chars.
114             expr = "const " + type.expr
115         elif type.expr.startswith("const ") or '*' in type.expr:
116             expr = type.expr + " const"
117         else:
118             # The most legible
119             expr = "const " + type.expr
120
121         Type.__init__(self, expr, 'C' + type.tag)
122
123         self.type = type
124
125     def visit(self, visitor, *args, **kwargs):
126         return visitor.visitConst(self, *args, **kwargs)
127
128
129 class Pointer(Type):
130
131     def __init__(self, type):
132         Type.__init__(self, type.expr + " *", 'P' + type.tag)
133         self.type = type
134
135     def visit(self, visitor, *args, **kwargs):
136         return visitor.visitPointer(self, *args, **kwargs)
137
138
139 class IntPointer(Type):
140     '''Integer encoded as a pointer.'''
141
142     def visit(self, visitor, *args, **kwargs):
143         return visitor.visitIntPointer(self, *args, **kwargs)
144
145
146 class ObjPointer(Type):
147     '''Pointer to an object.'''
148
149     def __init__(self, type):
150         Type.__init__(self, type.expr + " *", 'P' + type.tag)
151         self.type = type
152
153     def visit(self, visitor, *args, **kwargs):
154         return visitor.visitObjPointer(self, *args, **kwargs)
155
156
157 class LinearPointer(Type):
158     '''Pointer to a linear range of memory.'''
159
160     def __init__(self, type, size = None):
161         Type.__init__(self, type.expr + " *", 'P' + type.tag)
162         self.type = type
163         self.size = size
164
165     def visit(self, visitor, *args, **kwargs):
166         return visitor.visitLinearPointer(self, *args, **kwargs)
167
168
169 class Reference(Type):
170     '''C++ references.'''
171
172     def __init__(self, type):
173         Type.__init__(self, type.expr + " &", 'R' + type.tag)
174         self.type = type
175
176     def visit(self, visitor, *args, **kwargs):
177         return visitor.visitReference(self, *args, **kwargs)
178
179
180 class Handle(Type):
181
182     def __init__(self, name, type, range=None, key=None):
183         Type.__init__(self, type.expr, 'P' + type.tag)
184         self.name = name
185         self.type = type
186         self.range = range
187         self.key = key
188
189     def visit(self, visitor, *args, **kwargs):
190         return visitor.visitHandle(self, *args, **kwargs)
191
192
193 def ConstPointer(type):
194     return Pointer(Const(type))
195
196
197 class Enum(Type):
198
199     __id = 0
200
201     def __init__(self, name, values):
202         Type.__init__(self, name)
203
204         self.id = Enum.__id
205         Enum.__id += 1
206
207         self.values = list(values)
208
209     def visit(self, visitor, *args, **kwargs):
210         return visitor.visitEnum(self, *args, **kwargs)
211
212
213 def FakeEnum(type, values):
214     return Enum(type.expr, values)
215
216
217 class Bitmask(Type):
218
219     __id = 0
220
221     def __init__(self, type, values):
222         Type.__init__(self, type.expr)
223
224         self.id = Bitmask.__id
225         Bitmask.__id += 1
226
227         self.type = type
228         self.values = values
229
230     def visit(self, visitor, *args, **kwargs):
231         return visitor.visitBitmask(self, *args, **kwargs)
232
233 Flags = Bitmask
234
235
236 class Array(Type):
237
238     def __init__(self, type, length):
239         Type.__init__(self, type.expr + " *")
240         self.type = type
241         self.length = length
242
243     def visit(self, visitor, *args, **kwargs):
244         return visitor.visitArray(self, *args, **kwargs)
245
246
247 class Blob(Type):
248
249     def __init__(self, type, size):
250         Type.__init__(self, type.expr + ' *')
251         self.type = type
252         self.size = size
253
254     def visit(self, visitor, *args, **kwargs):
255         return visitor.visitBlob(self, *args, **kwargs)
256
257
258 class Struct(Type):
259
260     __id = 0
261
262     def __init__(self, name, members):
263         Type.__init__(self, name)
264
265         self.id = Struct.__id
266         Struct.__id += 1
267
268         self.name = name
269         self.members = []
270
271         # Eliminate anonymous unions
272         for type, name in members:
273             if name is not None:
274                 self.members.append((type, name))
275             else:
276                 assert isinstance(type, Union)
277                 assert type.name is None
278                 self.members.extend(type.members)
279
280     def visit(self, visitor, *args, **kwargs):
281         return visitor.visitStruct(self, *args, **kwargs)
282
283
284 class Union(Type):
285
286     __id = 0
287
288     def __init__(self, name, members):
289         Type.__init__(self, name)
290
291         self.id = Union.__id
292         Union.__id += 1
293
294         self.name = name
295         self.members = members
296
297
298 class Alias(Type):
299
300     def __init__(self, expr, type):
301         Type.__init__(self, expr)
302         self.type = type
303
304     def visit(self, visitor, *args, **kwargs):
305         return visitor.visitAlias(self, *args, **kwargs)
306
307 class Arg:
308
309     def __init__(self, type, name, input=True, output=False):
310         self.type = type
311         self.name = name
312         self.input = input
313         self.output = output
314         self.index = None
315
316     def __str__(self):
317         return '%s %s' % (self.type, self.name)
318
319
320 def In(type, name):
321     return Arg(type, name, input=True, output=False)
322
323 def Out(type, name):
324     return Arg(type, name, input=False, output=True)
325
326 def InOut(type, name):
327     return Arg(type, name, input=True, output=True)
328
329
330 class Function:
331
332     # 0-3 are reserved to memcpy, malloc, free, and realloc
333     __id = 4
334
335     def __init__(self, type, name, args, call = '', fail = None, sideeffects=True):
336         self.id = Function.__id
337         Function.__id += 1
338
339         self.type = type
340         self.name = name
341
342         self.args = []
343         index = 0
344         for arg in args:
345             if not isinstance(arg, Arg):
346                 if isinstance(arg, tuple):
347                     arg_type, arg_name = arg
348                 else:
349                     arg_type = arg
350                     arg_name = "arg%u" % index
351                 arg = Arg(arg_type, arg_name)
352             arg.index = index
353             index += 1
354             self.args.append(arg)
355
356         self.call = call
357         self.fail = fail
358         self.sideeffects = sideeffects
359
360     def prototype(self, name=None):
361         if name is not None:
362             name = name.strip()
363         else:
364             name = self.name
365         s = name
366         if self.call:
367             s = self.call + ' ' + s
368         if name.startswith('*'):
369             s = '(' + s + ')'
370         s = self.type.expr + ' ' + s
371         s += "("
372         if self.args:
373             s += ", ".join(["%s %s" % (arg.type, arg.name) for arg in self.args])
374         else:
375             s += "void"
376         s += ")"
377         return s
378
379     def argNames(self):
380         return [arg.name for arg in self.args]
381
382
383 def StdFunction(*args, **kwargs):
384     kwargs.setdefault('call', '__stdcall')
385     return Function(*args, **kwargs)
386
387
388 def FunctionPointer(type, name, args, **kwargs):
389     # XXX: We should probably treat function pointers (callbacks or not) in a generic fashion
390     return Opaque(name)
391
392
393 class Interface(Type):
394
395     def __init__(self, name, base=None):
396         Type.__init__(self, name)
397         self.name = name
398         self.base = base
399         self.methods = []
400
401     def visit(self, visitor, *args, **kwargs):
402         return visitor.visitInterface(self, *args, **kwargs)
403
404     def iterMethods(self):
405         if self.base is not None:
406             for method in self.base.iterMethods():
407                 yield method
408         for method in self.methods:
409             yield method
410         raise StopIteration
411
412     def iterBaseMethods(self):
413         if self.base is not None:
414             for iface, method in self.base.iterBaseMethods():
415                 yield iface, method
416         for method in self.methods:
417             yield self, method
418         raise StopIteration
419
420
421 class Method(Function):
422
423     def __init__(self, type, name, args, call = '__stdcall', const=False, sideeffects=True):
424         Function.__init__(self, type, name, args, call = call, sideeffects=sideeffects)
425         for index in range(len(self.args)):
426             self.args[index].index = index + 1
427         self.const = const
428
429     def prototype(self, name=None):
430         s = Function.prototype(self, name)
431         if self.const:
432             s += ' const'
433         return s
434
435
436 def StdMethod(*args, **kwargs):
437     kwargs.setdefault('call', '__stdcall')
438     return Method(*args, **kwargs)
439
440
441 class String(Type):
442
443     def __init__(self, expr = "char *", length = None, kind = 'String'):
444         Type.__init__(self, expr)
445         self.length = length
446         self.kind = kind
447
448     def visit(self, visitor, *args, **kwargs):
449         return visitor.visitString(self, *args, **kwargs)
450
451
452 class Opaque(Type):
453     '''Opaque pointer.'''
454
455     def __init__(self, expr):
456         Type.__init__(self, expr)
457
458     def visit(self, visitor, *args, **kwargs):
459         return visitor.visitOpaque(self, *args, **kwargs)
460
461
462 def OpaquePointer(type, *args):
463     return Opaque(type.expr + ' *')
464
465 def OpaqueArray(type, size):
466     return Opaque(type.expr + ' *')
467
468 def OpaqueBlob(type, size):
469     return Opaque(type.expr + ' *')
470
471
472 class Polymorphic(Type):
473
474     def __init__(self, defaultType, switchExpr, switchTypes):
475         Type.__init__(self, defaultType.expr)
476         self.defaultType = defaultType
477         self.switchExpr = switchExpr
478         self.switchTypes = switchTypes
479
480     def visit(self, visitor, *args, **kwargs):
481         return visitor.visitPolymorphic(self, *args, **kwargs)
482
483     def iterSwitch(self):
484         cases = [['default']]
485         types = [self.defaultType]
486
487         for expr, type in self.switchTypes:
488             case = 'case %s' % expr
489             try:
490                 i = types.index(type)
491             except ValueError:
492                 cases.append([case])
493                 types.append(type)
494             else:
495                 cases[i].append(case)
496
497         return zip(cases, types)
498
499
500 class Visitor:
501     '''Abstract visitor for the type hierarchy.'''
502
503     def visit(self, type, *args, **kwargs):
504         return type.visit(self, *args, **kwargs)
505
506     def visitVoid(self, void, *args, **kwargs):
507         raise NotImplementedError
508
509     def visitLiteral(self, literal, *args, **kwargs):
510         raise NotImplementedError
511
512     def visitString(self, string, *args, **kwargs):
513         raise NotImplementedError
514
515     def visitConst(self, const, *args, **kwargs):
516         raise NotImplementedError
517
518     def visitStruct(self, struct, *args, **kwargs):
519         raise NotImplementedError
520
521     def visitArray(self, array, *args, **kwargs):
522         raise NotImplementedError
523
524     def visitBlob(self, blob, *args, **kwargs):
525         raise NotImplementedError
526
527     def visitEnum(self, enum, *args, **kwargs):
528         raise NotImplementedError
529
530     def visitBitmask(self, bitmask, *args, **kwargs):
531         raise NotImplementedError
532
533     def visitPointer(self, pointer, *args, **kwargs):
534         raise NotImplementedError
535
536     def visitIntPointer(self, pointer, *args, **kwargs):
537         raise NotImplementedError
538
539     def visitObjPointer(self, pointer, *args, **kwargs):
540         raise NotImplementedError
541
542     def visitLinearPointer(self, pointer, *args, **kwargs):
543         raise NotImplementedError
544
545     def visitReference(self, reference, *args, **kwargs):
546         raise NotImplementedError
547
548     def visitHandle(self, handle, *args, **kwargs):
549         raise NotImplementedError
550
551     def visitAlias(self, alias, *args, **kwargs):
552         raise NotImplementedError
553
554     def visitOpaque(self, opaque, *args, **kwargs):
555         raise NotImplementedError
556
557     def visitInterface(self, interface, *args, **kwargs):
558         raise NotImplementedError
559
560     def visitPolymorphic(self, polymorphic, *args, **kwargs):
561         raise NotImplementedError
562         #return self.visit(polymorphic.defaultType, *args, **kwargs)
563
564
565 class OnceVisitor(Visitor):
566     '''Visitor that guarantees that each type is visited only once.'''
567
568     def __init__(self):
569         self.__visited = set()
570
571     def visit(self, type, *args, **kwargs):
572         if type not in self.__visited:
573             self.__visited.add(type)
574             return type.visit(self, *args, **kwargs)
575         return None
576
577
578 class Rebuilder(Visitor):
579     '''Visitor which rebuild types as it visits them.
580
581     By itself it is a no-op -- it is intended to be overwritten.
582     '''
583
584     def visitVoid(self, void):
585         return void
586
587     def visitLiteral(self, literal):
588         return literal
589
590     def visitString(self, string):
591         return string
592
593     def visitConst(self, const):
594         const_type = self.visit(const.type)
595         if const_type is const.type:
596             return const
597         else:
598             return Const(const_type)
599
600     def visitStruct(self, struct):
601         members = [(self.visit(type), name) for type, name in struct.members]
602         return Struct(struct.name, members)
603
604     def visitArray(self, array):
605         type = self.visit(array.type)
606         return Array(type, array.length)
607
608     def visitBlob(self, blob):
609         type = self.visit(blob.type)
610         return Blob(type, blob.size)
611
612     def visitEnum(self, enum):
613         return enum
614
615     def visitBitmask(self, bitmask):
616         type = self.visit(bitmask.type)
617         return Bitmask(type, bitmask.values)
618
619     def visitPointer(self, pointer):
620         pointer_type = self.visit(pointer.type)
621         if pointer_type is pointer.type:
622             return pointer
623         else:
624             return Pointer(pointer_type)
625
626     def visitIntPointer(self, pointer):
627         return pointer
628
629     def visitObjPointer(self, pointer):
630         pointer_type = self.visit(pointer.type)
631         if pointer_type is pointer.type:
632             return pointer
633         else:
634             return ObjPointer(pointer_type)
635
636     def visitLinearPointer(self, pointer):
637         pointer_type = self.visit(pointer.type)
638         if pointer_type is pointer.type:
639             return pointer
640         else:
641             return LinearPointer(pointer_type)
642
643     def visitReference(self, reference):
644         reference_type = self.visit(reference.type)
645         if reference_type is reference.type:
646             return reference
647         else:
648             return Reference(reference_type)
649
650     def visitHandle(self, handle):
651         handle_type = self.visit(handle.type)
652         if handle_type is handle.type:
653             return handle
654         else:
655             return Handle(handle.name, handle_type, range=handle.range, key=handle.key)
656
657     def visitAlias(self, alias):
658         alias_type = self.visit(alias.type)
659         if alias_type is alias.type:
660             return alias
661         else:
662             return Alias(alias.expr, alias_type)
663
664     def visitOpaque(self, opaque):
665         return opaque
666
667     def visitInterface(self, interface, *args, **kwargs):
668         return interface
669
670     def visitPolymorphic(self, polymorphic):
671         defaultType = self.visit(polymorphic.defaultType)
672         switchExpr = polymorphic.switchExpr
673         switchTypes = [(expr, self.visit(type)) for expr, type in polymorphic.switchTypes]
674         return Polymorphic(defaultType, switchExpr, switchTypes)
675
676
677 class MutableRebuilder(Rebuilder):
678     '''Type visitor which derives a mutable type.'''
679
680     def visitConst(self, const):
681         # Strip out const qualifier
682         return const.type
683
684     def visitAlias(self, alias):
685         # Tear the alias on type changes
686         type = self.visit(alias.type)
687         if type is alias.type:
688             return alias
689         return type
690
691     def visitReference(self, reference):
692         # Strip out references
693         return reference.type
694
695
696 class Traverser(Visitor):
697     '''Visitor which all types.'''
698
699     def visitVoid(self, void, *args, **kwargs):
700         pass
701
702     def visitLiteral(self, literal, *args, **kwargs):
703         pass
704
705     def visitString(self, string, *args, **kwargs):
706         pass
707
708     def visitConst(self, const, *args, **kwargs):
709         self.visit(const.type, *args, **kwargs)
710
711     def visitStruct(self, struct, *args, **kwargs):
712         for type, name in struct.members:
713             self.visit(type, *args, **kwargs)
714
715     def visitArray(self, array, *args, **kwargs):
716         self.visit(array.type, *args, **kwargs)
717
718     def visitBlob(self, array, *args, **kwargs):
719         pass
720
721     def visitEnum(self, enum, *args, **kwargs):
722         pass
723
724     def visitBitmask(self, bitmask, *args, **kwargs):
725         self.visit(bitmask.type, *args, **kwargs)
726
727     def visitPointer(self, pointer, *args, **kwargs):
728         self.visit(pointer.type, *args, **kwargs)
729
730     def visitIntPointer(self, pointer, *args, **kwargs):
731         pass
732
733     def visitObjPointer(self, pointer, *args, **kwargs):
734         self.visit(pointer.type, *args, **kwargs)
735
736     def visitLinearPointer(self, pointer, *args, **kwargs):
737         self.visit(pointer.type, *args, **kwargs)
738
739     def visitReference(self, reference, *args, **kwargs):
740         self.visit(reference.type, *args, **kwargs)
741
742     def visitHandle(self, handle, *args, **kwargs):
743         self.visit(handle.type, *args, **kwargs)
744
745     def visitAlias(self, alias, *args, **kwargs):
746         self.visit(alias.type, *args, **kwargs)
747
748     def visitOpaque(self, opaque, *args, **kwargs):
749         pass
750
751     def visitInterface(self, interface, *args, **kwargs):
752         if interface.base is not None:
753             self.visit(interface.base, *args, **kwargs)
754         for method in interface.iterMethods():
755             for arg in method.args:
756                 self.visit(arg.type, *args, **kwargs)
757             self.visit(method.type, *args, **kwargs)
758
759     def visitPolymorphic(self, polymorphic, *args, **kwargs):
760         self.visit(polymorphic.defaultType, *args, **kwargs)
761         for expr, type in polymorphic.switchTypes:
762             self.visit(type, *args, **kwargs)
763
764
765 class Collector(Traverser):
766     '''Visitor which collects all unique types as it traverses them.'''
767
768     def __init__(self):
769         self.__visited = set()
770         self.types = []
771
772     def visit(self, type):
773         if type in self.__visited:
774             return
775         self.__visited.add(type)
776         Visitor.visit(self, type)
777         self.types.append(type)
778
779
780
781 class API:
782     '''API abstraction.
783
784     Essentially, a collection of types, functions, and interfaces.
785     '''
786
787     def __init__(self, name = None):
788         self.name = name
789         self.headers = []
790         self.functions = []
791         self.interfaces = []
792
793     def getAllTypes(self):
794         collector = Collector()
795         for function in self.functions:
796             for arg in function.args:
797                 collector.visit(arg.type)
798             collector.visit(function.type)
799         for interface in self.interfaces:
800             collector.visit(interface)
801             for method in interface.iterMethods():
802                 for arg in method.args:
803                     collector.visit(arg.type)
804                 collector.visit(method.type)
805         return collector.types
806
807     def getAllInterfaces(self):
808         types = self.getAllTypes()
809         interfaces = [type for type in types if isinstance(type, Interface)]
810         for interface in self.interfaces:
811             if interface not in interfaces:
812                 interfaces.append(interface)
813         return interfaces
814
815     def addFunction(self, function):
816         self.functions.append(function)
817
818     def addFunctions(self, functions):
819         for function in functions:
820             self.addFunction(function)
821
822     def addInterface(self, interface):
823         self.interfaces.append(interface)
824
825     def addInterfaces(self, interfaces):
826         self.interfaces.extend(interfaces)
827
828     def addApi(self, api):
829         self.headers.extend(api.headers)
830         self.addFunctions(api.functions)
831         self.addInterfaces(api.interfaces)
832
833     def get_function_by_name(self, name):
834         for function in self.functions:
835             if function.name == name:
836                 return function
837         return None
838
839
840 Bool = Literal("bool", "Bool")
841 SChar = Literal("signed char", "SInt")
842 UChar = Literal("unsigned char", "UInt")
843 Short = Literal("short", "SInt")
844 Int = Literal("int", "SInt")
845 Long = Literal("long", "SInt")
846 LongLong = Literal("long long", "SInt")
847 UShort = Literal("unsigned short", "UInt")
848 UInt = Literal("unsigned int", "UInt")
849 ULong = Literal("unsigned long", "UInt")
850 ULongLong = Literal("unsigned long long", "UInt")
851 Float = Literal("float", "Float")
852 Double = Literal("double", "Double")
853 SizeT = Literal("size_t", "UInt")
854
855 # C string (i.e., zero terminated)
856 CString = String()
857 WString = String("wchar_t *", kind="WString")
858
859 Int8 = Literal("int8_t", "SInt")
860 UInt8 = Literal("uint8_t", "UInt")
861 Int16 = Literal("int16_t", "SInt")
862 UInt16 = Literal("uint16_t", "UInt")
863 Int32 = Literal("int32_t", "SInt")
864 UInt32 = Literal("uint32_t", "UInt")
865 Int64 = Literal("int64_t", "SInt")
866 UInt64 = Literal("uint64_t", "UInt")