Index: plug-ins/script-fu/scheme-wrapper.c =================================================================== --- plug-ins/script-fu/scheme-wrapper.c (revision 23402) +++ plug-ins/script-fu/scheme-wrapper.c (working copy) @@ -47,9 +47,6 @@ #include "scheme-wrapper.h" -static ts_output_func ts_output_handler = NULL; -static gpointer ts_output_data = NULL; - #undef cons struct named_constant @@ -192,14 +189,6 @@ static scheme sc; void -ts_register_output_func (ts_output_func func, - gpointer user_data) -{ - ts_output_handler = func; - ts_output_data = user_data; -} - -void ts_stdout_output_func (TsOutputType type, const char *string, int len, @@ -264,19 +253,6 @@ ts_get_success_msg (void) return "Success"; } -/* len is length of 'string' in bytes or -1 for null terminated strings */ -void -ts_output_string (TsOutputType type, - const char *string, - int len) -{ - if (len < 0) - len = strlen (string); - - if (ts_output_handler && len > 0) - (* ts_output_handler) (type, string, len, ts_output_data); -} - static void init_constants (void); static void init_procedures (void); Index: plug-ins/script-fu/tinyscheme/scheme.c =================================================================== --- plug-ins/script-fu/tinyscheme/scheme.c (revision 23402) +++ plug-ins/script-fu/tinyscheme/scheme.c (working copy) @@ -41,13 +41,36 @@ #include #include #include +#include #include #include "scheme-private.h" #if !STANDALONE -#include "../scheme-wrapper.h" +static ts_output_func ts_output_handler = NULL; +static gpointer ts_output_data = NULL; + +void +ts_register_output_func (ts_output_func func, + gpointer user_data) +{ + ts_output_handler = func; + ts_output_data = user_data; +} + +/* len is length of 'string' in bytes or -1 for null terminated strings */ +void +ts_output_string (TsOutputType type, + const char *string, + int len) +{ + if (len < 0) + len = strlen (string); + + if (ts_output_handler && len > 0) + (* ts_output_handler) (type, string, len, ts_output_data); +} #endif /* Used for documentation purposes, to signal functions in 'interface' */ Index: plug-ins/script-fu/tinyscheme/scheme.h =================================================================== --- plug-ins/script-fu/tinyscheme/scheme.h (revision 23402) +++ plug-ins/script-fu/tinyscheme/scheme.h (working copy) @@ -114,6 +114,22 @@ typedef struct num { } value; } num; +#if !STANDALONE + +typedef enum { TS_OUTPUT_NORMAL, TS_OUTPUT_ERROR } TsOutputType; + +typedef void (* ts_output_func) (TsOutputType type, + const char *string, + int len, + gpointer data); + +SCHEME_EXPORT void ts_register_output_func (ts_output_func func, + gpointer user_data); +SCHEME_EXPORT void ts_output_string (TsOutputType type, + const char *string, + int len); +#endif + SCHEME_EXPORT scheme *scheme_init_new(); SCHEME_EXPORT scheme *scheme_init_new_custom_alloc(func_alloc malloc, func_dealloc free); SCHEME_EXPORT int scheme_init(scheme *sc); Index: plug-ins/script-fu/scheme-wrapper.h =================================================================== --- plug-ins/script-fu/scheme-wrapper.h (revision 23402) +++ plug-ins/script-fu/scheme-wrapper.h (working copy) @@ -19,15 +19,7 @@ #ifndef SCHEME_WRAPPER_H #define SCHEME_WRAPPER_H -typedef enum { TS_OUTPUT_NORMAL, TS_OUTPUT_ERROR } TsOutputType; - -typedef void (* ts_output_func) (TsOutputType type, - const char *string, - int len, - gpointer data); - -void ts_register_output_func (ts_output_func func, - gpointer user_data); +#include "tinyscheme/scheme.h" void ts_stdout_output_func (TsOutputType type, const char *string, @@ -48,10 +40,6 @@ void tinyscheme_init (cons gboolean local_register_scripts); void tinyscheme_deinit (void); -void ts_output_string (TsOutputType type, - const char *string, - int len); - void ts_interpret_stdin (void); /* if the return value is 0, success. error otherwise. */