swmdelete.c
来自「支持数字元件仿真的SPICE插件」· C语言 代码 · 共 44 行
C
44 行
/* * Copyright (c) 1985 Gordon Jacobs */#include "prefix.h"#include <stdio.h>#include "SWdefs.h"#include "util.h"#include "SPerror.h"#include "suffix.h"RCSID("SWmDelete.c $Revision: 1.1 $ on $Date: 90/10/11 12:46:23 $")intSWmDelete(inModel,modname,kill) GENmodel **inModel; IFuid modname; GENmodel *kill;{ SWmodel **model = (SWmodel **)inModel; SWmodel *modfast = (SWmodel *)kill; SWinstance *here; SWinstance *prev = NULL; SWmodel **oldmod; oldmod = model; for( ; *model ; model = &((*model)->SWnextModel)) { if( (*model)->SWmodName == modname || (modfast && *model == modfast) ) goto delgot; oldmod = model; } return(E_NOMOD);delgot: *oldmod = (*model)->SWnextModel; /* cut deleted device out of list */ for(here = (*model)->SWinstances ; here ; here = here->SWnextInstance) { if(prev) FREE(prev); prev = here; } if(prev) FREE(prev); FREE(*model); return(OK);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?