sharedspice.h, .c, prepare adding callback functions: new ngSpice_Init_Evt() and function pointers

This commit is contained in:
h_vogt 2017-05-21 22:00:01 +02:00 committed by Holger Vogt
parent df4136a93d
commit b621875abf
2 changed files with 24 additions and 1 deletions

View File

@ -281,6 +281,14 @@ typedef int (GetSyncData)(double, double*, double, int, int, int, void*);
void* return pointer received from caller void* return pointer received from caller
*/ */
#ifdef XSPICE
/* callback functions
addresses received from caller with ngSpice_Init_Evt() function
*/
typedef int (SendEvtData)();
typedef int (SendInitEvtData)();
#endif
/* ngspice initialization, /* ngspice initialization,
printfcn: pointer to callback function for reading printf, fprintf printfcn: pointer to callback function for reading printf, fprintf
statfcn: pointer to callback function for the status string and percent value statfcn: pointer to callback function for the status string and percent value
@ -325,6 +333,14 @@ pevt_shared_data ngGet_Evt_NodeInfo(char* nodename);
/* get a list of all event nodes */ /* get a list of all event nodes */
IMPEXP IMPEXP
char** ngSpice_AllEvtNodes(void); char** ngSpice_AllEvtNodes(void);
/* initialization of XSPICE callback functions
sevtdata:
sinitevtdata:
userData: pointer to user-defined data, will not be modified, but
handed over back to caller during Callback, e.g. address of calling object */
IMPEXP
int ngSpice_Init_Evt(SendEvtData* sevtdata, SendInitEvtData* sinitevtdata, void* userData);
#endif #endif

View File

@ -964,7 +964,14 @@ bool ngSpice_SetBkpt(double time)
} }
#ifdef XSPICE #ifdef XSPICE
/* get info about the event node vector */ /* return callback initialization addresses to caller */
IMPEXP
int ngSpice_Init_Evt(SendEvtData* sevtdata, SendInitEvtData* sinitevtdata, void* userData)
{
}
/* Get info about the event node vector.
If node_name is NULL, just delete previous data */
IMPEXP IMPEXP
pevt_shared_data ngGet_Evt_NodeInfo(char* node_name) pevt_shared_data ngGet_Evt_NodeInfo(char* node_name)
{ {