make the path for fopen more flexible, add e.g. the contents of the 'sourcepath' variable.
This commit is contained in:
parent
2d6ca92a7e
commit
baef6f4957
|
|
@ -32,6 +32,8 @@ keyword. All numeric fields are plain doubles.
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "ngspice/fteext.h"
|
||||||
|
|
||||||
/* token reader: skips '#'-to-EOL comments; returns 1 on a token, 0 on EOF */
|
/* token reader: skips '#'-to-EOL comments; returns 1 on a token, 0 on EOF */
|
||||||
static int
|
static int
|
||||||
nport_tok(FILE *f, char *buf, int cap)
|
nport_tok(FILE *f, char *buf, int cap)
|
||||||
|
|
@ -79,7 +81,7 @@ snp_nport_read(const char *path,
|
||||||
double **presRe, double **presIm,
|
double **presRe, double **presIm,
|
||||||
char *err, int errlen)
|
char *err, int errlen)
|
||||||
{
|
{
|
||||||
FILE *f = fopen(path, "r");
|
FILE *f = inp_pathopen(path, "r");
|
||||||
int N = 0, Np = -1, ver = 0, i, got_hdr = 0;
|
int N = 0, Np = -1, ver = 0, i, got_hdr = 0;
|
||||||
double *poleRe = NULL, *poleIm = NULL, *d = NULL, *e = NULL;
|
double *poleRe = NULL, *poleIm = NULL, *d = NULL, *e = NULL;
|
||||||
double *resRe = NULL, *resIm = NULL;
|
double *resRe = NULL, *resIm = NULL;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue