Jspice3
dctprse.c File Reference
#include "spice.h"
#include "ftedefs.h"
#include "inpdefs.h"
#include "inpmacs.h"
#include "misc.h"
Include dependency graph for dctprse.c:

Go to the source code of this file.

Functions

int DCTparse (GENERIC *ckt, INPtables *tab, int which, GENERIC *currentp, char **line, GENERIC *task, GENERIC *gnode)
 
int ParseDC (GENERIC *ckt, char **line, card *current, int which, GENERIC *aptr, INPtables *tab, int index)
 

Function Documentation

int DCTparse ( GENERIC ckt,
INPtables tab,
int  which,
GENERIC currentp,
char **  line,
GENERIC task,
GENERIC gnode 
)

Definition at line 16 of file dctprse.c.

29 {
30  GENERIC *foo; /* pointer to analysis */
31  int error; /* error code temporary */
32  card *current = (card *)currentp;
33 
34  IFC(newAnalysis,(ckt,which,"DCtransferCurve",&foo, task))
35 
36  GCA(ParseDC,(ckt,line,current,which,foo,tab,1))
37 
38  if (**line) {
39  GCA(ParseDC,(ckt,line,current,which,foo,tab,2))
40  }
41  return (0);
42 }
if(TDesc==NULL)
Definition: cd.c:1326
int ParseDC(GENERIC *ckt, char **line, card *current, int which, GENERIC *aptr, INPtables *tab, int index)
Definition: dctprse.c:46
Definition: inpdefs.h:62
Definition: fteinp.h:14
#define GCA(func, args)
Definition: inpmacs.h:27
#define IFC(func, args)
Definition: inpmacs.h:19
char GENERIC
Definition: ifsim.h:27
int ParseDC ( GENERIC ckt,
char **  line,
card current,
int  which,
GENERIC aptr,
INPtables tab,
int  index 
)

Definition at line 46 of file dctprse.c.

55 {
56  char *name; /* the device's name */
57  IFvalue ptemp; /* a value structure to package stuff into */
58  int error; /* error code temporary */
59  double vstart, vstop, vstep;
60  char buf[32];
61 
62  INPgetTok(line,&name,1);
63  strtolower(name);
64  INPinsert(&name,tab);
65  ptemp.uValue = name;
66  sprintf(buf,"name%d",index);
67  GCA(INPapName,(ckt,which,aptr,buf,&ptemp))
68 
69  vstart = INPevaluate(line,&error,1); /* vstart */
70  if (error == 0) {
71  ptemp.rValue = vstart;
72  sprintf(buf,"start%d",index);
73  GCA(INPapName,(ckt,which,aptr,buf,&ptemp))
74  }
75  else {
76  LITERR("Bad vstart parameter.")
77  }
78 
79  vstop = INPevaluate(line,&error,1); /* vstop? */
80  if (error == 0) {
81  ptemp.rValue = vstop;
82  sprintf(buf,"stop%d",index);
83  GCA(INPapName,(ckt,which,aptr,buf,&ptemp))
84  vstep = INPevaluate(line,&error,1); /* vstep? */
85  if (error == 0)
86  ptemp.rValue = vstep;
87  else
88  ptemp.rValue = vstop - vstart;
89  sprintf(buf,"step%d",index);
90  GCA(INPapName,(ckt,which,aptr,buf,&ptemp))
91  }
92  else {
93  ptemp.rValue = vstart;
94  sprintf(buf,"stop%d",index);
95  GCA(INPapName,(ckt,which,aptr,buf,&ptemp))
96  ptemp.rValue = 0.0;
97  sprintf(buf,"step%d",index);
98  GCA(INPapName,(ckt,which,aptr,buf,&ptemp))
99  }
100 
101  return (0);
102 }
static char buf[MAXPROMPT]
Definition: arg.c:18
if(TDesc==NULL)
Definition: cd.c:1326
double INPevaluate()
double step
Definition: outdata.h:26
double rValue
Definition: ifsim.h:233
#define LITERR(text)
Definition: inpmacs.h:35
int INPinsert()
Definition: fteinp.h:14
Definition: cddefs.h:237
void strtolower()
#define GCA(func, args)
Definition: inpmacs.h:27
int INPapName()
return(True)
char * index(char *s, char c) const
Definition: string.c:294
IFuid uValue
Definition: ifsim.h:236
int INPgetTok()