aboutsummaryrefslogtreecommitdiffstats
path: root/asm/ffi.py
diff options
context:
space:
mode:
authorGravatar Peter McGoron 2023-02-08 13:56:39 +0000
committerGravatar Peter McGoron 2023-02-08 13:56:39 +0000
commite044a7b457da7468d2fb49ef658549ea1b4861af (patch)
treea7cdbb3a8b76e6fba3e935456672240d8d366f52 /asm/ffi.py
parentpython ffi: test parsing (diff)
test refactoring
Diffstat (limited to '')
-rw-r--r--asm/ffi.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/asm/ffi.py b/asm/ffi.py
index 87f6275..7468996 100644
--- a/asm/ffi.py
+++ b/asm/ffi.py
@@ -1,6 +1,18 @@
from ctypes import *
+from enum import Enum
dll = CDLL("./libcreole.so")
+class CompileRet(Enum):
+ COMPILE_OK = 0
+ OPCODE_READ_ERROR = 1
+ OPCODE_MALFORMED = 2
+ ARG_READ_ERROR = 3
+ ARG_MALFORMED = 4
+ LAST_READ_ERROR = 5
+ LAST_MALFORMED = 6
+ LABEL_OVERFLOW = 7
+ TYPE_ERROR = 8
+
class CIns(Structure):
_fields_ = [("opcode", c_int),
("w_flags", c_ubyte * 3),