/************* * Main header file for ngspice * 1999 E. Rouat ************/ #ifndef NGSPICE_H_INCLUDED /* va */ #define NGSPICE_H_INCLUDED /* #include "memwatch.h" #define MEMWATCH */ /* * This file will eventually replace spice.h and lots of other * files in src/include */ #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif #include "config.h" #include #ifdef HAVE_LIMITS_H # include #endif #ifdef HAVE_FLOAT_H # include #endif #include "ngspice/memory.h" #include "ngspice/defines.h" #include "ngspice/macros.h" #include "ngspice/bool.h" #include "ngspice/complex.h" #include "ngspice/typedefs.h" #include #include #ifdef HAVE_IEEEFP_H #include #endif #include "ngspice/missing_math.h" #ifdef STDC_HEADERS # include # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_CTYPE_H # include #endif #ifdef HAVE_FCNTL_H #include #endif #ifdef HAVE_TERMIOS_H #include #else # ifdef HAVE_SGTTY_H # include # else # ifdef HAVE_TERMIO_H # include # endif # endif #endif #ifdef HAVE_PWD_H #include #endif #ifdef HAVE_NETINET_IN_H #include #endif #ifdef HAVE_NETDB_H #include #endif #ifdef HAVE_SYS_SOCKET_H #include #endif #ifdef HAVE_SYS_WAIT_H #include #endif #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_DIR_H #include #else # ifdef HAVE_DIRENT_H # include # include # ifndef direct # define direct dirent # endif # endif #endif #ifdef HAVE_GETRLIMIT # include # include #endif #ifdef HAVE_GETRUSAGE # ifndef HAVE_GETRLIMIT # include # include # endif #else # ifdef HAVE_TIMES # include # include # else # ifdef HAVE_FTIME # include # endif # endif #endif #ifdef HAVE_UNISTD_H #include #include #endif #ifdef HAS_TIME_H #include #endif #ifdef HAS_WINDOWS #include "ngspice/wstdio.h" #endif #if defined (__MINGW32__) || defined (__CYGWIN__) || defined (_MSC_VER) #include #else # ifdef HAVE_SYS_IO_H # include # endif #endif #if defined (__MINGW32__) #include /* getpid() */ #endif #if defined (_MSC_VER) #include #include #define strdup _strdup #define unlink _unlink #define fileno _fileno #define getcwd _getcwd #define chdir _chdir #define isnan _isnan #define finite _finite #define scalb _scalb #define logb _logb #define getpid _getpid #define access _access #define dup2 _dup2 #define open _open #define write _write #define strcasecmp _stricmp #define snprintf _snprintf #define inline __inline /* NAN not available in MS VS 2008 */ #ifndef NAN static const __int64 global_nan = 0x7ff8000000000000i64; #define NAN (*(const double *) &global_nan) #endif // warning C4127: Bedingter Ausdruck ist konstant #pragma warning(disable: 4127) #endif /* Fast random number generator */ //#define FastRand #define WaGauss #define RR_MAX RAND_MAX #ifdef HAVE_INDEX # define strchr index # define strrchr rindex #else /* va: no index, but strchr */ # ifdef HAVE_STRCHR # define index strchr # define rindex strrchr # endif /* va: no index, but strchr */ #endif /* added for CYGWIN */ #ifndef HUGE #define HUGE HUGE_VAL #endif extern char *gettok_noparens(char **s); extern char *gettok_node(char **s); extern char *gettok_iv(char **s); extern int get_l_paren(char **s); extern int get_r_paren(char **s); /* Some external variables */ extern char *Spice_Exec_Dir; extern char *Spice_Lib_Dir; extern char *Def_Editor; extern char *Bug_Addr; extern int AsciiRawFile; extern char *Spice_Host; extern char *Spiced_Log; extern char Spice_Version[]; extern char Spice_Notice[]; extern char Spice_Build_Date[]; extern char Spice_Manual[]; extern char *News_File; extern char *Default_MFB_Cap; extern char *Spice_Path; extern char *Help_Path; extern char *Lib_Path; extern char *Inp_Path; extern int ARCHme; /* My logical process number */ extern int ARCHsize; /* Total number of processes */ #if ADMS >= 3 int load_vadev(CKTcircuit *ckt, char *name); #endif #ifdef TCL_MODULE #include extern int tcl_printf(const char *format, ...); extern int tcl_fprintf(FILE *f, const char *format, ...); #undef printf #define printf tcl_printf #undef perror #define perror(string) fprintf(stderr,"%s: %s\n",string,sys_errlist[errno]) #endif /* macro to ignore unused variables and parameters */ #define NG_IGNORE(x) (void)x #define NG_IGNOREABLE(x) (void)x #endif /* NGSPICE_H_INCLUDED */