brief option reimplementation.
This commit is contained in:
parent
7703a63230
commit
10997c0fa5
|
|
@ -160,6 +160,7 @@ ft_cpinit(void)
|
|||
|
||||
cp_vset("prompt", VT_STRING, buf);
|
||||
cp_vset("noglob", VT_BOOL, (char *) &t);
|
||||
cp_vset("brief", VT_BOOL, (char *) &t);
|
||||
|
||||
/* Now do a bunch of things that used to be in the spiceinit file
|
||||
* but were too slow to read in...
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ $Id$
|
|||
* the listing routines.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <libgen.h>
|
||||
#include "ngspice.h"
|
||||
#include "cpdefs.h"
|
||||
|
|
@ -48,23 +47,6 @@ static char * upper(register char *string);
|
|||
static bool doedit(char *filename);
|
||||
static void line_free_x(struct line * deck, bool recurse);
|
||||
|
||||
// Initial AlmostEqualULPs version - fast and simple, but
|
||||
// some limitations.
|
||||
static bool AlmostEqualUlps(float A, float B, int maxUlps)
|
||||
{
|
||||
assert(sizeof(float) == sizeof(int));
|
||||
|
||||
if (A == B)
|
||||
return TRUE;
|
||||
|
||||
int intDiff = abs(*(int*)&A - *(int*)&B);
|
||||
|
||||
if (intDiff <= maxUlps)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Do a listing. Use is listing [expanded] [logical] [physical] [deck] */
|
||||
void
|
||||
com_listing(wordlist *wl)
|
||||
|
|
@ -657,7 +639,7 @@ inp_dodeck(struct line *deck, char *tt, wordlist *end, bool reuse,
|
|||
struct variable *eev = NULL;
|
||||
wordlist *wl;
|
||||
bool noparse, ii;
|
||||
double brief = 0, i;
|
||||
bool brief;
|
||||
|
||||
/* First throw away any old error messages there might be and fix
|
||||
* the case of the lines. */
|
||||
|
|
@ -710,9 +692,6 @@ inp_dodeck(struct line *deck, char *tt, wordlist *end, bool reuse,
|
|||
eev->va_type, (char *) &eev->va_num);
|
||||
break;
|
||||
case VT_REAL:
|
||||
if ( strcmp("brief",eev->va_name)==0 ){
|
||||
cp_vset("brief", VT_REAL, (char*) &eev->va_real );
|
||||
}
|
||||
if_option(ct->ci_ckt, eev->va_name,
|
||||
eev->va_type, (char *) &eev->va_real);
|
||||
break;
|
||||
|
|
@ -776,11 +755,9 @@ inp_dodeck(struct line *deck, char *tt, wordlist *end, bool reuse,
|
|||
|
||||
} /* for (dd = deck; dd; dd = dd->li_next) */
|
||||
|
||||
if ( cp_getvar( "brief", VT_REAL, (char *) &i ) ) {
|
||||
brief = i;
|
||||
}
|
||||
// only print out netlist if brief == 0
|
||||
if(AlmostEqualUlps(brief,0,3)) {
|
||||
/* Only print out netlist if brief is FALSE */
|
||||
cp_getvar( "brief", VT_BOOL, (bool *) &brief );
|
||||
if(brief==FALSE) {
|
||||
/* output deck */
|
||||
out_printf( "\nProcessed Netlist\n" );
|
||||
out_printf( "=================\n" );
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ char *ft_setkwords[] = {
|
|||
"addcontrol",
|
||||
"altshow",
|
||||
"appendwrite",
|
||||
"brief",
|
||||
"bypass",
|
||||
"chgtol",
|
||||
"color<num>",
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@ alias exit quit
|
|||
alias acct rusage all
|
||||
set x11lineararcs
|
||||
|
||||
*unset brief
|
||||
|
||||
strcmp __flag $program "ngspice"
|
||||
if $__flag = 0
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue