def _ctypes_code_parameter(lines, parameter, position):
    """Returns the code for the specified parameter being written into a subroutine wrapper.

    :arg position: one of ['indices', 'variable', 'out', 'regular', 'saved', 'assign', 'clean']
    """
    mdict = {
        'indices': _ctypes_indices,
        'variable': _ctypes_variables,
        'out': _ctypes_out,
        'regular': _ctypes_regular,
        'saved': _ctypes_saved,
        'assign': _ctypes_assign,
        'clean': _ctypes_clean
    }
    line = mdict[position](parameter)
    if line is not None:
        value, blank = line
        lines.append(value)
        if blank:
            lines.append("")