'Get the implemented Function type for *restype* and *argtypes*.'

def get_function_type(self, restype, argtypes):

    arginfo = self._get_arg_packer(argtypes)
    argtypes = list(arginfo.argument_types)
    resptr = self.get_return_type(restype)
    fnty = ir.FunctionType(errcode_t, ([resptr] + argtypes))
    return fnty
