Giles Atkinson
6b0ab44f1e
Add code in ivars.c to look for a SPICE_ROOT environment variable
that gives the location of the ngspice installation. That allows
binaries to be installed in a different directory to the one
compiled in. The spinit startup file is made location-independent
by passing a variable giving the location of loadable modules,
so this fixes Bug #615 -
"spinit contains arch dependent paths, but is installed as noarch DATA".
3 years ago
Holger Vogt
ff9c98f597
Patch 112 by Robert Turnbull
Remove compiler warning.
3 years ago
Holger Vogt
2e2b74c188
In the ngspice shared library the fcn ivers is called
with a NULL argument. The fix safeguards against argv0
being NULL.
In this case Spice_Exec_Path is set to NULL, it is
safeguarded against NULL when being used.
3 years ago
Holger Vogt
6ef94cb9f2
Prevent from endless loop
3 years ago
Holger Vogt
6da2659026
Remove the debug printout
3 years ago
Holger Vogt
167c708e69
Add searchpath for *.osdi relative to ngspice executable
3 years ago
Holger Vogt
59413a7f71
Add error messages when controlled_exit is called:
No exit without message.
3 years ago
Holger Vogt
e6772f4e4e
Prevent crash in gettok() and similar functions by checking for NULL
input. Return NULL instead.
4 years ago
Holger Vogt
1329942865
Add a new function char* gettok_np(char** s)
which finds a token, while scanning over (), like
they were white spaces. It also proceeds with s while
still finding (), (which gettok_noparens does not do).
4 years ago
Holger Vogt
e80dad01fc
Fix bug 581, reported by Adam Denton
4 years ago
Holger Vogt
08a12b5355
Add a function itoa10 and use it
instead of non-standard itoa.
4 years ago
Holger Vogt
7c38699cd7
Add missing function nghash_delete_special(),
developed for branch gc-local
5 years ago
Holger Vogt
a6079781ea
Fix previous commit, enable name upgrade for Linux and other non-Win OSs
5 years ago
Holger Vogt
604c4624d1
Within a single run, allow multiple plots with different names:
Add an increasing number to the id file name.
5 years ago
Holger Vogt
d2f6ad239f
If the input file path contains ANSI-encoded special characters,
utf-8 conversion and thus file opening will fail.
This patch then in addition tries opening the file with standard fopen.
5 years ago
dwarning
a08f120518
TEMPFORMAT has already leading / in defines.h
5 years ago
Holger Vogt
736d42a5b0
remove unused
5 years ago
Holger Vogt
5747982ae8
Re-enable devices like E2 1 0 (2,3) 1
Add a new function nexttok_noparens(const char *s) which
skips tokens. Characters , ( and ) are treated like spaces.
5 years ago
Holger Vogt
4a8065c3ee
replace strncpy by memcpy to prevent valgrind error message
on uninitialized string.
5 years ago
Holger Vogt
238f8d393a
Suppress some compiler warnings
5 years ago
Holger Vogt
ced7604fc4
fix comment
5 years ago
Holger Vogt
2335639848
License 3-clause BSD
Update to license information
6 years ago
Holger Vogt
02fdcaff2d
try first storing the temporary file in user directory,
only then in current directory
6 years ago
Holger Vogt
913635d252
remove unused function
6 years ago
Holger Vogt
e2ddc5c06b
exclude unused function
6 years ago
Holger Vogt
a40f06de52
add #include <stdint.h> for SIZE_MAX
6 years ago
Holger Vogt
e1a69e3fc5
controlled_exit only for WinGUI and shared ngspice
6 years ago
Jim Monte
654c9767d6
add fcn product_overflow()
6 years ago
Jim Monte
1d62ae2d97
type casts
6 years ago
Holger Vogt
a7e664a5c2
fix bug no. 484, correct TREALLOC usage
6 years ago
Holger Vogt
02cf88c119
correct the return values
6 years ago
Holger Vogt
d967e18632
compatibility to old vsnprintf() in MINGW is no longer needed.
Compiling with -D__USE_MINGW_ANSI_STDIO=1 enables C99 compatibility.
6 years ago
Holger Vogt
1398ee7aa0
set the proper preprocessor flag __MINGW32__
6 years ago
Holger Vogt
249304a06f
Instantiations of string and dstring functions as inline
This will remove the redundant-decls warning
6 years ago
Holger Vogt
bcfdc806a5
work around a bug in MINGW
Reported in
https://github.com/msys2/MINGW-packages/issues/6254
6 years ago
Holger Vogt
4ddcff55e7
add const declaration to newfopen
6 years ago
Holger Vogt
7f085144a9
remove all the remains of quote() and strip() that had been
used to modify the eigths bit of a character or string.
The functions had been switched off some time ago.
We now need all bits of a char for extended ascii or utf8
6 years ago
Holger Vogt
ac1c8c4a96
return NULL upon NULL input
6 years ago
h_vogt
9f272ea8f6
function newfopen to replace fopen
by reading wide char strings
9 years ago
Jim Monte
7084274344
Fixed incorrect type of variable ch_cur. It was from const char * but should have been const char.
6 years ago
Jim Monte
a53cd3a3e9
fixed path created by ngdirname in Windows. Also added const to parameters whose arguments do not change and fixed some potential buffer overruns.
6 years ago
Jim Monte
ac49ccaf58
Fixed compile warning about signed/unsigned comparison.
6 years ago
Holger Vogt
966b69090d
use only TMALLOC and TREALLOC for memory allocation
6 years ago
Jim Monte
0cf53a34b2
Fixed resolution of ~ to home directory. (Bug #405 ) Also fixed potential buffer overruns in glob expansion
6 years ago
Jim Monte
72801b1ab1
Fixed buffer resizing, made string utilities more modular, and added several new utilities, some which do not require a null termination, potentially avoiding the need to copy a string. Also some substring utilities using the Rabin-Karp algorithm were added.
6 years ago
Jim Monte
81fa829b7d
Fixed potential infinite loop (until memory is exhausted) and added several utility functions for processing strings.
6 years ago
Jim Monte
068df274bf
Made ft_numparse() thread-safe (no internal static variables) and prepared to support ngspice variable type CP_NUM.
6 years ago
Jim Monte
89efe5aeae
Dynamic string (dstring) rework
6 years ago
Holger Vogt
c50dfa2be8
prevent crash if function is called with NULL argument
7 years ago
Jim Monte
e92e2c7362
[PATCH #62 ] Fixed buffer overrun. Reworked to not use dstring for more
efficient parsing.
7 years ago