Jspice3
swparam.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3e2 - Copyright (c) Stephen R. Whiteley 1992
3 Copyright 1990 Regents of the University of California. All rights reserved.
4 Authors: 1985 Gordon M. Jacobs
5  1992 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include <stdio.h>
10 #include "swdefs.h"
11 #include "sperror.h"
12 #include "util.h"
13 
14 
15 /*ARGSUSED*/
16 int
17 SWparam(ckt,param,value,inst,select)
18 
19 CKTcircuit *ckt;
20 int param;
21 IFvalue *value;
22 GENinstance *inst;
23 IFvalue *select;
24 {
25  SWinstance *here = (SWinstance *)inst;
26 
27  switch (param) {
28 
29  case SW_IC_ON:
30  if (value->iValue) {
31  here->SWzero_stateGiven = TRUE;
32  }
33  break;
34  case SW_IC_OFF:
35  if (value->iValue) {
36  here->SWzero_stateGiven = FALSE;
37  }
38  break;
39  case SW_CONTROL:
40  here->SWcontName = value->uValue;
41  break;
42  default:
43  return (E_BADPARM);
44  }
45  return (OK);
46 }
IFuid SWcontName
Definition: swdefs.h:30
#define FALSE
Definition: mfb.h:23
#define SW_IC_OFF
Definition: swdefs.h:87
#define SW_IC_ON
Definition: swdefs.h:86
int SWparam(CKTcircuit *ckt, int param, IFvalue *value, GENinstance *inst, IFvalue *select)
Definition: swparam.c:17
#define E_BADPARM
Definition: iferrmsg.h:26
#define TRUE
Definition: util.h:27
int iValue
Definition: ifsim.h:232
#define OK
Definition: iferrmsg.h:17
unsigned SWzero_stateGiven
Definition: swdefs.h:43
#define SW_CONTROL
Definition: swdefs.h:92
IFuid uValue
Definition: ifsim.h:236