Index: trunk/src_plugins/fp_fs/fp_fs.c =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.c (revision 33110) +++ trunk/src_plugins/fp_fs/fp_fs.c (revision 33111) @@ -42,6 +42,7 @@ #include "data.h" #include #include +#include #include "plug_footprint.h" #include "plug_io.h" #include @@ -48,6 +49,7 @@ #include #include #include +#include #include "conf_core.h" #include #include @@ -57,7 +59,10 @@ #define FP_FS_CONF_FN "ar_extern.conf" static conf_fp_fs_t conf_fp_fs; +static const char fp_fs_cookie[] = "fp_fs plugin"; +static vtp0_t remove_regex; + #include "conf_internal.c" /*** low level map cache ***/ @@ -512,8 +517,34 @@ rnd_tempfile_unlink((char *)fctx->field[F_TMPNAME].p); } +static void fp_fs_free_remove_regex(void) +{ + long n; + for(n = 0; n < remove_regex.used; n++) + re_sei_free(remove_regex.array[n]); + vtp0_uninit(&remove_regex); +} +static void fp_fs_cfg_cb(rnd_conf_native_t *cfg, int arr_idx) +{ + int n; + rnd_conf_listitem_t *ci; + const char *p; + + fp_fs_free_remove_regex(); + vtp0_init(&remove_regex); + rnd_conf_loop_list_str(&conf_fp_fs.plugins.fp_fs.remove_regex, ci, p, n) { + re_sei_t *regex = re_sei_comp(p); + if (regex != NULL) + vtp0_append(&remove_regex, regex); + else + rnd_message(RND_MSG_ERROR, "fp_fs: failed to compile remove_regex: '%s'\n", p); + } +} + + static pcb_plug_fp_t fp_fs; +static rnd_conf_hid_id_t cfgid; int pplg_check_ver_fp_fs(int ver_needed) { return 0; } @@ -521,14 +552,19 @@ { RND_HOOK_UNREGISTER(pcb_plug_fp_t, pcb_plug_fp_chain, &fp_fs); + rnd_conf_hid_unreg(fp_fs_cookie); + rnd_conf_unreg_file(FP_FS_CONF_FN, fp_fs_conf_internal); fp_fs_cache_uninit(&fp_fs_cache); rnd_conf_unreg_fields("plugins/fp_fs/"); + fp_fs_free_remove_regex(); } int pplg_init_fp_fs(void) { + static rnd_conf_hid_callbacks_t cbs; + RND_API_CHK_VER; fp_fs.plugin_data = NULL; fp_fs.load_dir = fp_fs_load_dir; @@ -543,5 +579,9 @@ rnd_conf_reg_field(conf_fp_fs, field,isarray,type_name,cpath,cname,desc,flags); #include "fp_fs_conf_fields.h" + cfgid = rnd_conf_hid_reg(fp_fs_cookie, NULL); + cbs.val_change_post = fp_fs_cfg_cb; + rnd_conf_hid_set_cb(rnd_conf_get_field("plugins/fp_fs/remove_regex"), cfgid, &cbs); + return 0; } Index: trunk/src_plugins/fp_fs/fp_fs.conf =================================================================== --- trunk/src_plugins/fp_fs/fp_fs.conf (revision 33110) +++ trunk/src_plugins/fp_fs/fp_fs.conf (revision 33111) @@ -11,6 +11,15 @@ .html .pcb } + li:remove_regex = { + {.tdx$} + {.fp$} + {.ele$} + {.subc_lht$} + {.lht$} + {.bxl$} + {.kicad_mod$} + } } } } Index: trunk/src_plugins/fp_fs/fp_fs_conf.h =================================================================== --- trunk/src_plugins/fp_fs/fp_fs_conf.h (revision 33110) +++ trunk/src_plugins/fp_fs/fp_fs_conf.h (revision 33111) @@ -8,6 +8,7 @@ const struct { RND_CFT_LIST ignore_prefix; /* ignore file names starting with these prefixes */ RND_CFT_LIST ignore_suffix; /* ignore file names ending with these suffixes */ + RND_CFT_LIST remove_regex; /* regex's used to remove 'file extension', e.g. .fp or .lht to match footprint file name to footprint sch name */ } fp_fs; } plugins; } conf_fp_fs_t;