1 --- algoscore.c 2008-11-06 07:22:28.000000000 -0600
2 +++ algoscore.c.new 2010-08-25 16:59:35.010000562 -0500
11 //#include "watchdog.h"
16 +static naRef f_printerr(naContext c, naRef me, int argc, naRef* args)
19 + for(i=0; i<argc; i++) {
20 + naRef s = naStringValue(c, args[i]);
21 + if(naIsNil(s)) continue;
22 + g_printerr("%s",naStr_data(s));
23 +// fwrite(naStr_data(s), 1, naStr_len(s), stdout);
28 static naRef print_handler, printerr_handler;
30 void print_handler_wrapper(const gchar *s) {
35 +static naRef f_load_plugin(naContext c, naRef me, int argc, naRef* args) {
37 + void *handle = dlopen(naStr_data(args[0]),RTLD_LAZY);
39 + naRef (*init_func)(naContext);
40 + init_func = dlsym(handle, "init_nasal_namespace");
41 + if(init_func!=NULL) {
49 gboolean algoscore_idle_proc(gpointer data) {
53 #define F(x) naAddSym(ctx, namespace, #x, naNewFunc(ctx, naNewCCode(ctx, f_##x)))
58 F(set_printerr_handler);
64 #ifdef MAC_INTEGRATION
65 F(ige_mac_menu_set_menu_bar);
66 F(ige_mac_menu_set_quit_menu_item);