From 7b3b5285f0c91a63c8fdbecc17363fe69d0bfdb7 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Wed, 3 Apr 2013 20:56:28 +0200 Subject: [PATCH] sharedspice.c: small updates --- src/sharedspice.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/sharedspice.c b/src/sharedspice.c index 8f62ea0ac..df9debaf1 100644 --- a/src/sharedspice.c +++ b/src/sharedspice.c @@ -16,7 +16,10 @@ #define STDERR_FILENO 2 #endif -//#define low_latency + +/* The Delphi Interface has high latency times during printing, + therefore undef the following line */ +#define low_latency /**********************************************************************/ /* Header files for C functions */ @@ -593,12 +596,9 @@ ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexi struct passwd *pw; pw = getpwuid(getuid()); -#ifdef HAVE_ASPRINTF - asprintf(&s, "%s%s", pw->pw_dir, INITSTR); -#else s = TMALLOC(char, 1 + strlen(pw->pw_dir) + strlen(INITSTR)); sprintf(s, "%s%s", pw->pw_dir, INITSTR); -#endif + if (access(s, 0) == 0) inp_source(s); } @@ -660,7 +660,7 @@ bot: /* If caller has sent valid address for pfcn */ if (!noprintfwanted) #ifdef HAVE_LIBPTHREAD - pthread_create(&tid, NULL, (void * (*)(void *))printsend, (void *)NULL); + pthread_create(&printtid, NULL, (void * (*)(void *))printsend, (void *)NULL); #elif defined _MSC_VER || defined __MINGW32__ printtid = (HANDLE)_beginthreadex(NULL, 0, (unsigned int (__stdcall *)(void *))printsend, (void*) NULL, 0, NULL); @@ -770,7 +770,7 @@ char* ngSpice_CurPlot(void) } /* return to the caller a pointer to an array of all plots created -by ngspice.dll */ +by ngspice. Last entry in the array is NULL. */ IMPEXP char** ngSpice_AllPlots(void) { @@ -794,7 +794,7 @@ char** ngSpice_AllPlots(void) } /* return to the caller a pointer to an array of vector names in the plot -named by plotname */ +named by plotname. Last entry in the array is NULL. */ IMPEXP char** ngSpice_AllVecs(char* plotname) { @@ -998,7 +998,7 @@ sh_fputc(const char inp, FILE* f) static char* outstringerr = NULL; static char* outstringout = NULL; -#ifdef low_latency +#if defined (low_latency) || !defined(THREADS) /* using the strings by the caller sent directly to the caller has to fast enough (low latency) */ int