1 /**********
2 Copyright 1990 Regents of the University of California.  All rights reserved.
3 Author: 1985 Thomas L. Quarles
4 **********/
5 /*
6  */
7 
8     /* INPlist(file,deck,type)
9      *  provide an input listing on the specified file of the given
10      *  card deck.  The listing should be of either PHYSICAL or LOGICAL
11      *  lines as specified by the type parameter.
12      */
13 
14 #include "ngspice/ngspice.h"
15 #include <stdio.h>
16 #include "ngspice/inpdefs.h"
17 #include "inpxx.h"
18 
19 extern void INPlist(FILE *file, struct card *deck, int type);  /* nowhere used function */
20 
INPlist(FILE * file,struct card * deck,int type)21 void INPlist(FILE * file, struct card *deck, int type)
22 {
23 
24     struct card *here;
25     struct card *there;
26 
27     if (type == LOGICAL) {
28 	for (here = deck; here != NULL; here = here->nextcard) {
29 	    fprintf(file, "%6d : %s\n", here->linenum, here->line);
30 	    if (here->error != NULL) {
31 		fprintf(file, "%s", here->error);
32 	    }
33 	}
34     } else if (type == PHYSICAL) {
35 	for (here = deck; here != NULL; here = here->nextcard) {
36 	    if (here->actualLine == NULL) {
37 		fprintf(file, "%6d : %s\n", here->linenum, here->line);
38 		if (here->error != NULL) {
39 		    fprintf(file, "%s", here->error);
40 		}
41 	    } else {
42 		for (there = here->actualLine; there != NULL;
43 		     there = there->nextcard) {
44 		    fprintf(file, "%6d : %s\n", there->linenum,
45 			    there->line);
46 		    if (there->error != NULL) {
47 			fprintf(file, "%s", there->error);
48 		    }
49 		}
50 	    }
51 	}
52     }
53 }
54