parameters: (self, defined_structs = [], prefix = None)
return_statement: return { 'retval' : retval, 'name' : name, 'args' : args }
docstring: Return the parts of the C API function definition.
docstring_summary: Return the parts of the C API function definition.
docstring_tokens: Return the parts of the C API function definition .
function: def get_capi_parts(self, defined_structs = [], prefix = None):
          """ Return the parts of the C API function definition. """
          retval = ''
          dict = self.retval.get_type().get_capi(defined_structs)
          if dict['format'] == 'single':
              retval = dict['value']
  
          name = self.get_capi_name(prefix)
          args = []
  
          if isinstance(self, obj_function_virtual):
              # virtual functions get themselves as the first argument
              str = 'struct _'+self.parent.get_capi_name()+'* self'
              if isinstance(self, obj_function_virtual) and self.is_const():
                  # const virtual functions get const self pointers
                  str = 'const '+str
              args.append(str)
  
          if len(self.arguments) > 0:
              for cls in self.arguments:
                  type = cls.get_type()
                  dict = type.get_capi(defined_structs)
                  if dict['format'] == 'single':
                      args.append(dict['value'])
                  elif dict['format'] == 'multi-arg':
                      # add an additional argument for the size of the array
                      type_name = type.get_name()
                      if type.is_const():
                          # for const arrays pass the size argument by value
                          args.append('size_t '+type_name+'Count')
                      else:
                          # for non-const arrays pass the size argument by address
                          args.append('size_t* '+type_name+'Count')
                      args.append(dict['value'])
  
          return { 'retval' : retval, 'name' : name, 'args' : args }
function_tokens: def get_capi_parts ( self , defined_structs = [ ] , prefix = None ) : retval = '' dict = self . retval . get_type ( ) . get_capi ( defined_structs ) if dict [ 'format' ] == 'single' : retval = dict [ 'value' ] name = self . get_capi_name ( prefix ) args = [ ] if isinstance ( self , obj_function_virtual ) : # virtual functions get themselves as the first argument str = 'struct _' + self . parent . get_capi_name ( ) + '* self' if isinstance ( self , obj_function_virtual ) and self . is_const ( ) : # const virtual functions get const self pointers str = 'const ' + str args . append ( str ) if len ( self . arguments ) > 0 : for cls in self . arguments : type = cls . get_type ( ) dict = type . get_capi ( defined_structs ) if dict [ 'format' ] == 'single' : args . append ( dict [ 'value' ] ) elif dict [ 'format' ] == 'multi-arg' : # add an additional argument for the size of the array type_name = type . get_name ( ) if type . is_const ( ) : # for const arrays pass the size argument by value args . append ( 'size_t ' + type_name + 'Count' ) else : # for non-const arrays pass the size argument by address args . append ( 'size_t* ' + type_name + 'Count' ) args . append ( dict [ 'value' ] ) return { 'retval' : retval , 'name' : name , 'args' : args }