aboutsummaryrefslogtreecommitdiffstats
path: root/pyGHDL/libghdl/vhdl/lists.py
diff options
context:
space:
mode:
authortgingold <tgingold@users.noreply.github.com>2020-12-29 17:19:09 +0100
committerGitHub <noreply@github.com>2020-12-29 17:19:09 +0100
commit7ca54117b8f757396ba5ef04c83ff1228ca94384 (patch)
treecc5f7f4166cc0570bda5cf2047d3ef7abbc36e37 /pyGHDL/libghdl/vhdl/lists.py
parent340fc792bba2ffdb4f930bc427a39ea3a1b659b2 (diff)
parent50adcf884c3cfa4e33ca45769295f163baa63a3e (diff)
downloadghdl-7ca54117b8f757396ba5ef04c83ff1228ca94384.tar.gz
ghdl-7ca54117b8f757396ba5ef04c83ff1228ca94384.tar.bz2
ghdl-7ca54117b8f757396ba5ef04c83ff1228ca94384.zip
Merge pull request #1556 from Paebbels/paebbels/pyGHDL
Cleanup and Restructuring of pyGHDL
Diffstat (limited to 'pyGHDL/libghdl/vhdl/lists.py')
-rw-r--r--pyGHDL/libghdl/vhdl/lists.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/pyGHDL/libghdl/vhdl/lists.py b/pyGHDL/libghdl/vhdl/lists.py
new file mode 100644
index 000000000..4c4f98579
--- /dev/null
+++ b/pyGHDL/libghdl/vhdl/lists.py
@@ -0,0 +1,34 @@
+from pyGHDL.libghdl import libghdl
+from ctypes import c_int32, c_bool, POINTER, Structure
+
+
+List_Type = c_int32
+
+
+class Iterator(Structure):
+ _fields_ = [("chunk", c_int32), ("chunk_idx", c_int32), ("remain", c_int32)]
+
+
+Iterate = libghdl.vhdl__lists__iterate
+Iterate.argstype = [List_Type]
+Iterate.restype = Iterator
+
+Is_Valid = libghdl.vhdl__lists__is_valid
+Is_Valid.argstype = [POINTER(Iterator)]
+Is_Valid.restype = c_bool
+
+Next = libghdl.vhdl__lists__next
+Next.argstype = [POINTER(Iterator)]
+Next.restype = None
+
+Get_Element = libghdl.vhdl__lists__get_element
+Get_Element.argstype = [POINTER(Iterator)]
+Get_Element.restype = c_int32
+
+Get_Nbr_Elements = libghdl.vhdl__lists__get_nbr_elements
+Get_Nbr_Elements.argtype = [List_Type]
+Get_Nbr_Elements.restype = c_int32
+
+Create_Iir_List = libghdl.vhdl__lists__create_list
+
+Destroy_Iir_List = libghdl.vhdl__lists__destroy_list