Index: Makefile =================================================================== --- Makefile (nonexistent) +++ Makefile (revision 29468) @@ -0,0 +1,6 @@ +all: + cd ../../src && $(MAKE) mod_import_net_cmd + +clean: + rm *.o *.so 2>/dev/null ; true + Index: Plug.tmpasm =================================================================== --- Plug.tmpasm (nonexistent) +++ Plug.tmpasm (revision 29468) @@ -0,0 +1,8 @@ +put /local/pcb/mod {import_net_cmd} +append /local/pcb/mod/OBJS [@ $(PLUGDIR)/import_net_cmd/import_net_cmd.o @] + +switch /local/pcb/import_net_cmd/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: import_net_cmd.c =================================================================== --- import_net_cmd.c (nonexistent) +++ import_net_cmd.c (revision 29468) @@ -0,0 +1,75 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * (this file is based on PCB, interactive printed circuit board design) + * Copyright (C) 2020 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + */ + +#include "config.h" + +#include +#include +#include + +#include "plug_import.h" + +static pcb_plug_import_t import_net_cmd; + + +int net_cmd_support_prio(pcb_plug_import_t *ctx, unsigned int aspects, FILE *fp, const char *filename) +{ + if (aspects != IMPORT_ASPECT_NETLIST) + return 0; /* only pure netlist import is supported */ + + return 100; +} + + +static int net_cmd_import(pcb_plug_import_t *ctx, unsigned int aspects, const char *fn) +{ + return -1; +} + +int pplg_check_ver_import_net_cmd(int ver_needed) { return 0; } + +void pplg_uninit_import_net_cmd(void) +{ + PCB_HOOK_UNREGISTER(pcb_plug_import_t, pcb_plug_import_chain, &import_net_cmd); +} + +int pplg_init_import_net_cmd(void) +{ + PCB_API_CHK_VER; + + /* register the IO hook */ + import_net_cmd.plugin_data = NULL; + + import_net_cmd.fmt_support_prio = net_cmd_support_prio; + import_net_cmd.import = net_cmd_import; + import_net_cmd.name = "sch/netlist by cmd"; + + PCB_HOOK_REGISTER(pcb_plug_import_t, pcb_plug_import_chain, &import_net_cmd); + + return 0; +} + Index: import_net_cmd.pup =================================================================== --- import_net_cmd.pup (nonexistent) +++ import_net_cmd.pup (revision 29468) @@ -0,0 +1,10 @@ +$class import +$short sch/net import: run custom cmd +$long Import schematics/netlist by running a commandline +$state works +$fmt-native no +$fmt-feature-r Import schematics by running a commandline +$fmt-feature-r Import netlist by running a commandline +$package import-net +default buildin +autoload 1