parameters: (self, cmd)
return_statement: return [ pdecl + paramdecl, tdecl + paramdecl ]
docstring: Generate C function pointer typedef for <command> Element
docstring_summary: Generate C function pointer typedef for <command> Element
docstring_tokens: Generate C function pointer typedef for <command > Element
function: def makeCDecls(self, cmd):
          """Generate C function pointer typedef for <command> Element"""
          proto = cmd.find('proto')
          params = cmd.findall('param')
          # Begin accumulating prototype and typedef strings
          pdecl = self.genOpts.apicall
          tdecl = 'typedef '
          #
          # Insert the function return type/name.
          # For prototypes, add APIENTRY macro before the name
          # For typedefs, add (APIENTRYP <name>) around the name and
          #   use the PFNGLCMDNAMEPROC nameng convention.
          # Done by walking the tree for <proto> element by element.
          # lxml.etree has elem.text followed by (elem[i], elem[i].tail)
          #   for each child element and any following text
          # Leading text
          pdecl += noneStr(proto.text)
          tdecl += noneStr(proto.text)
          # For each child element, if it's a <name> wrap in appropriate
          # declaration. Otherwise append its contents and tail contents.
          for elem in proto:
              text = noneStr(elem.text)
              tail = noneStr(elem.tail)
              if (elem.tag == 'name'):
                  pdecl += self.genOpts.apientry + text + tail
                  tdecl += '(' + self.genOpts.apientryp + 'PFN' + text.upper() + 'PROC' + tail + ')'
              else:
                  pdecl += text + tail
                  tdecl += text + tail
          # Now add the parameter declaration list, which is identical
          # for prototypes and typedefs. Concatenate all the text from
          # a <param> node without the tags. No tree walking required
          # since all tags are ignored.
          n = len(params)
          paramdecl = ' ('
          if n > 0:
              for i in range(0,n):
                  paramdecl += ''.join([t for t in params[i].itertext()])
                  if (i < n - 1):
                      paramdecl += ', '
          else:
              paramdecl += 'void'
          paramdecl += ");\n";
          return [ pdecl + paramdecl, tdecl + paramdecl ]
function_tokens: def makeCDecls ( self , cmd ) : proto = cmd . find ( 'proto' ) params = cmd . findall ( 'param' ) # Begin accumulating prototype and typedef strings pdecl = self . genOpts . apicall tdecl = 'typedef ' # # Insert the function return type/name. # For prototypes, add APIENTRY macro before the name # For typedefs, add (APIENTRYP <name>) around the name and #   use the PFNGLCMDNAMEPROC nameng convention. # Done by walking the tree for <proto> element by element. # lxml.etree has elem.text followed by (elem[i], elem[i].tail) #   for each child element and any following text # Leading text pdecl += noneStr ( proto . text ) tdecl += noneStr ( proto . text ) # For each child element, if it's a <name> wrap in appropriate # declaration. Otherwise append its contents and tail contents. for elem in proto : text = noneStr ( elem . text ) tail = noneStr ( elem . tail ) if ( elem . tag == 'name' ) : pdecl += self . genOpts . apientry + text + tail tdecl += '(' + self . genOpts . apientryp + 'PFN' + text . upper ( ) + 'PROC' + tail + ')' else : pdecl += text + tail tdecl += text + tail # Now add the parameter declaration list, which is identical # for prototypes and typedefs. Concatenate all the text from # a <param> node without the tags. No tree walking required # since all tags are ignored. n = len ( params ) paramdecl = ' (' if n > 0 : for i in range ( 0 , n ) : paramdecl += '' . join ( [ t for t in params [ i ] . itertext ( ) ] ) if ( i < n - 1 ) : paramdecl += ', ' else : paramdecl += 'void' paramdecl += ");\n" return [ pdecl + paramdecl , tdecl + paramdecl ]