Jspice3
b2del.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Hong June Park, Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "bsim2def.h"
11 #include "sperror.h"
12 #include "util.h"
13 
14 
15 int
16 B2delete(inModel,name,inInst)
17  GENmodel *inModel;
18  IFuid name;
19  GENinstance **inInst;
20 
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
GENERIC * IFuid
Definition: ifsim.h:72
#define NULL
Definition: spdefs.h:121
static char model[32]
Definition: subckt.c:76
struct sBSIM2model * B2nextModel
Definition: bsim2def.h:224
int B2delete(GENmodel *inModel, IFuid name, GENinstance **inInst)
Definition: b2del.c:16
IFuid B2name
Definition: bsim2def.h:21