Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 27040) +++ trunk/scconfig/Rev.h (revision 27041) @@ -1 +1 @@ -static const int myrev = 26986; +static const int myrev = 27041; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 27040) +++ trunk/scconfig/Rev.tab (revision 27041) @@ -1,3 +1,4 @@ +27041 configure hidlib: remove hid_color.[ch] in favor of color_cache 26986 configure hidlib: fallback scripting with libfawk 26982 configure hidlib: conf namespace cleanup 26976 configure rename netlist2.[ch] to netlist.[ch] Index: trunk/src/hid_color.c =================================================================== --- trunk/src/hid_color.c (revision 27040) +++ trunk/src/hid_color.c (nonexistent) @@ -1,88 +0,0 @@ -/* - * COPYRIGHT - * - * pcb-rnd, interactive printed circuit board design - * (this file is based on PCB, interactive printed circuit board design) - * Copyright (C) 1994,1995,1996 Thomas Nau - * Copyright (C) 2004 harry eaton - * Copyright (C) 2016..2018 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 -#include "config.h" -#include "hid_color.h" -#include -#include "compat_misc.h" - -static pcb_hidval_t invalid_color = { 0 }; - -#define HT_HAS_CONST_KEY -typedef char *htsh_key_t; -typedef const char *htsh_const_key_t; -typedef pcb_hidval_t htsh_value_t; -#define HT_INVALID_VALUE invalid_color -#define HT(x) htsh_ ## x -#include -#include -#undef HT - - -int pcb_hid_cache_color(int set, const char *name, pcb_hidval_t * val, void **vcache) -{ - htsh_t *cache; - htsh_entry_t *e; - - cache = (htsh_t *) * vcache; - if (cache == 0) { - cache = htsh_alloc(strhash, strkeyeq); - *vcache = cache; - } - - if (!set) { /* read */ - e = htsh_getentry(cache, (char *)name); - if (e == NULL) /* not found */ - return 0; - memcpy(val, &e->value, sizeof(pcb_hidval_t)); - } - else - htsh_set(cache, pcb_strdup(name), *val); /* write */ - - return 1; -} - -void pcb_hid_cache_color_destroy(void **vcache, void (*user_free)(void **vcache, const char *name, pcb_hidval_t *val)) -{ - htsh_t *cache = (htsh_t *) * vcache; - htsh_entry_t *e; - - if (cache == 0) - return; - - for (e = htsh_first(cache); e; e = htsh_next(cache, e)) { - user_free(vcache, e->key, &e->value); - free(e->key); /* name allocated with pcb_strdup() */ - } - htsh_free(cache); - *vcache = NULL; -} - Index: trunk/src/hid_color.h =================================================================== --- trunk/src/hid_color.h (revision 27040) +++ trunk/src/hid_color.h (nonexistent) @@ -1,15 +0,0 @@ -#ifndef PCB_HID_COLOR_H -#define PCB_HID_COLOR_H - -#include "hid.h" - -/* Used to cache color lookups. If set is zero, it looks up the name - and if found sets val and returns nonzero. If not found, it - returns zero. If set is nonzero, name/val is added to the - cache. */ -int pcb_hid_cache_color(int set, const char *name, pcb_hidval_t * val, void **cache); - -/* Call user_free() on each cache entry and then destroy the cache */ -void pcb_hid_cache_color_destroy(void **vcache, void (*user_free)(void **vcache, const char *name, pcb_hidval_t *val)); - -#endif Index: trunk/src/Makefile.dep =================================================================== --- trunk/src/Makefile.dep (revision 27040) +++ trunk/src/Makefile.dep (revision 27041) @@ -1120,7 +1120,7 @@ ../src_3rd/puplug/error.h pcb-printf.h compat_misc.h \ ../src_plugins/export_dxf/lht_template.h safe_fs.h funchash_core.h \ funchash.h funchash_core_list.h hid.h hid_nogui.h hid_init.h \ - hid_attrib.h hid_color.h hid_cam.h hid_attrib.h \ + hid_attrib.h hid_cam.h hid_attrib.h \ ../src_plugins/export_dxf/dxf_draw.c dolists.h ../src_plugins/export_dxf/dxf_templ_lht.o: \ ../src_plugins/export_dxf/dxf_templ_lht.c @@ -1189,7 +1189,7 @@ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h pcb-printf.h \ compat_misc.h plug_io.h safe_fs.h hid.h hid_nogui.h hid_init.h \ - hid_attrib.h hid_color.h hid_cam.h hid_attrib.h \ + hid_attrib.h hid_cam.h hid_attrib.h \ ../src_plugins/lib_compat_help/pstk_compat.h obj_pstk.h dolists.h ../src_plugins/export_gcode/curve.o: ../src_plugins/export_gcode/curve.c \ ../config.h ../src_plugins/export_gcode/potracelib.h \ @@ -1235,7 +1235,7 @@ ../src_plugins/export_gcode/auxiliary.h \ ../src_plugins/export_gcode/trace.h \ ../src_plugins/export_gcode/decompose.h pcb-printf.h funchash_core.h \ - funchash.h funchash_core_list.h hid_init.h hid_attrib.h hid_color.h \ + funchash.h funchash_core_list.h hid_init.h hid_attrib.h \ dolists.h ../src_plugins/export_gcode/trace.o: ../src_plugins/export_gcode/trace.c \ ../config.h ../src_plugins/export_gcode/potracelib.h \ @@ -1446,7 +1446,7 @@ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h safe_fs.h \ obj_pstk_inlines.h data.h thermal.h polygon1_gen.h funchash_core.h \ funchash.h funchash_core_list.h hid.h hid_nogui.h hid_init.h actions.h \ - hid_attrib.h hid_color.h hid_cam.h hid_attrib.h \ + hid_attrib.h hid_cam.h hid_attrib.h \ ../src_plugins/export_openscad/scad_draw.c \ ../src_plugins/export_openscad/../lib_polyhelp/topoly.h obj_common.h \ plug_io.h ../src_plugins/export_openscad/scad_models.c dolists.h @@ -1476,7 +1476,7 @@ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h safe_fs.h \ funchash_core.h funchash.h funchash_core_list.h hid.h hid_nogui.h \ - ../src_plugins/export_png/png.h hid_init.h hid_attrib.h hid_color.h \ + ../src_plugins/export_png/png.h hid_init.h hid_attrib.h \ hid_cam.h hid_attrib.h dolists.h ../src_plugins/export_ps/eps.o: ../src_plugins/export_ps/eps.c \ ../config.h conf_core.h conf.h global_typedefs.h pcb_bool.h pcb-printf.h \ @@ -1504,7 +1504,7 @@ ../src_plugins/export_ps/ps.h hid_init.h ../src_3rd/puplug/puplug.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/os_dep.h \ ../src_3rd/puplug/config.h ../src_3rd/puplug/libs.h hid_attrib.h \ - hid_cam.h hid_attrib.h hid_color.h funchash_core.h funchash.h \ + hid_cam.h hid_attrib.h funchash_core.h funchash.h \ funchash_core_list.h ../src_plugins/export_ps/ps.o: ../src_plugins/export_ps/ps.c ../config.h \ math_helper.h board.h ../src_3rd/genht/htsp.h ../src_3rd/genht/ht.h \ @@ -1561,7 +1561,7 @@ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h pcb-printf.h \ compat_misc.h plug_io.h safe_fs.h obj_pstk_inlines.h thermal.h \ - polygon1_gen.h hid.h hid_nogui.h hid_init.h hid_attrib.h hid_color.h \ + polygon1_gen.h hid.h hid_nogui.h hid_init.h hid_attrib.h \ hid_cam.h hid_attrib.h dolists.h ../src_plugins/export_stl/export_stl.o: \ ../src_plugins/export_stl/export_stl.c ../config.h actions.h hid.h \ @@ -1604,7 +1604,7 @@ ../src_3rd/puplug/os_dep.h ../src_3rd/puplug/config.h \ ../src_3rd/puplug/libs.h ../src_3rd/puplug/error.h safe_fs.h \ funchash_core.h funchash.h funchash_core_list.h hid.h hid_nogui.h \ - hid_init.h hid_attrib.h hid_color.h hid_cam.h hid_attrib.h dolists.h + hid_init.h hid_attrib.h hid_cam.h hid_attrib.h dolists.h ../src_plugins/export_test/export_test.o: \ ../src_plugins/export_test/export_test.c ../config.h conf_core.h conf.h \ global_typedefs.h pcb_bool.h pcb-printf.h \ @@ -2085,7 +2085,7 @@ data_parent.h misc_util.h obj_line.h ../src_3rd/genlist/gendlist.h \ obj_poly.h polyarea.h route.h draw.h layer.h obj_arc_list.h obj_arc.h \ obj_line_list.h obj_poly_list.h obj_text_list.h obj_text.h font.h \ - ../src_3rd/genht/htip.h grid.h hid_attrib.h hid_color.h funchash_core.h \ + ../src_3rd/genht/htip.h grid.h hid_attrib.h funchash_core.h \ funchash.h funchash_core_list.h ../src_plugins/lib_gtk_common/pcb_gtk.h \ hid.h conf.h ../src_plugins/lib_gtk_common/compat.h \ ../src_plugins/lib_gtk_common/ui_zoompan.h pcb_bool.h \ @@ -6568,7 +6568,7 @@ ../src_3rd/genlist/gendlist.h color.h compat_misc.h event.h hidlib.h \ crosshair.h vtonpoint.h obj_line.h ../src_3rd/genlist/gendlist.h \ obj_poly.h polyarea.h route.h -hid_color.o: hid_color.c ../config.h hid_color.h hid.h \ +hid_color.o: hid_color.c ../config.h hid.h \ ../src_3rd/liblihata/dom.h ../src_3rd/liblihata/lihata.h \ ../src_3rd/liblihata/parser.h ../src_3rd/genht/htsp.h \ ../src_3rd/genht/ht.h error.h global_typedefs.h pcb_bool.h attrib.h \ Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 27040) +++ trunk/src/Makefile.in (revision 27041) @@ -79,7 +79,6 @@ hid_cfg.o hid_cfg_action.o hid_cfg_input.o - hid_color.o hid_dlg.o hid_dad.o hid_dad_tree.o Index: trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c =================================================================== --- trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 27040) +++ trunk/src_plugins/hid_gtk3_cairo/gtkhid-cairo.c (revision 27041) @@ -35,7 +35,6 @@ #include "draw.h" #include "grid.h" #include "hid_attrib.h" -#include "hid_color.h" #include "funchash_core.h" #include "../src_plugins/lib_gtk_common/pcb_gtk.h"