>>> import cffi >>> ffi = cffi.FFI() >>> ffi.cdef("enum color {RED, GREEN, BLUE};") >>> lib = ffi.dlopen(None) >>> lib.RED 0 >>> lib.GREEN 1 >>>