# HG changeset patch # User Mychaela Falconia # Date 1454287524 0 # Node ID 58f11f06d831327a32f90a93dc1dbb3b14c0e972 # Parent bdfd0b802bb0f2a67985750badf8843a48b27cba pads2gpcb: main output implemented diff -r bdfd0b802bb0 -r 58f11f06d831 pads2gpcb/Makefile --- a/pads2gpcb/Makefile Mon Feb 01 00:29:36 2016 +0000 +++ b/pads2gpcb/Makefile Mon Feb 01 00:45:24 2016 +0000 @@ -1,7 +1,7 @@ CC= gcc CFLAGS= -O2 -OBJS= decals.o fpmanip.o globals.o gpcbout.o main.o partinst.o parttype.o \ - rdunits.o readpads.o silkselect.o util.o writeelem.o +OBJS= decals.o fpmanip.o globals.o gpcbout.o main.o mainoutput.o partinst.o \ + parttype.o rdunits.o readpads.o silkselect.o util.o writeelem.o HDRS= globals.h gpcbout.h struct.h PROG= pads2gpcb BINDIR= /usr/local/bin diff -r bdfd0b802bb0 -r 58f11f06d831 pads2gpcb/main.c --- a/pads2gpcb/main.c Mon Feb 01 00:29:36 2016 +0000 +++ b/pads2gpcb/main.c Mon Feb 01 00:45:24 2016 +0000 @@ -87,5 +87,7 @@ goto loop; } } + if (main_output) + write_elements_pcb(main_output); exit(0); } diff -r bdfd0b802bb0 -r 58f11f06d831 pads2gpcb/mainoutput.c --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pads2gpcb/mainoutput.c Mon Feb 01 00:45:24 2016 +0000 @@ -0,0 +1,26 @@ +#include +#include +#include "globals.h" +#include "struct.h" + +write_elements_pcb(filename) + char *filename; +{ + struct part_instance *p; + FILE *outf; + + outf = fopen(filename, "w"); + if (!outf) { + perror(filename); + exit(1); + } + for (p = part_inst_list; p; p = p->next) { + if (!p->newname) + continue; + write_gpcb_element(outf, p->body, p->type->alpha_pins, + p->type->name, p->newname, p->decal->name, + p->onbottom); + } + fclose(outf); + return(0); +}