|
@@ -462,7 +462,7 @@ def printe(string):
|
|
def printc(string):
|
|
def printc(string):
|
|
print(string, end='\n', file=fc)
|
|
print(string, end='\n', file=fc)
|
|
|
|
|
|
-def iter_types(v, opaqueType):
|
|
|
|
|
|
+def iter_types(v):
|
|
l = None
|
|
l = None
|
|
if sys.version_info[0] < 3:
|
|
if sys.version_info[0] < 3:
|
|
l = list(v.itervalues())
|
|
l = list(v.itervalues())
|
|
@@ -472,13 +472,8 @@ def iter_types(v, opaqueType):
|
|
l = list(filter(lambda t: t.name in selected_types, l))
|
|
l = list(filter(lambda t: t.name in selected_types, l))
|
|
if args.no_builtin:
|
|
if args.no_builtin:
|
|
l = list(filter(lambda t: type(t) != BuiltinType, l))
|
|
l = list(filter(lambda t: type(t) != BuiltinType, l))
|
|
- if opaqueType:
|
|
|
|
- # only opaque type
|
|
|
|
- l = list(filter(lambda t: t.name in opaque_type_mapping, l))
|
|
|
|
- else:
|
|
|
|
- # remove opaque type
|
|
|
|
- l = list(filter(lambda t: t.name not in opaque_type_mapping, l))
|
|
|
|
return l
|
|
return l
|
|
|
|
+
|
|
################
|
|
################
|
|
# Print Header #
|
|
# Print Header #
|
|
################
|
|
################
|
|
@@ -503,8 +498,7 @@ extern "C" {
|
|
|
|
|
|
''')
|
|
''')
|
|
|
|
|
|
-filtered_types = iter_types(types, False)
|
|
|
|
-filtered_opaque_types = iter_types(types, True)
|
|
|
|
|
|
+filtered_types = iter_types(types)
|
|
|
|
|
|
printh('''/**
|
|
printh('''/**
|
|
* Every type is assigned an index in an array containing the type descriptions.
|
|
* Every type is assigned an index in an array containing the type descriptions.
|
|
@@ -526,20 +520,6 @@ for t in filtered_types:
|
|
printh("#define " + outname.upper() + "_" + t.name.upper() + " " + str(i))
|
|
printh("#define " + outname.upper() + "_" + t.name.upper() + " " + str(i))
|
|
i += 1
|
|
i += 1
|
|
|
|
|
|
-i = 0
|
|
|
|
-# Generate alias for opaque types
|
|
|
|
-for t in filtered_opaque_types:
|
|
|
|
- printh("\n/**\n * " + t.name)
|
|
|
|
- printh(" * " + "^" * len(t.name))
|
|
|
|
- if t.description == "":
|
|
|
|
- printh(" */")
|
|
|
|
- else:
|
|
|
|
- printh(" * " + t.description + " */")
|
|
|
|
- if type(t) != BuiltinType:
|
|
|
|
- printh(t.typedef_h() + "\n")
|
|
|
|
- printh("#define " + outname.upper() + "_" + t.name.upper() + " " + outname.upper() + "_" + get_base_type_for_opaque(t.name)['name'].upper())
|
|
|
|
- i += 1
|
|
|
|
-
|
|
|
|
printh('''
|
|
printh('''
|
|
#ifdef __cplusplus
|
|
#ifdef __cplusplus
|
|
} // extern "C"
|
|
} // extern "C"
|