Using function get_windows_canonical_path() may neglect the
ngspice file search sequence, as an absolute path is returned also
for relative input paths. ngspice however searches a file not only
relative to the current directory, as inforced by this
function, but for example also in the directory of the previous
input file.
So restrict this function to paths longer than MAX_PATH, which would fail
otherwise.
On Windows it reads:
is_block_type_valid(header->_block_use).
Memory for info.errors is allocated in the osdi device dll
during the call to
descr->setup_instance((void *)&handle, inst, model, temp,
connected_terminals, sim_params, &init_info);
(in fcn OSDIsetup(), line 254 of osdisetup.c).
Therefore ngspice is not the owner of this memory and thus cannot free it.
Fixes bug no. 803.
With commit
80d6e681f ("MS Windows: Get a canonical paths name: Important if path length exceeds MAX_PATH, might happen when using PDKs", 2025-04-12)
the newly introduced function get_windows_canonical_path() does not do the
right thing when the path name is only a simple file name. Then internally
used function GetFullPathNameW() then will prepend the current directory to the
file name, which may be simply wrong.
Move tprev out of the loop to enable storing the previous time value.
Add some general warning message that an error might have occurred during
reading the time or data values from the data input file.
Allow empty lines in the data input file.
Guard early data values (TIME < time offset) against false reading.
Add some simple examples.
Add type DoubleComplex, to become 'double complex'
with gcc and _Dcomplex with Visual Studio.
Add functions rdivide and divide to divide real or complex numbers
by another complex number.
Use rdivide and VS built in function to evaluate _Z11 - _Z14.