Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 7410) +++ trunk/scconfig/Rev.h (revision 7411) @@ -1 +1 @@ -static const int myrev = 7398; +static const int myrev = 7411; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 7410) +++ trunk/scconfig/Rev.tab (revision 7411) @@ -1,4 +1,4 @@ -7398 configure new plugin for non-graphical tEDAx sheets +7411 configure new plugin for non-graphical tEDAx sheets 7370 configure cleanup: get rid of local "inline" defs 7322 configure enable io_altium by default 7257 configure plugin config for io_altium Index: trunk/src/libcschem/Makefile.in =================================================================== --- trunk/src/libcschem/Makefile.in (revision 7410) +++ trunk/src/libcschem/Makefile.in (revision 7411) @@ -32,6 +32,7 @@ integrity.o intersect.o libcschem.o + non_graphical.o oidpath.o op_common.o operation.o Index: trunk/src/libcschem/non_graphical.c =================================================================== --- trunk/src/libcschem/non_graphical.c (nonexistent) +++ trunk/src/libcschem/non_graphical.c (revision 7411) @@ -0,0 +1,45 @@ +/* + * COPYRIGHT + * + * cschem - modular/flexible schematics editor - sch-rnd (executable) + * Copyright (C) 2023 Tibor 'Igor2' Palinkas + * + * (Supported by NLnet NGI0 Entrust in 2023) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version.* + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; 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/sch-rnd + * contact lead developer: http://www.repo.hu/projects/sch-rnd/contact.html + * mailing list: http://www.repo.hu/projects/sch-rnd/contact.html + */ + +#include "config.h" + +#include "concrete.h" +#include "non_graphical.h" + +void csch_non_graphical_impl_pre_unload(csch_non_graphical_impl_t *impl) +{ + rnd_design_t *curr; + for(curr = gdl_first(&rnd_designs); curr != NULL; curr = gdl_next(&rnd_designs, curr)) { + csch_sheet_t *sheet = (csch_sheet_t *)curr; + if (sheet->non_graphical && (sheet->non_graphical_impl == impl) && (impl->free_sheet != NULL)) { + impl->free_sheet(sheet); + sheet->non_graphical_impl = NULL; + sheet->non_graphical_data = NULL; + } + } +} Index: trunk/src/libcschem/non_graphical.h =================================================================== --- trunk/src/libcschem/non_graphical.h (revision 7410) +++ trunk/src/libcschem/non_graphical.h (revision 7411) @@ -34,3 +34,8 @@ }; +/* Iterate over all sheets and call ->free_sheet() if the sheet is handled + by impl. This should be called before a plugin that implements + non_graphical sheets is unloaded so the callbacks are not left behind */ +void csch_non_graphical_impl_pre_unload(csch_non_graphical_impl_t *impl); +