void libdir_setup(void) { int major, minor, bugfix; sys_getversion(&major, &minor, &bugfix); if (major>0 || minor >=47) { sys_register_loader((void*)libdir_loader_pathwise); } else { sys_register_loader((void*)libdir_loader_legacy); } logpost(NULL, 3, "libdir loader %s",version); logpost(NULL, 3, "\tcompiled on "__DATE__" at "__TIME__ " "); logpost(NULL, 3, "\tcompiled against Pd version %d.%d.%d.%s", PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION, PD_TEST_VERSION); libdir_class = class_new(gensym("libdir"), libdir_new, 0, sizeof(t_object), CLASS_NOINLET, 0); }
void autoabstraction_setup(void) { /* relies on t.grill's loader functionality, fully added in 0.40 */ iemguts_boilerplate("automatic abstraction creator", 0); #ifdef AUTOABSTRACTION_ENABLED autoabstraction_initialize(); sys_register_loader(autoabstraction_loader); #else error("autoabstraction needs to be compiled against Pd 0.40 or higher,\n"); error("\tor a version that has sys_register_loader()"); #endif autoabstraction_class = class_new(gensym("autoabstraction"), (t_newmethod)autoabstraction_new, 0, sizeof(t_autoabstraction), 0, A_GIMME, 0); class_addfloat(autoabstraction_class, (t_method)autoabstraction_state); }
void tclpd_setup(void) { if(tclpd_interp) { return; } /* verbose(-1) post to the pd window at level 3 */ verbose(-1, "tclpd loader v" TCLPD_VERSION); /* kludge to work around tclpd messing up the loading of UTF-8 patches. This * should really be solved correctly, its probably caused by the * locale/encoding not being setup correctly, perhaps in pd itself */ #if defined __gnu_linux__ || defined __GNU__ || defined __FreeBSD_kernel__ char *lang = getenv("LANG"); setenv("LANG", "C", 1); #endif proxyinlet_setup(); tclpd_interp = Tcl_CreateInterp(); Tcl_Init(tclpd_interp); Tclpd_SafeInit(tclpd_interp); #if defined __gnu_linux__ || defined __GNU__ || defined __FreeBSD_kernel__ setenv("LANG", lang, 1); #endif Tcl_Eval(tclpd_interp, "package provide Tclpd " TCLPD_VERSION); t_class *foo_class = class_new(gensym("tclpd_init"), 0, 0, 0, 0, 0); char buf[PATH_MAX]; snprintf(buf, PATH_MAX, "%s/tclpd.tcl", foo_class->c_externdir->s_name); verbose(-1, "tclpd: trying to load %s...", buf); int result = Tcl_EvalFile(tclpd_interp, buf); switch(result) { case TCL_ERROR: error("tclpd: error loading %s", buf); break; case TCL_RETURN: error("tclpd: warning: %s exited with code return", buf); break; case TCL_BREAK: case TCL_CONTINUE: error("tclpd: warning: %s exited with code break/continue", buf); break; } verbose(-1, "tclpd: loaded %s", buf); sys_register_loader(tclpd_do_load_lib); }
void autoabstraction_setup(void) { /* relies on t.grill's loader functionality, fully added in 0.40 */ post("automatic abstraction creator %s",version); post("\twritten by IOhannes m zmoelnig, IEM <*****@*****.**>"); post("\tcompiled on "__DATE__" at "__TIME__ " "); post("\tcompiled against Pd version %d.%d.%d.%s", PD_MAJOR_VERSION, PD_MINOR_VERSION, PD_BUGFIX_VERSION, PD_TEST_VERSION); #ifdef AUTOABSTRACTION_ENABLED autoabstraction_initialize(); sys_register_loader(autoabstraction_loader); #else error("to function, this needs to be compiled against Pd 0.40 or higher,\n"); error("\tor a version that has sys_register_loader()"); #endif autoabstraction_class = class_new(gensym("autoabstraction"), (t_newmethod)autoabstraction_new, 0, sizeof(t_autoabstraction), 0, A_GIMME, 0); class_addfloat(autoabstraction_class, (t_method)autoabstraction_state); }
void tclpd_setup(void) { if(tclpd_interp) { return; } /* verbose(-1) post to the pd window at level 3 */ verbose(-1, "tclpd loader v" TCLPD_VERSION); proxyinlet_setup(); tclpd_interp = Tcl_CreateInterp(); Tcl_Init(tclpd_interp); Tclpd_SafeInit(tclpd_interp); Tcl_Eval(tclpd_interp, "package provide Tclpd " TCLPD_VERSION); t_class *foo_class = class_new(gensym("tclpd_init"), 0, 0, 0, 0, 0); char buf[PATH_MAX]; snprintf(buf, PATH_MAX, "%s/tclpd.tcl", foo_class->c_externdir->s_name); verbose(-1, "tclpd: trying to load %s...", buf); int result = Tcl_EvalFile(tclpd_interp, buf); switch(result) { case TCL_ERROR: error("tclpd: error loading %s", buf); break; case TCL_RETURN: error("tclpd: warning: %s exited with code return", buf); break; case TCL_BREAK: case TCL_CONTINUE: error("tclpd: warning: %s exited with code break/continue", buf); break; } verbose(-1, "tclpd: loaded %s", buf); sys_register_loader(tclpd_do_load_lib); }