Jspice3
ckttemp.c
Go to the documentation of this file.
1 /***************************************************************************
2 JSPICE3 adaptation of Spice3f2 - 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  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8  /* CKTtemp(ckt)
9  * this is a driver program to iterate through all the various
10  * temperature dependency functions provided for the circuit
11  * elements in the given circuit
12  */
13 
14 #include "spice.h"
15 #include <stdio.h>
16 #include "devdefs.h"
17 #include "const.h"
18 #include "sperror.h"
19 #include "cktext.h"
20 
21 
22 extern SPICEdev *DEVices[];
23 
24 int
25 CKTtemp(ckt)
26 
27 CKTcircuit *ckt;
28 {
29  int error;
30  struct sCKTmodHead *mh;
31  int (*func)();
32 
33  ckt->CKTvt = CONSTKoverQ * ckt->CKTtemp;
34 
35  for (mh = ckt->CKTheadList; mh != NULL; mh = mh->next) {
36  if ((func = DEVices[mh->type]->DEVtemperature) != NULL) {
37  error = (*func)(mh->head,ckt);
38  if (error) return (error);
39  }
40  }
41  return (OK);
42 }
struct sCKTmodHead * next
Definition: cktdefs.h:58
double CONSTKoverQ
Definition: main.c:915
#define OK
Definition: iferrmsg.h:17
int(* DEVtemperature)()
Definition: devdefs.h:95
#define NULL
Definition: spdefs.h:121
SPICEdev * DEVices[]
Definition: sconfig.c:109
int CKTtemp(CKTcircuit *ckt)
Definition: ckttemp.c:25
Definition: fteparse.h:37
int type
Definition: cktdefs.h:56
GENmodel * head
Definition: cktdefs.h:57