devices/**/XXXdel.c, fix adms too
This commit is contained in:
parent
5ecf02796b
commit
eaa1fb7521
|
|
@ -40,35 +40,29 @@
|
|||
<admst:template match="code">
|
||||
<admst:value-of select="attribute[name='ngspicename']/value"/>
|
||||
<admst:variable name="module" select="%s"/>
|
||||
|
||||
#include "ngspice/ngspice.h"
|
||||
#include "$(module)defs.h"
|
||||
#include "ngspice/sperror.h"
|
||||
#include "ngspice/suffix.h"
|
||||
|
||||
int $(module)delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
|
||||
|
||||
int
|
||||
$(module)delete(GENmodel *model, IFuid name, GENinstance **kill)
|
||||
{
|
||||
register $(module)model *model = ($(module)model*)inModel;
|
||||
register $(module)instance **fast =($(module)instance**)inInst;
|
||||
|
||||
$(module)instance **prev = NULL;
|
||||
$(module)instance *here;
|
||||
|
||||
for ( ; model ; model = model->$(module)nextModel ) {
|
||||
prev = &(model->$(module)instances);
|
||||
for (here = *prev; here ; here = *prev) {
|
||||
if(here->$(module)name == name || (fast && here==*fast) ) {
|
||||
*prev = here->$(module)nextInstance;
|
||||
FREE(here);
|
||||
return(OK);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return(E_NODEV);
|
||||
}
|
||||
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;
|
||||
FREE(here);
|
||||
return OK;
|
||||
}
|
||||
prev = &(here->GENnextInstance);
|
||||
}
|
||||
}
|
||||
|
||||
return E_NODEV;
|
||||
}
|
||||
</admst:template>
|
||||
|
||||
<admst:for-each select="/module">
|
||||
|
|
|
|||
Loading…
Reference in New Issue