]> git.cworth.org Git - apitrace/blobdiff - stdapi.py
More compact struct representation.
[apitrace] / stdapi.py
index 68a837c61f32161a3e685385c3f1f36b08da30e6..8dca958b1edabc4c183fa856c9b515cb976b2850 100644 (file)
--- a/stdapi.py
+++ b/stdapi.py
@@ -254,9 +254,13 @@ def ConstPointer(type):
 
 class Enum(Concrete):
 
+    __vid = 0
+
     def __init__(self, name, values):
         Concrete.__init__(self, name)
-        self.values = values
+        self.vid = Enum.__vid
+        Enum.__vid += len(values)
+        self.values = list(values)
     
     def visit(self, visitor, *args, **kwargs):
         return visitor.visit_enum(self, *args, **kwargs)
@@ -341,7 +345,12 @@ class Arg:
 
 class Function:
 
+    __id = 0
+
     def __init__(self, type, name, args, call = '', fail = None, sideeffects=True, hidden=False):
+        self.id = Function.__id
+        Function.__id += 1
+
         self.type = type
         self.name = name
 
@@ -562,3 +571,11 @@ Double = Literal("double", "Float")
 SizeT = Literal("size_t", "UInt")
 WString = Literal("wchar_t *", "WString")
 
+Int8 = Literal("int8_t", "SInt")
+UInt8 = Literal("uint8_t", "UInt")
+Int16 = Literal("int16_t", "SInt")
+UInt16 = Literal("uint16_t", "UInt")
+Int32 = Literal("int32_t", "SInt")
+UInt32 = Literal("uint32_t", "UInt")
+Int64 = Literal("int64_t", "SInt")
+UInt64 = Literal("uint64_t", "UInt")