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

Go to the source code of this file.

Functions

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

Function Documentation

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

Definition at line 21 of file gendel.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(here);
36  return (OK);
37  }
38  prev = &(here->GENnextInstance);
39  }
40  }
41  return(E_NODEV);
42 }
#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