diff options
Diffstat (limited to 'pyGHDL/libghdl/vhdl/flists.py')
-rw-r--r-- | pyGHDL/libghdl/vhdl/flists.py | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/pyGHDL/libghdl/vhdl/flists.py b/pyGHDL/libghdl/vhdl/flists.py index c1303353c..b4217b36d 100644 --- a/pyGHDL/libghdl/vhdl/flists.py +++ b/pyGHDL/libghdl/vhdl/flists.py @@ -6,9 +6,9 @@ # | .__/ \__, |\____|_| |_|____/|_____(_)_|_|_.__/ \__, |_| |_|\__,_|_| # |_| |___/ |___/ # ============================================================================= -# Authors: -# Tristan Gingold -# Patrick Lehmann +# Authors: +# Tristan Gingold +# Patrick Lehmann # # Package module: Python binding and low-level API for shared library 'libghdl'. # @@ -31,14 +31,17 @@ # # SPDX-License-Identifier: GPL-2.0-or-later # ============================================================================ - from ctypes import c_int32 from pydecor import export -from pyGHDL.libghdl import libghdl +from pyGHDL.libghdl._decorator import BindToLibGHDL + -__all__ = ["Flist_Type", "Ffirst"] +__all__ = [ + "Flist_Type", + "Ffirst" +] Flist_Type = c_int32 #: First index of a ``FList``. @@ -46,7 +49,8 @@ Ffirst = 0 @export -def Flast(FList) -> int: +@BindToLibGHDL("vhdl__flists__flast") +def Flast(FList: int) -> int: """ Last index of :obj:`FList`. @@ -55,22 +59,22 @@ def Flast(FList) -> int: :param FList: List to query. :return: Index of the last element in the list. """ - return libghdl.vhdl__flists__flast(FList) @export -def Length(FList) -> int: +@BindToLibGHDL("vhdl__flists__length") +def Length(FList: int) -> int: """ Get the length of :obj:`FList`. :param FList: List to query. :return: Number of elements in the list. """ - return libghdl.vhdl__flists__length(FList) @export -def Get_Nth_Element(FList, N: int): +@BindToLibGHDL("vhdl__flists__get_nth_element") +def Get_Nth_Element(FList: int, N: int) -> int: """ Get the N-th element of :obj:`FList`. @@ -79,4 +83,3 @@ def Get_Nth_Element(FList, N: int): :param FList: List to query. :return: Type: ``El_Type`` """ - return libghdl.vhdl__flists__get_nth_element(FList, N) |