aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/libghdl/errorout_memory.py
diff options
context:
space:
mode:
authorPatrick Lehmann <Patrick.Lehmann@plc2.de>2021-01-09 01:10:22 +0100
committertgingold <tgingold@users.noreply.github.com>2021-01-10 10:14:16 +0100
commit936a25178d085c7dbc651ea8889718eb302c012b (patch)
tree20788774623fb7e6c626119bc063f926b776e6a4 /pyGHDL/libghdl/errorout_memory.py
parentb2a98ec0674c031688ebf479664db6fd4975b428 (diff)
downloadghdl-936a25178d085c7dbc651ea8889718eb302c012b.tar.gz
ghdl-936a25178d085c7dbc651ea8889718eb302c012b.tar.bz2
ghdl-936a25178d085c7dbc651ea8889718eb302c012b.zip
Fixes for Python files.
Diffstat (limited to 'pyGHDL/libghdl/errorout_memory.py')
-rw-r--r--pyGHDL/libghdl/errorout_memory.py100
1 files changed, 50 insertions, 50 deletions
diff --git a/pyGHDL/libghdl/errorout_memory.py b/pyGHDL/libghdl/errorout_memory.py
index 97873a1d3..2e53d0b4b 100644
--- a/pyGHDL/libghdl/errorout_memory.py
+++ b/pyGHDL/libghdl/errorout_memory.py
@@ -43,34 +43,34 @@ from pyGHDL.libghdl._types import ErrorIndex
@export
class Error_Message(Structure):
- """
- Id : Msgid_Type
- Message error/warning id
+ """
+ Id : Msgid_Type
+ Message error/warning id
- Group : Group_Type;
- Whether this is an single message or a related one.
+ Group : Group_Type;
+ Whether this is an single message or a related one.
- File : Source_File_Entry;
- Error soure file.
+ File : Source_File_Entry;
+ Error soure file.
- Line : Natural;
- The first line is line 1, 0 can be used when line number is not relevant.
+ Line : Natural;
+ The first line is line 1, 0 can be used when line number is not relevant.
- Offset : Natural;
- Offset in the line. The first character is at offset 0.
+ Offset : Natural;
+ Offset in the line. The first character is at offset 0.
- Length : Natural;
- Length of the location (for a range). It is assumed to be on the same line;
- use 0 when unknown.
- """
- _fields_ = [
- ("id", c_int8),
- ("group", c_int8),
- ("file", c_int32),
- ("line", c_int32),
- ("offset", c_int32),
- ("length", c_int32),
- ]
+ Length : Natural;
+ Length of the location (for a range). It is assumed to be on the same line;
+ use 0 when unknown.
+ """
+ _fields_ = [
+ ("id", c_int8),
+ ("group", c_int8),
+ ("file", c_int32),
+ ("line", c_int32),
+ ("offset", c_int32),
+ ("length", c_int32),
+ ]
# Values for group:
@@ -82,51 +82,51 @@ Msg_Last = 3
@export
def Install_Handler() -> None:
- """Install the handlers for reporting errors."""
- libghdl.errorout__memory__install_handler()
+ """Install the handlers for reporting errors."""
+ libghdl.errorout__memory__install_handler()
@export
def Get_Nbr_Messages() -> ErrorIndex:
- """
- Get number of error messages available.
+ """
+ Get number of error messages available.
- :return: Number of messages available.
- """
- return libghdl.errorout__memory__get_nbr_messages()
+ :return: Number of messages available.
+ """
+ return libghdl.errorout__memory__get_nbr_messages()
@export
def Get_Error_Record(Idx: ErrorIndex) -> Error_Message:
- """
- Get error messages by index :obj:`Idy` as structure :class:`Error_Message`.
+ """
+ Get error messages by index :obj:`Idy` as structure :class:`Error_Message`.
- :param Idx: Index from 1 to ``Nbr_Messages`` See :func:`Get_Nbr_Messages`.
- :return: Type: ``Error_Message``
- """
- func = libghdl.errorout__memory__get_error_record
- func.argstypes = [c_int32]
- func.restype = Error_Message
+ :param Idx: Index from 1 to ``Nbr_Messages`` See :func:`Get_Nbr_Messages`.
+ :return: Type: ``Error_Message``
+ """
+ func = libghdl.errorout__memory__get_error_record
+ func.argstypes = [c_int32]
+ func.restype = Error_Message
- return func(Idx)
+ return func(Idx)
@export
def Get_Error_Message(Idx: ErrorIndex) -> str:
- """
- Get error messages by index :obj:`Idy` as string.
+ """
+ Get error messages by index :obj:`Idy` as string.
- :param Idx: Index from 1 to ``Nbr_Messages`` See :func:`Get_Nbr_Messages`.
- :return: Type: ``Error_Message``
- """
- func = libghdl.errorout__memory__get_error_message_addr
- func.argstype = [c_int32]
- func.restype = c_char_p
+ :param Idx: Index from 1 to ``Nbr_Messages`` See :func:`Get_Nbr_Messages`.
+ :return: Type: ``Error_Message``
+ """
+ func = libghdl.errorout__memory__get_error_message_addr
+ func.argstype = [c_int32]
+ func.restype = c_char_p
- return func(Idx).decode("utf-8")
+ return func(Idx).decode("utf-8")
@export
def Clear_Errors() -> None:
- """Remove all error messages."""
- libghdl.errorout__memory__clear_errors()
+ """Remove all error messages."""
+ libghdl.errorout__memory__clear_errors()