From 3ecc23e290937eaf70245556be2c88d9aed754d5 Mon Sep 17 00:00:00 2001 From: h_vogt Date: Sat, 28 Feb 2009 14:03:08 +0000 Subject: [PATCH] flag OUTDECK yields printout of deck after param substitution --- ChangeLog | 4 ++++ src/frontend/inp.c | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index dcb6b10e9..8f096bfb9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-28 Holger Vogt + * inp.c:605 ff, fcn inp_spsource(), if preproc. flag OUTDECK defined, + the deck is saved as debug-out2.txt, here after parameter substitution + 2009-02-25 Holger Vogt * inpdomod.c:436 error message adapted to existing devices * /frontend/numparam/numparam.h, general.h: length of char arrays diff --git a/src/frontend/inp.c b/src/frontend/inp.c index eddd42889..cbfda7ccb 100644 --- a/src/frontend/inp.c +++ b/src/frontend/inp.c @@ -57,6 +57,13 @@ static char * upper(register char *string); static bool doedit(char *filename); static void line_free_x(struct line * deck, bool recurse); + +/* uncomment this line for getting deck output after all + manipulations into debug-out2.txt. + Used to check numpram substitution, compare to debug.out.txt + retrieved from inpcom.c, fcn inp_readall()*/ +/* #define OUTDECK */ + /* Do a listing. Use is listing [expanded] [logical] [physical] [deck] */ void com_listing(wordlist *wl) @@ -594,6 +601,20 @@ inp_spsource(FILE *fp, bool comfile, char *filename) printf("In inp_spsource, done with dodeck.\n"); #endif +/* print out the expanded deck into debug-out2.txt */ +#if defined(TRACE) || defined(OUTDECK) + { + FILE *fdo; + struct line *tmp_ptr1 = NULL; + /*debug: print into file*/ + fdo = fopen("debug-out2.txt", "w"); + for(tmp_ptr1 = deck; tmp_ptr1 != NULL; tmp_ptr1 = tmp_ptr1->li_next) + fprintf(fdo, "%s\n", tmp_ptr1->li_line); + ; + (void) fclose(fdo); + } +#endif + /* Now that the deck is loaded, do the commands, if there are any */ if (controls) { for (end = wl = wl_reverse(controls); wl; wl = wl->wl_next)