annotate pads2gpcb/mainoutput.c @ 105:1629fff165fb

SC75A.fp: created based on E-Sample version, with simplified silk courtyard
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 02 Oct 2019 05:12:36 +0000
parents 58f11f06d831
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
74
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
1 #include <stdio.h>
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
2 #include <stdlib.h>
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
3 #include "globals.h"
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
4 #include "struct.h"
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
5
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
6 write_elements_pcb(filename)
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
7 char *filename;
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
8 {
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
9 struct part_instance *p;
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
10 FILE *outf;
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
11
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
12 outf = fopen(filename, "w");
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
13 if (!outf) {
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
14 perror(filename);
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
15 exit(1);
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
16 }
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
17 for (p = part_inst_list; p; p = p->next) {
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
18 if (!p->newname)
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
19 continue;
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
20 write_gpcb_element(outf, p->body, p->type->alpha_pins,
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
21 p->type->name, p->newname, p->decal->name,
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
22 p->onbottom);
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
23 }
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
24 fclose(outf);
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
25 return(0);
58f11f06d831 pads2gpcb: main output implemented
Mychaela Falconia <falcon@ivan.Harhan.ORG>
parents:
diff changeset
26 }