Browse Source

Add function

char* ngCM_Input_Path(const char* path);
to shared  ngspice API
to send file path for code model input files (e.g. dsource).
Such path cannot be extracted automatically when netlist has
been sent by ngSpice_Circ
pre-master-46
Holger Vogt 3 years ago
parent
commit
eb70d81dab
  1. 6
      src/include/ngspice/sharedspice.h
  2. 16
      src/sharedspice.c

6
src/include/ngspice/sharedspice.h

@ -365,12 +365,16 @@ Commands are executed immediately */
IMPEXP IMPEXP
int ngSpice_Command(char* command); int ngSpice_Command(char* command);
/* get info about a vector */ /* get info about a vector */
IMPEXP IMPEXP
pvector_info ngGet_Vec_Info(char* vecname); pvector_info ngGet_Vec_Info(char* vecname);
#ifdef XSPICE #ifdef XSPICE
/* Set the input path for files loaded by code models.
If NULL is sent, return the current Infile_Path. */
IMPEXP
char* ngCM_Input_Path(const char* path);
/* get info about the event node vector */ /* get info about the event node vector */
IMPEXP IMPEXP
pevt_shared_data ngGet_Evt_NodeInfo(char* nodename); pevt_shared_data ngGet_Evt_NodeInfo(char* nodename);

16
src/sharedspice.c

@ -1085,6 +1085,22 @@ int ngSpice_Command(char* comexec)
return 1; return 1;
} }
#ifdef XSPICE
/* Set the input path for files loaded by code models.
If NULL is sent, return the current Infile_Path. */
IMPEXP
char *ngCM_Input_Path(const char* path)
{
/* delete existing command memory */
if (path) {
txfree(Infile_Path);
Infile_Path = copy(path);
}
fprintf(stdout, "Note: Codel model file loading path is %s\n", Infile_Path);
return Infile_Path;
}
#endif
/* Return information about a vector to the caller */ /* Return information about a vector to the caller */
IMPEXP IMPEXP
pvector_info ngGet_Vec_Info(char* vecname) pvector_info ngGet_Vec_Info(char* vecname)

Loading…
Cancel
Save