diff options
Diffstat (limited to 'src/vhdl/python')
-rw-r--r-- | src/vhdl/python/libghdl/thin/errorout.py | 10 | ||||
-rw-r--r-- | src/vhdl/python/libghdl/thin/errorout_memory.py | 20 | ||||
-rwxr-xr-x | src/vhdl/python/pnodespy.py | 11 |
3 files changed, 17 insertions, 24 deletions
diff --git a/src/vhdl/python/libghdl/thin/errorout.py b/src/vhdl/python/libghdl/thin/errorout.py index f059d99cc..5a79a5534 100644 --- a/src/vhdl/python/libghdl/thin/errorout.py +++ b/src/vhdl/python/libghdl/thin/errorout.py @@ -1,13 +1,3 @@ -from ctypes import c_int8, c_int32, Structure - -class Error_Record(Structure): - _fields_ = [("origin", c_int8), - ("id", c_int8), - ("file", c_int32), - ("line", c_int32), - ("offset", c_int32), - ("length", c_int32)] - class Msgid: diff --git a/src/vhdl/python/libghdl/thin/errorout_memory.py b/src/vhdl/python/libghdl/thin/errorout_memory.py index d0a1e255c..8027795df 100644 --- a/src/vhdl/python/libghdl/thin/errorout_memory.py +++ b/src/vhdl/python/libghdl/thin/errorout_memory.py @@ -1,6 +1,20 @@ from libghdl import libghdl -from ctypes import c_int32, c_char_p -import libghdl.thin.errorout as errorout +from ctypes import c_int8, c_int32, c_char_p, Structure + +class Error_Message(Structure): + _fields_ = [("id", c_int8), + ("group", c_int8), + ("file", c_int32), + ("line", c_int32), + ("offset", c_int32), + ("length", c_int32)] + + +# Values for group: +Msg_Single = 0 +Msg_Main = 1 +Msg_Related = 2 +Msg_Last = 3 Install_Handler = libghdl.errorout__memory__install_handler @@ -8,7 +22,7 @@ Get_Nbr_Messages = libghdl.errorout__memory__get_nbr_messages Get_Error_Record = libghdl.errorout__memory__get_error_record Get_Error_Record.argstypes = [c_int32] -Get_Error_Record.restype = errorout.Error_Record +Get_Error_Record.restype = Error_Message Get_Error_Message = libghdl.errorout__memory__get_error_message_addr Get_Error_Message.argstype = [c_int32] diff --git a/src/vhdl/python/pnodespy.py b/src/vhdl/python/pnodespy.py index b4d81a26a..4088efa3a 100755 --- a/src/vhdl/python/pnodespy.py +++ b/src/vhdl/python/pnodespy.py @@ -231,17 +231,6 @@ def do_libghdl_tokens(): def do_libghdl_errorout(): - print("""from ctypes import c_int8, c_int32, Structure - -class Error_Record(Structure): - _fields_ = [("origin", c_int8), - ("id", c_int8), - ("file", c_int32), - ("line", c_int32), - ("offset", c_int32), - ("length", c_int32)] -""") - read_enum("../errorout.ads", "Msgid_Type", "(Msgid|Warnid)_", "Msgid", g=lambda m: m.group(1) + '_' + m.group(2)) |