xspice ipc is possible
This commit is contained in:
parent
5c9f55c9e4
commit
b84cbc7127
|
|
@ -1,3 +1,7 @@
|
|||
2008-01-12 Dietmar Warning
|
||||
* configure.in, src/xspice/ipc/*.c: xspice ipc is possible
|
||||
* src/include/ngspice.h: reflect the extended autoconfigure
|
||||
|
||||
2008-01-06 Dietmar Warning
|
||||
* src/frontend/subckt.c: correct compare of binned model names. Fixed a bug
|
||||
of incorrect subckt expansion when MOS model inside.
|
||||
|
|
|
|||
36
configure.in
36
configure.in
|
|
@ -368,18 +368,13 @@ fi ;;
|
|||
|
||||
esac
|
||||
|
||||
dnl Define variables for YACC and LEX
|
||||
AC_PROG_YACC
|
||||
AM_PROG_LEX
|
||||
|
||||
|
||||
dnl Check for a few typdefs:
|
||||
AC_TYPE_PID_T
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
dnl Check for a few libraries and headers:
|
||||
AC_HEADER_DIRENT
|
||||
AC_CHECK_HEADERS(ctype.h unistd.h pwd.h fcntl.h string.h sys/ioctl.h stropts.h)
|
||||
AC_CHECK_HEADERS(ctype.h pwd.h fcntl.h sys/ioctl.h stropts.h)
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_HEADER_STAT
|
||||
|
||||
|
|
@ -422,13 +417,16 @@ AC_CHECK_LIB(m, sqrt)
|
|||
AC_CHECK_HEADERS(float.h limits.h values.h)
|
||||
|
||||
dnl Check for a few mathematical functions:
|
||||
AC_CHECK_FUNCS(erfc logb scalb scalbn asinh acosh atanh isnan pow sqrt floor)
|
||||
AC_CHECK_FUNCS(erfc logb scalb scalbn asinh acosh atanh isnan)
|
||||
|
||||
dnl Check for the random function:
|
||||
AC_CHECK_FUNCS(random,,AC_CHECK_LIB(iberty,random,AC_DEFINE([HAVE_RANDOM],1,[Have random in libiberty]) LIBS="$LIBS -liberty"))
|
||||
|
||||
dnl If user enables garbage collection, look for garbage collector
|
||||
if test "$enable_gc" = "yes"; then
|
||||
AC_MSG_RESULT(Checking for the presence of the Garbage Collector:)
|
||||
AC_CHECK_LIB(gc,GC_malloc,
|
||||
AC_DEFINE(HAVE_LIBGC,[],[Define if we want garbage collection enabled ])
|
||||
AC_DEFINE(HAVE_LIBGC,[],[Define if we want garbage collection enabled])
|
||||
LIBS="$LIBS -lgc")
|
||||
fi
|
||||
|
||||
|
|
@ -445,7 +443,7 @@ dnl Check for some headers (asprintf, dirname, etc.)
|
|||
AC_CHECK_HEADERS(libiberty.h libgen.h)
|
||||
|
||||
dnl Check for the asprintf function:
|
||||
AC_CHECK_FUNCS(asprintf,,AC_CHECK_LIB(iberty,asprintf,AC_DEFINE(HAVE_ASPRINTF) LIBS="$LIBS -liberty"))
|
||||
AC_CHECK_FUNCS(asprintf,,AC_CHECK_LIB(iberty,asprintf,AC_DEFINE(HAVE_ASPRINTF,1,[Have asprintf in libiberty]) LIBS="$LIBS -liberty"))
|
||||
|
||||
dnl Check for the snprintf function:
|
||||
if test "$ac_cv_func_asprintf" = no ; then
|
||||
|
|
@ -453,7 +451,7 @@ if test "$ac_cv_func_asprintf" = no ; then
|
|||
fi
|
||||
|
||||
dnl Check for the dirname function:
|
||||
AC_CHECK_FUNCS(dirname,,AC_CHECK_LIB(gen,dirname,AC_DEFINE(HAVE_DIRNAME) LIBS="$LIBS -lgen"))
|
||||
AC_CHECK_FUNCS(dirname,,AC_CHECK_LIB(gen,dirname,AC_DEFINE(HAVE_DIRNAME,1,[Have dirname in libgen]) LIBS="$LIBS -lgen"))
|
||||
|
||||
# AC_CHECK_FUNC(getopt_long, getopt_long=true)
|
||||
# AM_CONDITIONAL(HAVE_GETOPT_LONG, test "$getopt_long" = "true")
|
||||
|
|
@ -498,7 +496,7 @@ if test "$enable_nobypass" = "yes"; then
|
|||
AC_MSG_RESULT(NOBYPASS option enabled)
|
||||
fi
|
||||
if test "$enable_nosqrt" = "yes"; then
|
||||
AC_DEFINE(NOSQRT,[],[Define to use always exp/log for bulk diode calculations in mosfetf])
|
||||
AC_DEFINE(NOSQRT,[],[Define to use always exp/log for bulk diode calculations in mosfets])
|
||||
AC_MSG_RESULT(NOSQRT option enabled)
|
||||
fi
|
||||
if test "$enable_capbypass" = "yes"; then
|
||||
|
|
@ -581,13 +579,21 @@ AC_SUBST(NOTXGRAPH)
|
|||
dnl Add new code models to the build by pointing to them here.
|
||||
if test "$enable_xspice" = "yes"; then
|
||||
AC_MSG_RESULT(X-Spice features included)
|
||||
AC_DEFINE(XSPICE,[1],[The xspice enhancements])
|
||||
AC_DEFINE(XSPICE, [1], [The xspice enhancements])
|
||||
dnl Define variables for YACC and LEX
|
||||
AC_PROG_YACC
|
||||
AM_PROG_LEX
|
||||
XSPICEDIR="xspice"
|
||||
case $host_os in
|
||||
*mingw* | *cygwin* )
|
||||
DLLIBS="";;
|
||||
*mingw* )
|
||||
AC_DEFINE([IPC_DEBUG_VIA_STDIO], [1], [Client-Server only via stdio.])
|
||||
DLLIBS="";;
|
||||
*cygwin* )
|
||||
AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.])
|
||||
DLLIBS="" ;;
|
||||
* )
|
||||
DLLIBS="-ldl";;
|
||||
AC_DEFINE([IPC_UNIX_SOCKETS], [1], [Client-Server via socket.])
|
||||
DLLIBS="-ldl";;
|
||||
esac
|
||||
XSPICELIB1="$XSPICEDIR/cm/libcmxsp.a \
|
||||
$XSPICEDIR/mif/libmifxsp.a"
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@
|
|||
# include <ctype.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_TERMIOS_H
|
||||
#include <termios.h>
|
||||
#else
|
||||
|
|
@ -63,13 +67,27 @@
|
|||
#include <pwd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETINET_IN_H
|
||||
#include <netinet/in.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_WAIT_H
|
||||
#include <sys/wait.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_DIR_H
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_DIR_H
|
||||
#include <sys/dir.h>
|
||||
#else
|
||||
# ifdef HAVE_DIRENT_H
|
||||
|
|
@ -102,6 +120,19 @@ struct timeb timebegin;
|
|||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef HAS_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAS_WINDOWS
|
||||
#include "wstdio.h"
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_RANDOM
|
||||
#define random rand
|
||||
#define srandom srand
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_INDEX
|
||||
# define strchr index
|
||||
# define strrchr rindex
|
||||
|
|
@ -112,19 +143,11 @@ struct timeb timebegin;
|
|||
# endif /* va: no index, but strchr */
|
||||
#endif
|
||||
|
||||
#ifdef HAS_TIME_H
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
/* added for CYGWIN */
|
||||
#ifndef HUGE
|
||||
#define HUGE HUGE_VAL
|
||||
#endif
|
||||
|
||||
#ifdef HAS_WINDOWS
|
||||
#include "wstdio.h"
|
||||
#endif
|
||||
|
||||
extern char *gettok(char **s);
|
||||
extern char *gettok_noparens(char **s);
|
||||
extern char *gettok_node(char **s);
|
||||
|
|
|
|||
|
|
@ -70,17 +70,15 @@ SUMMARY
|
|||
|
||||
============================================================================*/
|
||||
|
||||
#ifndef NDEBUG
|
||||
#include "config.h"
|
||||
#include "ngspice.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#if defined (__MINGW32__) || defined (__CYGWIN__)
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <sys/io.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <memory.h> /* NOTE: I think this is a Sys5ism (there is not man
|
||||
* page for it under Bsd, but it's in /usr/include
|
||||
* and it has a BSD copyright header. Go figure.
|
||||
|
|
@ -94,20 +92,16 @@ SUMMARY
|
|||
/*
|
||||
* Conditional compilation sanity check:
|
||||
*/
|
||||
|
||||
/*
|
||||
#if !defined (IPC_AEGIS_MAILBOXES) && !defined (IPC_UNIX_SOCKETS)\
|
||||
&& !defined (IPC_DEBUG_VIA_STDIO)
|
||||
" compiler error - must specify a transport mechanism";
|
||||
#endif
|
||||
|
||||
*///ka removed
|
||||
|
||||
/*
|
||||
* static 'globals'
|
||||
*/
|
||||
|
||||
/*typedef unsigned char Buffer_Char_t;*/
|
||||
/* typedef unsigned char Buffer_Char_t; */
|
||||
typedef char Buffer_Char_t;
|
||||
|
||||
#define OUT_BUFFER_SIZE 1000
|
||||
|
|
@ -183,7 +177,7 @@ Ipc_Status_t ipc_initialize_server (server_name, m, p)
|
|||
|
||||
num_records = 0;
|
||||
fill_count = 0;
|
||||
#ifndef HAS_WINDOWS
|
||||
|
||||
status = ipc_transport_initialize_server (server_name, m, p,
|
||||
batch_filename);
|
||||
|
||||
|
|
@ -198,14 +192,11 @@ Ipc_Status_t ipc_initialize_server (server_name, m, p)
|
|||
#endif
|
||||
batch_fd = open (batch_filename, O_WRONLY | O_CREAT, 0666);
|
||||
if (batch_fd < 0) {
|
||||
// fprintf (stderr, "ERROR: IPC: Error opening batch output file: %s\n",batch_filename);
|
||||
/* fprintf (stderr, "ERROR: IPC: Error opening batch output file: %s\n",batch_filename); */
|
||||
perror ("IPC");
|
||||
return IPC_STATUS_ERROR;
|
||||
}
|
||||
}
|
||||
#else /* ifdef HAS_WINDOWS */
|
||||
status=IPC_STATUS_OK;
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -222,11 +213,7 @@ Ipc_Status_t ipc_transport_terminate_server ();
|
|||
|
||||
Ipc_Status_t ipc_terminate_server ()
|
||||
{
|
||||
#ifndef HAS_WINDOWS
|
||||
return ipc_transport_terminate_server ();
|
||||
#else /* ifdef HAS_WINDOWS */
|
||||
return 0;
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
|
@ -272,7 +259,7 @@ Ipc_Status_t ipc_get_line (str, len, wait)
|
|||
{
|
||||
Ipc_Status_t status;
|
||||
Ipc_Boolean_t need_another = IPC_TRUE;
|
||||
#ifndef HAS_WINDOWS
|
||||
|
||||
do {
|
||||
|
||||
status = ipc_transport_get_line (str, len, wait);
|
||||
|
|
@ -377,9 +364,7 @@ Ipc_Status_t ipc_get_line (str, len, wait)
|
|||
break;
|
||||
}
|
||||
} while (need_another);
|
||||
#else /* ifndef HAS_WINDOWS */
|
||||
status=IPC_STATUS_OK;
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
@ -413,7 +398,7 @@ Ipc_Status_t ipc_flush ()
|
|||
/* write the records to the .log file */
|
||||
if ((end_of_record_index [i] - last) !=
|
||||
write (batch_fd, &out_buffer[last], end_of_record_index [i] - last)) {
|
||||
// fprintf (stderr,"ERROR: IPC: Error writing to batch output file\n");
|
||||
/* fprintf (stderr,"ERROR: IPC: Error writing to batch output file\n"); */
|
||||
perror ("IPC");
|
||||
return IPC_STATUS_ERROR;
|
||||
}
|
||||
|
|
@ -423,27 +408,24 @@ Ipc_Status_t ipc_flush ()
|
|||
if( kw_match("#ERRCHK", &out_buffer[last]) ||
|
||||
kw_match(">ENDANAL", &out_buffer[last]) ||
|
||||
kw_match(">ABORTED", &out_buffer[last]) ) {
|
||||
#ifndef HAS_WINDOWS
|
||||
|
||||
status = ipc_transport_send_line (&out_buffer[last],
|
||||
end_of_record_index [i] - last);
|
||||
if (IPC_STATUS_OK != status) {
|
||||
return status;
|
||||
}
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
}
|
||||
last = end_of_record_index [i];
|
||||
}
|
||||
|
||||
/* else, must be interactive mode */
|
||||
} else {
|
||||
#ifndef HAS_WINDOWS
|
||||
/* send the full buffer over the ipc channel */
|
||||
status = ipc_transport_send_line (&out_buffer[0],
|
||||
end_of_record_index [num_records - 1]);
|
||||
if (IPC_STATUS_OK != status) {
|
||||
return status;
|
||||
}
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
}
|
||||
|
||||
/* reset counts to zero and return */
|
||||
|
|
@ -486,7 +468,7 @@ Ipc_Status_t ipc_send_line_binary (str, len)
|
|||
* make sure that the str will fit:
|
||||
*/
|
||||
if (length + fill_count > OUT_BUFFER_SIZE) {
|
||||
// fprintf (stderr,"ERROR: IPC: String too long to fit in output buffer (> %d bytes) - truncated\n",OUT_BUFFER_SIZE);
|
||||
/* fprintf (stderr,"ERROR: IPC: String too long to fit in output buffer (> %d bytes) - truncated\n",OUT_BUFFER_SIZE); */
|
||||
length = OUT_BUFFER_SIZE - fill_count;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ NON-STANDARD FEATURES
|
|||
|
||||
#ifdef IPC_AEGIS_MAILBOXES
|
||||
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include <apollo/base.h>
|
||||
#include <apollo/mbx.h>
|
||||
|
|
@ -87,7 +86,7 @@ Ipc_Status_t ipc_transport_initialize_server (server_name, m, p,
|
|||
char *batch_filename; /* Batch filename returned */
|
||||
{
|
||||
int len;
|
||||
// extern void *malloc();
|
||||
/* extern void *malloc(); */
|
||||
|
||||
assert (p == IPC_PROTOCOL_V1);
|
||||
|
||||
|
|
|
|||
|
|
@ -90,29 +90,19 @@
|
|||
|
||||
=============================================================================*/
|
||||
|
||||
#include "ngspice.h"
|
||||
|
||||
/* #ifdef IPC_UNIX_SOCKETS */
|
||||
#include "config.h"
|
||||
#ifndef HAS_WINDOWS
|
||||
#ifdef IPC_UNIX_SOCKETS
|
||||
|
||||
/*=== INCLUDE FILES ===*/
|
||||
#include "ngspice.h"
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netdb.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "ipc.h"
|
||||
#include "ipctiein.h"
|
||||
|
||||
|
||||
|
||||
|
||||
/*=== TYPE DEFINITIONS ===*/
|
||||
|
||||
typedef enum {
|
||||
|
|
@ -210,7 +200,7 @@ Ipc_Status_t ipc_transport_initialize_server (server_name, mode, protocol,
|
|||
|
||||
server.sin_family = AF_INET;
|
||||
server.sin_addr.s_addr = INADDR_ANY;
|
||||
server.sin_port = port_num; /* SOCKET_PORT; */
|
||||
server.sin_port = SOCKET_PORT;
|
||||
|
||||
server_length = sizeof (server);
|
||||
if (bind (sock_desc, (struct sockaddr *)&server, server_length)
|
||||
|
|
@ -308,7 +298,8 @@ static u_long bytes_to_integer (str, start)
|
|||
buff[index] = str[index+start];
|
||||
index++;
|
||||
}
|
||||
u = ntohl (*((u_long *) buff));
|
||||
/* u = ntohl (*((u_long *) buff)); */
|
||||
u = strtoul(buff, (char **) NULL, 10);
|
||||
|
||||
return u;
|
||||
} /* end bytes_to_integer */
|
||||
|
|
@ -744,5 +735,4 @@ Ipc_Status_t ipc_transport_terminate_server ()
|
|||
return status;
|
||||
}
|
||||
|
||||
/* #endif IPC_UNIX_SOCKETS */
|
||||
#endif /* ifndef HAS_WINDOWS */
|
||||
#endif /* IPC_UNIX_SOCKETS */
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
*
|
||||
*/
|
||||
|
||||
//#include <port.h>
|
||||
#include "ngspice.h"
|
||||
|
||||
#ifdef IPC_DEBUG_VIA_STDIO
|
||||
|
||||
|
|
|
|||
|
|
@ -53,10 +53,6 @@ NON-STANDARD FEATURES
|
|||
#define CONFIG
|
||||
|
||||
#include "ngspice.h"
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
//#include "util.h"
|
||||
#include "inpdefs.h"
|
||||
#include "gendefs.h"
|
||||
#include "cktdefs.h"
|
||||
|
|
|
|||
Loading…
Reference in New Issue