Index: trunk/scconfig/Rev.h =================================================================== --- trunk/scconfig/Rev.h (revision 33367) +++ trunk/scconfig/Rev.h (revision 33368) @@ -1 +1 @@ -static const int myrev = 33318; +static const int myrev = 33368; Index: trunk/scconfig/Rev.tab =================================================================== --- trunk/scconfig/Rev.tab (revision 33367) +++ trunk/scconfig/Rev.tab (revision 33368) @@ -1,3 +1,4 @@ +33368 configure scripting support cleanup 33318 distclean switch over to using librnd as a whole 33267 configure remove vtlibrary (footprint lib allocation simplification) 33056 configure menu item for feature plugins: asm and shape Index: trunk/src_plugins/script/live_script.c =================================================================== --- trunk/src_plugins/script/live_script.c (revision 33367) +++ trunk/src_plugins/script/live_script.c (revision 33368) @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -96,71 +97,7 @@ } #ifdef RND_HAVE_SYS_FUNGW -#include -typedef struct pup_list_parse_pup_s pup_list_parse_pup_t; - -struct pup_list_parse_pup_s { - int (*open)(pup_list_parse_pup_t *ctx, const char *path); - void (*close)(pup_list_parse_pup_t *ctx, const char *path); - int (*line_raw)(pup_list_parse_pup_t *ctx, const char *path, char *line); - void *user_data; -}; - -static void pup_list_parse_pups(pup_list_parse_pup_t *ctx, const char **paths) -{ - const char **path; - - for(path = paths; *path != NULL; path++) { - char fn[RND_PATH_MAX*2], *fn_end; - int dirlen; - const char *fname; - void *d = pup_open_dir(*path); - - if (d == NULL) - continue; - - dirlen = strlen(*path); - memcpy(fn, *path, dirlen); - fn_end = fn + dirlen; - *fn_end = RND_DIR_SEPARATOR_C; - fn_end++; - - while((fname = pup_read_dir(d)) != NULL) { - FILE *f; - int len = strlen(fname); - char *s, line[1024]; - const char *end; - - if (len < 5) - continue; - - end = fname + len -4; - if (strcmp(end, ".pup") != 0) - continue; - - if ((ctx->open != NULL) && (ctx->open(ctx, fname) != 0)) - continue; - - strcpy(fn_end, fname); - - f = rnd_fopen(NULL, fn, "r"); - if (f == NULL) - continue; - while((s = fgets(line, sizeof(line), f)) != NULL) { - while(isspace(*s)) s++; - - if ((ctx->line_raw != NULL) && (ctx->line_raw(ctx, fname, s) != 0)) - break; - } - fclose(f); - if (ctx->close != NULL) - ctx->close(ctx, fname); - } - rnd_closedir(d); - } -} - static int lvs_list_langs_open(pup_list_parse_pup_t *ctx, const char *path) { if (strncmp(path, "fungw_", 6) != 0) Index: trunk/src_plugins/script/script.c =================================================================== --- trunk/src_plugins/script/script.c (revision 33367) +++ trunk/src_plugins/script/script.c (revision 33368) @@ -2,7 +2,7 @@ * COPYRIGHT * * pcb-rnd, interactive printed circuit board design - * Copyright (C) 2018 Tibor 'Igor2' Palinkas + * Copyright (C) 2018,2020 Tibor 'Igor2' Palinkas * * This module, debug, was written and is Copyright (C) 2016 by Tibor Palinkas * this module is also subject to the GNU GPL as described below