options.c, whitespace
This commit is contained in:
parent
e93960f9ed
commit
a2f58da0d0
|
|
@ -9,7 +9,6 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|||
* variables, though, and a few commonly used ones are dealt with here.
|
||||
*/
|
||||
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "ngspice/cpdefs.h"
|
||||
#include "ngspice/ftedefs.h"
|
||||
|
|
@ -30,6 +29,7 @@ bool ft_acctprint = FALSE, ft_noacctprint = FALSE, ft_listprint = FALSE;
|
|||
bool ft_nodesprint = FALSE, ft_optsprint = FALSE, ft_noinitprint = FALSE;
|
||||
bool ft_ngdebug = FALSE, ft_stricterror = FALSE;
|
||||
|
||||
|
||||
/* The user-supplied routine to query the values of variables. This
|
||||
* recognises the $&varname notation, and also searches the values of
|
||||
* plot and circuit environment variables.
|
||||
|
|
@ -44,7 +44,9 @@ cp_enqvar(char *word)
|
|||
int i;
|
||||
|
||||
if (*word == '&') {
|
||||
|
||||
word++;
|
||||
|
||||
d = vec_get(word);
|
||||
if (d) {
|
||||
if (d->v_length == 1) {
|
||||
|
|
@ -84,6 +86,7 @@ cp_enqvar(char *word)
|
|||
} else
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
if (plot_cur) {
|
||||
for (vv = plot_cur->pl_env; vv; vv = vv->va_next)
|
||||
if (eq(vv->va_name, word))
|
||||
|
|
@ -133,6 +136,7 @@ cp_enqvar(char *word)
|
|||
return (vv);
|
||||
}
|
||||
}
|
||||
|
||||
if (ft_curckt) {
|
||||
for (vv = ft_curckt->ci_vars; vv; vv = vv->va_next)
|
||||
if (eq(vv->va_name, word))
|
||||
|
|
@ -140,9 +144,11 @@ cp_enqvar(char *word)
|
|||
if (vv)
|
||||
return (vv);
|
||||
}
|
||||
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
|
||||
/* Return the plot and ckt env vars, $plots, and $curplot{name,title,date,} */
|
||||
|
||||
void
|
||||
|
|
@ -154,6 +160,7 @@ cp_usrvars(struct variable **v1, struct variable **v2)
|
|||
v = plot_cur->pl_env;
|
||||
else
|
||||
v = NULL;
|
||||
|
||||
if ((tv = cp_enqvar("plots")) != NULL) {
|
||||
tv->va_next = v;
|
||||
v = tv;
|
||||
|
|
@ -174,6 +181,7 @@ cp_usrvars(struct variable **v1, struct variable **v2)
|
|||
tv->va_next = v;
|
||||
v = tv;
|
||||
}
|
||||
|
||||
*v1 = v;
|
||||
if (ft_curckt)
|
||||
*v2 = ft_curckt->ci_vars;
|
||||
|
|
@ -203,9 +211,11 @@ inp_getopts(struct line *deck)
|
|||
} else
|
||||
last = dd;
|
||||
}
|
||||
|
||||
return (opts);
|
||||
}
|
||||
|
||||
|
||||
/* Extract the option lines from a comfile (spinit, .spiceinit) */
|
||||
struct line *
|
||||
inp_getoptsc(char *in_line, struct line *com_options)
|
||||
|
|
@ -224,6 +234,7 @@ inp_getoptsc(char *in_line, struct line *com_options)
|
|||
next->li_linenum = 0;
|
||||
next->li_error = NULL;
|
||||
next->li_actual = NULL;
|
||||
|
||||
/* put new line in front */
|
||||
if (com_options != NULL)
|
||||
next->li_next = com_options;
|
||||
|
|
@ -311,7 +322,6 @@ cp_usrset(struct variable *var, bool isset)
|
|||
else
|
||||
fprintf(cp_err, "Excuse me??\n");
|
||||
} else if (eq(var->va_name, "unixcom")) {
|
||||
|
||||
cp_dounixcom = isset;
|
||||
if (isset) {
|
||||
s = getenv("PATH");
|
||||
|
|
@ -320,7 +330,6 @@ cp_usrset(struct variable *var, bool isset)
|
|||
else
|
||||
fprintf(cp_err, "Warning: no PATH in environment.\n");
|
||||
}
|
||||
|
||||
} else if (eq(var->va_name, "units") && (var->va_type == CP_STRING)) {
|
||||
if (isset && ((*var->va_string == 'd') ||
|
||||
(*var->va_string == 'D')))
|
||||
|
|
@ -359,6 +368,7 @@ cp_usrset(struct variable *var, bool isset)
|
|||
for (tv = plot_cur->pl_env; tv; tv = tv->va_next)
|
||||
if (eq(tv->va_name, var->va_name))
|
||||
return (US_READONLY);
|
||||
|
||||
/*
|
||||
if (ft_curckt)
|
||||
for (tv = ft_curckt->ci_vars; tv; tv = tv->va_next)
|
||||
|
|
@ -411,9 +421,11 @@ cp_usrset(struct variable *var, bool isset)
|
|||
return US_SIMVAR;
|
||||
} else if (if_option(NULL, var->va_name, var->va_type, vv))
|
||||
return US_NOSIMVAR;
|
||||
|
||||
return (US_OK);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
setdb(char *str)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue