Jspice3
pzprse.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: 1987 Thomas L. Quarles
5  1993 Stephen R. Whiteley
6 ****************************************************************************/
7 
8 #include "spice.h"
9 #include "ftedefs.h"
10 #include "inpdefs.h"
11 #include "inpmacs.h"
12 #include "misc.h"
13 
14 
15 /* ARGSUSED */
16 int
17 PZparse(ckt,tab,which,currentp,line,task,gnode)
18 
19 /* .pz nodeI nodeG nodeJ nodeK {V I} {POL ZER PZ} */
20 GENERIC *ckt;
21 INPtables *tab;
22 int which;
23 GENERIC *currentp;
24 char **line;
25 GENERIC *task;
26 GENERIC *gnode;
27 {
28  char *steptype; /* type of stepping function */
29  GENERIC *foo; /* pointer to analysis */
30  IFvalue ptemp; /* a value structure to package stuff into */
31  IFvalue *parm; /* a pointer to a value struct for function returns */
32  int error; /* error code temporary */
33  card *current = (card *)currentp;
34 
35  IFC(newAnalysis,(ckt,which,"pole-zero analysis",&foo, task))
36 
37  parm = INPgetValue(ckt,line,IF_NODE,tab);
38  GCA(INPapName,(ckt,which,foo,"nodei",parm))
39 
40  parm = INPgetValue(ckt,line,IF_NODE,tab);
41  GCA(INPapName,(ckt,which,foo,"nodeg",parm))
42 
43  parm = INPgetValue(ckt,line,IF_NODE,tab);
44  GCA(INPapName,(ckt,which,foo,"nodej",parm))
45 
46  parm = INPgetValue(ckt,line,IF_NODE,tab);
47  GCA(INPapName,(ckt,which,foo,"nodek",parm))
48 
49  INPgetTok(line,&steptype,1); /* get V or I */
50  steptype[1] = '\0';
51  strtolower(steptype);
52  if (*steptype == 'c') /* recognize "cur" */
53  *steptype = 'i';
54  ptemp.iValue = 1;
55  GCA(INPapName,(ckt,which,foo,steptype,&ptemp))
56  txfree(steptype);
57 
58  INPgetTok(line,&steptype,1); /* get POL, ZER, or PZ */
59  steptype[3] = '\0'; /* "pole", "zero" OK */
60  strtolower(steptype);
61  ptemp.iValue = 1;
62  GCA(INPapName,(ckt,which,foo,steptype,&ptemp))
63  txfree(steptype);
64 
65  return (0);
66 }
IFvalue * INPgetValue()
Definition: inpdefs.h:62
Definition: subckt.c:51
int iValue
Definition: ifsim.h:232
Definition: fteinp.h:14
void txfree()
void strtolower()
#define GCA(func, args)
Definition: inpmacs.h:27
#define IFC(func, args)
Definition: inpmacs.h:19
int PZparse(GENERIC *ckt, INPtables *tab, int which, GENERIC *currentp, char **line, GENERIC *task, GENERIC *gnode)
Definition: pzprse.c:17
int INPapName()
#define IF_NODE
Definition: ifsim.h:110
char GENERIC
Definition: ifsim.h:27
int INPgetTok()