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)
|
||||
|
||||
void cm_cexit(const int);
|
||||
|
||||
#endif /* include guard */
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ struct coreInfo_t {
|
|||
void * ((*dllitf_tmalloc)(size_t));
|
||||
void * ((*dllitf_trealloc)(const void *, size_t));
|
||||
void ((*dllitf_txfree)(const void *));
|
||||
void ((*dllitf_cexit)(const int));
|
||||
|
||||
#ifdef KLU
|
||||
int ((*dllitf_MIFbindCSC) (GENmodel *, CKTcircuit *)) ;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,8 @@ struct coreInfo_t coreInfo =
|
|||
txfree,
|
||||
tmalloc,
|
||||
trealloc,
|
||||
txfree
|
||||
txfree,
|
||||
cm_cexit
|
||||
#else
|
||||
GC_malloc,
|
||||
tcalloc,
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ INTERFACES
|
|||
cm_complex_subtract()
|
||||
cm_complex_multiply()
|
||||
cm_complex_divide()
|
||||
|
||||
cm_cexit()
|
||||
|
||||
REFERENCED FILES
|
||||
|
||||
|
|
@ -51,6 +51,8 @@ NON-STANDARD FEATURES
|
|||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include "ngspice/cm.h"
|
||||
|
||||
extern void controlled_exit(const int);
|
||||
|
||||
/* Corner Smoothing Function ************************************
|
||||
* *
|
||||
|
|
@ -525,4 +527,7 @@ Complex_t cm_complex_divide(Complex_t x, Complex_t y)
|
|||
return(c);
|
||||
}
|
||||
|
||||
|
||||
void cm_cexit(const int exitcode)
|
||||
{
|
||||
controlled_exit(exitcode);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -430,6 +430,10 @@ void txfree(const void *ptr) {
|
|||
(coreitf->dllitf_txfree)(ptr);
|
||||
}
|
||||
|
||||
void cm_cexit(const int exitcode) {
|
||||
(coreitf->dllitf_cexit)(exitcode);
|
||||
}
|
||||
|
||||
#ifdef KLU
|
||||
int MIFbindCSC (GENmodel *inModel, CKTcircuit *ckt) {
|
||||
return (coreitf->dllitf_MIFbindCSC) (inModel, ckt) ;
|
||||
|
|
|
|||
Loading…
Reference in New Issue