From 438e3d98c18af5c71f4216ba14b33f1e4fde6893 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 23 Apr 2016 16:53:52 +0200 Subject: [PATCH] inpcom.c, improved tprint for debugging --- src/frontend/inpcom.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index 1e4f76ba5..68b5b45c0 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -148,7 +148,7 @@ static char *inp_spawn_brace(char *s); static char *inp_pathresolve(const char *name); static char *inp_pathresolve_at(char *name, char *dir); static char *search_plain_identifier(char *str, const char *identifier); -void tprint(struct line *deck); +void tprint(struct line *deck, int numb); struct inp_read_t { struct line *cc; @@ -530,7 +530,9 @@ inp_readall(FILE *fp, char *dir_name, bool comfile, bool intfile) inp_fix_param_values(working); inp_reorder_params(subckt_w_params, cc); +// tprint(working, 1); inp_fix_inst_calls_for_numparam(subckt_w_params, working); +// tprint(working, 2); delete_names(subckt_w_params); subckt_w_params = NULL; @@ -5875,12 +5877,13 @@ inp_poly_err(struct line *card) * somewhere in function inp_readall() of this file to have * a printout of the actual deck written to file "tprint-out.txt" */ void -tprint(struct line *t) +tprint(struct line *t, int numb) { struct line *tmp; + char *filename = tprintf("tprint-out%d.txt", numb); /*debug: print into file*/ - FILE *fd = fopen("tprint-out.txt", "w"); + FILE *fd = fopen(filename, "w"); for (tmp = t; tmp; tmp = tmp->li_next) if (*(tmp->li_line) != '*') fprintf(fd, "%6d %6d %s\n", tmp->li_linenum_orig, tmp->li_linenum, tmp->li_line); @@ -5896,6 +5899,7 @@ tprint(struct line *t) if (*(tmp->li_line) != '*') fprintf(fd, "%s\n",tmp->li_line); fclose(fd); + tfree(filename); }