diff --git a/src/include/ngspice/cmproto.h b/src/include/ngspice/cmproto.h index bae49bddb..75e474241 100644 --- a/src/include/ngspice/cmproto.h +++ b/src/include/ngspice/cmproto.h @@ -19,7 +19,8 @@ AUTHORS 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); diff --git a/src/include/ngspice/dllitf.h b/src/include/ngspice/dllitf.h index 8c6ccb8fc..4df1822ad 100644 --- a/src/include/ngspice/dllitf.h +++ b/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)); diff --git a/src/xspice/cm/cm.c b/src/xspice/cm/cm.c index 0de9572f8..daba3020e 100644 --- a/src/xspice/cm/cm.c +++ b/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; +} + diff --git a/src/xspice/cm/cmexport.c b/src/xspice/cm/cmexport.c index aeadd292c..5dabf80bd 100644 --- a/src/xspice/cm/cmexport.c +++ b/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, diff --git a/src/xspice/xspice.c b/src/xspice/xspice.c index 21e0cc880..bfd277710 100644 --- a/src/xspice/xspice.c +++ b/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,