Index: cam.c =================================================================== --- cam.c (revision 28033) +++ cam.c (revision 28034) @@ -177,7 +177,7 @@ } if (pcb_strcasecmp(cmd, "gui") == 0) { - rs = cam_gui(arg); + rs = cam_gui(argv[0].val.argv0.user_call_ctx, arg); } else { if (arg == NULL) { Index: cam_compile.c =================================================================== --- cam_compile.c (revision 28033) +++ cam_compile.c (revision 28034) @@ -81,7 +81,7 @@ case PCB_CAM_PARTIAL: if (code->op.partial.arg != NULL) { ctx->partial = 1; - pcb_actionva("query", "setflag:exportsel", code->op.partial.arg, NULL); + pcb_actionva(&PCB->hidlib, "query", "setflag:exportsel", code->op.partial.arg, NULL); } else { if (ctx->partial) { Index: cam_compile.h =================================================================== --- cam_compile.h (revision 28033) +++ cam_compile.h (revision 28034) @@ -73,6 +73,7 @@ #include typedef struct { + pcb_hidlib_t *hidlib; char *prefix; /* strdup'd file name prefix from the last prefix command */ pcb_hid_t *exporter; unsigned partial:1; /* when 1, there are objects marked with the EXPORTSEL flag */ Index: cam_gui.c =================================================================== --- cam_gui.c (revision 28033) +++ cam_gui.c (revision 28034) @@ -199,7 +199,7 @@ if (row != NULL) { const char *outfile = ctx->dlg[ctx->woutfile].val.str; char *tmp = pcb_strdup_printf("outfile=%s", outfile); - pcb_actionva("cam", "call", row->cell[0], tmp, NULL); + pcb_actionva(ctx->cam.hidlib, "cam", "call", row->cell[0], tmp, NULL); free(tmp); } } @@ -257,7 +257,7 @@ PCB_DAD_END(ctx->dlg); } -static int cam_gui(const char *arg) +static int cam_gui(pcb_hidlib_t *hidlib, const char *arg) { cam_dlg_t *ctx = calloc(sizeof(cam_dlg_t), 1); const char *opt_hdr[] = {"key", "option value", NULL}; @@ -265,6 +265,7 @@ const char *digest_hdr[] = {"file", "plugin", "layer groups", NULL}; pcb_hid_dad_buttons_t clbtn[] = {{"Close", 0}, {NULL, 0}}; + ctx->cam.hidlib = hidlib; ctx->cam.vars = pcb_cam_vars_alloc(); PCB_DAD_BEGIN_VBOX(ctx->dlg);