Tidy up of the header files in src/frontend and sub-directories. Motivation is to remove extern declarations within .c files and place them in .h files. Added new header files where necessary (and adjusted makefile.am files where required)
This commit is contained in:
parent
150a3e1775
commit
67ff1b3a83
|
|
@ -1,4 +1,5 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## $Id$
|
||||
|
||||
SUBDIRS = plotting help parser wdisp @NUMPARAMDIR@
|
||||
DIST_SUBDIRS = plotting help parser wdisp numparam
|
||||
|
|
@ -17,6 +18,7 @@ libfte_a_SOURCES = \
|
|||
com_cdump.c \
|
||||
com_cdump.h \
|
||||
com_chdir.c \
|
||||
com_chdir.h \
|
||||
com_compose.c \
|
||||
com_compose.h \
|
||||
com_dl.c \
|
||||
|
|
@ -26,6 +28,7 @@ libfte_a_SOURCES = \
|
|||
com_dump.c \
|
||||
com_dump.h \
|
||||
com_echo.c \
|
||||
com_echo.h \
|
||||
com_ghelp.c \
|
||||
com_ghelp.h \
|
||||
com_hardcopy.c \
|
||||
|
|
@ -41,17 +44,21 @@ libfte_a_SOURCES = \
|
|||
com_plot.c \
|
||||
com_plot.h \
|
||||
com_rehash.c \
|
||||
com_rehash.h \
|
||||
com_set.c \
|
||||
com_set.h \
|
||||
com_setscale.c \
|
||||
com_setscale.h \
|
||||
com_shell.c \
|
||||
com_shell.h \
|
||||
com_shift.c \
|
||||
com_shift.h \
|
||||
com_state.c \
|
||||
com_state.h \
|
||||
com_strcmp.c \
|
||||
com_strcmp.h \
|
||||
com_unset.c \
|
||||
com_unset.h \
|
||||
com_xgraph.c \
|
||||
com_xgraph.h \
|
||||
completion.h \
|
||||
|
|
@ -104,6 +111,7 @@ libfte_a_SOURCES = \
|
|||
gens.c \
|
||||
gens.h \
|
||||
hpgl.c \
|
||||
hpgl.h \
|
||||
inp.c \
|
||||
inp.h \
|
||||
inpcom.c \
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -55,15 +56,6 @@ struct proc {
|
|||
static struct proc *running = NULL;
|
||||
static int numchanged = 0; /* How many children have changed in state. */
|
||||
|
||||
|
||||
extern pid_t fork (void);
|
||||
extern int dup2 (int, int);
|
||||
extern int execl (const char *, const char *, ...);
|
||||
extern int unlink (const char *);
|
||||
extern int pipe (int *);
|
||||
extern int close (int);
|
||||
extern int execlp (const char *, const char *, ...);
|
||||
|
||||
void
|
||||
com_aspice(wordlist *wl)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -13,15 +14,13 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|||
#include "dvec.h"
|
||||
#include "ftedebug.h"
|
||||
#include "breakp.h"
|
||||
#include "breakp2.h"
|
||||
|
||||
#include "completion.h"
|
||||
|
||||
static bool satisfied(struct dbcomm *d, struct plot *plot);
|
||||
static void printcond(struct dbcomm *d, FILE *fp);
|
||||
|
||||
void dbfree(struct dbcomm *db);
|
||||
extern struct dbcomm *dbs; /* export for iplot */
|
||||
extern int debugnumber;
|
||||
static int howmanysteps = 0;
|
||||
static int steps = 0;
|
||||
|
||||
|
|
@ -32,9 +31,6 @@ static int steps = 0;
|
|||
* If more than one is given on a command line, then this is a conjunction.
|
||||
*/
|
||||
|
||||
|
||||
extern void settrace (wordlist *wl, int what, char *name);
|
||||
|
||||
void
|
||||
com_stop(wordlist *wl)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -12,14 +13,11 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|||
#include "ftedefs.h"
|
||||
#include "dvec.h"
|
||||
#include "ftedebug.h"
|
||||
|
||||
#include "quote.h"
|
||||
#include "breakp2.h"
|
||||
|
||||
|
||||
struct dbcomm *dbs = NULL; /* export for iplot */
|
||||
int debugnumber = 1;
|
||||
void settrace(wordlist *wl, int what, char *name);
|
||||
|
||||
/* Set a breakpoint. Possible commands are:
|
||||
* stop after n
|
||||
|
|
@ -126,4 +124,3 @@ ft_getSaves(struct save_info **savesp)
|
|||
|
||||
return (count);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,18 @@
|
|||
/*************
|
||||
* com_chdir.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#include <config.h>
|
||||
#include <ngspice.h>
|
||||
|
||||
#include <wordlist.h>
|
||||
|
||||
#ifdef HAVE_PWD_H
|
||||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#include "com_chdir.h"
|
||||
#include "quote.h"
|
||||
#include "streams.h"
|
||||
|
||||
|
|
@ -12,7 +22,6 @@ com_chdir(wordlist *wl)
|
|||
{
|
||||
char *s;
|
||||
struct passwd *pw;
|
||||
extern struct passwd *getpwuid(uid_t);
|
||||
char localbuf[257];
|
||||
int copied = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
/*************
|
||||
* Header file for com_chdir.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef COM_CHDIR_H
|
||||
#define COM_CHDIR_H
|
||||
|
||||
#include <wordlist.h>
|
||||
|
||||
void com_chdir(wordlist *wl);
|
||||
|
||||
#endif /* COM_CHDIR_H */
|
||||
|
|
@ -1,8 +1,14 @@
|
|||
/*************
|
||||
* com_echo.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#include <config.h>
|
||||
#include <ngspice.h>
|
||||
#include <wordlist.h>
|
||||
#include <bool.h>
|
||||
|
||||
#include "com_echo.h"
|
||||
#include "quote.h"
|
||||
#include "streams.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
/*************
|
||||
* Header file for com_echo.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef COM_ECHO_H
|
||||
#define COM_ECHO_H
|
||||
|
||||
#include <wordlist.h>
|
||||
|
||||
void com_echo(wordlist *wlist);
|
||||
|
||||
#endif /* COM_ECHO_H */
|
||||
|
|
@ -1,9 +1,15 @@
|
|||
/*************
|
||||
* com_rehash.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#include <config.h>
|
||||
#include <ngspice.h>
|
||||
|
||||
#include <wordlist.h>
|
||||
#include <cpextern.h>
|
||||
|
||||
#include "com_rehash.h"
|
||||
#include "streams.h"
|
||||
#include "control.h"
|
||||
|
||||
void
|
||||
com_rehash(wordlist *wl)
|
||||
|
|
@ -21,4 +27,3 @@ com_rehash(wordlist *wl)
|
|||
fprintf(cp_err, "Error: no PATH in environment.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
/*************
|
||||
* Header file for com_rehsh.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef COM_REHASH_H
|
||||
#define COM_REHASH_H
|
||||
|
||||
#include <wordlist.h>
|
||||
|
||||
void com_rehash(wordlist *wl);
|
||||
|
||||
#endif /* COM_REHASH_H */
|
||||
|
|
@ -1,8 +1,13 @@
|
|||
/*************
|
||||
* com_shell.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#include <config.h>
|
||||
#include <ngspice.h>
|
||||
#include <wordlist.h>
|
||||
|
||||
#include <cpextern.h>
|
||||
#include "com_shell.h"
|
||||
|
||||
|
||||
/* Fork a shell. */
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
/*************
|
||||
* Header file for com_shell.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef COM_SHELL_H
|
||||
#define COM_SHELL_H
|
||||
|
||||
void com_shell(wordlist *wl);
|
||||
|
||||
#endif /* COM_SHELL_H */
|
||||
|
|
@ -1,8 +1,14 @@
|
|||
/*************
|
||||
* com_shift.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#include <config.h>
|
||||
#include <ngspice.h>
|
||||
#include <bool.h>
|
||||
#include <wordlist.h>
|
||||
|
||||
#include "com_shift.h"
|
||||
#include "variable.h"
|
||||
#include "streams.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
/*************
|
||||
* Header file for com_shift.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef COM_SHIFT_H
|
||||
#define COM_SHIFT_H
|
||||
|
||||
void com_shift(wordlist *wl);
|
||||
|
||||
#endif /* COM_SHIFT_H */
|
||||
|
|
@ -1,13 +1,17 @@
|
|||
/*************
|
||||
* com_unset.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#include <config.h>
|
||||
#include <ngspice.h>
|
||||
|
||||
#include <macros.h>
|
||||
#include <bool.h>
|
||||
#include <wordlist.h>
|
||||
|
||||
#include "com_unset.h"
|
||||
#include "variable.h"
|
||||
|
||||
|
||||
void
|
||||
com_unset(wordlist *wl)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
/*************
|
||||
* Header file for com_unset.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef COM_UNSET_H
|
||||
#define COM_UNSET_H
|
||||
|
||||
#include <wordlist.h>
|
||||
|
||||
void com_unset(wordlist *wl);
|
||||
|
||||
#endif /* COM_UNSET_H */
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
/* NG-SPICE -- An electrical circuit simulator
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (c) 1990 University of California
|
||||
* Copyright (c) 2000 Arno W. Peters
|
||||
|
|
@ -48,12 +49,17 @@
|
|||
#include "com_setscale.h"
|
||||
#include "com_xgraph.h"
|
||||
#include "com_state.h"
|
||||
#include "com_chdir.h"
|
||||
#include "com_echo.h"
|
||||
#include "com_rehash.h"
|
||||
#include "com_shell.h"
|
||||
#include "com_shift.h"
|
||||
#include "com_unset.h"
|
||||
#include "fourier.h"
|
||||
|
||||
#ifdef EXPERIMENTAL_CODE
|
||||
#include "com_option.h"
|
||||
void com_loadsnap(wordlist *wl);
|
||||
void com_savesnap(wordlist *wl);
|
||||
#include "spiceif.h" /* for com_loadsnap() and com_savesnap() */
|
||||
#endif
|
||||
|
||||
#include "com_dl.h"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
#ifndef _CONTROL_H
|
||||
#define _CONTROL_H
|
||||
/**********
|
||||
* Header file for control.c
|
||||
* $Id$
|
||||
**********/
|
||||
|
||||
#ifndef CONTROL_H
|
||||
#define CONTROL_H
|
||||
|
||||
#include <bool.h>
|
||||
|
||||
/* Stuff to do control structures. We keep a history (seperate from
|
||||
* the cshpar history, for now at least) of commands and their event
|
||||
|
|
@ -42,5 +48,6 @@ enum co_command {
|
|||
extern struct control *control[CONTROLSTACKSIZE];
|
||||
extern struct control *cend[CONTROLSTACKSIZE];
|
||||
extern int stackp;
|
||||
extern bool cp_dounixcom;
|
||||
|
||||
#endif
|
||||
#endif /* CONTROL_H */
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
|
||||
|
|
@ -12,6 +13,7 @@ Copyright 1990 Regents of the University of California. All rights reserved.
|
|||
|
||||
#include "display.h"
|
||||
#include "variable.h"
|
||||
#include "error.h"
|
||||
|
||||
/* static declarations */
|
||||
static void gen_DatatoScreen(GRAPH *graph, double x, double y, int *screenx, int *screeny);
|
||||
|
|
@ -19,47 +21,20 @@ static int gen_Input(REQUEST *request, RESPONSE *response);
|
|||
static int nop(void);
|
||||
static int nodev(void);
|
||||
|
||||
|
||||
|
||||
|
||||
#ifndef X_DISPLAY_MISSING
|
||||
extern int X11_Init(void), X11_NewViewport(GRAPH *graph), X11_Close(void), X11_Clear(void),
|
||||
X11_DrawLine(int x1, int y1, int x2, int y2), X11_Arc(int x0, int y0, int radius, double theta1, double theta2), X11_Text(char *text, int x, int y), X11_DefineColor(int colorid, double red, double green, double blue),
|
||||
X11_DefineLinestyle(int linestyleid, int mask), X11_SetLinestyle(int linestyleid), X11_SetColor(int colorid),
|
||||
X11_Update(void),
|
||||
X11_Input(REQUEST *request, RESPONSE *response);
|
||||
#include "plotting/x11.h"
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAS_WINDOWS /* Graphic-IO under MS Windows */
|
||||
extern int WIN_Init(), WIN_NewViewport(), WIN_Close(), WIN_Clear(),
|
||||
WIN_DrawLine(), WIN_Arc(), WIN_Text(), WIN_DefineColor(),
|
||||
WIN_DefineLinestyle(), WIN_SetLinestyle(), WIN_SetColor(),
|
||||
WIN_Update(), WIN_DiagramReady();
|
||||
|
||||
extern int WPRINT_Init(), WPRINT_NewViewport(), WPRINT_Close(), WPRINT_Clear(),
|
||||
WPRINT_DrawLine(), WPRINT_Arc(), WPRINT_Text(), WPRINT_DefineColor(),
|
||||
WPRINT_DefineLinestyle(), WPRINT_SetLinestyle(), WPRINT_SetColor(),
|
||||
WPRINT_Update(), WPRINT_DiagramReady();
|
||||
#include "windisp/windisp.h"
|
||||
#include "windisp/winprint.h"
|
||||
#endif
|
||||
|
||||
#include "plotting/plot5.h"
|
||||
#include "postsc.h"
|
||||
#include "hpgl.h"
|
||||
|
||||
|
||||
extern int Plt5_Init(void), Plt5_NewViewport(GRAPH *graph), Plt5_Close(void), Plt5_Clear(void),
|
||||
Plt5_DrawLine(int x1, int y1, int x2, int y2), Plt5_Arc(int x0, int y0, int radius, double theta1, double theta2), Plt5_Text(char *text, int x, int y),
|
||||
Plt5_DefineLinestyle(), Plt5_SetLinestyle(int linestyleid), Plt5_SetColor(int colorid),
|
||||
Plt5_Update(void);
|
||||
|
||||
extern int PS_Init(void), PS_NewViewport(GRAPH *graph), PS_Close(void), PS_Clear(void),
|
||||
PS_DrawLine(int x1, int y1, int x2, int y2), PS_Arc(int x0, int y0, int r, double theta1, double theta2), PS_Text(char *text, int x, int y),
|
||||
PS_DefineLinestyle(), PS_SetLinestyle(int linestyleid), PS_SetColor(int colorid),
|
||||
PS_Update(void);
|
||||
|
||||
extern int GL_Init(void), GL_NewViewport(GRAPH *graph), GL_Close(void), GL_Clear(void),
|
||||
GL_DrawLine(int x1, int y1, int x2, int y2), GL_Arc(int x0, int y0, int r, double theta1, double theta2), GL_Text(char *text, int x, int y),
|
||||
GL_DefineLinestyle(), GL_SetLinestyle(int linestyleid), GL_SetColor(int colorid),
|
||||
GL_Update(void);
|
||||
|
||||
DISPDEVICE device[] = {
|
||||
|
||||
{"error", 0, 0, 0, 0, 0, 0, nop, nop,
|
||||
|
|
@ -67,7 +42,7 @@ DISPDEVICE device[] = {
|
|||
nop, nop, nop, nop, nop,
|
||||
nop, nop, nop,
|
||||
nop, nop, nop, gen_Input,
|
||||
(void *)nop,},
|
||||
(void*)nop,},
|
||||
|
||||
#ifndef X_DISPLAY_MISSING
|
||||
{"X11", 0, 0, 1024, 864, 0, 0, X11_Init, X11_NewViewport,
|
||||
|
|
@ -79,43 +54,41 @@ DISPDEVICE device[] = {
|
|||
#endif
|
||||
|
||||
#ifdef HAS_WINDOWS /* Graphic-IO under MS Windows */
|
||||
{"Windows", 0, 0, 1000, 1000, 0, 0, WIN_Init, WIN_NewViewport,
|
||||
WIN_Close, WIN_Clear,
|
||||
WIN_DrawLine, WIN_Arc, WIN_Text, WIN_DefineColor, WIN_DefineLinestyle,
|
||||
WIN_SetLinestyle, WIN_SetColor, WIN_Update,
|
||||
nodev, nodev, nodev, gen_Input,
|
||||
gen_DatatoScreen, WIN_DiagramReady},
|
||||
|
||||
/* Warning: name "WinPrint" do not change! */
|
||||
{"WinPrint", 0, 0, 1000, 1000, 0, 0, WPRINT_Init, WPRINT_NewViewport,
|
||||
WPRINT_Close, WPRINT_Clear,
|
||||
WPRINT_DrawLine, WPRINT_Arc, WPRINT_Text, WPRINT_DefineColor, WPRINT_DefineLinestyle,
|
||||
WPRINT_SetLinestyle, WPRINT_SetColor, WPRINT_Update,
|
||||
nodev, nodev, nodev, nodev,
|
||||
gen_DatatoScreen, WPRINT_DiagramReady},
|
||||
{"Windows", 0, 0, 1000, 1000, 0, 0, WIN_Init, WIN_NewViewport,
|
||||
WIN_Close, WIN_Clear,
|
||||
WIN_DrawLine, WIN_Arc, WIN_Text, WIN_DefineColor, WIN_DefineLinestyle,
|
||||
WIN_SetLinestyle, WIN_SetColor, WIN_Update,
|
||||
nodev, nodev, nodev, gen_Input,
|
||||
gen_DatatoScreen, WIN_DiagramReady},
|
||||
|
||||
/* Warning: name "WinPrint" do not change! */
|
||||
{"WinPrint", 0, 0, 1000, 1000, 0, 0, WPRINT_Init, WPRINT_NewViewport,
|
||||
WPRINT_Close, WPRINT_Clear,
|
||||
WPRINT_DrawLine, WPRINT_Arc, WPRINT_Text, WPRINT_DefineColor, WPRINT_DefineLinestyle,
|
||||
WPRINT_SetLinestyle, WPRINT_SetColor, WPRINT_Update,
|
||||
nodev, nodev, nodev, nodev,
|
||||
gen_DatatoScreen, WPRINT_DiagramReady},
|
||||
#endif
|
||||
|
||||
|
||||
{"plot5", 0, 0, 1000, 1000, 0, 0, Plt5_Init, Plt5_NewViewport,
|
||||
Plt5_Close, Plt5_Clear,
|
||||
Plt5_DrawLine, Plt5_Arc, Plt5_Text, nodev, nodev,
|
||||
Plt5_DrawLine, Plt5_Arc, Plt5_Text, (void*)nodev, (void*)nodev,
|
||||
Plt5_SetLinestyle, Plt5_SetColor, Plt5_Update,
|
||||
nodev, nodev, nodev, nodev,
|
||||
gen_DatatoScreen,},
|
||||
|
||||
{"postscript", 0, 0, 1000, 1000, 0, 0, PS_Init, PS_NewViewport,
|
||||
PS_Close, PS_Clear,
|
||||
PS_DrawLine, PS_Arc, PS_Text, nodev, nodev,
|
||||
PS_DrawLine, PS_Arc, PS_Text, (void*)nodev, (void*)nodev,
|
||||
PS_SetLinestyle, PS_SetColor, PS_Update,
|
||||
nodev, nodev, nodev, nodev,
|
||||
nodev, nodev, nodev, (void*)nodev,
|
||||
gen_DatatoScreen,},
|
||||
|
||||
{"hpgl", 0, 0, 1000, 1000, 0, 0, GL_Init, GL_NewViewport,
|
||||
GL_Close, GL_Clear,
|
||||
GL_DrawLine, GL_Arc, GL_Text, nodev, nodev,
|
||||
GL_DrawLine, GL_Arc, GL_Text, (void*)nodev, (void*)nodev,
|
||||
GL_SetLinestyle, GL_SetColor, GL_Update,
|
||||
nodev, nodev, nodev, nodev,
|
||||
nodev, nodev, nodev, (void*)nodev,
|
||||
gen_DatatoScreen,},
|
||||
|
||||
{"printf", 0, 0, 24, 80, 0, 0, nodev, nodev,
|
||||
|
|
@ -132,9 +105,6 @@ DISPDEVICE *dispdev = device + NUMELEMS(device) - 1;
|
|||
#define XtNumber(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||
|
||||
|
||||
extern void internalerror (char *message);
|
||||
extern void externalerror (char *message);
|
||||
|
||||
DISPDEVICE *FindDev(char *name)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -341,7 +311,7 @@ gen_Input(REQUEST *request, RESPONSE *response)
|
|||
response->option = error_option;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* no operation, do nothing */
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
Modified: 2000 AlansFixes
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -21,6 +22,7 @@ Modified: 2000 AlansFixes
|
|||
#include "dotcards.h"
|
||||
#include "variable.h"
|
||||
#include "fourier.h"
|
||||
#include "breakp2.h"
|
||||
|
||||
/* Extract all the .save lines */
|
||||
|
||||
|
|
@ -30,10 +32,6 @@ static char * fixem(char *string);
|
|||
static wordlist * gettoks(char *s);
|
||||
|
||||
|
||||
extern void com_save2 (wordlist *wl, char *name);
|
||||
|
||||
|
||||
|
||||
static struct plot *
|
||||
setcplot(char *name)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -34,8 +34,10 @@ Author: Jim Groves
|
|||
#include "ftedbgra.h"
|
||||
#include "ftedev.h"
|
||||
#include "fteinput.h"
|
||||
|
||||
#include "variable.h"
|
||||
#include "error.h"
|
||||
#include "plotting/graphdb.h"
|
||||
#include "hpgl.h"
|
||||
|
||||
#define RAD_TO_DEG (180.0 / M_PI)
|
||||
#define DEVDEP(g) (*((GLdevdep *) (g)->devdep))
|
||||
|
|
@ -82,9 +84,6 @@ static double tocm = 0.0025;
|
|||
static double scale; /* Used for fine tuning */
|
||||
static int hcopygraphid;
|
||||
|
||||
extern int DestroyGraph (int id);
|
||||
extern void internalerror (char *message);
|
||||
|
||||
int GL_Init()
|
||||
{
|
||||
if (!cp_getvar("hcopyscale", VT_STRING, psscale)) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
/*************
|
||||
* Header file for hpgl.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef HPGH_H
|
||||
#define HPGH_H
|
||||
|
||||
int GL_Init(void);
|
||||
int GL_NewViewport(GRAPH *graph);
|
||||
int GL_Close(void);
|
||||
int GL_Clear(void);
|
||||
int GL_DrawLine(int x1, int y1, int x2, int y2);
|
||||
int GL_Arc(int x0, int y0, int r, double theta1, double theta2);
|
||||
int GL_Text(char *text, int x, int y);
|
||||
int GL_DefineLinestyle();
|
||||
int GL_SetLinestyle(int linestyleid);
|
||||
int GL_SetColor(int colorid);
|
||||
int GL_Update(void);
|
||||
|
||||
#endif /* HPGH_H */
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -25,6 +26,7 @@ Author: 1985 Wayne A. Christopher
|
|||
#include "circuits.h"
|
||||
#include "completion.h"
|
||||
#include "variable.h"
|
||||
#include "breakp2.h"
|
||||
|
||||
#ifdef XSPICE
|
||||
/* gtri - add - 12/12/90 - wbk - include new stuff */
|
||||
|
|
@ -39,9 +41,6 @@ static bool doedit(char *filename);
|
|||
|
||||
/* Do a listing. Use is listing [expanded] [logical] [physical] [deck] */
|
||||
|
||||
|
||||
extern int unlink (const char *);
|
||||
|
||||
void
|
||||
com_listing(wordlist *wl)
|
||||
{
|
||||
|
|
@ -513,6 +512,9 @@ inp_spsource(FILE *fp, bool comfile, char *filename)
|
|||
}
|
||||
}
|
||||
|
||||
/* Hitoshi Tanaka */
|
||||
if(dbs) tfree(dbs); /* Added */
|
||||
|
||||
/*saj, to process save commands always, not just in batch mode
|
||||
*(breaks encapsulation of frountend and parsing commands slightly)*/
|
||||
ft_dotsaves();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
#include "ngspice.h"
|
||||
|
|
@ -10,15 +11,13 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|||
|
||||
#include "circuits.h"
|
||||
#include "linear.h"
|
||||
#include "interp.h"
|
||||
|
||||
|
||||
/* Interpolate all the vectors in a plot to a linear time scale, which
|
||||
* we determine by looking at the transient parameters in the CKT struct.
|
||||
*/
|
||||
|
||||
|
||||
extern void lincopy (struct dvec *ov, double *newscale, int newlen, struct dvec *oldscale);
|
||||
|
||||
void
|
||||
com_linearize(wordlist *wl)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/* Michael Widlok 2 Jun 1999 */
|
||||
|
||||
/* $Id$ */
|
||||
/* New commands for unloading circuits */
|
||||
|
||||
#include "ngspice.h"
|
||||
|
|
@ -12,10 +12,7 @@
|
|||
#include "circuits.h"
|
||||
#include "mw_coms.h"
|
||||
#include "variable.h"
|
||||
|
||||
extern FILE *rawfileFp;
|
||||
extern bool rawfileBinary;
|
||||
extern struct dbcomm *dbs;
|
||||
#include "runcoms.h"
|
||||
|
||||
/* Clears ckt and removes current circ. form database */
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -12,7 +13,6 @@ Author: 1985 Wayne A. Christopher
|
|||
#include "ftedefs.h"
|
||||
#include "dvec.h"
|
||||
#include "fteinp.h"
|
||||
|
||||
#include "nutinp.h"
|
||||
#include "variable.h"
|
||||
|
||||
|
|
@ -22,9 +22,6 @@ Author: 1985 Wayne A. Christopher
|
|||
* after the run is over.
|
||||
*/
|
||||
|
||||
|
||||
extern int unlink (const char *);
|
||||
|
||||
void
|
||||
inp_nutsource(FILE *fp, bool comfile, char *filename)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -19,6 +20,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|||
#include "circuits.h"
|
||||
#include "options.h"
|
||||
#include "variable.h"
|
||||
#include "control.h"
|
||||
|
||||
|
||||
/* static declarations */
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1988 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
Modified: 2000 AlansFixes
|
||||
Modified: 2000 AlansFixes
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -28,8 +29,10 @@ Modified: 2000 AlansFixes
|
|||
#include <time.h>
|
||||
#include "cktdefs.h"
|
||||
#include <inpdefs.h>
|
||||
#include "breakp2.h"
|
||||
#include "runcoms.h"
|
||||
#include "plotting/graf.h"
|
||||
|
||||
extern void gr_end_iplot(void);
|
||||
extern char *spice_analysis_get_name(int index);
|
||||
extern char *spice_analysis_get_description(int index);
|
||||
|
||||
|
|
@ -70,10 +73,6 @@ static bool printinfo = FALSE; /* Print informational "error messages". */
|
|||
|
||||
/* The two "begin plot" routines share all their internals... */
|
||||
|
||||
|
||||
extern int ft_getSaves (struct save_info **savesp);
|
||||
extern bool ft_getOutReq (FILE **fpp, struct plot **plotp, bool *binp, char *name, char *title);
|
||||
|
||||
int
|
||||
OUTpBeginPlot(void *circuitPtr, void *analysisPtr, IFuid analName, IFuid refName, int refType, int numNames, IFuid *dataNames, int dataType, void **plotPtr)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -88,7 +89,6 @@ backeval(char *string)
|
|||
FILE *proc, *old;
|
||||
wordlist *wl;
|
||||
bool intv;
|
||||
extern FILE *popen(const char *, const char *);
|
||||
|
||||
proc = popen(string, "r");
|
||||
if (proc == NULL) {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,14 @@
|
|||
/*************
|
||||
* Header file for backq.c
|
||||
* 1999 E. Rouat
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef BACKQ_H_INCLUDED
|
||||
#define BACKQ_H_INCLUDED
|
||||
|
||||
extern char cp_back;
|
||||
|
||||
wordlist * cp_bquote(wordlist *wlist);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -33,13 +34,11 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* Things go as follows:
|
||||
* (1) Read the line and do some initial quoting (by setting the 8th bit),
|
||||
* and command ignoring. Also deal with command completion.
|
||||
|
|
@ -53,8 +52,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|||
* (7) Do io redirection.
|
||||
*/
|
||||
|
||||
|
||||
void fixdescriptors(void);
|
||||
/* static functions */
|
||||
static void pwlist(wordlist *wlist, char *name);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,12 @@
|
|||
/*************
|
||||
* Header file for cshpar.c
|
||||
* 1999 E. Rouat
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef CSHPAR_H_INCLUDED
|
||||
#define CSHPAR_H_INCLUDED
|
||||
|
||||
wordlist * cp_parse(char *string);
|
||||
void com_echo(wordlist *wlist);
|
||||
wordlist * cp_redirect(wordlist *wl);
|
||||
void cp_ioreset(void);
|
||||
void com_shell(wordlist *wl);
|
||||
void fixdescriptors(void);
|
||||
void com_rehash(wordlist *wl);
|
||||
void com_chdir(wordlist *wl);
|
||||
void com_strcmp(wordlist *wl);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1988 Jeffrey M. Hsu
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -14,6 +15,7 @@ Author: 1988 Jeffrey M. Hsu
|
|||
#include "fteinput.h"
|
||||
#include "input.h"
|
||||
#include "cpextern.h"
|
||||
#include "../display.h"
|
||||
|
||||
/* A special 'getc' so that we can deal with ^D properly. There is no way for
|
||||
* stdio to know if we have typed a ^D after some other characters, so
|
||||
|
|
@ -45,8 +47,6 @@ inchar(FILE *fp)
|
|||
}
|
||||
|
||||
|
||||
extern void Input(REQUEST *req, RESPONSE *resp);
|
||||
|
||||
int
|
||||
input(FILE *fp)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,10 +1,13 @@
|
|||
/*************
|
||||
* Header file for graf.c
|
||||
* 1999 E. Rouat
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef _GRAF_H
|
||||
#define _GRAF_H
|
||||
#ifndef GRAF_H
|
||||
#define GRAF_H
|
||||
|
||||
#include "graph.h"
|
||||
|
||||
int gr_init(double *xlims, double *ylims,
|
||||
char *xname, char *plotname,
|
||||
|
|
@ -34,4 +37,4 @@ void gr_iplot(struct plot *plot);
|
|||
void gr_end_iplot(void);
|
||||
double * readtics(char *string);
|
||||
|
||||
#endif
|
||||
#endif /* GRAF_H */
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ $Id$
|
|||
|
||||
#include "graphdb.h"
|
||||
#include "../breakp2.h"
|
||||
#include "../error.h"
|
||||
#include "../display.h"
|
||||
|
||||
|
||||
/* invariant: currentgraph contains the current graph */
|
||||
|
|
@ -51,9 +53,6 @@ static int RunningId = 1;
|
|||
|
||||
/* returns NULL on error */
|
||||
|
||||
extern void internalerror (char *message);
|
||||
extern void SaveText (GRAPH *graph, char *text, int x, int y);
|
||||
|
||||
GRAPH *NewGraph(void)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Modified: 2001 AlansFixes
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -14,7 +15,7 @@ Modified: 2001 AlansFixes
|
|||
#include <ftedefs.h>
|
||||
|
||||
#include "grid.h"
|
||||
|
||||
#include "../display.h"
|
||||
|
||||
#define RAD_TO_DEG (180.0 / M_PI)
|
||||
#define LABEL_CHARS 20
|
||||
|
|
@ -36,22 +37,11 @@ static double cliparc(double cx, double cy, double rad, double start, double end
|
|||
int iclipy, int icliprad, int flag);
|
||||
|
||||
|
||||
|
||||
|
||||
/* note: scaleunits is static and never changed in this file
|
||||
ie, can get rid of it */
|
||||
static bool scaleunits = TRUE;
|
||||
|
||||
|
||||
extern void SetColor (int colorid);
|
||||
extern void SetLinestyle (int linestyleid);
|
||||
extern void Text (char *text, int x, int y);
|
||||
void drawloggrid (GRAPH *graph, char *units, int hmt, int lmt, int decsp, int subs, int pp, Axis axis);
|
||||
void drawlingrid (GRAPH *graph, char *units, int spacing, int nsp, double dst, double lmt, double hmt, bool onedec, int mult, double mag, int digits, Axis axis);
|
||||
extern void DrawLine (int x1, int y1, int x2, int y2);
|
||||
extern void Update (void);
|
||||
extern void Arc (int x0, int y0, int radius, double theta1, double theta2);
|
||||
|
||||
void
|
||||
gr_fixgrid(GRAPH *graph, double xdelta, double ydelta, int xtype, int ytype)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ Plt5_NewViewport(GRAPH *graph)
|
|||
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
Plt5_Close(void)
|
||||
{
|
||||
|
||||
|
|
@ -91,18 +91,18 @@ Plt5_Close(void)
|
|||
w/o having reached Plt5_NewViewport */
|
||||
if (plotfile)
|
||||
fclose(plotfile);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
Plt5_Clear(void)
|
||||
{
|
||||
|
||||
/* do nothing */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
Plt5_DrawLine(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
|
||||
|
|
@ -111,18 +111,18 @@ Plt5_DrawLine(int x1, int y1, int x2, int y2)
|
|||
putsi(y1);
|
||||
putsi(x2);
|
||||
putsi(y2);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ARGSUSED */ /* until some code gets written */
|
||||
void
|
||||
int
|
||||
Plt5_Arc(int x0, int y0, int radius, double theta1, double theta2)
|
||||
{
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
Plt5_Text(char *text, int x, int y)
|
||||
{
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ Plt5_Text(char *text, int x, int y)
|
|||
|
||||
/* restore old linestyle */
|
||||
Plt5_SetLinestyle(savedlstyle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -152,7 +152,7 @@ Plt5_SetLinestyle(int linestyleid)
|
|||
|
||||
if (linestyleid < 0 || linestyleid > dispdev->numlinestyles) {
|
||||
internalerror("bad linestyleid");
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
putc('f', plotfile);
|
||||
fprintf(plotfile, "%s\n", linestyle[linestyleid]);
|
||||
|
|
@ -161,19 +161,19 @@ Plt5_SetLinestyle(int linestyleid)
|
|||
}
|
||||
|
||||
/* ARGSUSED */
|
||||
void
|
||||
int
|
||||
Plt5_SetColor(int colorid)
|
||||
{
|
||||
|
||||
/* do nothing */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
Plt5_Update(void)
|
||||
{
|
||||
|
||||
fflush(plotfile);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*************
|
||||
* Header file for plot5.c
|
||||
* 1999 E. Rouat
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef PLOT5_H_INCLUDED
|
||||
|
|
@ -8,13 +9,13 @@
|
|||
|
||||
int Plt5_Init(void);
|
||||
int Plt5_NewViewport(GRAPH *graph);
|
||||
void Plt5_Close(void);
|
||||
void Plt5_Clear(void);
|
||||
void Plt5_DrawLine(int x1, int y1, int x2, int y2);
|
||||
void Plt5_Arc(int x0, int y0, int radius, double theta1, double theta2);
|
||||
void Plt5_Text(char *text, int x, int y);
|
||||
int Plt5_Close(void);
|
||||
int Plt5_Clear(void);
|
||||
int Plt5_DrawLine(int x1, int y1, int x2, int y2);
|
||||
int Plt5_Arc(int x0, int y0, int radius, double theta1, double theta2);
|
||||
int Plt5_Text(char *text, int x, int y);
|
||||
int Plt5_SetLinestyle(int linestyleid);
|
||||
void Plt5_SetColor(int colorid);
|
||||
void Plt5_Update(void);
|
||||
int Plt5_SetColor(int colorid);
|
||||
int Plt5_Update(void);
|
||||
|
||||
#endif
|
||||
#endif /* PLOT5_H_INCLUDED */
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,23 +1,28 @@
|
|||
/*************
|
||||
* Header file for x11.c
|
||||
* 1999 E. Rouat
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef X11_H_INCLUDED
|
||||
#define X11_H_INCLUDED
|
||||
|
||||
#ifndef X_DISPLAY_MISSING
|
||||
|
||||
#include <X11/Intrinsic.h> /* required for Widget */
|
||||
|
||||
int X11_Init(void);
|
||||
int X11_NewViewport(GRAPH *graph);
|
||||
void X11_Close(void);
|
||||
void X11_DrawLine(int x1, int y1, int x2, int y2);
|
||||
void X11_Arc(int x0, int y0, int radius, double theta1, double theta2);
|
||||
void X11_Text(char *text, int x, int y);
|
||||
int X11_Close(void);
|
||||
int X11_DrawLine(int x1, int y1, int x2, int y2);
|
||||
int X11_Arc(int x0, int y0, int radius, double theta1, double theta2);
|
||||
int X11_Text(char *text, int x, int y);
|
||||
int X11_DefineColor(int colorid, double red, double green, double blue);
|
||||
void X11_DefineLinestyle(int linestyleid, int mask);
|
||||
void X11_SetLinestyle(int linestyleid);
|
||||
void X11_SetColor(int colorid);
|
||||
void X11_Update(void);
|
||||
void X11_Clear(void);
|
||||
int X11_DefineLinestyle(int linestyleid, int mask);
|
||||
int X11_SetLinestyle(int linestyleid);
|
||||
int X11_SetColor(int colorid);
|
||||
int X11_Update(void);
|
||||
int X11_Clear(void);
|
||||
void handlekeypressed(Widget w, caddr_t clientdata, caddr_t calldata);
|
||||
void handlebuttonev(Widget w, caddr_t clientdata, caddr_t calldata);
|
||||
void slopelocation(GRAPH *graph, int x0, int y0);
|
||||
|
|
@ -26,7 +31,8 @@ void hardcopy(Widget w, caddr_t client_data, caddr_t call_data);
|
|||
void killwin(Widget w, caddr_t client_data, caddr_t call_data);
|
||||
void redraw(Widget w, caddr_t client_data, caddr_t call_data);
|
||||
void resize(Widget w, caddr_t client_data, caddr_t call_data);
|
||||
void X11_Input(REQUEST *request, RESPONSE *response);
|
||||
int X11_Input(REQUEST *request, RESPONSE *response);
|
||||
|
||||
#endif /* X_DISPLAY_MISSING */
|
||||
|
||||
#endif
|
||||
#endif /* X11_H_INCLUDED */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1988 Jeffrey M. Hsu
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -16,6 +17,8 @@ Author: 1988 Jeffrey M. Hsu
|
|||
|
||||
#include "postsc.h"
|
||||
#include "variable.h"
|
||||
#include "error.h"
|
||||
#include "plotting/graphdb.h"
|
||||
|
||||
#define RAD_TO_DEG (180.0 / M_PI)
|
||||
#define DEVDEP(g) (*((PSdevdep *) (g)->devdep))
|
||||
|
|
@ -68,8 +71,6 @@ static int ytadj; /* text adjustment y */
|
|||
static int hcopygraphid;
|
||||
|
||||
|
||||
extern int DestroyGraph (int id);
|
||||
extern void internalerror (char *message);
|
||||
void PS_LinestyleColor(int linestyleid, int colorid);
|
||||
void PS_SelectColor(int colorid);
|
||||
void PS_Stroke(void);
|
||||
|
|
@ -157,7 +158,7 @@ PS_Init(void)
|
|||
int
|
||||
PS_NewViewport(GRAPH *graph)
|
||||
{
|
||||
int x1,x2,y1,y2;
|
||||
int x1,x2,y1,y2;
|
||||
hcopygraphid = graph->graphid;
|
||||
|
||||
if (!(plotfile = fopen(graph->devdep, "w"))) {
|
||||
|
|
@ -185,43 +186,43 @@ PS_NewViewport(GRAPH *graph)
|
|||
xoff = scale * XOFF;
|
||||
yoff = scale * YOFF;
|
||||
|
||||
x1 = 0.75 * 72;
|
||||
y1 = x1;
|
||||
x2 = graph->absolute.width + .75 * 72;
|
||||
y2 = graph->absolute.height + .75 * 72;
|
||||
x1 = 0.75 * 72;
|
||||
y1 = x1;
|
||||
x2 = graph->absolute.width + .75 * 72;
|
||||
y2 = graph->absolute.height + .75 * 72;
|
||||
/* start file off with a % */
|
||||
fprintf(plotfile, "%%!PS-Adobe-3.0 EPSF-3.0\n");
|
||||
fprintf(plotfile, "%%%%Creator: nutmeg\n");
|
||||
fprintf(plotfile, "%%%%BoundingBox: %d %d %d %d\n",x1,y1,x2,y2);
|
||||
fprintf(plotfile, "%%%%BoundingBox: %d %d %d %d\n",x1,y1,x2,y2);
|
||||
|
||||
fprintf(plotfile, "%g %g scale\n", 1.0 / scale, 1.0 / scale);
|
||||
|
||||
if (colorflag == 1){ /* set the background to color0 */
|
||||
PS_SelectColor(0);
|
||||
fprintf(plotfile,"%s setrgbcolor\n",pscolor);
|
||||
fprintf(plotfile,"newpath\n");
|
||||
fprintf(plotfile,"%d %d moveto %d %d lineto\n",x1,y1,x2,y1);
|
||||
fprintf(plotfile,"%d %d lineto %d %d lineto\n",x2,y2,x1,y2);
|
||||
fprintf(plotfile,"closepath fill\n");
|
||||
}
|
||||
if (colorflag == 1){ /* set the background to color0 */
|
||||
PS_SelectColor(0);
|
||||
fprintf(plotfile,"%s setrgbcolor\n",pscolor);
|
||||
fprintf(plotfile,"newpath\n");
|
||||
fprintf(plotfile,"%d %d moveto %d %d lineto\n",x1,y1,x2,y1);
|
||||
fprintf(plotfile,"%d %d lineto %d %d lineto\n",x2,y2,x1,y2);
|
||||
fprintf(plotfile,"closepath fill\n");
|
||||
}
|
||||
|
||||
/* set up a reasonable font */
|
||||
fprintf(plotfile, "/%s findfont %d scalefont setfont\n\n",
|
||||
fprintf(plotfile, "/%s findfont %d scalefont setfont\n\n",
|
||||
psfont, (int) (fontsize * scale));
|
||||
|
||||
graph->devdep = tmalloc(sizeof(PSdevdep));
|
||||
DEVDEP(graph).lastlinestyle = -1;
|
||||
DEVDEP(graph).lastcolor = -1;
|
||||
DEVDEP(graph).lastcolor = -1;
|
||||
DEVDEP(graph).lastx = -1;
|
||||
DEVDEP(graph).lasty = -1;
|
||||
DEVDEP(graph).linecount = 0;
|
||||
PS_SelectColor(0);
|
||||
PS_SelectColor(0);
|
||||
graph->linestyle = -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
PS_Close(void)
|
||||
{
|
||||
|
||||
|
|
@ -230,27 +231,27 @@ PS_Close(void)
|
|||
if (plotfile) {
|
||||
PS_Stroke();
|
||||
fprintf(plotfile, "showpage\n%%%%EOF\n");
|
||||
fclose(plotfile);
|
||||
plotfile = NULL;
|
||||
fclose(plotfile);
|
||||
plotfile = NULL;
|
||||
}
|
||||
/* In case of hardcopy command destroy the hardcopy graph
|
||||
* and reset currentgraph to graphid 1, if possible
|
||||
*/
|
||||
if (!screenflag) {
|
||||
DestroyGraph(hcopygraphid);
|
||||
currentgraph = FindGraph(1);
|
||||
DestroyGraph(hcopygraphid);
|
||||
currentgraph = FindGraph(1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
PS_Clear(void)
|
||||
{
|
||||
|
||||
/* do nothing */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
PS_DrawLine(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
|
||||
|
|
@ -273,14 +274,15 @@ PS_DrawLine(int x1, int y1, int x2, int y2)
|
|||
|
||||
DEVDEP(currentgraph).lastx = x2;
|
||||
DEVDEP(currentgraph).lasty = y2;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
PS_Arc(int x0, int y0, int r, double theta1, double theta2)
|
||||
{
|
||||
double x1, y1;
|
||||
double angle1, angle2;
|
||||
PS_Stroke();
|
||||
PS_Stroke();
|
||||
while (theta1 >= theta2)
|
||||
theta2 += 2 * M_PI;
|
||||
|
||||
|
|
@ -295,23 +297,24 @@ PS_Arc(int x0, int y0, int r, double theta1, double theta2)
|
|||
fprintf(plotfile, "stroke\n");
|
||||
|
||||
DEVDEP(currentgraph).linecount = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
PS_Text(char *text, int x, int y)
|
||||
{
|
||||
int savedlstyle, savedcolor;
|
||||
int savedlstyle, savedcolor;
|
||||
|
||||
/* set linestyle to solid
|
||||
or may get funny color text on some plotters */
|
||||
or may get funny color text on some plotters */
|
||||
savedlstyle = currentgraph->linestyle;
|
||||
savedcolor = currentgraph->currentcolor;
|
||||
savedcolor = currentgraph->currentcolor;
|
||||
|
||||
PS_SetLinestyle(SOLID);
|
||||
PS_SetColor(1);
|
||||
PS_SetColor(1);
|
||||
|
||||
/* stroke the path if there's an open one */
|
||||
PS_Stroke();
|
||||
/* stroke the path if there's an open one */
|
||||
PS_Stroke();
|
||||
/* move to (x, y) */
|
||||
fprintf(plotfile, "%d %d moveto\n", x + xoff + xtadj, y + yoff + ytadj);
|
||||
fprintf(plotfile, "(%s) show\n", text);
|
||||
|
|
@ -321,8 +324,9 @@ PS_Text(char *text, int x, int y)
|
|||
|
||||
/* restore old linestyle */
|
||||
|
||||
PS_SetColor(savedcolor);
|
||||
PS_SetLinestyle(savedlstyle);
|
||||
PS_SetColor(savedcolor);
|
||||
PS_SetLinestyle(savedlstyle);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* PS_DefineColor */
|
||||
|
|
@ -335,27 +339,29 @@ PS_SetLinestyle(int linestyleid)
|
|||
/* special case
|
||||
get it when PS_Text restores a -1 linestyle */
|
||||
if (linestyleid == -1) {
|
||||
currentgraph->linestyle = -1;
|
||||
return 0;
|
||||
currentgraph->linestyle = -1;
|
||||
return 0;
|
||||
}
|
||||
if (linestyleid < 0 || linestyleid > dispdev->numlinestyles) {
|
||||
internalerror("bad linestyleid inside PS_SetLinestyle");
|
||||
return 0;
|
||||
internalerror("bad linestyleid inside PS_SetLinestyle");
|
||||
return 0;
|
||||
}
|
||||
PS_LinestyleColor(linestyleid, currentgraph->currentcolor);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
PS_SetColor(int colorid)
|
||||
{
|
||||
PS_LinestyleColor(currentgraph->linestyle, colorid);
|
||||
}
|
||||
|
||||
void
|
||||
int
|
||||
PS_SetColor(int colorid)
|
||||
{
|
||||
PS_LinestyleColor(currentgraph->linestyle, colorid);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
PS_Update(void)
|
||||
{
|
||||
fflush(plotfile);
|
||||
fflush(plotfile);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**************** PRIVAT FUNCTIONS OF PS FRONTEND *****************************/
|
||||
|
|
|
|||
|
|
@ -8,14 +8,14 @@
|
|||
|
||||
int PS_Init(void);
|
||||
int PS_NewViewport(GRAPH *graph);
|
||||
void PS_Close(void);
|
||||
void PS_Clear(void);
|
||||
void PS_DrawLine(int x1, int y1, int x2, int y2);
|
||||
void PS_Arc(int x0, int y0, int r, double theta1, double theta2);
|
||||
void PS_Text(char *text, int x, int y);
|
||||
int PS_Close(void);
|
||||
int PS_Clear(void);
|
||||
int PS_DrawLine(int x1, int y1, int x2, int y2);
|
||||
int PS_Arc(int x0, int y0, int r, double theta1, double theta2);
|
||||
int PS_Text(char *text, int x, int y);
|
||||
int PS_SetLinestyle(int linestyleid);
|
||||
void PS_SetColor(int colorid);
|
||||
void PS_Update(void);
|
||||
int PS_SetColor(int colorid);
|
||||
int PS_Update(void);
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ $Id$
|
|||
/* static declarations */
|
||||
static int dosim(char *what, wordlist *wl);
|
||||
|
||||
extern struct dbcomm *dbs;
|
||||
|
||||
/* Routines for the commands op, tran, ac, dc, listing, device, state,
|
||||
* resume, stop, trace, run, end. Op, tran, ac, and dc cause the action
|
||||
* to be performed immediately, and run causes whatever actions were
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -16,16 +17,14 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
|||
|
||||
#include "circuits.h"
|
||||
#include "runcoms2.h"
|
||||
#include "runcoms.h"
|
||||
#include "variable.h"
|
||||
#include "breakp2.h"
|
||||
#include "plotting/graf.h"
|
||||
|
||||
|
||||
extern FILE *rawfileFp;
|
||||
extern bool rawfileBinary;
|
||||
/*rawfile output saj*/
|
||||
extern char *last_used_rawfile;
|
||||
#define RAWBUF_SIZE 32768
|
||||
char rawfileBuf[RAWBUF_SIZE];
|
||||
/*end saj*/
|
||||
extern struct dbcomm *dbs;
|
||||
|
||||
/* Continue a simulation. If there is non in progress, this is the
|
||||
* equivalent of "run".
|
||||
|
|
@ -39,9 +38,6 @@ extern struct dbcomm *dbs;
|
|||
|
||||
bool resumption = FALSE;
|
||||
|
||||
|
||||
extern void reset_trace (void);
|
||||
|
||||
void
|
||||
com_resume(wordlist *wl)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/**********
|
||||
Copyright 1994 Macquarie University, Sydney Australia. All rights reserved.
|
||||
Author: 1994 Anthony E. Parker, Department of Electronics, Macquarie Uni.
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*
|
||||
|
|
@ -135,7 +136,6 @@ com_spec(wordlist *wl)
|
|||
} else if (eq(window, "gaussian")) {
|
||||
int order;
|
||||
double scale;
|
||||
extern double erfc(double);
|
||||
if (!cp_getvar("specwindoworder", VT_NUM, &order)) order = 2;
|
||||
if (order < 2) order = 2;
|
||||
scale = pow(2*M_PI/order,0.5)*(0.5-erfc(pow(order,0.5)));
|
||||
|
|
|
|||
|
|
@ -1378,4 +1378,4 @@ void com_savesnap(wordlist *wl) {
|
|||
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* EXPERIMENTAL_CODE */
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
/*************
|
||||
* Header file for spiceif.c
|
||||
* 1999 E. Rouat
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef SPICEIF_H_INCLUDED
|
||||
|
|
@ -19,9 +20,8 @@ bool if_tranparams(struct circ *ci, double *start, double *stop, double *step);
|
|||
struct variable * if_getstat(void *ckt, char *name);
|
||||
|
||||
#ifdef EXPERIMENTAL_CODE
|
||||
void if_loadsnap(wordlist *wl);
|
||||
void if_savesnap(wordlist *wl);
|
||||
void com_loadsnap(wordlist *wl);
|
||||
void com_savesnap(wordlist *wl);
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
#endif /* SPICEIF_H_INCLUDED */
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
/*************
|
||||
* streams.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#include <config.h>
|
||||
#include <ngspice.h>
|
||||
#include <wordlist.h>
|
||||
|
|
@ -8,7 +13,6 @@
|
|||
#include "quote.h"
|
||||
#include "streams.h"
|
||||
|
||||
|
||||
bool cp_debug = FALSE;
|
||||
char cp_gt = '>';
|
||||
char cp_lt = '<';
|
||||
|
|
@ -25,6 +29,8 @@ FILE *cp_curin = NULL;
|
|||
FILE *cp_curout = NULL;
|
||||
FILE *cp_curerr = NULL;
|
||||
|
||||
/* static functions */
|
||||
static bool fileexists(char *name);
|
||||
|
||||
static bool
|
||||
fileexists(char *name)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,27 @@
|
|||
#ifndef _STREAMS_H
|
||||
#define _STREAMS_H
|
||||
/*************
|
||||
* Header file for streams.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef STREAMS_H
|
||||
#define STREAMS_H
|
||||
|
||||
#include <bool.h>
|
||||
#include <wordlist.h>
|
||||
|
||||
extern bool cp_debug;
|
||||
extern char cp_amp;
|
||||
extern char cp_gt;
|
||||
extern char cp_lt;
|
||||
extern FILE *cp_in;
|
||||
extern FILE *cp_out;
|
||||
extern FILE *cp_err;
|
||||
extern FILE *cp_curin;
|
||||
extern FILE *cp_curout;
|
||||
extern FILE *cp_curerr;
|
||||
|
||||
#endif
|
||||
void cp_ioreset(void);
|
||||
void fixdescriptors(void);
|
||||
wordlist * cp_redirect(wordlist *wl);
|
||||
|
||||
#endif /* STREAMS_H */
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
Copyright 1990 Regents of the University of California. All rights reserved.
|
||||
Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group
|
||||
Modified: 2000 AlansFixes
|
||||
$Id$
|
||||
**********/
|
||||
|
||||
/*------------------------------------------------------------------------------
|
||||
|
|
@ -60,18 +61,11 @@ Modified: 2000 AlansFixes
|
|||
#include "subckt.h"
|
||||
#include "variable.h"
|
||||
|
||||
#ifdef NUMPARAMS
|
||||
/* Uncomment to turn on tracing for the Numparam */
|
||||
/*#define TRACE_NUMPARAMS*/
|
||||
|
||||
#ifdef NUMPARAMS
|
||||
#define NUPADECKCOPY 0
|
||||
#define NUPASUBSTART 1
|
||||
#define NUPASUBDONE 2
|
||||
#define NUPAEVALDONE 3
|
||||
extern char * nupa_copy(char *s, int linenum);
|
||||
extern int nupa_eval(char *s, int linenum);
|
||||
extern int nupa_signal(int sig, char *info);
|
||||
extern void nupa_scan(char * s, int linenum); /* SJB added */
|
||||
#include "numparam/numpaif.h"
|
||||
#endif
|
||||
|
||||
/* ----- static declarations ----- */
|
||||
|
|
|
|||
|
|
@ -1,8 +1,13 @@
|
|||
## Process this file with automake to produce Makefile.in
|
||||
## $Id$
|
||||
|
||||
noinst_LIBRARIES = libwindisp.a
|
||||
|
||||
libwindisp_a_SOURCES = \
|
||||
windisp.c \
|
||||
windisp.h \
|
||||
winprint.c \
|
||||
winprint.h \
|
||||
ftegraf.h
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
/*************
|
||||
* Header file for windisp.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef WINDISP_H
|
||||
#define WINDISP_H
|
||||
|
||||
extern int WIN_Init();
|
||||
extern int WIN_NewViewport();
|
||||
extern int WIN_Close();
|
||||
extern int WIN_Clear();
|
||||
extern int WIN_DrawLine();
|
||||
extern int WIN_Arc();
|
||||
extern int WIN_Text();
|
||||
extern int WIN_DefineColor();
|
||||
extern int WIN_DefineLinestyle();
|
||||
extern int WIN_SetLinestyle();
|
||||
extern int WIN_SetColor();
|
||||
extern int WIN_Update();
|
||||
extern int WIN_DiagramReady();
|
||||
|
||||
#endif /* WINDISP_H */
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/*************
|
||||
* Header file for winprint.c
|
||||
* $Id$
|
||||
************/
|
||||
|
||||
#ifndef WINPRINT_H
|
||||
#define WINPRINT_H
|
||||
|
||||
extern int WPRINT_Init();
|
||||
extern int WPRINT_NewViewport();
|
||||
extern int WPRINT_Close();
|
||||
extern int WPRINT_Clear();
|
||||
extern int WPRINT_DrawLine();
|
||||
extern int WPRINT_Arc();
|
||||
extern int WPRINT_Text();
|
||||
extern int WPRINT_DefineColor();
|
||||
extern int WPRINT_DefineLinestyle();
|
||||
extern int WPRINT_SetLinestyle();
|
||||
extern int WPRINT_SetColor();
|
||||
extern int WPRINT_Update();
|
||||
extern int WPRINT_DiagramReady();
|
||||
|
||||
#endif /* WINPRINT_H */
|
||||
Loading…
Reference in New Issue