original_docstring: Return C prototype and function pointer typedef for a
          `<command>` Element, as a two-element list of strings.
  
          - cmd - Element containing a `<command>` tag
docstring: Return C prototype and function pointer typedef for a
  `` Element, as a two-element list of strings.
  
  Element containing a `` tag
docstring_tokens: Return C prototype and function pointer typedef for a ` ` Element as a two - element list of strings . Element containing a ` ` tag
code: def makeCDecls(self, cmd):
          """Return C prototype and function pointer typedef for a
          `<command>` Element, as a two-element list of strings.
  
          - cmd - Element containing a `<command>` tag"""
          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 (APIENTRY *<name>) around the name and
          #   use the PFN_cmdnameproc naming convention.
          # Done by walking the tree for <proto> element by element.
          # 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.makeProtoName(text, tail)
                  tdecl += self.makeTypedefName(text, tail)
              else:
                  pdecl += text + tail
                  tdecl += text + tail
  
          if self.genOpts.alignFuncParam == 0:
              # Squeeze out multiple spaces - there is no indentation
              pdecl = ' '.join(pdecl.split())
              tdecl = ' '.join(tdecl.split())
  
          # 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.
          # Uses: self.indentFuncProto
          # self.indentFuncPointer
          # self.alignFuncParam
          n = len(params)
          # Indented parameters
          if n > 0:
              indentdecl = '(\n'
              indentdecl += ',\n'.join(self.makeCParamDecl(p, self.genOpts.alignFuncParam)
                                       for p in params)
              indentdecl += ');'
          else:
              indentdecl = '(void);'
          # Non-indented parameters
          paramdecl = '('
          if n > 0:
              paramnames = []
              if self.misracppstyle():
                  for p in params:
                      param = ''
                      firstIter = True;
                      for t in p.itertext():
                          if (firstIter):
                              prefix = t
                              firstIter = False
                          else:
                              # Change pointer type order from e.g. "const void *" to "void const *".
                              # If the string starts with 'const', reorder it to be after the first type.
                              if (prefix.find('const ') != -1):
                                  param += prefix.replace('const ', '') + t + ' const '
                              else:
                                  param += prefix + t
                              # Clear prefix for subsequent iterations
                              prefix = ''
                      paramnames.append(param);
              else:
                  paramnames = (''.join(t for t in p.itertext())
                                for p in params)
              paramdecl += ', '.join(paramnames)
          else:
              paramdecl += 'void'
          paramdecl += ");"
          return [pdecl + indentdecl, tdecl + paramdecl]
code_tokens: def makeCDecls ( self , cmd ) : proto = cmd . find ( 'proto' ) params = cmd . findall ( 'param' ) pdecl = self . genOpts . apicall tdecl = 'typedef ' pdecl += noneStr ( proto . text ) tdecl += noneStr ( proto . text ) for elem in proto : text = noneStr ( elem . text ) tail = noneStr ( elem . tail ) if elem . tag == 'name' : pdecl += self . makeProtoName ( text , tail ) tdecl += self . makeTypedefName ( text , tail ) else : pdecl += text + tail tdecl += text + tail if self . genOpts . alignFuncParam == 0 : pdecl = ' ' . join ( pdecl . split ( ) ) tdecl = ' ' . join ( tdecl . split ( ) ) n = len ( params ) if n > 0 : indentdecl = '(\n' indentdecl += ',\n' . join ( self . makeCParamDecl ( p , self . genOpts . alignFuncParam ) for p in params ) indentdecl += ');' else : indentdecl = '(void);' paramdecl = '(' if n > 0 : paramnames = [ ] if self . misracppstyle ( ) : for p in params : param = '' firstIter = True ; for t in p . itertext ( ) : if ( firstIter ) : prefix = t firstIter = False else : if ( prefix . find ( 'const ' ) != - 1 ) : param += prefix . replace ( 'const ' , '' ) + t + ' const ' else : param += prefix + t prefix = '' paramnames . append ( param ) ; else : paramnames = ( '' . join ( t for t in p . itertext ( ) ) for p in params ) paramdecl += ', ' . join ( paramnames ) else : paramdecl += 'void' paramdecl += ");" return [ pdecl + indentdecl , tdecl + paramdecl ]
short_docstring: Return C prototype and function pointer typedef for a
  `<command>` Element, as a two-element list of strings.
short_docstring_tokens: Return C prototype and function pointer typedef for a ` <command > ` Element as a two - element list of strings .
comment: """Return C prototype and function pointer typedef for a
          `<command>` Element, as a two-element list of strings.
  
          - cmd - Element containing a `<command>` tag"""$SEP$# Begin accumulating prototype and typedef strings$SEP$# Insert the function return type/name.$SEP$# For prototypes, add APIENTRY macro before the name$SEP$# For typedefs, add (APIENTRY *<name>) around the name and$SEP$#   use the PFN_cmdnameproc naming convention.$SEP$# Done by walking the tree for <proto> element by element.$SEP$# etree has elem.text followed by (elem[i], elem[i].tail)$SEP$#   for each child element and any following text$SEP$# Leading text$SEP$# For each child element, if it's a <name> wrap in appropriate$SEP$# declaration. Otherwise append its contents and tail contents.$SEP$# Squeeze out multiple spaces - there is no indentation$SEP$# Now add the parameter declaration list, which is identical$SEP$# for prototypes and typedefs. Concatenate all the text from$SEP$# a <param> node without the tags. No tree walking required$SEP$# since all tags are ignored.$SEP$# Uses: self.indentFuncProto$SEP$# self.indentFuncPointer$SEP$# self.alignFuncParam$SEP$# Indented parameters$SEP$# Non-indented parameters$SEP$# Change pointer type order from e.g. "const void *" to "void const *".$SEP$# If the string starts with 'const', reorder it to be after the first type.$SEP$# Clear prefix for subsequent iterations