parameters: (name, hlist)
docstring: Output a parsed header in OpenGLAPI XML.
docstring_summary: Output a parsed header in OpenGLAPI XML.
docstring_tokens: Output a parsed header in OpenGLAPI XML .
function: def output_xml(name, hlist):
      """Output a parsed header in OpenGLAPI XML."""
  
      for i in xrange(len(hlist)):
          cat_name, cat = hlist[i]
  
          print '<category name="%s">' % (cat_name)
          indent = 4
  
          for enum in cat["enums"]:
              name = enum[0][3:]
              value = enum[1]
              tab = spaces(41, name)
              attrs = 'name="%s"%svalue="%s"' % (name, tab, value)
              print '%s<enum %s/>' % (spaces(indent), attrs)
  
          if cat["enums"] and cat["types"]:
              print
  
          for type in cat["types"]:
              ctype = type[0]
              size, is_float, is_signed = type[2]
  
              attrs = 'name="%s"' % (type[1][2:])
              attrs += spaces(16, attrs) + 'size="%d"' % (size)
              if is_float:
                  attrs += ' float="true"'
              elif not is_signed:
                  attrs += ' unsigned="true"'
  
              print '%s<type %s/>' % (spaces(indent), attrs)
  
          for func in cat["functions"]:
              print
              ret = func[0]
              name = func[1][2:]
              params = func[2]
  
              attrs = 'name="%s" offset="assign"' % name
              print '%s<function %s>' % (spaces(indent), attrs)
  
              for param in params:
                  attrs = 'name="%s" type="%s"' % (param[1], param[0])
                  print '%s<param %s/>' % (spaces(indent * 2), attrs)
              if ret:
                  attrs = 'type="%s"' % ret
                  print '%s<return %s/>' % (spaces(indent * 2), attrs)
  
              print '%s</function>' % spaces(indent)
  
          print '</category>'
          print
function_tokens: def output_xml ( name , hlist ) : for i in xrange ( len ( hlist ) ) : cat_name , cat = hlist [ i ] print '<category name="%s">' % ( cat_name ) indent = 4 for enum in cat [ "enums" ] : name = enum [ 0 ] [ 3 : ] value = enum [ 1 ] tab = spaces ( 41 , name ) attrs = 'name="%s"%svalue="%s"' % ( name , tab , value ) print '%s<enum %s/>' % ( spaces ( indent ) , attrs ) if cat [ "enums" ] and cat [ "types" ] : print for type in cat [ "types" ] : ctype = type [ 0 ] size , is_float , is_signed = type [ 2 ] attrs = 'name="%s"' % ( type [ 1 ] [ 2 : ] ) attrs += spaces ( 16 , attrs ) + 'size="%d"' % ( size ) if is_float : attrs += ' float="true"' elif not is_signed : attrs += ' unsigned="true"' print '%s<type %s/>' % ( spaces ( indent ) , attrs ) for func in cat [ "functions" ] : print ret = func [ 0 ] name = func [ 1 ] [ 2 : ] params = func [ 2 ] attrs = 'name="%s" offset="assign"' % name print '%s<function %s>' % ( spaces ( indent ) , attrs ) for param in params : attrs = 'name="%s" type="%s"' % ( param [ 1 ] , param [ 0 ] ) print '%s<param %s/>' % ( spaces ( indent * 2 ) , attrs ) if ret : attrs = 'type="%s"' % ret print '%s<return %s/>' % ( spaces ( indent * 2 ) , attrs ) print '%s</function>' % spaces ( indent ) print '</category>' print