Update of /cvsroot/pure-data/externals/clr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5311
Modified Files: PureData.dll test-clr.pd Added Files: clr.cpp Removed Files: clr.c Log Message: Completely rewrote the PD side of clr, using class loader hook and much more efficient access
Index: PureData.dll =================================================================== RCS file: /cvsroot/pure-data/externals/clr/PureData.dll,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsxMqbop and /tmp/cvscY69yk differ
Index: test-clr.pd =================================================================== RCS file: /cvsroot/pure-data/externals/clr/test-clr.pd,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** test-clr.pd 16 Jan 2006 16:26:58 -0000 1.7 --- test-clr.pd 27 Jan 2006 22:53:18 -0000 1.8 *************** *** 1,53 **** ! #N canvas 73 31 760 568 12; ! #X obj 49 51 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 ! -1; ! #X floatatom 65 70 5 0 0 0 - - -; ! #X symbolatom 80 93 10 0 0 0 - - -; ! #X text 146 66 simple messages; ! #X msg 221 95 sel1; ! #X msg 235 118 sel2; ! #X text 282 107 selectors; ! #X msg 244 161 selFloat $1; ! #X obj 247 142 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 ! -1 -1 0 1; ! #X obj 227 263 hsl 128 15 0 127 0 0 empty empty empty -2 -6 0 8 -262144 ! -1 -1 0 1; ! #X text 224 242 mapped to selFloat; ! #X msg 94 210 selGenericList 12 a 0.5 b; ! #X text 93 188 complex list; ! #X obj 82 297 print; ! #X text 43 329 arguments: Class name , Filename; ! #X obj 438 353 clr Counter External.dll 2; ! #X obj 83 267 clr External; ! #X text 43 345 you omit filename if is the same as classname; ! #X text 40 411 you can pass arguments; ! #X text 39 431 in this case you must provide filename too; ! #X floatatom 438 392 5 0 0 0 - - -; ! #X floatatom 438 302 5 0 0 0 - - -; ! #X msg 510 299 init 0; ! #X text 36 453 the parameter is the initial value of the counter; ! #X floatatom 641 320 5 0 0 0 - - -; ! #X text 408 244 this external sums the value passed in the left inlet ! with the stored one; ! #X obj 411 305 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 ! -1; ! #X text 287 3 more than one class can be compiled in the same assembly ! ; ! #X text 37 477 NB: a class corresponding constructor must exist; ! #X msg 309 210 1 2 3 a b c; ! #X connect 0 0 16 0; ! #X connect 1 0 16 0; ! #X connect 2 0 16 0; ! #X connect 4 0 16 0; ! #X connect 5 0 16 0; ! #X connect 7 0 16 0; ! #X connect 8 0 7 0; ! #X connect 9 0 16 1; ! #X connect 11 0 16 0; ! #X connect 15 0 20 0; ! #X connect 16 0 13 0; ! #X connect 21 0 15 0; ! #X connect 22 0 15 0; ! #X connect 24 0 15 1; ! #X connect 26 0 15 0; ! #X connect 29 0 16 0; --- 1,12 ---- ! #N canvas 0 0 454 304 12; ! #X obj 114 183 Counter; ! #X floatatom 35 70 5 0 0 0 - - -; ! #X msg 91 67 bang; ! #X msg 145 69 1 2 3; ! #X symbolatom 204 72 10 0 0 0 - - -; ! #X msg 209 111 msg one 2 three; ! #X connect 1 0 0 0; ! #X connect 2 0 0 0; ! #X connect 3 0 0 0; ! #X connect 4 0 0 0; ! #X connect 5 0 0 0;
--- clr.c DELETED ---
--- NEW FILE: clr.cpp --- // mono extern "C" { #include <mono/jit/jit.h> #include <mono/metadata/object.h> #include <mono/metadata/environment.h> #include <mono/metadata/assembly.h> #include <mono/metadata/debug-helpers.h> #include <mono/metadata/class.h> #include <mono/metadata/metadata.h> }
#ifdef _MSC_VER #pragma warning(disable: 4091) #endif #include <m_pd.h>
#include <assert.h> #include <stdlib.h> #include <string.h> [...1111 lines suppressed...] clr_desc_float = mono_method_desc_new(":MethodFloat",FALSE); assert(clr_desc_float); clr_desc_symbol = mono_method_desc_new(":MethodSymbol",FALSE); assert(clr_desc_symbol); clr_desc_pointer = mono_method_desc_new(":MethodPointer",TRUE); assert(clr_desc_pointer); clr_desc_list = mono_method_desc_new(":MethodList",TRUE); assert(clr_desc_list); clr_desc_anything = mono_method_desc_new(":MethodAnything",TRUE); assert(clr_desc_anything);
// install loader hook sys_loader(classloader);
// ready! post("CLR - (c) Davide Morelli, Thomas Grill"); } else error("clr: mono domain couldn't be initialized!"); }