sharedspice.c: small updates

This commit is contained in:
h_vogt 2013-04-03 20:56:28 +02:00
parent 2632c1f540
commit 7b3b5285f0
1 changed files with 9 additions and 9 deletions

View File

@ -16,7 +16,10 @@
#define STDERR_FILENO 2 #define STDERR_FILENO 2
#endif #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 */ /* Header files for C functions */
@ -593,12 +596,9 @@ ngSpice_Init(SendChar* printfcn, SendStat* statusfcn, ControlledExit* ngspiceexi
struct passwd *pw; struct passwd *pw;
pw = getpwuid(getuid()); 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)); s = TMALLOC(char, 1 + strlen(pw->pw_dir) + strlen(INITSTR));
sprintf(s, "%s%s", pw->pw_dir, INITSTR); sprintf(s, "%s%s", pw->pw_dir, INITSTR);
#endif
if (access(s, 0) == 0) if (access(s, 0) == 0)
inp_source(s); inp_source(s);
} }
@ -660,7 +660,7 @@ bot:
/* If caller has sent valid address for pfcn */ /* If caller has sent valid address for pfcn */
if (!noprintfwanted) if (!noprintfwanted)
#ifdef HAVE_LIBPTHREAD #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__ #elif defined _MSC_VER || defined __MINGW32__
printtid = (HANDLE)_beginthreadex(NULL, 0, (unsigned int (__stdcall *)(void *))printsend, printtid = (HANDLE)_beginthreadex(NULL, 0, (unsigned int (__stdcall *)(void *))printsend,
(void*) NULL, 0, NULL); (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 /* 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 IMPEXP
char** ngSpice_AllPlots(void) 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 /* 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 IMPEXP
char** ngSpice_AllVecs(char* plotname) char** ngSpice_AllVecs(char* plotname)
{ {
@ -998,7 +998,7 @@ sh_fputc(const char inp, FILE* f)
static char* outstringerr = NULL; static char* outstringerr = NULL;
static char* outstringout = 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 /* using the strings by the caller sent directly to the caller
has to fast enough (low latency) */ has to fast enough (low latency) */
int int