def decode_prefix(byte):
    """Decode a byte according to the Field Prefix encoding
    scheme.

    Arguments:
        byte: the encoded representation of the prefix

    Return:
        fixedwidth: Is the field fixed width (bool)
        variablewidth: if not fixed width, the number of bytes
            needed to encode the value width (1, 2 or 4)
        has_ordinal: The field has an ordinal encoded  (bool)
        has_name: This field has a name encoded (bool)

    """
    fixedwidth = (byte & 0x80) != 0
    has_name = (byte & 0x08) != 0
    has_ordinal = (byte & 0x10) != 0
    variablewidth = (byte & 0x60) >>5
    if variablewidth == 3:
        variablewidth = 4
    return fixedwidth, variablewidth, has_ordinal, has_name