* src/Makefile.am src/main.c src/sconvert.c

src/analysis/cktdisto.c src/analysis/cktnoise.c
	src/analysis/noisean.c: Updates for the
	new header files.

	* src/maths/cmaths/cmath1.c src/maths/cmaths/cmath2.c
	src/maths/cmaths/cmath3.c src/maths/cmaths/cmath4.c: Updates
	for the new header files.

	* src/frontend/.cvsignore src/frontend/Makefile.am: Updates
	for the new files.

	* src/frontend/agraf.c src/frontend/aspice.c
	src/frontend/breakp.c src/frontend/breakp2.c
	src/frontend/circuits.c src/frontend/cpitf.c
	src/frontend/debugcom.c src/frontend/define.c
	src/frontend/diff.c src/frontend/dimens.c
	src/frontend/display.c src/frontend/doplot.c
	src/frontend/dotcards.c src/frontend/evaluate.c
	src/frontend/fourier.c src/frontend/graf.c
	src/frontend/grid.c src/frontend/inp.c src/frontend/inpcom.c
	src/frontend/interp.c src/frontend/linear.c
	src/frontend/misccoms.c src/frontend/misccoms.h
	src/frontend/miscvars.c src/frontend/mw_coms.c
	src/frontend/newcoms.c src/frontend/nutinp.c
	src/frontend/options.c src/frontend/outitf.c
	src/frontend/parse.c src/frontend/plotcurv.c
	src/frontend/points.c src/frontend/postcoms.c
	src/frontend/rawfile.c src/frontend/runcoms.c
	src/frontend/runcoms2.c src/frontend/shyu.c
	src/frontend/spec.c src/frontend/spiceif.c
	src/frontend/typesdef.c src/frontend/vectors.c
	src/frontend/where.c src/frontend/postcoms.c: Updates for the
	new header files.  Some commands have moved into the new files
	below.

	* src/frontend/README src/frontend/com_compose.c
	src/frontend/com_compose.h src/frontend/com_display.c
	src/frontend/com_display.h src/frontend/com_let.c
	src/frontend/com_let.h src/frontend/com_setscale.c
	src/frontend/com_setscale.h src/frontend/commands.c
	src/frontend/commands.h src/frontend/completion.h
	src/frontend/streams.h src/frontend/testcommands.c:
	Separation into different com_* commands.  This is a start.
	The rest of the subdirectory needs doing.

	* src/include/complex.h src/include/cpdefs.h
	src/include/cpextern.h src/include/cpstd.h
	src/include/fteconst.h src/include/ftedata.h
	src/include/ftedev.h src/include/fteext.h
	src/include/ftegraph.h src/include/fteparse.h
	src/include/dvec.h src/include/grid.h src/include/plot.h
	src/include/pnode.h src/include/sim.h src/include/variable.h
	src/include/wordlist.h src/include/bool.h: Separation of
	header files into smaller pieces.  This limits recompilation
	to only the affected source files.  The original header
	files have a warning message embedded to flag obsoleted use.

	* src/frontend/compose.c src/frontend/compose.h
	src/frontend/nutctab.c src/frontend/nutctab.h
	src/frontend/plot5.c src/frontend/plot5.h
	src/frontend/spcmdtab.c src/frontend/x11.c
	src/frontend/x11.h src/frontend/xgraph.c
	src/frontend/xgraph.h: Moved these files into
	src/frontend/plotting subdirectory.

	* src/frontend/plotting/.cvsignore
	src/frontend/plotting/Makefile.am
	src/frontend/plotting/plot5.c src/frontend/plotting/plot5.h
	src/frontend/plotting/plotting.c
	src/frontend/plotting/plotting.h
	src/frontend/plotting/pvec.c src/frontend/plotting/pvec.h
	src/frontend/plotting/x11.c src/frontend/plotting/x11.h
	src/frontend/plotting/xgraph.c
	src/frontend/plotting/xgraph.h: The new libplotting library
	with automake and CVS infrastructure.
