diff --git a/ChangeLog b/ChangeLog index dfc6ffbd0..c993ba7b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2003-08-28 Stefan Jones + + * src/spicelib/parser/inpgtok.c: + Fix reading in ')' tokens at the end of a node list + + * src/xspice/ipc/ipc.c: + Remove linux specific includes which are not needed + + * src/tclspice.c: + Add quick support for plotting complex vectors + + * src/frontend/aspice.c: + Add ifdef for SOLARIS + + * src/frontend/terminal.[ch] src/tclspice.c: + Fix output redirection with tclspice + 2003-08-21 Stefan Jones * src/frontend/define.c: diff --git a/src/Makefile.am b/src/Makefile.am index ba18a00b3..05eae5623 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -213,7 +213,7 @@ install-tclspice: ${TCL_FILES} tclspice.o: tclspice.c $(COMPILE) -c -fpic tclspice.c -DTCLSPICE_version="\"$(TCLSPICE_VERSION)\"" -libspice.so: $(ngspice_OBJECTS) $(LIBSPICE_OBJS) $(ngspice_DEPENDENCIES) +libspice.so: $(ngspice_OBJECTS) $(LIBSPICE_OBJS) $(ngspice_LDADD) $(LINK) $(ngspice_LDFLAGS) $(ngspice_OBJECTS) $(ngspice_LDADD) $(LIBS) $(LIBSPICE_OBJS) -shared -Wl,--version-script=tclspice.map if test -f .libs/$@ ; then \ mv .libs/$@ ./ ;\ diff --git a/src/frontend/aspice.c b/src/frontend/aspice.c index 0a3bd777e..5625af5e3 100644 --- a/src/frontend/aspice.c +++ b/src/frontend/aspice.c @@ -176,7 +176,7 @@ sigchild(void) * whether the exit was normal or not. */ -#if defined(__NetBSD__) +#if defined(__NetBSD__) || defined(SOLARIS) pid_t status; #else union wait status; diff --git a/src/frontend/terminal.c b/src/frontend/terminal.c index d00e21e1d..13cbaa387 100644 --- a/src/frontend/terminal.c +++ b/src/frontend/terminal.c @@ -342,12 +342,12 @@ void term_home(void) {} void term_cleol(void) {} void tcap_init(void) {} -void out_send(char *string) {tcl_printf(string);} +void out_send(char *string) {fprintf(cp_out,string);} void out_printf(char *fmt, char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8, char *s9, char *s10) { - tcl_printf(fmt, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10); + fprintf(cp_out,fmt, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10); } #endif /* TCL_MODULE */ diff --git a/src/frontend/terminal.h b/src/frontend/terminal.h index 2615b80d7..bf045a59f 100644 --- a/src/frontend/terminal.h +++ b/src/frontend/terminal.h @@ -3,8 +3,6 @@ extern bool out_isatty; -#ifndef TCL_MODULE - void out_init(void); void outbufputc(void); void promptreturn(void); @@ -17,28 +15,4 @@ void term_home(void); void term_cleol(void); void tcap_init(void); -#else - -extern int tcl_printf(const char *format, ...); - -inline extern void out_init(void) {} -inline extern void outbufputc(void) {} -inline extern void promptreturn(void) {} -inline extern void term_clear(void) {} -inline extern void term_home(void) {} -inline extern void term_cleol(void) {} -inline extern void tcap_init(void) {} - -inline extern void out_send(char *string) {tcl_printf(string);} - -inline extern void -out_printf(char *fmt, char *s1, char *s2, char *s3, char *s4, char *s5, char *s6, char *s7, char *s8, char *s9, char *s10) { - tcl_printf(fmt, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10); -} - - -#endif - - - #endif diff --git a/src/tclspice.c b/src/tclspice.c index 904a76456..147108f60 100755 --- a/src/tclspice.c +++ b/src/tclspice.c @@ -1075,6 +1075,28 @@ int sp_Tk_Update(void) { /* The Blt method for plotting */ /********************************************************/ +static void dvecToBlt(Blt_Vector *Data, struct dvec *x) { + if(x->v_flags & VF_REAL) { + Blt_ResetVector (Data, x->v_realdata ,x->v_length, + x->v_length, TCL_VOLATILE); + } else { + double *data; + int i; + + data = tmalloc(x->v_length * sizeof(double)); + + for(i=0;iv_length;i++) { + data[i] = realpart(&x->v_compdata[i]); + } + + Blt_ResetVector (Data, data, x->v_length, x->v_length, TCL_VOLATILE); + + tfree(data); + } + + return; +} + int blt_plot(struct dvec *y,struct dvec *x){ Blt_Vector *X_Data=NULL, *Y_Data=NULL; char buf[1024]; @@ -1091,16 +1113,9 @@ int blt_plot(struct dvec *y,struct dvec *x){ return 1; } - Blt_ResetVector (Y_Data, y->v_realdata ,y->v_length, y->v_length, TCL_VOLATILE); - - if (x) { - Blt_ResetVector (X_Data, x->v_realdata, x->v_length, x->v_length, TCL_VOLATILE); - } else { - x = y; - /*TODO: handle complex data properly */ - Blt_ResetVector (X_Data, y->v_realdata, y->v_length, y->v_length, TCL_VOLATILE); - } - + dvecToBlt(X_Data,x); + dvecToBlt(Y_Data,y); + sprintf(buf,"spice_gr_Plot %s %s %s %s %s %s", x->v_name, ft_typenames(x->v_type), ft_typabbrev(x->v_type), y->v_name, ft_typenames(y->v_type), ft_typabbrev(y->v_type)); @@ -1588,7 +1603,7 @@ int tcl_vfprintf(FILE *f, const char *fmt, va_list args_in) char *outptr, *bigstr = NULL, *finalstr = NULL; int i, nchars, result, escapes = 0; - if((f != stdout && f != stderr) + if((fileno(f) != STDOUT_FILENO && fileno(f) != STDERR_FILENO) #ifdef HAVE_LIBPTHREAD || ( fl_running && bgtid == pthread_self()) #endif diff --git a/src/xspice/ipc/ipc.c b/src/xspice/ipc/ipc.c index 03be29fb3..b802092d3 100755 --- a/src/xspice/ipc/ipc.c +++ b/src/xspice/ipc/ipc.c @@ -71,9 +71,7 @@ SUMMARY #ifndef NDEBUG #include #endif -#include /* Specific to BSD - Use sys/fcntl.h for sys5 */ #include -#include #include #include