Jspice3
b2del.c File Reference
#include "spice.h"
#include <stdio.h>
#include "bsim2def.h"
#include "sperror.h"
#include "util.h"
Include dependency graph for b2del.c:

Go to the source code of this file.

Functions

int B2delete (GENmodel *inModel, IFuid name, GENinstance **inInst)
 

Function Documentation

int B2delete ( GENmodel inModel,
IFuid  name,
GENinstance **  inInst 
)

Definition at line 16 of file b2del.c.

21 {
22 
23  B2instance **fast = (B2instance**)inInst;
24  B2model *model = (B2model*)inModel;
25  B2instance **prev = NULL;
26  B2instance *here;
27 
28  for( ; model ; model = model->B2nextModel) {
29  prev = &(model->B2instances);
30  for(here = *prev; here ; here = *prev) {
31  if(here->B2name == name || (fast && here==*fast) ) {
32  *prev= here->B2nextInstance;
33  FREE(here);
34  return(OK);
35  }
36  prev = &(here->B2nextInstance);
37  }
38  }
39  return(E_NODEV);
40 }
B2instance * B2instances
Definition: bsim2def.h:226
struct sBSIM2instance * B2nextInstance
Definition: bsim2def.h:19
#define E_NODEV
Definition: iferrmsg.h:22
#define FREE(ptr)
Definition: spdefs.h:436
#define OK
Definition: iferrmsg.h:17
#define NULL
Definition: spdefs.h:121
static char model[32]
Definition: subckt.c:76
struct sBSIM2model * B2nextModel
Definition: bsim2def.h:224
IFuid B2name
Definition: bsim2def.h:21