This commit is contained in:
arno
2000-05-06 14:12:51 +00:00
parent ebaafe3ca5
commit 8696a52e89
102 changed files with 2463 additions and 2233 deletions
+6
View File
@@ -0,0 +1,6 @@
#ifndef _BOOL_H
#define _BOOL_H
typedef int bool;
#endif
+16 -3
View File
@@ -1,9 +1,22 @@
/*
* Copyright (c) 1985 Thomas L. Quarles
* Modified: Paolo Nenzi 1999
* Modified: Paolo Nenzi 1999, Arno W. Peters 2000
*/
#ifndef CMPLX
#define CMPLX "complex.h $Revision$ on $Date$ "
#ifndef _COMPLEX_H
#define _COMPLEX_H
/* Complex numbers. */
struct _complex { /* IBM portability... */
double cx_real;
double cx_imag;
} ;
typedef struct _complex complex;
#define realpart(cval) ((struct _complex *) (cval))->cx_real
#define imagpart(cval) ((struct _complex *) (cval))->cx_imag
/* header file containing definitions for complex functions
*
+37 -37
View File
@@ -18,17 +18,38 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
/* Information about spice commands. */
struct comm {
char *co_comname; /* The name of the command. */
void (*co_func) (); /* The function that handles the command. */
bool co_stringargs; /* Collapse the arguments into a string. */
bool co_spiceonly; /* These can't be used from nutmeg. */
bool co_major; /* Is this a "major" command? */
long co_cctypes[4]; /* Bitmasks for command completion. */
unsigned int co_env;/* print help message on this environment mask */
int co_minargs; /* minimum number of arguments required */
int co_maxargs; /* maximum number of arguments allowed */
int (*co_argfn) (); /* The fn that prompts the user. */
char *co_help; /* When these are printed, printf(string, av[0]) .. */
/* The name of the command. */
char *co_comname;
/* The function that handles the command. */
void (*co_func) (wordlist *wl);
/* Collapse the arguments into a string. */
bool co_stringargs;
/* These can't be used from nutmeg. */
bool co_spiceonly;
/* Is this a "major" command? */
bool co_major;
/* Bitmasks for command completion. */
long co_cctypes[4];
/* print help message on this environment mask */
unsigned int co_env;
/* minimum number of arguments required */
int co_minargs;
/* maximum number of arguments allowed */
int co_maxargs;
/* The fn that prompts the user. */
void (*co_argfn) (wordlist *wl, struct comm *command);
/* When these are printed, printf(string, av[0]) .. */
char *co_help;
};
#define LOTS 1000
@@ -44,34 +65,13 @@ struct histent {
struct histent *hi_prev;
};
/* Variables that are accessible to the parser via $varname expansions.
* If the type is VT_LIST the value is a pointer to a list of the elements.
*/
struct variable {
char va_type;
char *va_name;
union {
bool vV_bool;
int vV_num;
double vV_real;
char *vV_string;
struct variable *vV_list;
} va_V;
struct variable *va_next; /* Link. */
} ;
/* FIXME: Split this file and adjust all callers to the new header files. */
#if 0
#warning "Please use a header file more specific than cpdef.h"
#endif
#include "variable.h"
#define va_bool va_V.vV_bool
#define va_num va_V.vV_num
#define va_real va_V.vV_real
#define va_string va_V.vV_string
#define va_vlist va_V.vV_list
#define VT_BOOL 1
#define VT_NUM 2
#define VT_REAL 3
#define VT_STRING 4
#define VT_LIST 5
/* The values returned by cp_userset(). */
+6
View File
@@ -10,6 +10,11 @@ Author: 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
#ifndef CPEXTERN_H
#define CPEXTERN_H
#include "wordlist.h"
#include "bool.h"
#include "variable.h"
/* alias.c */
extern struct alias *cp_aliases;
@@ -18,6 +23,7 @@ extern void com_unalias();
extern void cp_paliases();
extern void cp_setalias();
extern void cp_unalias();
extern wordlist *cp_doalias();
/* backquote.c */
+7 -22
View File
@@ -11,35 +11,20 @@ Author: 1986 Wayne A. Christopher, U. C. Berkeley CAD Group
#ifndef _STD_H_
#define _STD_H_
typedef int bool;
#ifndef FILE
/* XXX Bogus */
# include <stdio.h>
#endif
/* Doubly linked lists of words. */
/* FIXME: Split this file and adjust all callers to use new header files */
#if 0
#warning "Please use bool.h, wordlist.h or complex.h rather than cpstd.h"
#endif
struct wordlist {
char *wl_word;
struct wordlist *wl_next;
struct wordlist *wl_prev;
} ;
typedef struct wordlist wordlist;
/* Complex numbers. */
struct _complex { /* IBM portability... */
double cx_real;
double cx_imag;
} ;
typedef struct _complex complex;
#define realpart(cval) ((struct _complex *) (cval))->cx_real
#define imagpart(cval) ((struct _complex *) (cval))->cx_imag
#include "bool.h"
#include "wordlist.h"
#include "complex.h"
/* Externs defined in std.c */
+65
View File
@@ -0,0 +1,65 @@
#ifndef _DVEC_H
#define _DVEC_H
#include "complex.h"
#include "grid.h"
/* Dvec flags. */
enum dvec_flags {
VF_REAL = (1 << 0), /* The data is real. */
VF_COMPLEX = (1 << 1), /* The data is complex. */
VF_ACCUM = (1 << 2), /* writedata should save this vector. */
VF_PLOT = (1 << 3), /* writedata should incrementally plot it. */
VF_PRINT = (1 << 4), /* writedata should print this vector. */
VF_MINGIVEN = (1 << 5), /* The v_minsignal value is valid. */
VF_MAXGIVEN = (1 << 6), /* The v_maxsignal value is valid. */
VF_PERMANENT = (1 << 7) /* Don't garbage collect this vector. */
};
/* Plot types. */
typedef enum {
PLOT_LIN, PLOT_COMB, PLOT_POINT
} PLOTTYPE;
/* A (possibly multi-dimensional) data vector. The data is represented
* internally by a 1-d array. The number of dimensions and the size
* of each dimension is recorded, along with v_length, the total size of
* the array. If the dimensionality is 0 or 1, v_length is significant
* instead of v_numdims and v_dims, and the vector is handled in the old
* manner.
*/
#define MAXDIMS 8
struct dvec {
char *v_name; /* Same as so_vname. */
int v_type; /* Same as so_vtype. */
short v_flags; /* Flags (a combination of VF_*). */
double *v_realdata; /* Real data. */
complex *v_compdata; /* Complex data. */
double v_minsignal; /* Minimum value to plot. */
double v_maxsignal; /* Maximum value to plot. */
GRIDTYPE v_gridtype; /* One of GRID_*. */
PLOTTYPE v_plottype; /* One of PLOT_*. */
int v_length; /* Length of the vector. */
int v_rlength; /* How much space we really have. */
int v_outindex; /* Index if writedata is building the
vector. */
int v_linestyle; /* What line style we are using. */
int v_color; /* What color we are using. */
char *v_defcolor; /* The name of a color to use. */
int v_numdims; /* How many dims -- 0 = scalar (len = 1). */
int v_dims[MAXDIMS]; /* The actual size in each dimension. */
struct plot *v_plot; /* The plot structure (if it has one). */
struct dvec *v_next; /* Link for list of plot vectors. */
struct dvec *v_link2; /* Extra link for things like print. */
struct dvec *v_scale; /* If this has a non-standard scale... */
} ;
#define isreal(v) ((v)->v_flags & VF_REAL)
#define iscomplex(v) ((v)->v_flags & VF_COMPLEX)
#endif
+5 -75
View File
@@ -8,81 +8,11 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#ifndef _CONSTANTS_
#define _CONSTANTS_
#define SV_NOTYPE 0
#define SV_TIME 1
#define SV_FREQUENCY 2
#define SV_VOLTAGE 3
#define SV_CURRENT 4
#define SV_OUTPUT_N_DENS 5
#define SV_OUTPUT_NOISE 6
#define SV_INPUT_N_DENS 7
#define SV_INPUT_NOISE 8
#define SV_POLE 9
#define SV_ZERO 10
#define SV_SPARAM 11
/* Dvec flags. */
#define VF_REAL (1 << 0) /* The data is real. */
#define VF_COMPLEX (1 << 1) /* The data is complex. */
#define VF_ACCUM (1 << 2) /* writedata should save this vector. */
#define VF_PLOT (1 << 3) /* writedata should incrementally plot it. */
#define VF_PRINT (1 << 4) /* writedata should print this vector. */
#define VF_MINGIVEN (1 << 5) /* The v_minsignal value is valid. */
#define VF_MAXGIVEN (1 << 6) /* The v_maxsignal value is valid. */
#define VF_PERMANENT (1 << 7) /* Don't garbage collect this vector. */
/* Grid types. */
/*
#define GRID_NONE 0
#define GRID_LIN 1
#define GRID_LOGLOG 2
#define GRID_XLOG 3
#define GRID_YLOG 4
#define GRID_POLAR 5
#define GRID_SMITH 6
*/
/* SMITHGRID is only a smith grid, SMITH transforms the data */
typedef enum {
GRID_NONE = 0, GRID_LIN = 1, GRID_LOGLOG = 2, GRID_XLOG = 3,
GRID_YLOG = 4, GRID_POLAR = 5, GRID_SMITH = 6, GRID_SMITHGRID = 7
} GRIDTYPE;
/* Plot types. */
/*
#define PLOT_LIN 0
#define PLOT_COMB 1
#define PLOT_POINT 2
*/
typedef enum {
PLOT_LIN = 0, PLOT_COMB = 1, PLOT_POINT = 2
} PLOTTYPE;
/* The types for command completion keywords. Note that these constants
* are built into cmdtab.c, so DON'T change them unless you want to
* change all of the bitmasks in cp_coms.
* Note that this is spice- and nutmeg- dependent.
*/
#define CT_FILENAME 0
#define CT_CKTNAMES 2
#define CT_COMMANDS 3
#define CT_DBNUMS 4
#define CT_DEVNAMES 5
#define CT_LISTINGARGS 6
#define CT_NODENAMES 7
#define CT_PLOT 8
#define CT_PLOTKEYWORDS 9
#define CT_RUSEARGS 10
#define CT_STOPARGS 11
#define CT_UDFUNCS 12
#define CT_VARIABLES 13
#define CT_VECTOR 14
#define CT_TYPENAMES 16
/* FIXME: Adjust all callers to use new header files */
#warning "Please use either sim.h, grid.h or plot.h instead of fteconst.h"
#include "sim.h"
#include "grid.h"
#include "plot.h"
#endif
+4 -57
View File
@@ -10,63 +10,10 @@
#define FTEdata_h
#include "cpstd.h" /* for struct complex */
#include "fteconst.h"
/* A (possibly multi-dimensional) data vector. The data is represented
* internally by a 1-d array. The number of dimensions and the size
* of each dimension is recorded, along with v_length, the total size of
* the array. If the dimensionality is 0 or 1, v_length is significant
* instead of v_numdims and v_dims, and the vector is handled in the old
* manner.
*/
#define MAXDIMS 8
struct dvec {
char *v_name; /* Same as so_vname. */
int v_type; /* Same as so_vtype. */
short v_flags; /* Flags (a combination of VF_*). */
double *v_realdata; /* Real data. */
complex *v_compdata; /* Complex data. */
double v_minsignal; /* Minimum value to plot. */
double v_maxsignal; /* Maximum value to plot. */
GRIDTYPE v_gridtype; /* One of GRID_*. */
PLOTTYPE v_plottype; /* One of PLOT_*. */
int v_length; /* Length of the vector. */
int v_rlength; /* How much space we really have. */
int v_outindex; /* Index if writedata is building the
vector. */
int v_linestyle; /* What line style we are using. */
int v_color; /* What color we are using. */
char *v_defcolor; /* The name of a color to use. */
int v_numdims; /* How many dims -- 0 = scalar (len = 1). */
int v_dims[MAXDIMS]; /* The actual size in each dimension. */
struct plot *v_plot; /* The plot structure (if it has one). */
struct dvec *v_next; /* Link for list of plot vectors. */
struct dvec *v_link2; /* Extra link for things like print. */
struct dvec *v_scale; /* If this has a non-standard scale... */
} ;
#define isreal(v) ((v)->v_flags & VF_REAL)
#define iscomplex(v) ((v)->v_flags & VF_COMPLEX)
/* The information for a particular set of vectors that come from one
* plot.
*/
struct plot {
char *pl_title; /* The title card. */
char *pl_date; /* Date. */
char *pl_name; /* The plot name. */
char *pl_typename; /* Tran1, op2, etc. */
struct dvec *pl_dvecs; /* The data vectors in this plot. */
struct dvec *pl_scale; /* The "scale" for the rest of the vectors. */
struct plot *pl_next; /* List of plots. */
wordlist *pl_commands; /* Commands to execute for this plot. */
struct variable *pl_env;/* The 'environment' for this plot. */
char *pl_ccom; /* The ccom struct for this plot. */
bool pl_written; /* Some or all of the vecs have been saved. */
int pl_ndims; /* Number of dimensions */
} ;
/* FIXME: Adjust all callers to use the new header files. */
#warning "Please use either dvec.h or plot.h instead of ftedata.h"
#include "dvec.h"
#include "plot.h"
#endif /* FTEdata_h */
+1 -1
View File
@@ -31,7 +31,7 @@ typedef struct {
int (*MakeMenu)();
int (*MakeDialog)();
int (*Input)();
int (*DatatoScreen)();
void (*DatatoScreen)();
} DISPDEVICE;
extern DISPDEVICE *dispdev;
+2 -2
View File
@@ -15,7 +15,8 @@ Modified: 1999 Paolo Nenzi
/* needed to find out what the interface structures look like */
#include "ifsim.h"
#include "fteparse.h"
#include "dvec.h"
#include "plot.h"
#include "cpdefs.h"
#include "ftedefs.h"
#include "fteinp.h"
@@ -311,7 +312,6 @@ extern void com_ghelp();
extern void com_help();
extern void com_quit();
extern void com_version();
extern int hcomp();
extern void com_where();
/* numparse.c */
+4 -2
View File
@@ -10,8 +10,10 @@ Author: 1988 Jeffrey M. Hsu
#ifndef _GRAPH_H_
#define _GRAPH_H_
#include "fteconst.h"
#include "ftedata.h" /* for struct dvec */
#include "sim.h"
#include "grid.h"
#include "plot.h"
#include "dvec.h" /* for struct dvec */
/* Device-independent data structure for plots. */
+14 -12
View File
@@ -12,17 +12,15 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
#define FTEPARSE
#include "ftedata.h"
#include "cpstd.h"
#include "dvec.h"
#include "plot.h"
struct pnode {
char *pn_name; /* If non-NULL, the name. */
struct dvec *pn_value; /* Non-NULL in a terminal node. */
struct func *pn_func; /* Non-NULL is a function. */
struct op *pn_op; /* Operation if the above two NULL. */
struct pnode *pn_left; /* Left branch or function argument. */
struct pnode *pn_right; /* Right branch. */
struct pnode *pn_next; /* For expression lists. */
} ;
/* FIXME: Split this file and adjust all callers. */
#if 0
#warning "Please use a more specific header than fteparse.h"
#endif
#include "pnode.h"
/* Operations. These should really be considered functions. */
@@ -36,8 +34,12 @@ struct op {
/* The functions that are available. */
struct func {
char *fu_name; /* The print name of the function. */
void *(*fu_func)(); /* The function. */
/* The print name of the function. */
char *fu_name;
/* The function. */
void *(*fu_func)(void *data, short int type, int length,
int *newlength, short int *newtype);
} ;
/* User-definable functions. The idea of ud_name is that the args are
+12
View File
@@ -0,0 +1,12 @@
#ifndef _GRID_H
#define _GRID_H
/* Grid types.
Note: SMITHGRID is only a smith grid, SMITH transforms the data */
typedef enum {
GRID_NONE, GRID_LIN, GRID_LOGLOG, GRID_XLOG,
GRID_YLOG, GRID_POLAR, GRID_SMITH, GRID_SMITHGRID
} GRIDTYPE;
#endif
+27
View File
@@ -0,0 +1,27 @@
#ifndef _PLOT_H
#define _PLOT_H
#include "wordlist.h"
#include "bool.h"
#include "dvec.h"
#include "variable.h"
/* The information for a particular set of vectors that come from one
* plot. */
struct plot {
char *pl_title; /* The title card. */
char *pl_date; /* Date. */
char *pl_name; /* The plot name. */
char *pl_typename; /* Tran1, op2, etc. */
struct dvec *pl_dvecs; /* The data vectors in this plot. */
struct dvec *pl_scale; /* The "scale" for the rest of the vectors. */
struct plot *pl_next; /* List of plots. */
wordlist *pl_commands; /* Commands to execute for this plot. */
struct variable *pl_env; /* The 'environment' for this plot. */
char *pl_ccom; /* The ccom struct for this plot. */
bool pl_written; /* Some or all of the vecs have been saved. */
int pl_ndims; /* Number of dimensions */
} ;
#endif
+14
View File
@@ -0,0 +1,14 @@
#ifndef _PNODE_H
#define _PNODE_H
struct pnode {
char *pn_name; /* If non-NULL, the name. */
struct dvec *pn_value; /* Non-NULL in a terminal node. */
struct func *pn_func; /* Non-NULL is a function. */
struct op *pn_op; /* Operation if the above two NULL. */
struct pnode *pn_left; /* Left branch or function argument. */
struct pnode *pn_right; /* Right branch. */
struct pnode *pn_next; /* For expression lists. */
} ;
#endif
+19
View File
@@ -0,0 +1,19 @@
#ifndef _SIM_H
#define _SIM_H
enum simulation_types {
SV_NOTYPE,
SV_TIME,
SV_FREQUENCY,
SV_VOLTAGE,
SV_CURRENT,
SV_OUTPUT_N_DENS,
SV_OUTPUT_NOISE,
SV_INPUT_N_DENS,
SV_INPUT_NOISE,
SV_POLE,
SV_ZERO,
SV_SPARAM
};
#endif
+36
View File
@@ -0,0 +1,36 @@
#ifndef _VARIABLE_H
#define _VARIABLE_H
/* Variables that are accessible to the parser via $varname expansions.
* If the type is VT_LIST the value is a pointer to a list of the elements.
*/
struct variable {
char va_type;
char *va_name;
union {
bool vV_bool;
int vV_num;
double vV_real;
char *vV_string;
struct variable *vV_list;
} va_V;
struct variable *va_next; /* Link. */
} ;
#define va_bool va_V.vV_bool
#define va_num va_V.vV_num
#define va_real va_V.vV_real
#define va_string va_V.vV_string
#define va_vlist va_V.vV_list
enum vt_types {
VT_BOOL,
VT_NUM,
VT_REAL,
VT_STRING,
VT_LIST
};
#endif
+14
View File
@@ -0,0 +1,14 @@
#ifndef _WORDLIST_H
#define _WORDLIST_H
/* Doubly linked lists of words. */
struct wordlist {
char *wl_word;
struct wordlist *wl_next;
struct wordlist *wl_prev;
} ;
typedef struct wordlist wordlist;
#endif