diff --git a/src/spicelib/devices/mos6/Makefile.am b/src/spicelib/devices/mos6/Makefile.am index 5161dbac3..324030804 100644 --- a/src/spicelib/devices/mos6/Makefile.am +++ b/src/spicelib/devices/mos6/Makefile.am @@ -7,6 +7,7 @@ libmos6_la_SOURCES = \ mos6ask.c \ mos6conv.c \ mos6defs.h \ + mos6del.c \ mos6dest.c \ mos6ext.h \ mos6ic.c \ @@ -15,6 +16,7 @@ libmos6_la_SOURCES = \ mos6itf.h \ mos6load.c \ mos6mask.c \ + mos6mdel.c \ mos6mpar.c \ mos6par.c \ mos6set.c \ diff --git a/src/spicelib/devices/mos6/mos6del.c b/src/spicelib/devices/mos6/mos6del.c new file mode 100644 index 000000000..c19ca5e61 --- /dev/null +++ b/src/spicelib/devices/mos6/mos6del.c @@ -0,0 +1,34 @@ +/********** +Copyright 1990 Regents of the University of California. All rights reserved. +Author: 1985 Thomas L. Quarles +**********/ +/* + */ + +#include "ngspice/ngspice.h" +#include "mos6defs.h" +#include "ngspice/sperror.h" +#include "ngspice/suffix.h" + + +int +MOS6delete(GENmodel *inModel, IFuid name, GENinstance **inst) +{ + MOS6model *model = (MOS6model *)inModel; + MOS6instance **fast = (MOS6instance **)inst; + MOS6instance **prev = NULL; + MOS6instance *here; + + for( ; model ; model = model->MOS6nextModel) { + prev = &(model->MOS6instances); + for(here = *prev; here ; here = *prev) { + if(here->MOS6name == name || (fast && here==*fast) ) { + *prev= here->MOS6nextInstance; + FREE(here); + return(OK); + } + prev = &(here->MOS6nextInstance); + } + } + return(E_NODEV); +} diff --git a/src/spicelib/devices/mos6/mos6init.c b/src/spicelib/devices/mos6/mos6init.c index 65df0328c..c87370016 100644 --- a/src/spicelib/devices/mos6/mos6init.c +++ b/src/spicelib/devices/mos6/mos6init.c @@ -52,8 +52,8 @@ SPICEdev MOS6info = { /* DEVacLoad */ NULL, /* MOS6acLoad, XXX */ /* DEVaccept */ NULL, /* DEVdestroy */ MOS6destroy, - /* DEVmodDelete */ NULL, - /* DEVdelete */ NULL, + /* DEVmodDelete */ MOS6mDelete, + /* DEVdelete */ MOS6delete, /* DEVsetic */ MOS6getic, /* DEVask */ MOS6ask, /* DEVmodAsk */ MOS6mAsk, diff --git a/src/spicelib/devices/mos6/mos6mdel.c b/src/spicelib/devices/mos6/mos6mdel.c new file mode 100644 index 000000000..0d0029c21 --- /dev/null +++ b/src/spicelib/devices/mos6/mos6mdel.c @@ -0,0 +1,40 @@ +/********** +Copyright 1990 Regents of the University of California. All rights reserved. +Author: 1985 Thomas L. Quarles +**********/ +/* + */ + +#include "ngspice/ngspice.h" +#include "mos6defs.h" +#include "ngspice/sperror.h" +#include "ngspice/suffix.h" + + +int +MOS6mDelete(GENmodel **inModel, IFuid modname, GENmodel *kill) +{ + MOS6model **model = (MOS6model **)inModel; + MOS6model *modfast = (MOS6model *)kill; + MOS6instance *here; + MOS6instance *prev = NULL; + MOS6model **oldmod; + oldmod = model; + for( ; *model ; model = &((*model)->MOS6nextModel)) { + if( (*model)->MOS6modName == modname || + (modfast && *model == modfast) ) goto delgot; + oldmod = model; + } + return(E_NOMOD); + +delgot: + *oldmod = (*model)->MOS6nextModel; /* cut deleted device out of list */ + for(here = (*model)->MOS6instances ; here ; here = here->MOS6nextInstance) { + if(prev) FREE(prev); + prev = here; + } + if(prev) FREE(prev); + FREE(*model); + return(OK); + +} diff --git a/visualc/sharedspice.vcxproj b/visualc/sharedspice.vcxproj index 900cedad9..2ef2c661c 100644 --- a/visualc/sharedspice.vcxproj +++ b/visualc/sharedspice.vcxproj @@ -1975,11 +1975,13 @@ + + diff --git a/visualc/vngspice-fftw.vcxproj b/visualc/vngspice-fftw.vcxproj index 6f82f8ab6..d1345372e 100644 --- a/visualc/vngspice-fftw.vcxproj +++ b/visualc/vngspice-fftw.vcxproj @@ -2413,11 +2413,13 @@ lib /machine:x64 /def:..\..\fftw-3.3.4-dll64\libfftw3-3.def /out:$(IntDir)libfft + + diff --git a/visualc/vngspice.vcxproj b/visualc/vngspice.vcxproj index 0474d6015..4f0f8581a 100644 --- a/visualc/vngspice.vcxproj +++ b/visualc/vngspice.vcxproj @@ -2379,11 +2379,13 @@ + +