Browse Source

forward declaration of structs, unions and typedefs

pre-master-46
rlar 16 years ago
parent
commit
a321d7f419
  1. 11
      ChangeLog
  2. 12
      src/include/cktdefs.h
  3. 18
      src/include/gendefs.h
  4. 27
      src/include/graph.h
  5. 46
      src/include/ifsim.h
  6. 23
      src/include/inpdefs.h
  7. 7
      src/include/tfdefs.h

11
ChangeLog

@ -1,7 +1,16 @@
2010-07-03 Robert Larice
* src/include/cktdefs.h ,
* src/include/gendefs.h ,
* src/include/graph.h ,
* src/include/ifsim.h ,
* src/include/inpdefs.h ,
* src/include/tfdefs.h :
forward declaration of structs, unions and typedefs
2010-07-02 Robert Larice 2010-07-02 Robert Larice
* src/spicelib/analysis/cktsens.c , * src/spicelib/analysis/cktsens.c ,
* src/xspice/mif/mifload.c : * src/xspice/mif/mifload.c :
ansi style function args for some function pointers
ansi style function args for some function pointers
2010-07-02 Holger Vogt 2010-07-02 Holger Vogt
* src/frontend/inpcom.c : .TITLE line added * src/frontend/inpcom.c : .TITLE line added

12
src/include/cktdefs.h

