#include "complex.h"

typedef char *POINTER, *STRING;

/* each section of the transmission line is characterized by
   its abcd matrix, sometimes called the transmission matrix,
   which is a 2x2 matrix containing COMPLEX elements */

typedef struct {

	COMPLEX a;
	COMPLEX b;
	COMPLEX c;
	COMPLEX d;

	} ABCD;

/* typedef of a pointer to a function which returns an ABCD matrix */

typedef ABCD (*PFM)();

/* the data structure for the line is a linked list:
   each element is a twoport network modelled by abcd parameters,
   and each element contains a pointer to the twoport on the
   right (which is NULL for the last twoport) */

/* data structure for a single twoport on the line */

typedef struct net {

	struct net *right;  /* points to twoport on right */
	struct net *tap;    /* points to first twoport in a bridge tap */
	STRING line;	/* the input line defining that twoport */
	PFM function;	/* function which returns ABCD matrix of that
			   twoport */
	POINTER param;	/* pointer to structure containing parameters
			   of the twoport */

	} TWOPORT;
