Browse Source

new callback function cm_get_path, which makes the global

ngspice variable Infile_Path available to XSPICE code models
pre-master-46
h_vogt 12 years ago
parent
commit
0a17d46509
  1. 5
      src/include/ngspice/cmproto.h
  2. 1
      src/include/ngspice/dllitf.h
  3. 14
      src/xspice/cm/cm.c
  4. 1
      src/xspice/cm/cmexport.c
  5. 1
      src/xspice/xspice.c

5
src/include/ngspice/cmproto.h

@ -19,7 +19,8 @@ AUTHORS
MODIFICATIONS
<date> <person name> <nature of modifications>
01/17/14 Holger Vogt
Add function cm_get_path
SUMMARY
@ -93,6 +94,8 @@ Complex_t cm_complex_subtract(Complex_t x, Complex_t y);
Complex_t cm_complex_multiply(Complex_t x, Complex_t y);
Complex_t cm_complex_divide(Complex_t x, Complex_t y);
char *cm_get_path(void);
FILE *cm_stream_out(void);
FILE *cm_stream_in(void);
FILE *cm_stream_err(void);

1
src/include/ngspice/dllitf.h

@ -63,6 +63,7 @@ struct coreInfo_t {
Complex_t ((*dllitf_cm_complex_subtract)(Complex_t, Complex_t));
Complex_t ((*dllitf_cm_complex_multiply)(Complex_t, Complex_t));
Complex_t ((*dllitf_cm_complex_divide)(Complex_t, Complex_t));
char * ((*dllitf_cm_get_path)(void));
FILE * ((*dllitf_cm_stream_out)(void));
FILE * ((*dllitf_cm_stream_in)(void));
FILE * ((*dllitf_cm_stream_err)(void));

14
src/xspice/cm/cm.c

@ -36,6 +36,7 @@ INTERFACES
cm_message_get_errmsg()
cm_message_send()
cm_get_path()
REFERENCED FILES
@ -691,3 +692,16 @@ void cm_analog_auto_partial(void)
g_mif_info.auto_partial.local = MIF_TRUE;
}
/*
cm_get_path()
Return the path of the first file given on the command line
after the command line options or set by the 'source' command.
Will be used in function fopen_with_path().
*/
char *cm_get_path(void)
{
return Infile_Path;
}

1
src/xspice/cm/cmexport.c

@ -63,6 +63,7 @@ struct coreInfo_t coreInfo =
cm_complex_subtract,
cm_complex_multiply,
cm_complex_divide,
cm_get_path,
no_file,
no_file,
no_file,

1
src/xspice/xspice.c

@ -61,6 +61,7 @@ struct coreInfo_t coreInfo =
cm_complex_subtract,
cm_complex_multiply,
cm_complex_divide,
cm_get_path,
no_file,
no_file,
no_file,

Loading…
Cancel
Save