diff --git a/ChangeLog b/ChangeLog index 63c3ecc2e..576649058 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-11-15 Holger Vogt + * main.c, src/include/compatmode.h: compatibility mode flag for HSPICE and SPICE3 + xpressn.c: compatmode removed + ============================ Rework-20 ================================== 2009-11-09 Dietmar Warning * subckt.c: support of 5-terminal bjt's in subckt's by prepending subckt name (similar @@ -8,7 +12,7 @@ * numparam/mystring.c: using floor and ceil from math lib for rounding and truncation 2009-11-07 Holger Vogt - * winmain.c: replace strdup()y copy() + * winmain.c: replace strdup() by copy() 2009-10-31 Holger Vogt * winmain.c: windows updated more often diff --git a/src/frontend/numparam/xpressn.c b/src/frontend/numparam/xpressn.c index 3fa6fb765..b1a268b38 100644 --- a/src/frontend/numparam/xpressn.c +++ b/src/frontend/numparam/xpressn.c @@ -1,7 +1,8 @@ /* xpressn.c Copyright (C) 2002 Georg Post - * - * This file is part of Numparam, see: readme.txt - * Free software under the terms of the GNU Lesser General Public License + + This file is part of Numparam, see: readme.txt + Free software under the terms of the GNU Lesser General Public License + $Id$ */ #include /* for function message() only. */ @@ -9,36 +10,15 @@ #include "general.h" #include "numparam.h" #include "ngspice.h" - -/* preliminary, until upload problem h_vogt is solved */ -//#include "../compatmode.h" #include "cpdefs.h" #include "ftedefs.h" #include "dvec.h" #include "../frontend/variable.h" -/* end preliminary */ +#include "compatmode.h" /* random numbers in /maths/misc/randnumb.c */ extern double gauss(); - -/* preliminary until upload problem h_vogt is solved */ -typedef enum { - COMPATMODE_NATIVE = 0, - COMPATMODE_HSPICE = 1 -} COMPATMODE_T ; - - -COMPATMODE_T ngpsice_compat_mode(void) -{ - char behaviour[80] ; - - if( cp_getvar("ngbehavior", VT_STRING, behaviour)){ - if (strcasecmp(behaviour,"hspice")==0) - return( COMPATMODE_HSPICE ) ; - } - return(COMPATMODE_NATIVE) ; -} /* end ngspice_compat_mode() */ -/* end preliminary */ +extern COMPATMODE_T ngspice_compat_mode(void) ; /************ keywords ************/ @@ -198,7 +178,8 @@ initdico (tdico * dico) dico->stack[dico->tos] = 0; /* global data beneath */ initkeys (); - compat_mode = ngpsice_compat_mode() ; + compat_mode = ngspice_compat_mode() ; + if( compat_mode == COMPATMODE_HSPICE ) dico->hspice_compatibility = 1 ; else diff --git a/src/include/compatmode.h b/src/include/compatmode.h new file mode 100644 index 000000000..c59391d0e --- /dev/null +++ b/src/include/compatmode.h @@ -0,0 +1,12 @@ +#ifndef _COMPATMODE_H +#define _COMPATMODE_H + +#include + +typedef enum { + COMPATMODE_NATIVE = 0, + COMPATMODE_HSPICE = 1, + COMPATMODE_SPICE3 = 2 +} COMPATMODE_T ; + +#endif diff --git a/src/main.c b/src/main.c index 0b045e7fd..5d31db089 100644 --- a/src/main.c +++ b/src/main.c @@ -53,6 +53,7 @@ extern int rl_catch_signals; /* missing from editline/readline.h */ #include "frontend/variable.h" #include "frontend/display.h" /* added by SDB to pick up Input() fcn */ #include "frontend/signal_handler.h" +#include "compatmode.h" /* saj xspice headers */ #ifdef XSPICE @@ -188,9 +189,14 @@ bool ft_nutmeg = FALSE; extern struct comm spcp_coms[ ]; struct comm *cp_coms = spcp_coms; -extern int OUTpBeginPlot(), OUTpData(), OUTwBeginPlot(), OUTwReference(); -extern int OUTwData(), OUTwEnd(), OUTendPlot(), OUTbeginDomain(); -extern int OUTendDomain(), OUTstopnow(), OUTerror(), OUTattributes(); +extern int OUTpBeginPlot(void *,void *,IFuid,IFuid,int,int,IFuid *,int,void **); +extern int OUTpData(void *,IFvalue *,IFvalue *); +extern int OUTwBeginPlot(void *,void *,IFuid,IFuid,int,int,IFuid *,int,void **); +extern int OUTwReference(void *,IFvalue *,void **); +extern int OUTwData(void *,int,IFvalue *,void *), OUTwEnd(void *), OUTendPlot(void *); +extern int OUTbeginDomain(void *,IFuid,int,IFvalue *); +extern int OUTendDomain(void *), OUTstopnow(void), OUTerror(int,char *,IFuid *); +extern int OUTattributes(void *,IFuid *,int,IFvalue *); IFfrontEnd nutmeginfo = { IFnewUid, @@ -346,6 +352,26 @@ double CONSTe; IFfrontEnd *SPfrontEnd = NULL; int DEVmaxnum = 0; +/* -------------------------------------------------------------------------- */ +/* Set a compatibility flag. + Currently available are flags for: + ngspice (standard) + HSPICE + Spice3 +*/ +COMPATMODE_T ngspice_compat_mode(void) +{ + char behaviour[80] ; + + if( cp_getvar("ngbehavior", VT_STRING, behaviour)){ + if (strcasecmp(behaviour,"hspice")==0) + return( COMPATMODE_HSPICE ) ; + if (strcasecmp(behaviour,"spice3")==0) + return( COMPATMODE_SPICE3 ) ; + } + return(COMPATMODE_NATIVE) ; +} /* end ngspice_compat_mode() */ + /* -------------------------------------------------------------------------- */ int SIMinit(IFfrontEnd *frontEnd, IFsimulator **simulator) diff --git a/visualc/vngspice.vcproj b/visualc/vngspice.vcproj index d0d220ff6..f0b74a349 100644 --- a/visualc/vngspice.vcproj +++ b/visualc/vngspice.vcproj @@ -24,14 +24,13 @@ > + +