@ -30,8 +30,10 @@ extern int DEVmaxnum; /* Not sure if still used */
#include "pzdefs.h" #include "pzdefs.h"
#include "noisedef.h" #include "noisedef.h"
typedef struct CKTnode CKTnode;
typedef struct CKTcircuit CKTcircuit;
typedef struct sCKTnode {
struct CKTnode {
IFuid name; IFuid name;
int type; int type;
@ -44,10 +46,10 @@ typedef struct sCKTnode {
double ic; /* Value of the initial condition */ double ic; /* Value of the initial condition */
double nodeset; /* Value of the .nodeset option */ double nodeset; /* Value of the .nodeset option */
double *ptr; /* ??? */ double *ptr; /* ??? */
struct sCKTnode *next; /* pointer to the next node */
CKTnode *next; /* pointer to the next node */
unsigned int icGiven:1; /* FLAG ic given */ unsigned int icGiven:1; /* FLAG ic given */
unsigned int nsGiven:1; /* FLAG nodeset given */ unsigned int nsGiven:1; /* FLAG nodeset given */
} CKTnode;
};
/* defines for node parameters */ /* defines for node parameters */
#define PARM_NS 1 #define PARM_NS 1
@ -56,7 +58,7 @@ typedef struct sCKTnode {
typedef struct {
struct CKTcircuit {
/* gtri - begin - wbk - change declaration to allow dynamic sizing */ /* gtri - begin - wbk - change declaration to allow dynamic sizing */
@ -261,7 +263,7 @@ typedef struct {
#endif #endif
/* gtri - evt - wbk - 5/20/91 - add event-driven and enhancements data */ /* gtri - evt - wbk - 5/20/91 - add event-driven and enhancements data */
} CKTcircuit;
};
/* Now function prottypes */ /* Now function prottypes */

18
src/include/gendefs.h

@ -8,13 +8,17 @@ Author: 1985 Thomas L. Quarles
#include "ifsim.h" #include "ifsim.h"
typedef struct GENinstance GENinstance ;
typedef struct GENmodel GENmodel;
/* definitions used to describe generic devices */ /* definitions used to describe generic devices */
/* information used to describe a single instance */ /* information used to describe a single instance */
typedef struct sGENinstance {
struct sGENmodel *GENmodPtr; /* backpointer to model */
struct sGENinstance *GENnextInstance; /* pointer to next instance of
struct GENinstance {
GENmodel *GENmodPtr; /* backpointer to model */
GENinstance *GENnextInstance; /* pointer to next instance of
* current model*/ * current model*/
IFuid GENname; /* pointer to character string naming this instance */ IFuid GENname; /* pointer to character string naming this instance */
int GENowner; /* number of owner process */ int GENowner; /* number of owner process */
@ -26,7 +30,7 @@ typedef struct sGENinstance {
int GENnode5; /* appropriate node numbers */ int GENnode5; /* appropriate node numbers */
int GENnode6; /* added to create body node 01/06/99 */ int GENnode6; /* added to create body node 01/06/99 */
int GENnode7; /* added to create temp node 2/03/99 */ int GENnode7; /* added to create temp node 2/03/99 */
} GENinstance ;
};
/* Generic circuit data */ /* Generic circuit data */
@ -35,13 +39,13 @@ typedef void GENcircuit;
/* per model data */ /* per model data */
typedef struct sGENmodel { /* model structure for a resistor */
struct GENmodel { /* model structure for a resistor */
int GENmodType; /* type index of this device type */ int GENmodType; /* type index of this device type */
struct sGENmodel *GENnextModel; /* pointer to next possible model in
GENmodel *GENnextModel; /* pointer to next possible model in
* linked list */ * linked list */
GENinstance * GENinstances; /* pointer to list of instances that have this GENinstance * GENinstances; /* pointer to list of instances that have this
* model */ * model */
IFuid GENmodName; /* pointer to character string naming this model */ IFuid GENmodName; /* pointer to character string naming this model */
} GENmodel;
};
#endif /*GEN*/ #endif /*GEN*/

27
src/include/graph.h

@ -14,11 +14,15 @@ Author: 1988 Jeffrey M. Hsu
#include "plot.h" #include "plot.h"
#include "dvec.h" /* for struct dvec */ #include "dvec.h" /* for struct dvec */
typedef struct graph GRAPH;
struct _keyed;
/* Device-independent data structure for plots. */ /* Device-independent data structure for plots. */
#define NUMCOLORS 20 #define NUMCOLORS 20
typedef struct graph {
struct graph {
int graphid; int graphid;
struct dveclist *plotdata; /* normalized data */ struct dveclist *plotdata; /* normalized data */
char *plotname; /* name of plot this graph is in */ char *plotname; /* name of plot this graph is in */
@ -114,12 +118,7 @@ typedef struct graph {
/* characters the user typed on graph */ /* characters the user typed on graph */
/* note: think up better names */ /* note: think up better names */
struct _keyed {
char *text;
int x, y;
int colorindex; /* index into colors array */
struct _keyed *next;
} *keyed;
struct _keyed *keyed;
/* for zoomin */ /* for zoomin */
char *commandline; char *commandline;
@ -129,7 +128,19 @@ typedef struct graph {
*/ */
char *devdep; char *devdep;
} GRAPH;
};
/* characters the user typed on graph */
/* note: think up better names */
struct _keyed {
char *text;
int x, y;
int colorindex; /* index into colors array */
struct _keyed *next;
};
#define NEWGRAPH (GRAPH *) tmalloc(sizeof(GRAPH)) #define NEWGRAPH (GRAPH *) tmalloc(sizeof(GRAPH))

46
src/include/ifsim.h

@ -14,6 +14,16 @@ Author: 1986 Thomas L. Quarles
/* gtri - end - wbk - 10/11/90 */ /* gtri - end - wbk - 10/11/90 */
typedef struct IFparm IFparm;
typedef union IFvalue IFvalue;
typedef struct IFparseTree IFparseTree;
typedef struct IFcomplex IFcomplex;
typedef struct IFdevice IFdevice;
typedef struct IFanalysis IFanalysis;
typedef struct IFsimulator IFsimulator;
typedef struct IFfrontEnd IFfrontEnd;
/* /*
* structure: IFparm * structure: IFparm
* *
@ -38,12 +48,12 @@ Author: 1986 Thomas L. Quarles
* used for. * used for.
*/ */
typedef struct sIFparm {
struct IFparm {
char *keyword; char *keyword;
int id; int id;
int dataType; int dataType;
char *description; char *description;
} IFparm;
};
/* /*
* *
@ -156,16 +166,16 @@ typedef char *IFuid;
* *
*/ */
typedef struct sIFparseTree {
struct IFparseTree {
int numVars; /* number of variables used */ int numVars; /* number of variables used */
int *varTypes; /* array of types of variables */ int *varTypes; /* array of types of variables */
union uIFvalue * vars; /* array of structures describing values */
IFvalue * vars; /* array of structures describing values */
#ifdef __STDC__ #ifdef __STDC__
int ((*IFeval)(struct sIFparseTree*,double,double*,double*,double*));
int ((*IFeval)(IFparseTree*,double,double*,double*,double*));
#else #else
int ((*IFeval)()); /* function to call to get evaluated */ int ((*IFeval)()); /* function to call to get evaluated */
#endif /* STDC */ #endif /* STDC */
} IFparseTree;
};
/* /*
@ -217,13 +227,13 @@ typedef void * IFnode;
/* /*
* and of course, the standard complex data type * and of course, the standard complex data type
*/ */
typedef struct sIFcomplex {
struct IFcomplex {
double real; double real;
double imag; double imag;
} IFcomplex;
};
typedef union uIFvalue {
union IFvalue {
int iValue; /* integer or flag valued data */ int iValue; /* integer or flag valued data */
double rValue; /* real valued data */ double rValue; /* real valued data */
IFcomplex cValue; /* complex valued data */ IFcomplex cValue; /* complex valued data */
@ -242,7 +252,7 @@ typedef union uIFvalue {
IFnode *nVec; /* pointer to node vector */ IFnode *nVec; /* pointer to node vector */
}vec; }vec;
}v; }v;
} IFvalue;
};
/* /*
@ -261,7 +271,7 @@ typedef union uIFvalue {
* *
*/ */
typedef struct sIFdevice {
struct IFdevice {
char *name; /* name of this type of device */ char *name; /* name of this type of device */
char *description; /* description of this type of device */ char *description; /* description of this type of device */
@ -293,7 +303,7 @@ typedef struct sIFdevice {
#endif #endif
int flags; /* DEV_ */ int flags; /* DEV_ */
} IFdevice;
};
/* /*
@ -310,14 +320,14 @@ typedef struct sIFdevice {
* *
*/ */
typedef struct sIFanalysis {
struct IFanalysis {
char *name; /* name of this analysis type */ char *name; /* name of this analysis type */
char *description; /* description of this type of analysis */ char *description; /* description of this type of analysis */
int numParms; /* number of analysis parameter descriptors */ int numParms; /* number of analysis parameter descriptors */
IFparm *analysisParms; /* array of analysis parameter descriptors */ IFparm *analysisParms; /* array of analysis parameter descriptors */
} IFanalysis;
};
/* /*
@ -331,7 +341,7 @@ typedef struct sIFanalysis {
* *
*/ */
typedef struct sIFsimulator {
struct IFsimulator {
char *simulator; /* the simulator's name */ char *simulator; /* the simulator's name */
char *description; /* description of this simulator */ char *description; /* description of this simulator */
char *version; /* version or revision level of simulator*/ char *version; /* version or revision level of simulator*/
@ -410,7 +420,7 @@ typedef struct sIFsimulator {
int numSpecSigs; /* number of special signals legal in parse trees */ int numSpecSigs; /* number of special signals legal in parse trees */
char **specSigs; /* names of special signals legal in parse trees */ char **specSigs; /* names of special signals legal in parse trees */
} IFsimulator;
};
/* /*
* Structure: IFfrontEnd * Structure: IFfrontEnd
@ -422,7 +432,7 @@ typedef struct sIFsimulator {
* *
*/ */
typedef struct sIFfrontEnd {
struct IFfrontEnd {
int ((*IFnewUid)(void*,IFuid*,IFuid,char*,int,void**)); int ((*IFnewUid)(void*,IFuid*,IFuid,char*,int,void**));
/* create a new UID in the circuit */ /* create a new UID in the circuit */
int ((*IFdelUid)(void*,IFuid,int)); int ((*IFdelUid)(void*,IFuid,int));
@ -455,7 +465,7 @@ typedef struct sIFfrontEnd {
/* end nested domain */ /* end nested domain */
int ((*OUTattributes)(void *,IFuid,int,IFvalue*)); int ((*OUTattributes)(void *,IFuid,int,IFvalue*));
/* specify output attributes of node */ /* specify output attributes of node */
} IFfrontEnd;
};
/* flags for the first argument to IFerror */ /* flags for the first argument to IFerror */
#define ERR_WARNING 0x1 #define ERR_WARNING 0x1

23
src/include/inpdefs.h

@ -13,6 +13,11 @@ Modified: 2000 AlansFixes
#include "gendefs.h" #include "gendefs.h"
#include "inpptree.h" #include "inpptree.h"
typedef struct INPtables INPtables;
typedef struct card card;
typedef struct INPmodel INPmodel;
struct INPtab { struct INPtab {
char *t_ent; char *t_ent;
struct INPtab *t_next; struct INPtab *t_next;
@ -24,7 +29,7 @@ struct INPnTab {
struct INPnTab *t_next; struct INPnTab *t_next;
}; };
typedef struct sINPtables{
struct INPtables{
struct INPtab **INPsymtab; struct INPtab **INPsymtab;
struct INPnTab **INPtermsymtab; struct INPnTab **INPtermsymtab;
int INPsize; int INPsize;
@ -54,26 +59,26 @@ typedef struct sINPtables{
void *defWmod; void *defWmod;
void *defYmod; void *defYmod;
void *defZmod; void *defZmod;
} INPtables;
};
typedef struct card{
struct card{
int linenum; int linenum;
int linenum_orig; int linenum_orig;
char *line; char *line;
char *error; char *error;
struct card *nextcard;
struct card *actualLine;
} card;
card *nextcard;
card *actualLine;
};
/* structure used to save models in after they are read during pass 1 */ /* structure used to save models in after they are read during pass 1 */
typedef struct sINPmodel{
struct INPmodel{
IFuid INPmodName; /* uid of model */ IFuid INPmodName; /* uid of model */
int INPmodType; /* type index of device type */ int INPmodType; /* type index of device type */
struct sINPmodel *INPnextModel; /* link to next model */
INPmodel *INPnextModel; /* link to next model */
int INPmodUsed; /* flag to indicate it has already been used */ int INPmodUsed; /* flag to indicate it has already been used */
card *INPmodLine; /* pointer to line describing model */ card *INPmodLine; /* pointer to line describing model */
void *INPmodfast; /* high speed pointer to model for access */ void *INPmodfast; /* high speed pointer to model for access */
} INPmodel;
};

7
src/include/tfdefs.h

@ -10,9 +10,12 @@ Author: 1985 Thomas L. Quarles
#include "tskdefs.h" #include "tskdefs.h"
#include "cktdefs.h" #include "cktdefs.h"
typedef struct TFan TFan;
/* TFdefs.h - defs for transfer function analyses */ /* TFdefs.h - defs for transfer function analyses */
typedef struct {
struct TFan {
int JOBtype; int JOBtype;
JOB *JOBnextJob; JOB *JOBnextJob;
IFuid JOBname; IFuid JOBname;
@ -25,7 +28,7 @@ typedef struct {
unsigned int TFoutIsI :1; unsigned int TFoutIsI :1;
unsigned int TFinIsV :1; unsigned int TFinIsV :1;
unsigned int TFinIsI :1; unsigned int TFinIsI :1;
} TFan;
};
#define TF_OUTPOS 1 #define TF_OUTPOS 1
#define TF_OUTNEG 2 #define TF_OUTNEG 2

Loading…
Cancel
Save