summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-02-08 02:11:14 +0000
committerIan Romanick <[email protected]>2005-02-08 02:11:14 +0000
commit6cfd4f7e5583aefebfcc66e0b3ee04f95ae3257c (patch)
tree3654975a540a52f9d806107303485367ec629de6 /src/mesa
parent463642c0be7a6b8c0552bb32b5bc8e86ee352d67 (diff)
Add the ability to include other XML files by using a
<include name="file"/> element as a sub-element of <OpenGLAPI>.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/glapi/gl_XML.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/glapi/gl_XML.py b/src/mesa/glapi/gl_XML.py
index a24a8450a1f..b2e3cd43252 100644
--- a/src/mesa/glapi/gl_XML.py
+++ b/src/mesa/glapi/gl_XML.py
@@ -611,6 +611,8 @@ class FilterGLAPISpecBase(saxutils.XMLFilterBase):
self.current_object.startElement(name, attrs)
elif name == "category":
self.current_category = attrs.get('name', "")
+ elif name == "include":
+ self.next_include = attrs.get('name', "")
else:
self.current_object = self.factory.create(self, name, attrs)
return
@@ -620,6 +622,14 @@ class FilterGLAPISpecBase(saxutils.XMLFilterBase):
if self.current_object != None:
if self.current_object.endElement(name):
self.current_object = None
+ elif name == "include":
+ parser = make_parser()
+ parser.setFeature(feature_namespaces, 0)
+ parser.setContentHandler(self)
+
+ f = open(self.next_include)
+ parser.parse(f)
+
return