From 4a850818bc1c674d6b4e9c4bcc44ee6bbaa13ffc Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 20 May 2019 18:16:34 +0200 Subject: errorout-memory: handle message groups; adjust python --- src/vhdl/python/libghdl/thin/errorout.py | 10 ---------- src/vhdl/python/libghdl/thin/errorout_memory.py | 20 +++++++++++++++++--- 2 files changed, 17 insertions(+), 13 deletions(-) (limited to 'src/vhdl/python/libghdl') 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] -- cgit v1.2.3