51 variables = dependencies = NULL;
57 variables = dependencies = NULL;
64 file = d.file ? strdup (d.file) : NULL;
67 for (v = d.dependencies; v != NULL; v = (
vector *) v->
getNext ()) {
71 for (v = variables; v != NULL; v = (
vector *) v->
getNext ()) {
80 for (v = dependencies; v != NULL; v =
n) {
85 for (v = variables; v != NULL; v =
n) {
89 if (file) free (file);
94 if (dependencies) dependencies->
setPrev (v);
102 if (dependencies == v) {
104 if (dependencies) dependencies->
setPrev (NULL);
110 if (next) next->
setPrev (prev);
119 for (
vector *
t = v;
t != NULL;
t = next) {
120 next = (
vector *)
t->getNext ();
144 for (
vector *
t = v;
t != NULL;
t = next) {
145 next = (
vector *)
t->getNext ();
152 if (variables) variables->
setPrev (v);
160 if (variables == v) {
162 if (variables) variables->
setPrev (NULL);
168 if (next) next->
setPrev (prev);
177 for (
vector *
t = v;
t != NULL;
t = next) {
178 next = (
vector *)
t->getNext ();
202 for (
vector *
t = v;
t != NULL;
t = next) {
203 next = (
vector *)
t->getNext ();
215 next = (
vector *)
t->getNext ();
216 if (
t->getDependencies () == NULL) {
217 t->setDependencies (
new strlist (*deps));
228 for (v = variables; v != NULL; v = (
vector *) v->
getNext ()) {
230 if (origin != NULL && n != NULL && !strcmp (n, origin))
233 for (v = dependencies; v != NULL; v = (
vector *) v->
getNext ()) {
235 if (origin != NULL && n != NULL && !strcmp (n, origin))
245 char *
n = v->getOrigin ();
246 if (n != NULL && origin != NULL && !strcmp (origin, n)) {
247 strlist * deplist = v->getDependencies ();
248 if (deplist != NULL) {
255 deplist->
add (depvar);
256 v->setDependencies (deplist);
265 if (v == dep)
return 1;
272 if (v == var)
return 1;
281 if (!strcmp (v->getName (),
n))
292 if (!strcmp (v->getName (),
n))
322 if (file) free (file);
323 file = f ? strdup (f) : NULL;
335 if ((f = fopen (file,
"w")) == NULL) {
337 file, strerror (errno));
343 fprintf (f,
"<Qucs Dataset " PACKAGE_VERSION
">\n");
352 if (v->getDependencies () != NULL)
359 if (file) fclose (f);
397 if (
imag (c) == 0.0) {
398 fprintf (f,
" %+." NR_DECS
"e\n", (
double)
real (c));
401 fprintf (f,
" %+." NR_DECS
"e%cj%." NR_DECS
"e\n", (
double)
real (c),
402 imag (c) >= 0.0 ?
'+' :
'-', (
double) fabs (
imag (c)));
412 if ((f = fopen (file,
"r")) == NULL) {
440 if ((f = fopen (file,
"r")) == NULL) {
465 if ((f = fopen (file,
"r")) == NULL) {
490 if ((f = fopen (file,
"r")) == NULL) {
515 if ((f = fopen (file,
"r")) == NULL) {
540 if ((f = fopen (file,
"r")) == NULL) {