brief option reimplementation.

This commit is contained in:
pnenzi 2007-10-12 21:59:18 +00:00
parent 7703a63230
commit 10997c0fa5
4 changed files with 8 additions and 27 deletions

View File

@ -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...

View File

@ -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" );

View File

@ -28,6 +28,7 @@ char *ft_setkwords[] = {
"addcontrol",
"altshow",
"appendwrite",
"brief",
"bypass",
"chgtol",
"color<num>",

View File

@ -3,6 +3,8 @@ alias exit quit
alias acct rusage all
set x11lineararcs
*unset brief
strcmp __flag $program "ngspice"
if $__flag = 0