plug-ins/script-fu/script-fu.c added an eval PDB interface for running

* plug-ins/script-fu/script-fu.c
* plug-ins/script-fu/script-fu-console.[ch]: added an eval
PDB interface for running arbitrary scheme code

* app/batch.c: redid batch mode to use script-fu-eval

* app/main.c: fixed command line parsing for batch mode and
image loading

-Yosh
This commit is contained in:
Manish Singh
1998-09-10 19:03:20 +00:00
parent bdc82fb50a
commit e5ef178966
7 changed files with 135 additions and 270 deletions

View File

@ -554,3 +554,40 @@ script_fu_close_siod_console ()
close (siod_output_pipe[0]);
close (siod_output_pipe[1]);
}
void
script_fu_eval_run (char *name,
int nparams,
GParam *params,
int *nreturn_vals,
GParam **return_vals)
{
static GParam values[1];
GStatusType status = STATUS_SUCCESS;
GRunModeType run_mode;
run_mode = params[0].data.d_int32;
switch (run_mode)
{
case RUN_NONINTERACTIVE:
if (repl_c_string (params[1].data.d_string, 0, 0, 1) != 0)
status = STATUS_EXECUTION_ERROR;
break;
case RUN_INTERACTIVE:
case RUN_WITH_LAST_VALS:
status = STATUS_CALLING_ERROR;
gimp_message ("Script-Fu evaluate mode allows only noninteractive invocation");
break;
default:
break;
}
*nreturn_vals = 1;
*return_vals = values;
values[0].type = PARAM_STATUS;
values[0].data.d_status = status;
}