devices/os6, introduce missing files mos6del.c and mos6mdel.c
For unknown reason, mos6 is missing MOS6mDelete() aka DEVmodDelete() and MOS6delete() aka DEVdelete()
This commit is contained in:
parent
c59983c5fc
commit
80d5614f49
|
|
@ -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 \
|
||||
|
|
|
|||
|
|
@ -0,0 +1,29 @@
|
|||
/**********
|
||||
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 *model, IFuid name, GENinstance **kill)
|
||||
{
|
||||
for (; model; model = model->GENnextModel) {
|
||||
GENinstance **prev = &(model->GENinstances);
|
||||
GENinstance *here = *prev;
|
||||
for (; here; here = *prev) {
|
||||
if (here->GENname == name || (kill && here == *kill)) {
|
||||
*prev = here->GENnextInstance;
|
||||
GENinstanceFree(here);
|
||||
return OK;
|
||||
}
|
||||
prev = &(here->GENnextInstance);
|
||||
}
|
||||
}
|
||||
|
||||
return E_NODEV;
|
||||
}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
/**********
|
||||
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 **models, IFuid modname, GENmodel *kill)
|
||||
{
|
||||
GENinstance *here;
|
||||
GENmodel **prev = models;
|
||||
GENmodel *model = *prev;
|
||||
|
||||
for (; model; model = model->GENnextModel) {
|
||||
if (model->GENmodName == modname || (kill && model == kill))
|
||||
break;
|
||||
prev = &(model->GENnextModel);
|
||||
}
|
||||
|
||||
if (!model)
|
||||
return E_NOMOD;
|
||||
|
||||
*prev = model->GENnextModel;
|
||||
for (here = model->GENinstances; here;) {
|
||||
GENinstance *next_instance = here->GENnextInstance;
|
||||
GENinstanceFree(here);
|
||||
here = next_instance;
|
||||
}
|
||||
GENmodelFree(model);
|
||||
return OK;
|
||||
}
|
||||
Loading…
Reference in New Issue