def funcline_parts(base, topline):
    """
    Parse the m-file function declaration.

    Returns [base, arguments, outputs] where base is the
    function name without the gsw_ prefix, arguments is a
    tuple of strings, and outputs is a tuple of strings.
    """

    cmd = topline.split(None, 1)[1]

    parts = cmd.split('=')
    if len(parts) == 1:
        out = ''
        func_call = parts[0].strip()
    else:
        out = parts[0].strip()
        if out.startswith('['):
            out = out[1:-1]
        func_call = parts[1].strip()
    out = [a.strip() for a in out.split(',')]

    parts = func_call.split('(')
    if len(parts) == 1:
        argstring = ''
    else:
        argstring = parts[1][:-1]

    args = [a.strip() for a in argstring.split(',')]

    parts = [base[4:], tuple(args), tuple(out)]
    return parts