@@ -0,0 +1,939 @@
+from ctypes import c_int%0A%0A%0Aclass EnumerationType(type(c_int)):%0A    def __new__(metacls, name, bases, dictionary):%0A        if not %22_members_%22 in dictionary:%0A            _members_ = %7B%7D%0A            for key, value in dictionary.items():%0A                if not key.startswith(%22_%22):%0A                    _members_%5Bkey%5D = value%0A%0A            dictionary%5B%22_members_%22%5D = _members_%0A        else:%0A            _members_ = dict%5B%22_members_%22%5D%0A%0A        dictionary%5B%22_reverse_map_%22%5D = %7Bvalue: key for key, value in _members_.items()%7D%0A        cls = type(c_int).__new__(metacls, name, bases, dict)%0A%0A        for key, value in cls._members_.items():%0A            globals()%5Bkey%5D = value%0A        return cls%0A%0A%0Aclass CEnumeration(c_int):%0A    __metaclass__ = EnumerationType%0A    _members_ = %7B%7D%0A%0A    def __eq__(self, other):%0A        if isinstance(other, int):%0A            return self.value == other%0A%0A        return type(self) == type(other) and self.value == other.value%0A

Add metaclass and class for CEnumeration adoption.