'Returns a string for the function prototype of the routine.
If the routine has multiple result objects, an CodeGenError is
raised.
See: http://en.wikipedia.org/wiki/Function_prototype'

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 = self.printer.doprint(arg.name)
        if (arg.dimensions or 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))
