mutmdelete.c

来自「支持数字元件仿真的SPICE插件」· C语言 代码 · 共 46 行

C
46
字号
/* * Copyright (c) 1985 Thomas L. Quarles */#include "prefix.h"#include <stdio.h>#include "util.h"#include "INDdefs.h"#include "SPerror.h"#include "suffix.h"RCSID("MUTmDelete.c $Revision: 1.1 $ on $Date: 90/10/11 12:43:12 $")#ifdef MUTUALintMUTmDelete(inModel,modname,kill)    GENmodel **inModel;    IFuid modname;    GENmodel *kill;{    MUTmodel **model = (MUTmodel**)inModel;    MUTmodel *modfast = (MUTmodel*)kill;    MUTinstance *here;    MUTinstance *prev = NULL;    MUTmodel **oldmod;    oldmod = model;    for( ; *model ; model = &((*model)->MUTnextModel)) {        if( (*model)->MUTmodName == modname ||                 (modfast && *model == modfast) ) goto delgot;        oldmod = model;    }    return(E_NOMOD);delgot:    *oldmod = (*model)->MUTnextModel; /* cut deleted device out of list */    for(here = (*model)->MUTinstances ; here ; here = here->MUTnextInstance) {        if(prev) FREE(prev);        prev = here;    }    if(prev) FREE(prev);    FREE(*model);    return(OK);}#endif /* MUTUAL */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?