def determine_enum_type_and_value(enum):
type = 'IntEnum'
value = int_enum_value_factory
for item in enum.values.enumerators:
if item.value:
if isinstance(item.value, c_ast.Constant) and item.value.type == 'char':
type = 'str, Enum'
value = char_enum_value_factory
break
elif isinstance(item.value, c_ast.BinaryOp) and item.value.op == '<<':
type = 'IntFlag'
break
return type, value