Add a code model function cm_exit(const int exitcode).
This function calls controlled_exit(exitcode) to shut down gracefully.
This commit is contained in:
parent
f26dda8616
commit
19ebfb1887
|
|
@ -125,4 +125,6 @@ FILE *fopen_with_path(const char *path, const char *mode);
|
||||||
|
|
||||||
#define CM_IGNORE(x) (void) (x)
|
#define CM_IGNORE(x) (void) (x)
|
||||||
|
|
||||||
|
void cm_cexit(const int);
|
||||||
|
|
||||||
#endif /* include guard */
|
#endif /* include guard */
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,7 @@ struct coreInfo_t {
|
||||||
void * ((*dllitf_tmalloc)(size_t));
|
void * ((*dllitf_tmalloc)(size_t));
|
||||||
void * ((*dllitf_trealloc)(const void *, size_t));
|
void * ((*dllitf_trealloc)(const void *, size_t));
|
||||||
void ((*dllitf_txfree)(const void *));
|
void ((*dllitf_txfree)(const void *));
|
||||||
|
void ((*dllitf_cexit)(const int));
|
||||||
|
|
||||||
#ifdef KLU
|
#ifdef KLU
|
||||||
int ((*dllitf_MIFbindCSC) (GENmodel *, CKTcircuit *)) ;
|
int ((*dllitf_MIFbindCSC) (GENmodel *, CKTcircuit *)) ;
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,8 @@ struct coreInfo_t coreInfo =
|
||||||
txfree,
|
txfree,
|
||||||
tmalloc,
|
tmalloc,
|
||||||
trealloc,
|
trealloc,
|
||||||
txfree
|
txfree,
|
||||||
|
cm_cexit
|
||||||
#else
|
#else
|
||||||
GC_malloc,
|
GC_malloc,
|
||||||
tcalloc,
|
tcalloc,
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ INTERFACES
|
||||||
cm_complex_subtract()
|
cm_complex_subtract()
|
||||||
cm_complex_multiply()
|
cm_complex_multiply()
|
||||||
cm_complex_divide()
|
cm_complex_divide()
|
||||||
|
cm_cexit()
|
||||||
|
|
||||||
REFERENCED FILES
|
REFERENCED FILES
|
||||||
|
|
||||||
|
|
@ -52,6 +52,8 @@ NON-STANDARD FEATURES
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "ngspice/cm.h"
|
#include "ngspice/cm.h"
|
||||||
|
|
||||||
|
extern void controlled_exit(const int);
|
||||||
|
|
||||||
/* Corner Smoothing Function ************************************
|
/* Corner Smoothing Function ************************************
|
||||||
* *
|
* *
|
||||||
* The following function smooths the transition between two *
|
* The following function smooths the transition between two *
|
||||||
|
|
@ -525,4 +527,7 @@ Complex_t cm_complex_divide(Complex_t x, Complex_t y)
|
||||||
return(c);
|
return(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cm_cexit(const int exitcode)
|
||||||
|
{
|
||||||
|
controlled_exit(exitcode);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -430,6 +430,10 @@ void txfree(const void *ptr) {
|
||||||
(coreitf->dllitf_txfree)(ptr);
|
(coreitf->dllitf_txfree)(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cm_cexit(const int exitcode) {
|
||||||
|
(coreitf->dllitf_cexit)(exitcode);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef KLU
|
#ifdef KLU
|
||||||
int MIFbindCSC (GENmodel *inModel, CKTcircuit *ckt) {
|
int MIFbindCSC (GENmodel *inModel, CKTcircuit *ckt) {
|
||||||
return (coreitf->dllitf_MIFbindCSC) (inModel, ckt) ;
|
return (coreitf->dllitf_MIFbindCSC) (inModel, ckt) ;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue