Index: trunk/scconfig/Makefile =================================================================== --- trunk/scconfig/Makefile (revision 2217) +++ trunk/scconfig/Makefile (revision 2218) @@ -1,6 +1,9 @@ # --- configuration part -- # - generic configuration - +SRC=src +BIN=src + # what cflags to use to compile scconfig USER_CFLAGS = -Wall -g -DGENCALL -Isrc Index: trunk/scconfig/plugins.h =================================================================== --- trunk/scconfig/plugins.h (revision 2217) +++ trunk/scconfig/plugins.h (revision 2218) @@ -33,8 +33,9 @@ plugin_def("export_lpr", "lpr exporter (printer)", sbuildin) plugin_def("export_ps", "postscript exporter", sbuildin) -plugin_header("\nIO plugins (core file formats):\n") +plugin_header("\nIO plugins (file formats):\n") plugin_def("io_pcb", "the original pcb format", sbuildin) +plugin_def("io_kicad_legacy", "Kicad's legacy format ", sdisable) plugin_header("\nHID plugins:\n") plugin_def("hid_batch", "batch process (no-gui HID)",sbuildin) Index: trunk/src_plugins/io_kicad_legacy/HACKING =================================================================== --- trunk/src_plugins/io_kicad_legacy/HACKING (nonexistent) +++ trunk/src_plugins/io_kicad_legacy/HACKING (revision 2218) @@ -0,0 +1,5 @@ +The plugin is disabled by default for now. This lets you work on it without +having to worry whether you break other people's compilation. You need to +enable it in your compilation, tho, when running configure: + +./configure --buildin-io_kicad_legacy Index: trunk/src_plugins/io_kicad_legacy/Makefile =================================================================== --- trunk/src_plugins/io_kicad_legacy/Makefile (nonexistent) +++ trunk/src_plugins/io_kicad_legacy/Makefile (revision 2218) @@ -0,0 +1,5 @@ +all: + cd ../../src && make mod_io_kicad_legacy + +clean: + rm *.o *.so 2>/dev/null ; true Index: trunk/src_plugins/io_kicad_legacy/Plug.tmpasm =================================================================== --- trunk/src_plugins/io_kicad_legacy/Plug.tmpasm (nonexistent) +++ trunk/src_plugins/io_kicad_legacy/Plug.tmpasm (revision 2218) @@ -0,0 +1,10 @@ +put /local/pcb/mod {io_kicad_legacy} +put /local/pcb/mod/OBJS [@ $(PLUGDIR)/io_kicad_legacy/io_kicad_legacy.o $(PLUGDIR)/io_kicad_legacy/write.o @] +#put /local/pcb/mod/YACC {$(PLUGDIR)/io_kicad_legacy/parse_y} +#put /local/pcb/mod/LEX {$(PLUGDIR)/io_kicad_legacy/parse_l} + +switch /local/pcb/io_kicad_legacy/controls + case {buildin} include /local/pcb/tmpasm/buildin; end; + case {plugin} include /local/pcb/tmpasm/plugin; end; + case {disable} include /local/pcb/tmpasm/disable; end; +end Index: trunk/src_plugins/io_kicad_legacy/README =================================================================== --- trunk/src_plugins/io_kicad_legacy/README (nonexistent) +++ trunk/src_plugins/io_kicad_legacy/README (revision 2218) @@ -0,0 +1,5 @@ +Load and save the design and elements in Kicad's legacy format. + +#state: work-in-progress +#default: disabled +#implements: io Index: trunk/src_plugins/io_kicad_legacy/io_kicad_legacy.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/io_kicad_legacy.c (nonexistent) +++ trunk/src_plugins/io_kicad_legacy/io_kicad_legacy.c (revision 2218) @@ -0,0 +1,56 @@ +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 2016 Tibor 'Igor2' Palinkas + * + * This module, io_kicad_legacy, was written and is Copyright (C) 2016 by Tibor Palinkas + * this module is also subject to the GNU GPL as described below + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ + +#include "config.h" +#include "global.h" +#include "plugins.h" +#include "parse_l.h" +#include "file.h" + +static plug_io_t io_kicad_legacy; + +static void hid_io_kicad_legacy_uninit(void) +{ + /* Runs once when the plugin is unloaded. TODO: free plugin-globals here. */ +} + +pcb_uninit_t hid_io_kicad_legacy_init(void) +{ + + /* register the IO hook */ + io_kicad_legacy.plugin_data = NULL; + io_kicad_legacy.parse_pcb = NULL; + io_kicad_legacy.parse_element = NULL; + io_kicad_legacy.parse_font = NULL; + io_kicad_legacy.write_buffer = io_kicad_legacy_write_buffer; + io_kicad_legacy.write_element = io_kicad_legacy_write_element; + io_kicad_legacy.write_pcb = io_kicad_legacy_write_pcb; + HOOK_REGISTER(plug_io_t, plug_io_chain, &io_kicad_legacy); + + /* TODO: Alloc plugin-globals here. */ + + return hid_io_kicad_legacy_uninit; +} + Index: trunk/src_plugins/io_kicad_legacy/write.c =================================================================== --- trunk/src_plugins/io_kicad_legacy/write.c (nonexistent) +++ trunk/src_plugins/io_kicad_legacy/write.c (revision 2218) @@ -0,0 +1,94 @@ +/* $Id$ */ + +/* + * COPYRIGHT + * + * PCB, interactive printed circuit board design + * Copyright (C) 1994,1995,1996,1997,1998,2005,2006 Thomas Nau + * Copyright (C) 2015 Tibor 'Igor2' Palinkas + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * Contact addresses for paper mail and Email: + * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany + * Thomas.Nau@rz.uni-ulm.de + * + */ + +#include "config.h" +#include "conf_core.h" + +#include + +#include "global.h" + +#include +#include +#include + +#include "buffer.h" +#include "change.h" +#include "create.h" +#include "crosshair.h" +#include "data.h" +#include "error.h" +#include "file.h" +#include "plug_io.h" +#include "hid.h" +#include "misc.h" +#include "move.h" +#include "mymem.h" +#include "parse_l.h" +#include "pcb-printf.h" +#include "polygon.h" +#include "rats.h" +#include "remove.h" +#include "set.h" +#include "strflags.h" +#include "compat_fs.h" +#include "paths.h" +#include "rats_patch.h" +#include "stub_edif.h" +#include "hid_actions.h" +#include "hid_flags.h" +#include "flags.h" +#include "attribs.h" +#include "route_style.h" + + +RCSID("$Id$"); + +/* writes element data */ +int io_kicad_legacy_write_element(plug_io_t *ctx, FILE * FP, DataTypePtr Data) +{ + fputs("io_kicad_legacy_write_element()", FP); + return 0; +} + +/* writes the buffer to file */ +int io_kicad_legacy_write_buffer(plug_io_t *ctx, FILE * FP, BufferType *buff) +{ + fputs("io_kicad_legacy_write_buffer()", FP); + return 0; +} + +/* --------------------------------------------------------------------------- + * writes PCB to file + */ +int io_kicad_legacy_write_pcb(plug_io_t *ctx, FILE * FP) +{ + fputs("io_kicad_legacy_write_pcb()", FP); + return 0; +}