Code cleaned. Added compilation of TXLfindBr and TXLaccept but non included into device.

This commit is contained in:
pnenzi 2003-12-31 16:12:08 +00:00
parent bcfdf3885a
commit a8aa5e2c41
15 changed files with 36 additions and 75 deletions

View File

@ -4,8 +4,10 @@ noinst_LIBRARIES = libtxl.a
libtxl_a_SOURCES = \ libtxl_a_SOURCES = \
txl.c \ txl.c \
txlacct.c \
txlask.c \ txlask.c \
txldest.c \ txldest.c \
txlfbr.c \
txlload.c \ txlload.c \
txlmdel.c \ txlmdel.c \
txlparam.c \ txlparam.c \

View File

@ -6,7 +6,6 @@ Author: 1992 Charles Hough
#include "ngspice.h" #include "ngspice.h"
#include <math.h>
#include "cktdefs.h" #include "cktdefs.h"
#include "txldefs.h" #include "txldefs.h"
#include "sperror.h" #include "sperror.h"
@ -14,14 +13,12 @@ Author: 1992 Charles Hough
int int
TXLaccept(ckt,inModel) TXLaccept(CKTcircuit *ckt, GENmodel *inModel)
register CKTcircuit *ckt;
GENmodel *inModel;
/* set up the breakpoint table. /* set up the breakpoint table.
*/ */
{ {
register TXLmodel *model = (TXLmodel *)inModel; TXLmodel *model = (TXLmodel *)inModel;
register TXLinstance *here; TXLinstance *here;
int hint; int hint;
double h, v, v1; double h, v, v1;
NODE *nd; NODE *nd;

View File

@ -6,7 +6,6 @@ Author: 1992 Charles Hough
#include "ngspice.h" #include "ngspice.h"
#include <math.h>
#include "const.h" #include "const.h"
#include "txldefs.h" #include "txldefs.h"
#include "ifsim.h" #include "ifsim.h"
@ -17,12 +16,7 @@ Author: 1992 Charles Hough
/*ARGSUSED*/ /*ARGSUSED*/
int int
TXLask(ckt,inst,which,value,select) TXLask(CKTcircuit *ckt, GENinstance *inst, int which, IFvalue *value, IFvalue *select)
CKTcircuit *ckt;
GENinstance *inst;
int which;
IFvalue *value;
IFvalue *select;
{ {
TXLinstance *fast = (TXLinstance *)inst; TXLinstance *fast = (TXLinstance *)inst;
switch(which) { switch(which) {
@ -32,9 +26,9 @@ TXLask(ckt,inst,which,value,select)
case TXL_IN_NODE: case TXL_IN_NODE:
value->iValue = fast->TXLposNode; value->iValue = fast->TXLposNode;
return(OK); return(OK);
case TXL_LENGTH: case TXL_LENGTH:
value->rValue = fast->TXLlength; value->rValue = fast->TXLlength;
return(OK); return(OK);
default: default:
return(E_BADPARM); return(E_BADPARM);
} }

View File

@ -28,6 +28,7 @@ typedef struct sTXLinstance {
TXLine *txline2; /* pointer to SWEC txline type. temporary storage */ TXLine *txline2; /* pointer to SWEC txline type. temporary storage */
char *in_node_name; char *in_node_name;
char *out_node_name; char *out_node_name;
int TXLbranch; /* unused */
double *TXLposPosptr; double *TXLposPosptr;
double *TXLposNegptr; double *TXLposNegptr;
@ -47,7 +48,7 @@ typedef struct sTXLinstance {
unsigned TXLibr1Given : 1; unsigned TXLibr1Given : 1;
unsigned TXLibr2Given : 1; unsigned TXLibr2Given : 1;
unsigned TXLdcGiven : 1; unsigned TXLdcGiven : 1;
unsigned TXLlengthgiven : 1; /* flag to indicate C was specified */ unsigned TXLlengthgiven : 1; /* flag to indicate C was specified */
} TXLinstance ; } TXLinstance ;

View File

@ -12,10 +12,7 @@ Author: 1992 Charles Hough
int int
TXLdelete(inModel,name,inst) TXLdelete(GENmodel *inModel, IFuid name, GENinstance **inst)
GENmodel *inModel;
IFuid name;
GENinstance **inst;
{ {
TXLmodel *model = (TXLmodel *)inModel; TXLmodel *model = (TXLmodel *)inModel;
TXLinstance **fast = (TXLinstance **)inst; TXLinstance **fast = (TXLinstance **)inst;

View File

@ -11,8 +11,7 @@ Author: 1992 Charles Hough
void void
TXLdestroy(inModel) TXLdestroy(GENmodel **inModel)
GENmodel **inModel;
{ {
TXLmodel **model = (TXLmodel **)inModel; TXLmodel **model = (TXLmodel **)inModel;
TXLinstance *here; TXLinstance *here;

View File

@ -1,19 +1,13 @@
#ifdef __STDC__
/* extern int TXLaccept(CKTcircuit*,GENmodel*); */ extern int TXLaccept(CKTcircuit*,GENmodel*);
extern int TXLask(CKTcircuit*, GENinstance*, int, IFvalue*, IFvalue*);
extern int TXLdelete(GENmodel*,IFuid,GENinstance**); extern int TXLdelete(GENmodel*,IFuid,GENinstance**);
extern void TXLdestroy(GENmodel**); extern void TXLdestroy(GENmodel**);
extern int TXLfindBr(CKTcircuit*, GENmodel*, IFuid);
extern int TXLload(GENmodel*,CKTcircuit*); extern int TXLload(GENmodel*,CKTcircuit*);
extern int TXLmodAsk(CKTcircuit*, GENmodel*, int, IFvalue*);
extern int TXLmDelete(GENmodel**,IFuid,GENmodel*); extern int TXLmDelete(GENmodel**,IFuid,GENmodel*);
extern int TXLmParam(int,IFvalue*,GENmodel*); extern int TXLmParam(int,IFvalue*,GENmodel*);
extern int TXLparam(int,IFvalue*,GENinstance*,IFvalue*); extern int TXLparam(int,IFvalue*,GENinstance*,IFvalue*);
extern int TXLsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*); extern int TXLsetup(SMPmatrix*,GENmodel*,CKTcircuit*,int*);
#else /* stdc */
/* extern int TXLaccept(); */
extern int TXLdelete();
extern void TXLdestroy();
extern int TXLload();
extern int TXLmDelete();
extern int TXLmParam();
extern int TXLparam();
extern int TXLsetup();
#endif /* stdc */

View File

@ -13,13 +13,10 @@ Author: 1992 Charles Hough
int int
TXLfindBr(ckt,inModel,name) TXLfindBr(CKTcircuit *ckt, GENmodel *inModel, IFuid name)
register CKTcircuit *ckt;
GENmodel *inModel;
register IFuid name;
{ {
register TXLmodel *model = (TXLmodel *)inModel; TXLmodel *model = (TXLmodel *)inModel;
register TXLinstance *here; TXLinstance *here;
int error; int error;
CKTnode *tmp; CKTnode *tmp;

View File

@ -53,15 +53,15 @@ SPICEdev TXLinfo = {
DEVpzSetup : NULL, DEVpzSetup : NULL,
DEVtemperature: NULL, DEVtemperature: NULL,
DEVtrunc : NULL, DEVtrunc : NULL,
DEVfindBranch : NULL, /* TXLfindBranch, */ DEVfindBranch : NULL, /* TXLfindBranch default: disabled */
DEVacLoad : TXLload, /* ac load */ DEVacLoad : TXLload, /* ac load */
DEVaccept : NULL, DEVaccept : NULL, /* TXLaccept default: disabled */
DEVdestroy : TXLdestroy, DEVdestroy : TXLdestroy,
DEVmodDelete : TXLmDelete, DEVmodDelete : TXLmDelete,
DEVdelete : TXLdelete, DEVdelete : TXLdelete,
DEVsetic : NULL, DEVsetic : NULL,
DEVask : NULL, DEVask : TXLask,
DEVmodAsk : NULL, DEVmodAsk : TXLmodAsk,
DEVpzLoad : NULL, DEVpzLoad : NULL,
DEVconvTest : NULL, DEVconvTest : NULL,
DEVsenSetup : NULL, DEVsenSetup : NULL,

View File

@ -26,12 +26,10 @@ static void copy_tx();
/*ARGSUSED*/ /*ARGSUSED*/
int int
TXLload(inModel,ckt) TXLload(GENmodel *inModel, CKTcircuit *ckt)
GENmodel *inModel;
CKTcircuit *ckt;
{ {
register TXLmodel *model = (TXLmodel *)inModel; TXLmodel *model = (TXLmodel *)inModel;
register TXLinstance *here; TXLinstance *here;
TXLine *tx, *tx2; TXLine *tx, *tx2;
int k, l; int k, l;
int time, time2; int time, time2;

View File

@ -18,11 +18,7 @@ Author: 1992 Charles Hough
/* ARGSUSED */ /* ARGSUSED */
int int
TXLmodAsk(ckt,inModel,which,value) TXLmodAsk(CKTcircuit *ckt, GENmodel *inModel, int which, IFvalue *value)
CKTcircuit *ckt;
GENmodel *inModel;
int which;
IFvalue *value;
{ {
TXLmodel *model = (TXLmodel *)inModel; TXLmodel *model = (TXLmodel *)inModel;
switch(which) { switch(which) {

View File

@ -12,10 +12,7 @@ Author: 1992 Charles Hough
int int
TXLmDelete(inModel,modname,kill) TXLmDelete(GENmodel **inModel, IFuid modname, GENmodel *kill)
GENmodel **inModel;
IFuid modname;
GENmodel *kill;
{ {
TXLmodel **model = (TXLmodel **)inModel; TXLmodel **model = (TXLmodel **)inModel;
TXLmodel *modfast = (TXLmodel *)kill; TXLmodel *modfast = (TXLmodel *)kill;

View File

@ -14,10 +14,7 @@ Author: 1992 Charles Hough
int int
TXLmParam(param,value,inModel) TXLmParam(int param, IFvalue *value, GENmodel *inModel)
int param;
IFvalue *value;
GENmodel *inModel;
{ {
register TXLmodel *model = (TXLmodel *)inModel; register TXLmodel *model = (TXLmodel *)inModel;
switch(param) { switch(param) {

View File

@ -14,11 +14,7 @@ Author: 1992 Charles Hough
/* ARGSUSED */ /* ARGSUSED */
int int
TXLparam(param,value,inst,select) TXLparam(int param, IFvalue *value, GENinstance *inst, IFvalue *select)
int param;
IFvalue *value;
GENinstance *inst;
IFvalue *select;
{ {
TXLinstance *here = (TXLinstance *)inst; TXLinstance *here = (TXLinstance *)inst;
switch(param) { switch(param) {

View File

@ -75,14 +75,10 @@ static double AA[3][4];
/* ARGSUSED */ /* ARGSUSED */
int int
TXLsetup(matrix,inModel,ckt,state) TXLsetup(SMPmatrix *matrix, GENmodel *inModel, CKTcircuit*ckt, int *state)
register SMPmatrix *matrix;
GENmodel *inModel;
CKTcircuit*ckt;
int *state;
{ {
register TXLmodel *model = (TXLmodel *)inModel; TXLmodel *model = (TXLmodel *)inModel;
register TXLinstance *here; TXLinstance *here;
CKTnode *tmp; CKTnode *tmp;
int error; int error;