aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/glx
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/glx')
-rw-r--r--xorg-server/hw/xwin/glx/genheaders.py36
-rw-r--r--xorg-server/hw/xwin/glx/gl.xml74
-rw-r--r--xorg-server/hw/xwin/glx/reg.py114
3 files changed, 106 insertions, 118 deletions
diff --git a/xorg-server/hw/xwin/glx/genheaders.py b/xorg-server/hw/xwin/glx/genheaders.py
index f9913285d..f1d130e4c 100644
--- a/xorg-server/hw/xwin/glx/genheaders.py
+++ b/xorg-server/hw/xwin/glx/genheaders.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python3
+#!/usr/bin/env python
#
# Copyright (c) 2013 The Khronos Group Inc.
#
@@ -50,33 +50,33 @@ if __name__ == '__main__':
arg = sys.argv[i]
i = i + 1
if (arg == '-debug'):
- print('Enabling debug (-debug)', file=sys.stderr)
+ write('Enabling debug (-debug)', file=sys.stderr)
debug = True
elif (arg == '-dump'):
- print('Enabling dump (-dump)', file=sys.stderr)
+ write('Enabling dump (-dump)', file=sys.stderr)
dump = True
elif (arg == '-noprotect'):
- print('Disabling inclusion protection in output headers', file=sys.stderr)
+ write('Disabling inclusion protection in output headers', file=sys.stderr)
protect = False
elif (arg == '-profile'):
- print('Enabling profiling (-profile)', file=sys.stderr)
+ write('Enabling profiling (-profile)', file=sys.stderr)
profile = True
elif (arg == '-registry'):
regFilename = sys.argv[i]
i = i+1
- print('Using registry ', regFilename, file=sys.stderr)
+ write('Using registry ', regFilename, file=sys.stderr)
elif (arg == '-time'):
- print('Enabling timing (-time)', file=sys.stderr)
+ write('Enabling timing (-time)', file=sys.stderr)
timeit = True
elif (arg == '-validate'):
- print('Enabling group validation (-validate)', file=sys.stderr)
+ write('Enabling group validation (-validate)', file=sys.stderr)
validate = True
elif (arg[0:1] == '-'):
- print('Unrecognized argument:', arg, file=sys.stderr)
+ write('Unrecognized argument:', arg, file=sys.stderr)
exit(1)
else:
target = arg
- print('Using target', target, file=sys.stderr)
+ write('Using target', target, file=sys.stderr)
# Simple timer functions
startTime = None
@@ -87,7 +87,7 @@ def endTimer(msg):
global startTime
endTime = time.clock()
if (timeit):
- print(msg, endTime - startTime)
+ write(msg, endTime - startTime)
startTime = None
# Load & parse registry
@@ -105,9 +105,9 @@ if (validate):
reg.validateGroups()
if (dump):
- print('***************************************')
- print('Performing Registry dump to regdump.txt')
- print('***************************************')
+ write('***************************************')
+ write('Performing Registry dump to regdump.txt')
+ write('***************************************')
reg.dumpReg(filehandle = open('regdump.txt','w'))
# Turn a list of strings into a regexp string matching exactly those strings
@@ -526,9 +526,9 @@ def genHeaders():
if (genOpts == None):
break
if (target and target != genOpts.filename):
- # print('*** Skipping', genOpts.filename)
+ # write('*** Skipping', genOpts.filename)
continue
- print('*** Building', genOpts.filename)
+ write('*** Building', genOpts.filename)
generated = generated + 1
startTimer()
gen = COutputGenerator(errFile=errWarn,
@@ -536,10 +536,10 @@ def genHeaders():
diagFile=diag)
reg.setGenerator(gen)
reg.apiGen(genOpts)
- print('** Generated', genOpts.filename)
+ write('** Generated', genOpts.filename)
endTimer('Time to generate ' + genOpts.filename + ' =')
if (target and generated == 0):
- print('Failed to generate target:', target)
+ write('Failed to generate target:', target)
if (debug):
pdb.run('genHeaders()')
diff --git a/xorg-server/hw/xwin/glx/gl.xml b/xorg-server/hw/xwin/glx/gl.xml
index 11c100acb..e46fcaf48 100644
--- a/xorg-server/hw/xwin/glx/gl.xml
+++ b/xorg-server/hw/xwin/glx/gl.xml
@@ -304,10 +304,8 @@ typedef unsigned int GLhandleARB;
<group name="ColorTableParameterPNameSGI">
<enum name="GL_COLOR_TABLE_BIAS"/>
<enum name="GL_COLOR_TABLE_BIAS_SGI"/>
- <enum name="GL_COLOR_TABLE_BIAS_SGI"/>
<enum name="GL_COLOR_TABLE_SCALE"/>
<enum name="GL_COLOR_TABLE_SCALE_SGI"/>
- <enum name="GL_COLOR_TABLE_SCALE_SGI"/>
</group>
<group name="ColorTableTargetSGI">
@@ -9071,11 +9069,6 @@ typedef unsigned int GLhandleARB;
<param><ptype>GLuint64</ptype> <name>timeout</name></param>
</command>
<command>
- <proto>void <name>glClipControlARB</name></proto>
- <param><ptype>GLenum</ptype> <name>origin</name></param>
- <param><ptype>GLenum</ptype> <name>depth</name></param>
- </command>
- <command>
<proto>void <name>glClipPlane</name></proto>
<param group="ClipPlaneName"><ptype>GLenum</ptype> <name>plane</name></param>
<param len="4">const <ptype>GLdouble</ptype> *<name>equation</name></param>
@@ -11588,7 +11581,7 @@ typedef unsigned int GLhandleARB;
<command>
<proto>void <name>glElementPointerAPPLE</name></proto>
<param group="ElementPointerTypeATI"><ptype>GLenum</ptype> <name>type</name></param>
- <param len="type">const void *<name>pointer</name></param>
+ <param len="COMPSIZE(type)">const void *<name>pointer</name></param>
</command>
<command>
<proto>void <name>glElementPointerATI</name></proto>
@@ -12872,7 +12865,7 @@ typedef unsigned int GLhandleARB;
<command>
<proto>void <name>glGetBooleanv</name></proto>
<param group="GetPName"><ptype>GLenum</ptype> <name>pname</name></param>
- <param group="Boolean" len="COMPSIZE(pname)"><ptype>GLboolean</ptype> *<name>params</name></param>
+ <param group="Boolean" len="COMPSIZE(pname)"><ptype>GLboolean</ptype> *<name>data</name></param>
<glx type="single" opcode="112"/>
</command>
<command>
@@ -13223,7 +13216,7 @@ typedef unsigned int GLhandleARB;
<command>
<proto>void <name>glGetDoublev</name></proto>
<param group="GetPName"><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="COMPSIZE(pname)"><ptype>GLdouble</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLdouble</ptype> *<name>data</name></param>
<glx type="single" opcode="114"/>
</command>
<command>
@@ -13297,7 +13290,7 @@ typedef unsigned int GLhandleARB;
<command>
<proto>void <name>glGetFloatv</name></proto>
<param group="GetPName"><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="COMPSIZE(pname)"><ptype>GLfloat</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLfloat</ptype> *<name>data</name></param>
<glx type="single" opcode="116"/>
</command>
<command>
@@ -13491,7 +13484,7 @@ typedef unsigned int GLhandleARB;
<command>
<proto>void <name>glGetInteger64v</name></proto>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="COMPSIZE(pname)"><ptype>GLint64</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint64</ptype> *<name>data</name></param>
</command>
<command>
<proto>void <name>glGetInteger64vAPPLE</name></proto>
@@ -13531,7 +13524,7 @@ typedef unsigned int GLhandleARB;
<command>
<proto>void <name>glGetIntegerv</name></proto>
<param group="GetPName"><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>data</name></param>
<glx type="single" opcode="117"/>
</command>
<command>
@@ -13583,12 +13576,6 @@ typedef unsigned int GLhandleARB;
<glx type="single" opcode="119"/>
</command>
<command>
- <proto>void <name>glGetLightx</name></proto>
- <param><ptype>GLenum</ptype> <name>light</name></param>
- <param><ptype>GLenum</ptype> <name>pname</name></param>
- <param><ptype>GLfixed</ptype> *<name>params</name></param>
- </command>
- <command>
<proto>void <name>glGetLightxOES</name></proto>
<param><ptype>GLenum</ptype> <name>light</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
@@ -13714,12 +13701,6 @@ typedef unsigned int GLhandleARB;
<glx type="single" opcode="124"/>
</command>
<command>
- <proto>void <name>glGetMaterialx</name></proto>
- <param><ptype>GLenum</ptype> <name>face</name></param>
- <param><ptype>GLenum</ptype> <name>pname</name></param>
- <param><ptype>GLfixed</ptype> <name>param</name></param>
- </command>
- <command>
<proto>void <name>glGetMaterialxOES</name></proto>
<param><ptype>GLenum</ptype> <name>face</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
@@ -14027,7 +14008,7 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetObjectParameterfvARB</name></proto>
<param group="handleARB"><ptype>GLhandleARB</ptype> <name>obj</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLfloat</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLfloat</ptype> *<name>params</name></param>
</command>
<command>
<proto>void <name>glGetObjectParameterivAPPLE</name></proto>
@@ -14040,7 +14021,7 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetObjectParameterivARB</name></proto>
<param group="handleARB"><ptype>GLhandleARB</ptype> <name>obj</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>params</name></param>
</command>
<command>
<proto>void <name>glGetObjectPtrLabel</name></proto>
@@ -14492,7 +14473,7 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetProgramiv</name></proto>
<param><ptype>GLuint</ptype> <name>program</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>params</name></param>
<glx type="single" opcode="199"/>
</command>
<command>
@@ -14525,7 +14506,7 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetQueryObjecti64vEXT</name></proto>
<param><ptype>GLuint</ptype> <name>id</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLint64</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint64</ptype> *<name>params</name></param>
<glx type="vendor" opcode="1328"/>
<alias name="glGetQueryObjecti64v"/>
</command>
@@ -14533,14 +14514,14 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetQueryObjectiv</name></proto>
<param><ptype>GLuint</ptype> <name>id</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>params</name></param>
<glx type="single" opcode="165"/>
</command>
<command>
<proto>void <name>glGetQueryObjectivARB</name></proto>
<param><ptype>GLuint</ptype> <name>id</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>params</name></param>
<alias name="glGetQueryObjectiv"/>
</command>
<command>
@@ -14560,7 +14541,7 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetQueryObjectui64vEXT</name></proto>
<param><ptype>GLuint</ptype> <name>id</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLuint64</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLuint64</ptype> *<name>params</name></param>
<glx type="vendor" opcode="1329"/>
<alias name="glGetQueryObjectui64v"/>
</command>
@@ -14568,14 +14549,14 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetQueryObjectuiv</name></proto>
<param><ptype>GLuint</ptype> <name>id</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLuint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLuint</ptype> *<name>params</name></param>
<glx type="single" opcode="166"/>
</command>
<command>
<proto>void <name>glGetQueryObjectuivARB</name></proto>
<param><ptype>GLuint</ptype> <name>id</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLuint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLuint</ptype> *<name>params</name></param>
<alias name="glGetQueryObjectuiv"/>
</command>
<command>
@@ -14588,14 +14569,14 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetQueryiv</name></proto>
<param><ptype>GLenum</ptype> <name>target</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>params</name></param>
<glx type="single" opcode="164"/>
</command>
<command>
<proto>void <name>glGetQueryivARB</name></proto>
<param><ptype>GLenum</ptype> <name>target</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>params</name></param>
<alias name="glGetQueryiv"/>
</command>
<command>
@@ -14704,7 +14685,7 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetShaderiv</name></proto>
<param><ptype>GLuint</ptype> <name>shader</name></param>
<param><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>params</name></param>
<glx type="single" opcode="198"/>
</command>
<command>
@@ -15206,13 +15187,13 @@ typedef unsigned int GLhandleARB;
<proto>void <name>glGetVertexAttribArrayObjectfvATI</name></proto>
<param><ptype>GLuint</ptype> <name>index</name></param>
<param group="ArrayObjectPNameATI"><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLfloat</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLfloat</ptype> *<name>params</name></param>
</command>
<command>
<proto>void <name>glGetVertexAttribArrayObjectivATI</name></proto>
<param><ptype>GLuint</ptype> <name>index</name></param>
<param group="ArrayObjectPNameATI"><ptype>GLenum</ptype> <name>pname</name></param>
- <param len="pname"><ptype>GLint</ptype> *<name>params</name></param>
+ <param len="COMPSIZE(pname)"><ptype>GLint</ptype> *<name>params</name></param>
</command>
<command>
<proto>void <name>glGetVertexAttribIiv</name></proto>
@@ -21489,14 +21470,14 @@ typedef unsigned int GLhandleARB;
<param><ptype>GLuint</ptype> <name>shader</name></param>
<param><ptype>GLsizei</ptype> <name>count</name></param>
<param len="count">const <ptype>GLchar</ptype> *const*<name>string</name></param>
- <param len="1">const <ptype>GLint</ptype> *<name>length</name></param>
+ <param len="count">const <ptype>GLint</ptype> *<name>length</name></param>
</command>
<command>
<proto>void <name>glShaderSourceARB</name></proto>
<param group="handleARB"><ptype>GLhandleARB</ptype> <name>shaderObj</name></param>
<param><ptype>GLsizei</ptype> <name>count</name></param>
<param len="count">const <ptype>GLcharARB</ptype> **<name>string</name></param>
- <param len="1">const <ptype>GLint</ptype> *<name>length</name></param>
+ <param len="count">const <ptype>GLint</ptype> *<name>length</name></param>
<alias name="glShaderSource"/>
</command>
<command>
@@ -28815,7 +28796,6 @@ typedef unsigned int GLhandleARB;
<enum name="GL_WAIT_FAILED"/>
<enum name="GL_TIMEOUT_IGNORED"/>
<enum name="GL_SYNC_FLUSH_COMMANDS_BIT"/>
- <enum name="GL_TIMEOUT_IGNORED"/>
<command name="glFenceSync"/>
<command name="glIsSync"/>
<command name="glDeleteSync"/>
@@ -35744,7 +35724,7 @@ typedef unsigned int GLhandleARB;
<command name="glCullParameterfvEXT"/>
</require>
</extension>
- <extension name="GL_EXT_debug_label" supported="gles2">
+ <extension name="GL_EXT_debug_label" supported="gl|gles2">
<require>
<enum name="GL_PROGRAM_PIPELINE_OBJECT_EXT"/>
<enum name="GL_PROGRAM_OBJECT_EXT"/>
@@ -35760,7 +35740,7 @@ typedef unsigned int GLhandleARB;
<enum name="GL_TRANSFORM_FEEDBACK"/>
</require>
</extension>
- <extension name="GL_EXT_debug_marker" supported="gles2">
+ <extension name="GL_EXT_debug_marker" supported="gl|gles2">
<require>
<command name="glInsertEventMarkerEXT"/>
<command name="glPushGroupMarkerEXT"/>
@@ -37833,6 +37813,9 @@ typedef unsigned int GLhandleARB;
<enum name="GL_INTERLACE_READ_INGR"/>
</require>
</extension>
+ <extension name="GL_INTEL_fragment_shader_ordering" supported="gl">
+ <require/>
+ </extension>
<extension name="GL_INTEL_map_texture" supported="gl">
<require>
<enum name="GL_TEXTURE_MEMORY_LAYOUT_INTEL"/>
@@ -41008,8 +40991,7 @@ typedef unsigned int GLhandleARB;
</require>
</extension>
<extension name="GL_SGIX_ycrcb_subsample" supported="gl">
- <require>
- </require>
+ <require/>
</extension>
<extension name="GL_SGIX_ycrcba" supported="gl">
<require>
diff --git a/xorg-server/hw/xwin/glx/reg.py b/xorg-server/hw/xwin/glx/reg.py
index 37b9a8cb1..de28323d5 100644
--- a/xorg-server/hw/xwin/glx/reg.py
+++ b/xorg-server/hw/xwin/glx/reg.py
@@ -24,6 +24,12 @@
import io,os,re,string,sys
from lxml import etree
+def write( *args, **kwargs ):
+ file = kwargs.pop('file',sys.stdout)
+ end = kwargs.pop( 'end','\n')
+ file.write( ' '.join([str(arg) for arg in args]) )
+ file.write( end )
+
# noneStr - returns string argument, or "" if argument is None.
# Used in converting lxml Elements into text.
# str - string to convert
@@ -365,16 +371,16 @@ class OutputGenerator:
"""Log a message at the given level. Can be ignored or log to a file"""
if (level == 'error'):
strfile = io.StringIO()
- print('ERROR:', *args, file=strfile)
+ write('ERROR:', *args, file=strfile)
if (self.errFile != None):
- print(strfile.getvalue(), file=self.errFile)
+ write(strfile.getvalue(), file=self.errFile)
raise UserWarning(strfile.getvalue())
elif (level == 'warn'):
if (self.warnFile != None):
- print('WARNING:', *args, file=self.warnFile)
+ write('WARNING:', *args, file=self.warnFile)
elif (level == 'diag'):
if (self.diagFile != None):
- print('DIAG:', *args, file=self.diagFile)
+ write('DIAG:', *args, file=self.diagFile)
else:
raise UserWarning(
'*** FATAL ERROR in Generator.logMsg: unknown level:' + level)
@@ -504,7 +510,7 @@ class COutputGenerator(OutputGenerator):
return [ pdecl + paramdecl, tdecl + paramdecl ]
#
def newline(self):
- print('', file=self.outFile)
+ write('', file=self.outFile)
#
def beginFile(self, genOpts):
OutputGenerator.beginFile(self, genOpts)
@@ -513,42 +519,42 @@ class COutputGenerator(OutputGenerator):
# Multiple inclusion protection & C++ wrappers.
if (genOpts.protectFile and self.genOpts.filename):
headerSym = '__' + re.sub('\.h', '_h_', os.path.basename(self.genOpts.filename))
- print('#ifndef', headerSym, file=self.outFile)
- print('#define', headerSym, '1', file=self.outFile)
+ write('#ifndef', headerSym, file=self.outFile)
+ write('#define', headerSym, '1', file=self.outFile)
self.newline()
- print('#ifdef __cplusplus', file=self.outFile)
- print('extern "C" {', file=self.outFile)
- print('#endif', file=self.outFile)
+ write('#ifdef __cplusplus', file=self.outFile)
+ write('extern "C" {', file=self.outFile)
+ write('#endif', file=self.outFile)
self.newline()
#
# User-supplied prefix text, if any (list of strings)
if (genOpts.prefixText):
for s in genOpts.prefixText:
- print(s, file=self.outFile)
+ write(s, file=self.outFile)
#
# Some boilerplate describing what was generated - this
# will probably be removed later since the extensions
# pattern may be very long.
- print('/* Generated C header for:', file=self.outFile)
- print(' * API:', genOpts.apiname, file=self.outFile)
+ write('/* Generated C header for:', file=self.outFile)
+ write(' * API:', genOpts.apiname, file=self.outFile)
if (genOpts.profile):
- print(' * Profile:', genOpts.profile, file=self.outFile)
- print(' * Versions considered:', genOpts.versions, file=self.outFile)
- print(' * Versions emitted:', genOpts.emitversions, file=self.outFile)
- print(' * Default extensions included:', genOpts.defaultExtensions, file=self.outFile)
- print(' * Additional extensions included:', genOpts.addExtensions, file=self.outFile)
- print(' * Extensions removed:', genOpts.removeExtensions, file=self.outFile)
- print(' */', file=self.outFile)
+ write(' * Profile:', genOpts.profile, file=self.outFile)
+ write(' * Versions considered:', genOpts.versions, file=self.outFile)
+ write(' * Versions emitted:', genOpts.emitversions, file=self.outFile)
+ write(' * Default extensions included:', genOpts.defaultExtensions, file=self.outFile)
+ write(' * Additional extensions included:', genOpts.addExtensions, file=self.outFile)
+ write(' * Extensions removed:', genOpts.removeExtensions, file=self.outFile)
+ write(' */', file=self.outFile)
def endFile(self):
# C-specific
# Finish C++ wrapper and multiple inclusion protection
self.newline()
- print('#ifdef __cplusplus', file=self.outFile)
- print('}', file=self.outFile)
- print('#endif', file=self.outFile)
+ write('#ifdef __cplusplus', file=self.outFile)
+ write('}', file=self.outFile)
+ write('#endif', file=self.outFile)
if (self.genOpts.protectFile and self.genOpts.filename):
self.newline()
- print('#endif', file=self.outFile)
+ write('#endif', file=self.outFile)
# Finish processing in superclass
OutputGenerator.endFile(self)
def beginFeature(self, interface, emit):
@@ -568,29 +574,29 @@ class COutputGenerator(OutputGenerator):
if (self.emit):
self.newline()
if (self.genOpts.protectFeature):
- print('#ifndef', self.featureName, file=self.outFile)
- print('#define', self.featureName, '1', file=self.outFile)
+ write('#ifndef', self.featureName, file=self.outFile)
+ write('#define', self.featureName, '1', file=self.outFile)
if (self.typeBody != ''):
- print(self.typeBody, end='', file=self.outFile)
+ write(self.typeBody, end='', file=self.outFile)
#
# Don't add additional protection for derived type declarations,
# which may be needed by other features later on.
if (self.featureExtraProtect != None):
- print('#ifdef', self.featureExtraProtect, file=self.outFile)
+ write('#ifdef', self.featureExtraProtect, file=self.outFile)
if (self.enumBody != ''):
- print(self.enumBody, end='', file=self.outFile)
+ write(self.enumBody, end='', file=self.outFile)
if (self.genOpts.genFuncPointers and self.cmdPointerBody != ''):
- print(self.cmdPointerBody, end='', file=self.outFile)
+ write(self.cmdPointerBody, end='', file=self.outFile)
if (self.cmdBody != ''):
if (self.genOpts.protectProto):
- print('#ifdef', self.genOpts.protectProtoStr, file=self.outFile)
- print(self.cmdBody, end='', file=self.outFile)
+ write('#ifdef', self.genOpts.protectProtoStr, file=self.outFile)
+ write(self.cmdBody, end='', file=self.outFile)
if (self.genOpts.protectProto):
- print('#endif', file=self.outFile)
+ write('#endif', file=self.outFile)
if (self.featureExtraProtect != None):
- print('#endif /*', self.featureExtraProtect, '*/', file=self.outFile)
+ write('#endif /*', self.featureExtraProtect, '*/', file=self.outFile)
if (self.genOpts.protectFeature):
- print('#endif /*', self.featureName, '*/', file=self.outFile)
+ write('#endif /*', self.featureName, '*/', file=self.outFile)
# Finish processing in superclass
OutputGenerator.endFeature(self)
#
@@ -793,37 +799,37 @@ class Registry:
self.addElementInfo(feature, ei, 'extension', self.extdict)
def dumpReg(self, maxlen = 40, filehandle = sys.stdout):
"""Dump all the dictionaries constructed from the Registry object"""
- print('***************************************', file=filehandle)
- print(' ** Dumping Registry contents **', file=filehandle)
- print('***************************************', file=filehandle)
- print('// Types', file=filehandle)
+ write('***************************************', file=filehandle)
+ write(' ** Dumping Registry contents **', file=filehandle)
+ write('***************************************', file=filehandle)
+ write('// Types', file=filehandle)
for name in self.typedict:
tobj = self.typedict[name]
- print(' Type', name, '->', etree.tostring(tobj.elem)[0:maxlen], file=filehandle)
- print('// Groups', file=filehandle)
+ write(' Type', name, '->', etree.tostring(tobj.elem)[0:maxlen], file=filehandle)
+ write('// Groups', file=filehandle)
for name in self.groupdict:
gobj = self.groupdict[name]
- print(' Group', name, '->', etree.tostring(gobj.elem)[0:maxlen], file=filehandle)
- print('// Enums', file=filehandle)
+ write(' Group', name, '->', etree.tostring(gobj.elem)[0:maxlen], file=filehandle)
+ write('// Enums', file=filehandle)
for name in self.enumdict:
eobj = self.enumdict[name]
- print(' Enum', name, '->', etree.tostring(eobj.elem)[0:maxlen], file=filehandle)
- print('// Commands', file=filehandle)
+ write(' Enum', name, '->', etree.tostring(eobj.elem)[0:maxlen], file=filehandle)
+ write('// Commands', file=filehandle)
for name in self.cmddict:
cobj = self.cmddict[name]
- print(' Command', name, '->', etree.tostring(cobj.elem)[0:maxlen], file=filehandle)
- print('// APIs', file=filehandle)
+ write(' Command', name, '->', etree.tostring(cobj.elem)[0:maxlen], file=filehandle)
+ write('// APIs', file=filehandle)
for key in self.apidict:
- print(' API Version ', key, '->',
+ write(' API Version ', key, '->',
etree.tostring(self.apidict[key].elem)[0:maxlen], file=filehandle)
- print('// Extensions', file=filehandle)
+ write('// Extensions', file=filehandle)
for key in self.extdict:
- print(' Extension', key, '->',
+ write(' Extension', key, '->',
etree.tostring(self.extdict[key].elem)[0:maxlen], file=filehandle)
- # print('***************************************', file=filehandle)
- # print(' ** Dumping XML ElementTree **', file=filehandle)
- # print('***************************************', file=filehandle)
- # print(etree.tostring(self.tree.getroot(),pretty_print=True), file=filehandle)
+ # write('***************************************', file=filehandle)
+ # write(' ** Dumping XML ElementTree **', file=filehandle)
+ # write('***************************************', file=filehandle)
+ # write(etree.tostring(self.tree.getroot(),pretty_print=True), file=filehandle)
#
# typename - name of type
# required - boolean (to tag features as required or not)