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

Go to the source code of this file.

Functions

int LTRAdelete (GENmodel *model, IFuid name, GENinstance **fast)
 

Function Documentation

int LTRAdelete ( GENmodel model,
IFuid  name,
GENinstance **  fast 
)

Definition at line 21 of file ltradel.c.

26 {
27  GENinstance **prev = NULL;
28  GENinstance *here;
29 
30  for ( ; model; model = model->GENnextModel) {
31  prev = &(model->GENinstances);
32  for (here = *prev; here; here = *prev) {
33  if (here->GENname == name || (fast && here == *fast)) {
34  *prev = here->GENnextInstance;
35  FREE(((LTRAinstance*)here)->LTRAv1);
36  FREE(((LTRAinstance*)here)->LTRAi1);
37  FREE(((LTRAinstance*)here)->LTRAv2);
38  FREE(((LTRAinstance*)here)->LTRAi2);
39  FREE(here);
40  return (OK);
41  }
42  prev = &(here->GENnextInstance);
43  }
44  }
45  return(E_NODEV);
46 }
#define E_NODEV
Definition: iferrmsg.h:22
struct sGENinstance * GENnextInstance
Definition: gendefs.h:26
struct sGENmodel * GENnextModel
Definition: gendefs.h:41
#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
GENinstance * GENinstances
Definition: gendefs.h:43
IFuid GENname
Definition: gendefs.h:28