2008-03-22 14:10:46 +01:00
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
|
#include <ngspice.h>
|
|
|
|
|
#include <bool.h>
|
|
|
|
|
#include <wordlist.h>
|
|
|
|
|
|
|
|
|
|
#include "plotting/plotit.h"
|
|
|
|
|
|
|
|
|
|
#include "com_gnuplot.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* gnuplot file plotargs */
|
|
|
|
|
void
|
|
|
|
|
com_gnuplot(wordlist *wl)
|
|
|
|
|
{
|
2009-10-04 13:48:37 +02:00
|
|
|
char *fname = NULL;
|
2008-03-22 14:10:46 +01:00
|
|
|
bool tempf = FALSE;
|
|
|
|
|
|
|
|
|
|
if (wl) {
|
|
|
|
|
fname = wl->wl_word;
|
|
|
|
|
wl = wl->wl_next;
|
|
|
|
|
}
|
|
|
|
|
if (!wl) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (cieq(fname, "temp") || cieq(fname, "tmp")) {
|
|
|
|
|
fname = smktemp("gp"); /* Is this the correct name ? */
|
|
|
|
|
tempf = TRUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(void) plotit(wl, fname, "gnuplot");
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
/* Leave temp file sitting around so gnuplot can grab it from
|
|
|
|
|
background. */
|
|
|
|
|
if (tempf)
|
|
|
|
|
(void) unlink(fname);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|