(self, routine)
return "%s %s(%s)" % (ctype, routine.name, arguments)
Returns a string for the function prototype for the given routine.

           If the routine has multiple result objects, an CodeGenError is
           raised.

           See: http://en.wikipedia.org/wiki/Function_prototype
Returns a string for the function prototype for the given routine.
Returns a string for the function prototype for the given routine .
def get_prototype(self, routine):
        """Returns a string for the function prototype for the given routine.

           If the routine has multiple result objects, an CodeGenError is
           raised.

           See: http://en.wikipedia.org/wiki/Function_prototype
        """
        if len(routine.results) > 1:
            raise CodeGenError("C only supports a single or no return value.")
        elif len(routine.results) == 1:
            ctype = routine.results[0].get_datatype('C')
        else:
            ctype = "void"

        type_args = []
        for arg in routine.arguments:
            name = ccode(arg.name)
            if arg.dimensions:
                type_args.append((arg.get_datatype('C'), "*%s" % name))
            elif isinstance(arg, ResultBase):
                type_args.append((arg.get_datatype('C'), "&%s" % name))
            else:
                type_args.append((arg.get_datatype('C'), name))
        arguments = ", ".join([ "%s %s" % t for t in type_args])
        return "%s %s(%s)" % (ctype, routine.name, arguments)
def get_prototype ( self , routine ) : if len ( routine . results ) > 1 : raise CodeGenError ( "C only supports a single or no return value." ) elif len ( routine . results ) == 1 : ctype = routine . results [ 0 ] . get_datatype ( 'C' ) else : ctype = "void" type_args = [ ] for arg in routine . arguments : name = ccode ( arg . name ) if arg . dimensions : type_args . append ( ( arg . get_datatype ( 'C' ) , "*%s" % name ) ) elif isinstance ( arg , ResultBase ) : type_args . append ( ( arg . get_datatype ( 'C' ) , "&%s" % name ) ) else : type_args . append ( ( arg . get_datatype ( 'C' ) , name ) ) arguments = ", " . join ( [ "%s %s" % t for t in type_args ] ) return "%s %s(%s)" % ( ctype , routine . name , arguments )