Browse Source
devices/mos6, add missing files mos6del.c and mos6mdel.c
devices/mos6, add missing files mos6del.c and mos6mdel.c
this is a plain copy from mos3pre-master-46
7 changed files with 84 additions and 2 deletions
-
2src/spicelib/devices/mos6/Makefile.am
-
34src/spicelib/devices/mos6/mos6del.c
-
4src/spicelib/devices/mos6/mos6init.c
-
40src/spicelib/devices/mos6/mos6mdel.c
-
2visualc/sharedspice.vcxproj
-
2visualc/vngspice-fftw.vcxproj
-
2visualc/vngspice.vcxproj
@ -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); |
|||
} |
|||
@ -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); |
|||
|
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue