Index: trunk/src/pcb-printf.c =================================================================== --- trunk/src/pcb-printf.c (revision 4605) +++ trunk/src/pcb-printf.c (revision 4606) @@ -843,7 +843,7 @@ } -char *pcb_strdup_subst(const char *template, int (*cb)(gds_t *s, const char **input)) +char *pcb_strdup_subst(const char *template, int (*cb)(void *ctx, gds_t *s, const char **input), void *ctx) { gds_t s; const char *curr, *next; @@ -864,7 +864,7 @@ curr = next+1; break; default: - if (cb(&s, &next) != 0) { + if (cb(ctx, &s, &next) != 0) { /* keep the directive intact */ gds_append(&s, '%'); } Index: trunk/src/pcb-printf.h =================================================================== --- trunk/src/pcb-printf.h (revision 4605) +++ trunk/src/pcb-printf.h (revision 4606) @@ -122,6 +122,6 @@ on unknown directive (whcih will be copied verbatim). %% will always be translated into a single %, without calling cb. */ -char *pcb_strdup_subst(const char *template, int (*cb)(gds_t *s, const char **input)); +char *pcb_strdup_subst(const char *template, int (*cb)(void *ctx, gds_t *s, const char **input), void *ctx); #endif Index: trunk/src/plug_io.c =================================================================== --- trunk/src/plug_io.c (revision 4605) +++ trunk/src/plug_io.c (revision 4606) @@ -691,7 +691,7 @@ backup_timer = gui->add_timer(backup_cb, 1000 * conf_core.rc.backup_interval, x); } -int pcb_build_fn_cb(gds_t *s, const char **input) +int pcb_build_fn_cb(void *ctx, gds_t *s, const char **input) { char buff[20]; @@ -745,7 +745,7 @@ static char *build_fn(const char *template) { - return pcb_strdup_subst(template, pcb_build_fn_cb); + return pcb_strdup_subst(template, pcb_build_fn_cb, NULL); } /* --------------------------------------------------------------------------- Index: trunk/src/plug_io.h =================================================================== --- trunk/src/plug_io.h (revision 4605) +++ trunk/src/plug_io.h (revision 4606) @@ -166,6 +166,6 @@ %N name of the current pcb %T wall time (Epoch) */ -int pcb_build_fn_cb(gds_t *s, const char **input); +int pcb_build_fn_cb(void *ctx, gds_t *s, const char **input); #endif Index: trunk/src_plugins/io_lihata/write.c =================================================================== --- trunk/src_plugins/io_lihata/write.c (revision 4605) +++ trunk/src_plugins/io_lihata/write.c (revision 4606) @@ -761,7 +761,7 @@ if ((fnpat != NULL) && (*fnpat != '\0')) { char *orig_fn; - char *pcb_fn = pcb_strdup_subst(fnpat, pcb_build_fn_cb); + char *pcb_fn = pcb_strdup_subst(fnpat, pcb_build_fn_cb, NULL); orig_fn = PCB->Filename; PCB->Filename = NULL;