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

Go to the source code of this file.

Functions

int URCdelete (GENmodel *inModel, IFuid name, GENinstance **inst)
 

Function Documentation

int URCdelete ( GENmodel inModel,
IFuid  name,
GENinstance **  inst 
)

Definition at line 16 of file urcdel.c.

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
#define FREE(ptr)
Definition: spdefs.h:436
IFuid URCname
Definition: urcdefs.h:24
#define OK
Definition: iferrmsg.h:17
#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