From 3d4cf4d86c74cf1922e399f8f5d5f6783fecc735 Mon Sep 17 00:00:00 2001 From: arno Date: Sat, 13 May 2000 17:28:16 +0000 Subject: [PATCH] * src/include/Makefile.am src/include/cpstd.h src/include/dvec.h src/include/fteinput.h src/include/ifsim.h src/include/wordlist.h src/frontend/arg.c src/frontend/display.c src/frontend/doplot.c src/frontend/graphdb.c src/frontend/plotcurv.c src/frontend/points.c src/frontend/postcoms.c src/frontend/postsc.c src/frontend/plotting/graf.c src/frontend/plotting/grid.c src/frontend/plotting/plot5.c src/frontend/plotting/x11.c src/include/graph.h: Reduced dependency on header files (avoid unneccessary recompilation on changes) * src/include/fteconst.h src/include/ftedata.h src/include/ftegraph.h: Removed unneeded header files. --- src/frontend/arg.c | 9 +++-- src/frontend/display.c | 15 ++++--- src/frontend/doplot.c | 19 +++++---- src/frontend/graphdb.c | 9 +++-- src/frontend/plotcurv.c | 13 +++--- src/frontend/plotting/graf.c | 4 +- src/frontend/plotting/grid.c | 11 +++-- src/frontend/plotting/plot5.c | 8 ++-- src/frontend/plotting/x11.c | 15 ++++--- src/frontend/points.c | 20 +++++----- src/frontend/postcoms.c | 14 +++---- src/frontend/postsc.c | 2 +- src/include/Makefile.am | 3 +- src/include/cpstd.h | 18 --------- src/include/dvec.h | 6 +++ src/include/fteconst.h | 18 --------- src/include/ftedata.h | 19 --------- src/include/fteinput.h | 4 +- src/include/{ftegraph.h => graph.h} | 13 ++---- src/include/ifsim.h | 62 ----------------------------- src/include/wordlist.h | 14 +++++++ 21 files changed, 94 insertions(+), 202 deletions(-) delete mode 100644 src/include/fteconst.h delete mode 100644 src/include/ftedata.h rename src/include/{ftegraph.h => graph.h} (94%) diff --git a/src/frontend/arg.c b/src/frontend/arg.c index e62afde7c..36e363347 100644 --- a/src/frontend/arg.c +++ b/src/frontend/arg.c @@ -8,10 +8,11 @@ Author: 1987 Jeffrey M. Hsu and prompt the user if necessary. */ -#include "ngspice.h" -#include "fteinput.h" -#include "cpdefs.h" -#include "fteext.h" +#include +#include +#include +#include + #include "arg.h" diff --git a/src/frontend/display.c b/src/frontend/display.c index 89e3cf1c1..f2451b378 100644 --- a/src/frontend/display.c +++ b/src/frontend/display.c @@ -3,17 +3,16 @@ Copyright 1990 Regents of the University of California. All rights reserved. **********/ -#include "ngspice.h" -#include "ftegraph.h" -#include "ftedev.h" -#include "fteinput.h" -#include "cpdefs.h" /* for VT_STRING */ -#include "ftedefs.h" /* for mylog() */ +#include +#include +#include +#include +#include /* for VT_STRING */ +#include /* for mylog() */ + #include "display.h" - - /* static declarations */ static void gen_DatatoScreen(GRAPH *graph, double x, double y, int *screenx, int *screeny); static void gen_Input(REQUEST *request, RESPONSE *response); diff --git a/src/frontend/doplot.c b/src/frontend/doplot.c index 1a3a98588..3f212d860 100644 --- a/src/frontend/doplot.c +++ b/src/frontend/doplot.c @@ -7,16 +7,15 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group * Plotting routines */ -#include "ngspice.h" -#include "fteinput.h" -#include "ftedbgra.h" -#include "cpdefs.h" -#include "plot.h" -#include "ftedefs.h" -#include "ftedev.h" -#include "dvec.h" -#include "fteparse.h" -#include "fteext.h" +#include +#include +#include +#include +#include +#include +#include +#include + #include "doplot.h" #include "plotting/agraf.h" diff --git a/src/frontend/graphdb.c b/src/frontend/graphdb.c index 6477da792..7176e7921 100644 --- a/src/frontend/graphdb.c +++ b/src/frontend/graphdb.c @@ -6,10 +6,11 @@ Copyright 1990 Regents of the University of California. All rights reserved. Manage graph data structure. */ -#include "ngspice.h" -#include "ftegraph.h" -#include "ftedebug.h" -#include "fteext.h" +#include +#include +#include +#include + #include "graphdb.h" diff --git a/src/frontend/plotcurv.c b/src/frontend/plotcurv.c index 3ece5fd69..b02e9272e 100644 --- a/src/frontend/plotcurv.c +++ b/src/frontend/plotcurv.c @@ -7,12 +7,13 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group * Curve plotting routines and general (non-graphics) plotting things. */ -#include "ngspice.h" -#include "cpdefs.h" -#include "ftedefs.h" -#include "dvec.h" -#include "ftegraph.h" -#include "ftedbgra.h" +#include +#include +#include +#include +#include +#include + #include "plotcurv.h" diff --git a/src/frontend/plotting/graf.c b/src/frontend/plotting/graf.c index 01d444b7e..c20f408a4 100644 --- a/src/frontend/plotting/graf.c +++ b/src/frontend/plotting/graf.c @@ -10,7 +10,7 @@ Author: 1988 Jeffrey M. Hsu */ -#include "ngspice.h" +#include #include "cpdefs.h" /* for VT_ */ #include "cpextern.h" #include @@ -18,7 +18,7 @@ Author: 1988 Jeffrey M. Hsu #include /* for struct dvec */ #include "ftedefs.h" /* for FTEextern.h and IPOINT{MIN,MAX} */ #include "fteinput.h" -#include "ftegraph.h" +#include #include "ftedbgra.h" #include "ftedev.h" #include diff --git a/src/frontend/plotting/grid.c b/src/frontend/plotting/grid.c index 0aed11550..c25517bf4 100644 --- a/src/frontend/plotting/grid.c +++ b/src/frontend/plotting/grid.c @@ -7,12 +7,11 @@ Copyright 1990 Regents of the University of California. All rights reserved. Routines to draw the various sorts of grids -- linear, log, polar. */ -#include "ngspice.h" -#include "ftegraph.h" -#include "cpdefs.h" -#include "ftedefs.h" -#include "dvec.h" -#include "fteparse.h" +#include +#include +#include +#include + #include "grid.h" diff --git a/src/frontend/plotting/plot5.c b/src/frontend/plotting/plot5.c index 4a1e7de85..25281c566 100644 --- a/src/frontend/plotting/plot5.c +++ b/src/frontend/plotting/plot5.c @@ -2,10 +2,10 @@ Copyright 1990 Regents of the University of California. All rights reserved. **********/ -#include "ngspice.h" -#include "ftegraph.h" -#include "ftedev.h" -#include "fteinput.h" +#include +#include +#include + #include "plot5.h" static FILE *plotfile; diff --git a/src/frontend/plotting/x11.c b/src/frontend/plotting/x11.c index f34e3ecf6..7423e7b78 100644 --- a/src/frontend/plotting/x11.c +++ b/src/frontend/plotting/x11.c @@ -8,7 +8,7 @@ Author: 1988 Jeffrey M. Hsu */ -#include "ngspice.h" +#include #ifndef X_DISPLAY_MISSING @@ -16,13 +16,12 @@ Author: 1988 Jeffrey M. Hsu # include /* PN */ # include /* PN */ - -# include "ftegraph.h" -# include "ftedbgra.h" -# include "ftedev.h" -# include "fteinput.h" -# include "cpdefs.h" -# include "ftedefs.h" +# include +# include +# include +# include +# include +# include /* Added X11/ prefix to the next includes - ER */ diff --git a/src/frontend/points.c b/src/frontend/points.c index abf580e43..3e7f5f199 100644 --- a/src/frontend/points.c +++ b/src/frontend/points.c @@ -3,19 +3,19 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group **********/ -#include "ngspice.h" -#include "cpdefs.h" -#include "ftedefs.h" -#include "dvec.h" -#include "ftegraph.h" -#include "ftedbgra.h" +#include +#include +#include +#include +#include +#include + #include "points.h" -/* Returns the minimum and maximum values of a dvec. Returns a pointer to - * static data. If real is TRUE look at the real parts, otherwise the imag - * parts. - */ +/* Returns the minimum and maximum values of a dvec. Returns a pointer + * to static data. If real is TRUE look at the real parts, otherwise + * the imag parts. */ diff --git a/src/frontend/postcoms.c b/src/frontend/postcoms.c index 8c6e188e5..bfdc35b55 100644 --- a/src/frontend/postcoms.c +++ b/src/frontend/postcoms.c @@ -7,14 +7,14 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group * Various post-processor commands having to do with vectors. */ -#include "ngspice.h" -#include "cpdefs.h" -#include "ftedefs.h" -#include "fteparse.h" -#include "dvec.h" -#include "sim.h" -#include "postcoms.h" +#include +#include +#include +#include +#include +#include +#include "postcoms.h" #include "completion.h" /* static declarations */ diff --git a/src/frontend/postsc.c b/src/frontend/postsc.c index 74ef6db00..481491e40 100644 --- a/src/frontend/postsc.c +++ b/src/frontend/postsc.c @@ -9,7 +9,7 @@ Author: 1988 Jeffrey M. Hsu #include "ngspice.h" #include "cpdefs.h" -#include "ftegraph.h" +#include "graph.h" #include "ftedbgra.h" #include "ftedev.h" #include "fteinput.h" diff --git a/src/include/Makefile.am b/src/include/Makefile.am index 83985a922..b361d11f6 100644 --- a/src/include/Makefile.am +++ b/src/include/Makefile.am @@ -15,18 +15,17 @@ noinst_HEADERS = \ distodef.h \ dvec.h \ fteconst.h \ - ftedata.h \ ftedbgra.h \ ftedebug.h \ ftedefs.h \ ftedev.h \ fteext.h \ - ftegraph.h \ ftehelp.h \ fteinp.h \ fteinput.h \ fteparse.h \ gendefs.h \ + graph.h \ grid.h \ hlpdefs.h \ iferrmsg.h \ diff --git a/src/include/cpstd.h b/src/include/cpstd.h index 946544064..be8496a33 100644 --- a/src/include/cpstd.h +++ b/src/include/cpstd.h @@ -35,24 +35,6 @@ extern char *printnum(); extern int cp_numdgt; extern void fatal(); -/* extern void setenv(); */ - extern void cp_printword(); -/* Externs from wlist.c */ - -extern char **wl_mkvec(); -extern char *wl_flatten(); -extern int wl_length(); -extern void wl_free(); -extern void wl_print(); -extern void wl_sort(); -extern wordlist *wl_append(); -extern wordlist *wl_build(); -extern wordlist *wl_copy(); -extern wordlist *wl_range(); -extern wordlist *wl_nthelem(); -extern wordlist *wl_reverse(); -extern wordlist *wl_splice(); - #endif /* _STD_H_*/ diff --git a/src/include/dvec.h b/src/include/dvec.h index c1ace9add..44d6c04fe 100644 --- a/src/include/dvec.h +++ b/src/include/dvec.h @@ -62,4 +62,10 @@ struct dvec { #define isreal(v) ((v)->v_flags & VF_REAL) #define iscomplex(v) ((v)->v_flags & VF_COMPLEX) +/* list of data vectors being displayed */ +struct dveclist { + struct dvec *vector; + struct dveclist *next; +}; + #endif diff --git a/src/include/fteconst.h b/src/include/fteconst.h deleted file mode 100644 index c6c6353e4..000000000 --- a/src/include/fteconst.h +++ /dev/null @@ -1,18 +0,0 @@ -/********** -Copyright 1990 Regents of the University of California. All rights reserved. -Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group -**********/ - -/* Vector types. */ - -#ifndef _CONSTANTS_ -#define _CONSTANTS_ - -/* 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 - diff --git a/src/include/ftedata.h b/src/include/ftedata.h deleted file mode 100644 index 48e498026..000000000 --- a/src/include/ftedata.h +++ /dev/null @@ -1,19 +0,0 @@ - -/* RCS Info: $Revision$ on $Date$ - * $Source$ - * Copyright (c) 1985 Wayne A. Christopher, U. C. Berkeley CAD Group - * - * Structures used for representing spice data in nutmeg. - */ - -#ifndef FTEdata_h -#define FTEdata_h - -#include "cpstd.h" /* for struct complex */ - -/* 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 */ diff --git a/src/include/fteinput.h b/src/include/fteinput.h index d50bb8dd1..dc6fd9f82 100644 --- a/src/include/fteinput.h +++ b/src/include/fteinput.h @@ -4,8 +4,6 @@ Author: 1988 Jeffrey M. Hsu **********/ /* - $Header$ - Defs to use the Input routine. char_option is used by the lexer and the command interpreter @@ -22,7 +20,7 @@ Author: 1988 Jeffrey M. Hsu #include -#include "ftegraph.h" +#include "graph.h" typedef enum { error_option, /* a reply option only */ diff --git a/src/include/ftegraph.h b/src/include/graph.h similarity index 94% rename from src/include/ftegraph.h rename to src/include/graph.h index 3c8716a51..cbf52a5d8 100644 --- a/src/include/ftegraph.h +++ b/src/include/graph.h @@ -7,10 +7,9 @@ Author: 1988 Jeffrey M. Hsu This file contains the graph structure. */ -#ifndef _GRAPH_H_ -#define _GRAPH_H_ +#ifndef _GRAPH_H +#define _GRAPH_H -#include "sim.h" #include "grid.h" #include "plot.h" #include "dvec.h" /* for struct dvec */ @@ -19,12 +18,6 @@ Author: 1988 Jeffrey M. Hsu #define NUMCOLORS 20 -/* list of data vectors being displayed */ -struct dveclist { - struct dvec *vector; - struct dveclist *next; -}; - typedef struct graph { int graphid; struct dveclist *plotdata; /* normalized data */ @@ -142,4 +135,4 @@ typedef struct graph { #define rnd(x) (int) ((x)+0.5) -#endif /* notdef _GRAPH_H_ */ +#endif diff --git a/src/include/ifsim.h b/src/include/ifsim.h index 8f5a4f734..e8ffc2c2f 100644 --- a/src/include/ifsim.h +++ b/src/include/ifsim.h @@ -6,13 +6,6 @@ Author: 1986 Thomas L. Quarles #ifndef IFSIMULATOR #define IFSIMULATOR -/* - * We don't always have access to an ANSI C compiler yet, so we - * make the following convenient definition - */ - - -/* Removed code for non STDC compilers Paolo Nenzi 2000*/ /* * structure: IFparm @@ -321,7 +314,6 @@ typedef struct sIFsimulator { char *description; /* description of this simulator */ char *version; /* version or revision level of simulator*/ -#ifdef __STDC__ int ((*newCircuit)(void **)); /* create new circuit */ int ((*deleteCircuit)(void *)); @@ -383,42 +375,6 @@ typedef struct sIFsimulator { int ((*doAnalyses)(void*,int,void*)); char *((*nonconvErr)(void*,char *)); /* return nonconvergence error */ -#else - int ((*newCircuit)()); /* create new circuit */ - int ((*deleteCircuit)()); /* destroy old circuit's data structures */ - - int ((*newNode)()); /* create new node */ - int ((*groundNode)()); /* create ground node */ - int ((*bindNode)()); /* bind a node to a terminal */ - int ((*findNode)()); /* find a node by name */ - int ((*instToNode)()); /* find the node attached to a terminal */ - int ((*setNodeParm)()); /* set a parameter on a node */ - int ((*askNodeQuest)()); /* ask a question about a node */ - int ((*deleteNode)()); /* delete a node from the circuit */ - - int ((*newInstance)()); /* create new instance */ - int ((*setInstanceParm)()); /* set a parameter on an instance */ - int ((*askInstanceQuest)()); /* ask a question about an instance */ - int ((*findInstance)()); /* find a specific instance */ - int ((*deleteInstance)()); /* delete an instance from the circuit */ - - int ((*newModel)()); /* create new model */ - int ((*setModelParm)()); /* set a parameter on a model */ - int ((*askModelQuest)()); /* ask a questions about a model */ - int ((*findModel)()); /* find a specific model */ - int ((*deleteModel)()); /* delete a model from the circuit*/ - - int ((*newTask)()); /* create a new task */ - int ((*newAnalysis)()); /* create new analysis within a task */ - int ((*setAnalysisParm)()); /* set a parameter on an analysis */ - int ((*askAnalysisQuest)()); /* ask a question about an analysis */ - int ((*findAnalysis)()); /* find a specific analysis */ - int ((*findTask)()); /* find a specific task */ - int ((*deleteTask)()); /* delete a task */ - - int ((*doAnalyses)()); /* run a specified task */ - char *((*nonconvErr)()); /* return nonconvergence error */ -#endif /* STDC */ int numDevices; /* number of device types supported */ IFdevice **devices; /* array of device type descriptors */ @@ -445,7 +401,6 @@ typedef struct sIFsimulator { */ typedef struct sIFfrontEnd { -#ifdef __STDC__ int ((*IFnewUid)(void*,IFuid*,IFuid,char*,int,void**)); /* create a new UID in the circuit */ int ((*IFdelUid)(void*,IFuid,int)); @@ -478,23 +433,6 @@ typedef struct sIFfrontEnd { /* end nested domain */ int ((*OUTattributes)(void *,IFuid*,int,IFvalue*)); /* specify output attributes of node */ -#else /* not STDC */ - int ((*IFnewUid)()); /* create a new UID in the circuit */ - int ((*IFdelUid)()); /* create a new UID in the circuit */ - int ((*IFpauseTest)()); /* should we stop now? */ - double ((*IFseconds)()); /* what time is it? */ - int ((*IFerror)()); /* output an error or warning message */ - int ((*OUTpBeginPlot)()); /* start pointwise output plot */ - int ((*OUTpData)()); /* data for pointwise plot */ - int ((*OUTwBeginPlot)()); /* start windowed output plot */ - int ((*OUTwReference)()); /* independent vector for windowed plot */ - int ((*OUTwData)()); /* data for windowed plot */ - int ((*OUTwEnd)()); /* signal end of windows */ - int ((*OUTendPlot)()); /* end of plot */ - int ((*OUTbeginDomain)()); /* start nested domain */ - int ((*OUTendDomain)()); /* end nested domain */ - int ((*OUTattributes)()); /* specify output attributes of node */ -#endif /* STDC */ } IFfrontEnd; /* flags for the first argument to IFerror */ diff --git a/src/include/wordlist.h b/src/include/wordlist.h index 73abb4482..8ec054f4a 100644 --- a/src/include/wordlist.h +++ b/src/include/wordlist.h @@ -11,4 +11,18 @@ struct wordlist { typedef struct wordlist wordlist; +extern char **wl_mkvec(); +extern char *wl_flatten(); +extern int wl_length(); +extern void wl_free(); +extern void wl_print(); +extern void wl_sort(); +extern wordlist *wl_append(); +extern wordlist *wl_build(); +extern wordlist *wl_copy(); +extern wordlist *wl_range(); +extern wordlist *wl_nthelem(); +extern wordlist *wl_reverse(); +extern wordlist *wl_splice(); + #endif