local directory in search path for spinit
This commit is contained in:
parent
1dd7a2869f
commit
878e471232
|
|
@ -20,7 +20,8 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||||
#include "completion.h"
|
#include "completion.h"
|
||||||
#include "variable.h"
|
#include "variable.h"
|
||||||
|
|
||||||
/* Set some standard variables and aliases, etc, and init the ccom stuff. */
|
/* Set some standard variables and aliases, etc, and init the ccom stuff.
|
||||||
|
Called by fcn main() */
|
||||||
|
|
||||||
void
|
void
|
||||||
ft_cpinit(void)
|
ft_cpinit(void)
|
||||||
|
|
@ -57,13 +58,14 @@ ft_cpinit(void)
|
||||||
"vm(x,y)", "mag(v(x) - v(y))",
|
"vm(x,y)", "mag(v(x) - v(y))",
|
||||||
"vg(x)", "group_delay(v(x))", //A.Rroldan 10/06/05 group delay new function
|
"vg(x)", "group_delay(v(x))", //A.Rroldan 10/06/05 group delay new function
|
||||||
"gd(x)", "group_delay(v(x))", //A.Rroldan 10/06/05 group delay new function
|
"gd(x)", "group_delay(v(x))", //A.Rroldan 10/06/05 group delay new function
|
||||||
"vp(x)", "ph(v(x))",
|
"vp(x)", "ph(v(x))",
|
||||||
"vp(x,y)", "ph(v(x) - v(y))",
|
"vp(x,y)", "ph(v(x) - v(y))",
|
||||||
"vr(x)", "re(v(x))",
|
"vr(x)", "re(v(x))",
|
||||||
"vr(x,y)", "re(v(x) - v(y))"
|
"vr(x,y)", "re(v(x) - v(y))"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
cp_ccon(TRUE); /* So the user can type ahead... */
|
cp_ccon(TRUE); /* So the user can type ahead... */
|
||||||
|
/* Initialize io, cp_chars[], variable "history" in init.c. */
|
||||||
cp_init();
|
cp_init();
|
||||||
|
|
||||||
if (!cp_nocc) {
|
if (!cp_nocc) {
|
||||||
|
|
@ -208,6 +210,7 @@ ft_cpinit(void)
|
||||||
|
|
||||||
/* NGSPICEDATADIR has been set to path "$dprefix/share/ngspice" in configure.in,
|
/* NGSPICEDATADIR has been set to path "$dprefix/share/ngspice" in configure.in,
|
||||||
Spice_Lib_Dir has been set to NGSPICEDATADIR in conf.c,
|
Spice_Lib_Dir has been set to NGSPICEDATADIR in conf.c,
|
||||||
|
may be overridden by environmental variable SPICE_LIB_DIR in ivars().
|
||||||
Lib_Path has been set to Spice_Lib_Dir adding /scripts in ivars() */
|
Lib_Path has been set to Spice_Lib_Dir adding /scripts in ivars() */
|
||||||
if (Lib_Path && *Lib_Path) {
|
if (Lib_Path && *Lib_Path) {
|
||||||
/* set variable 'sourcepath' */
|
/* set variable 'sourcepath' */
|
||||||
|
|
@ -217,7 +220,7 @@ ft_cpinit(void)
|
||||||
com_set(wl);
|
com_set(wl);
|
||||||
wl_free(wl);
|
wl_free(wl);
|
||||||
|
|
||||||
/* Now source the standard startup file. */
|
/* Now source the standard startup file spinit or tclspinit. */
|
||||||
|
|
||||||
/* jump over leading spaces */
|
/* jump over leading spaces */
|
||||||
for (copys=s=cp_tildexpand(Lib_Path); copys && *copys; ) {
|
for (copys=s=cp_tildexpand(Lib_Path); copys && *copys; ) {
|
||||||
|
|
@ -242,6 +245,15 @@ ft_cpinit(void)
|
||||||
cp_interactive = TRUE;
|
cp_interactive = TRUE;
|
||||||
found = TRUE;
|
found = TRUE;
|
||||||
break;
|
break;
|
||||||
|
#ifdef HAS_WINDOWS
|
||||||
|
/* search in local directory where ngspice.exe resides */
|
||||||
|
} else if ((fp = fopen("./spinit", "r"))) {
|
||||||
|
cp_interactive = FALSE;
|
||||||
|
inp_spsource(fp, TRUE, buf);
|
||||||
|
cp_interactive = TRUE;
|
||||||
|
found = TRUE;
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
} else if (ft_controldb)
|
} else if (ft_controldb)
|
||||||
fprintf(cp_err, "Note: can't open \"%s\".\n", buf);
|
fprintf(cp_err, "Note: can't open \"%s\".\n", buf);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue