diff options
author | umarcor <unai.martinezcorral@ehu.eus> | 2020-12-27 22:10:38 +0100 |
---|---|---|
committer | umarcor <unai.martinezcorral@ehu.eus> | 2020-12-27 23:13:21 +0100 |
commit | bf74a0983c2d534e217e7312ab559ca8929ff8a2 (patch) | |
tree | fb630d5b83afc2f112996ebb5f1eac44de868132 /pyGHDL/libghdl/vhdl/lists.py | |
parent | 340fc792bba2ffdb4f930bc427a39ea3a1b659b2 (diff) | |
download | ghdl-bf74a0983c2d534e217e7312ab559ca8929ff8a2.tar.gz ghdl-bf74a0983c2d534e217e7312ab559ca8929ff8a2.tar.bz2 ghdl-bf74a0983c2d534e217e7312ab559ca8929ff8a2.zip |
rework 'python', rename to 'pyGHDL'
* Rename 'python' to 'pyGHDL'.
* Let 'thin' be 'libghdl'.
* Move move 'pyutils.py' from 'python/libghdl/vhdl' to a separate
package ('pyGHDL/libghdl/utils/').
* Update 'vhdl_langserver' accordingly.
* Rename 'vhdl_langserver' to 'lsp'.
* Move 'ghdl-ls' to 'pyGHDL/cli'.
Diffstat (limited to 'pyGHDL/libghdl/vhdl/lists.py')
-rw-r--r-- | pyGHDL/libghdl/vhdl/lists.py | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/pyGHDL/libghdl/vhdl/lists.py b/pyGHDL/libghdl/vhdl/lists.py new file mode 100644 index 000000000..bcaecb89b --- /dev/null +++ b/pyGHDL/libghdl/vhdl/lists.py @@ -0,0 +1,33 @@ +from 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 |