Jspice3
urcdel.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 Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "urcdefs.h"
11 #include "sperror.h"
12 #include "util.h"
13 
14 
15 int
16 URCdelete(inModel,name,inst)
17  GENmodel *inModel;
18  IFuid name;
19  GENinstance **inst;
20 {
21  URCmodel *model = (URCmodel *)inModel;
22  URCinstance **fast = (URCinstance**)inst;
23  URCinstance **prev = NULL;
24  URCinstance *here;
25 
26  for( ; model ; model = model->URCnextModel) {
27  prev = &(model->URCinstances);
28  for(here = *prev; here ; here = *prev) {
29  if(here->URCname == name || (fast && here==*fast) ) {
30  *prev= here->URCnextInstance;
31  FREE(here);
32  return(OK);
33  }
34  prev = &(here->URCnextInstance);
35  }
36  }
37  return(E_NODEV);
38 }
#define E_NODEV
Definition: iferrmsg.h:22
int URCdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
Definition: urcdel.c:16
#define FREE(ptr)
Definition: spdefs.h:436
IFuid URCname
Definition: urcdefs.h:24
#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
URCinstance * URCinstances
Definition: urcdefs.h:43
struct sURCinstance * URCnextInstance
Definition: urcdefs.h:22
struct sURCmodel * URCnextModel
Definition: urcdefs.h:41