Jspice3
inppname.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 Thomas L. Quarles
5  1992 Stephen R. Whiteley
6 ****************************************************************************/
7 
8  /*
9  * INPpName()
10  *
11  * Take a parameter by Name and set it on the specified device
12  */
13 
14 #include "spice.h"
15 #include <stdio.h>
16 #include "inpdefs.h"
17 #include "iferrmsg.h"
18 
19 
20 int
21 INPpName(parm,val,ckt,dev,fast)
22 
23 char *parm; /* the name of the parameter to set */
24 IFvalue *val; /* the parameter union containing the value to set */
25 GENERIC *ckt; /* the circuit this device is a member of */
26 int dev; /* the device type code to the device being parsed */
27 GENERIC *fast; /* direct pointer to device being parsed */
28 {
29  int error; /* int to store evaluate error return codes in */
30  int i;
31 
32  for (i = 0; i < (*(*(ft_sim->devices)[dev]).numInstanceParms); i++) {
33  if (strcmp(parm,
34  ((*(ft_sim->devices)[dev]).instanceParms[i].keyword)) == 0) {
35  error = (*(ft_sim->setInstanceParm))(ckt,fast, (*(ft_sim->
36  devices)[dev]).instanceParms[i].id,val,(IFvalue*)NULL);
37  if (error) return (error);
38  break;
39  }
40  }
41  if (i == (*(*(ft_sim->devices)[dev]).numInstanceParms)) {
42  return (E_BADPARM);
43  }
44  return (OK);
45 }
int INPpName(char *parm, IFvalue *val, GENERIC *ckt, int dev, GENERIC *fast)
Definition: inppname.c:21
IFsimulator * ft_sim
Definition: main.c:111
#define E_BADPARM
Definition: iferrmsg.h:26
#define OK
Definition: iferrmsg.h:17
IFdevice ** devices
Definition: ifsim.h:461
#define NULL
Definition: spdefs.h:121
char GENERIC
Definition: ifsim.h:27