pyGHDL.libghdl.files_map
#
Variables
Functions
Location_To_File()
: ConvertLocation
to a source file.Location_File_To_Pos()
: ConvertLocation
andFile
to a position (offset) into the source file.Location_File_To_Line()
: ConvertLocation
andFile
to a line number.Location_File_Line_To_Offset()
: Get the offset inLine
ofLocation
.Location_File_Line_To_Col()
: Get logical column (with HT expanded) fromLocation
,File
andFile_To_Location()
: Convert aFile
into a location.File_Pos_To_Location()
: Convert aFile
and an offsetPos
in the file into a location.File_Line_To_Position()
: Convert aFile
andLine
into a position.Get_File_Name()
: Return the name of the file.Get_Directory_Name()
: Return the directory of the file.Get_File_Buffer()
: Return a buffer (access to the contents of the file) for a file entry.Get_File_Length()
: Get the position of the first EOT character.Set_File_Length()
: Set the length of the file (which is less than the size of the file buffer).Get_Buffer_Length()
: Get the length of the buffer, including the gap and the two EOT.Reserve_Source_File()
: Reserve an entry, but do not read any file.Discard_Source_File()
: MarkFile
as unavailable: clear the name and directory.Free_Source_File()
: Free resources used byFile
, but keep the entry.Get_Last_Source_File_Entry()
: Returns the entry of the last known file.
Variables
- pyGHDL.libghdl.files_map.EOT#
bytes(iterable_of_ints) -> bytes bytes(string, encoding[, errors]) -> bytes bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer bytes(int) -> bytes object of size given by the parameter initialized with null bytes bytes() -> empty bytes object
- Construct an immutable array of bytes from:
an iterable yielding integers in range(256)
a text string encoded using the specified encoding
any object implementing the buffer API.
an integer
b'\x04'
- pyGHDL.libghdl.files_map.No_Source_File_Entry#
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
0
- pyGHDL.libghdl.files_map.No_Location#
int([x]) -> integer int(x, base=10) -> integer
Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating point numbers, this truncates towards zero.
If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4
0
Functions
- pyGHDL.libghdl.files_map.Location_File_To_Pos(Location, File)[source]#
Convert
Location
andFile
to a position (offset) into the source file.
- pyGHDL.libghdl.files_map.Location_File_To_Line(Location, File)[source]#
Convert
Location
andFile
to a line number.
- pyGHDL.libghdl.files_map.Location_File_Line_To_Offset(Location, File, Line)[source]#
Get the offset in
Line
ofLocation
.
- pyGHDL.libghdl.files_map.Location_File_Line_To_Col(Location, File, Line)[source]#
Get logical column (with HT expanded) from
Location
,File
andLine
.
- pyGHDL.libghdl.files_map.File_Pos_To_Location(File, Pos)[source]#
Convert a
File
and an offsetPos
in the file into a location.
- pyGHDL.libghdl.files_map.File_Line_To_Position(File, Line)[source]#
Convert a
File
andLine
into a position.
- pyGHDL.libghdl.files_map.Get_File_Buffer(File)[source]#
Return a buffer (access to the contents of the file) for a file entry.
- pyGHDL.libghdl.files_map.Get_File_Length(File)[source]#
Get the position of the first EOT character.
- pyGHDL.libghdl.files_map.Set_File_Length(File, Length)[source]#
Set the length of the file (which is less than the size of the file buffer).
Set also append two EOT at the end of the file.
- pyGHDL.libghdl.files_map.Get_Buffer_Length(File)[source]#
Get the length of the buffer, including the gap and the two EOT.
- pyGHDL.libghdl.files_map.Reserve_Source_File(Directory, Name, Length)[source]#
Reserve an entry, but do not read any file.
The length should includes the two terminal EOT.
- pyGHDL.libghdl.files_map.Discard_Source_File(File)[source]#
Mark
File
as unavailable: clear the name and directory.Hint
This is needed before creating a new source file with the same name.