diff options
author | Thomas Grill <xovo@users.sourceforge.net> | 2006-03-07 13:18:32 +0000 |
---|---|---|
committer | Thomas Grill <xovo@users.sourceforge.net> | 2006-03-07 13:18:32 +0000 |
commit | 88ae96ff82ddc836a822a55aef17ea66ca06ac65 (patch) | |
tree | 28b5260ba5e0f2ced6f99ea5a28f49546a3322e6 | |
parent | 6ef70933fef8baaf373e43b3f2a02f3a6b083171 (diff) |
restructured project (MSVC can't cope well with folder/classname mismatch)
search for CLR DLLs in PD path
first steps to efficient method handling
svn path=/trunk/externals/clr/; revision=4656
-rwxr-xr-x | Counter/AssemblyInfo.cs (renamed from external/AssemblyInfo.cs) | 0 | ||||
-rwxr-xr-x | Counter/Counter.cs (renamed from external/Counter.cs) | 37 | ||||
-rw-r--r--[-rwxr-xr-x] | Counter/Counter.csproj (renamed from external/external.csproj) | 13 | ||||
-rwxr-xr-x | Counter/README.txt (renamed from external/README.txt) | 0 | ||||
-rwxr-xr-x | PureData/AssemblyInfo.cs (renamed from pd/AssemblyInfo.cs) | 0 | ||||
-rwxr-xr-x | PureData/Atom.cs (renamed from pd/Atom.cs) | 4 | ||||
-rw-r--r-- | PureData/PureData.cs | 64 | ||||
-rw-r--r--[-rwxr-xr-x] | PureData/PureData.csproj (renamed from pd/pd.csproj) | 6 | ||||
-rwxr-xr-x | PureData/README.txt (renamed from pd/README.txt) | 0 | ||||
-rwxr-xr-x | clr.cpp | 210 | ||||
-rwxr-xr-x | external/external.sln | 21 | ||||
-rw-r--r-- | pd/PureData.cs | 48 | ||||
-rwxr-xr-x | pd/pd.sln | 21 |
13 files changed, 228 insertions, 196 deletions
diff --git a/external/AssemblyInfo.cs b/Counter/AssemblyInfo.cs index f341568..f341568 100755 --- a/external/AssemblyInfo.cs +++ b/Counter/AssemblyInfo.cs diff --git a/external/Counter.cs b/Counter/Counter.cs index da2b814..bf1a9d1 100755 --- a/external/Counter.cs +++ b/Counter/Counter.cs @@ -6,7 +6,7 @@ using System; public class Counter: PureData.External { - public Counter(PureData.AtomList args) + public Counter(PureData.AtomList args) { Post("Count.ctor "+args.ToString()); @@ -15,48 +15,37 @@ public class Counter: } // this function MUST exist - public static void Main() + private static void Setup(Counter obj) { - Post("Count.Main"); + Add(new MethodBang(obj.MyBang)); + Add(new MethodFloat(obj.MyFloat)); + Add(new MethodSymbol(obj.MySymbol)); + Add(new MethodList(obj.MyList)); + + Post("Count.Main"); } -/* - public void MyBang() + protected virtual void MyBang() { Post("Count-BANG"); } - public void MyFloat(float f) - { - Post(String.Format("Count-FLOAT {0}",f)); - } -*/ - protected override void MethodBang() - { - Post("Count-BANG"); - } - - protected override void MethodFloat(float f) + protected virtual void MyFloat(float f) { Post("Count-FLOAT "+f.ToString()); } - protected override void MethodSymbol(PureData.Symbol s) + protected virtual void MySymbol(PureData.Symbol s) { Post("Count-SYMBOL "+s.ToString()); } - protected override void MethodList(PureData.AtomList l) + protected virtual void MyList(PureData.AtomList l) { Post("Count-LIST "+l.ToString()); } - /* - public void Init(float f) - { - curr = (int) f; - } - +/* public void SendOut() { pd.SendToOutlet(x, 0, new Atom(curr)); diff --git a/external/external.csproj b/Counter/Counter.csproj index 3848266..4502d55 100755..100644 --- a/external/external.csproj +++ b/Counter/Counter.csproj @@ -3,7 +3,7 @@ ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" - ProjectGuid = "{FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}" + ProjectGuid = "{8CFEFB15-2A72-45B5-BC99-3BAFFB2B27C3}" > <Build> <Settings @@ -18,7 +18,7 @@ OutputType = "Library" PreBuildEvent = "" PostBuildEvent = "" - RootNamespace = "PureData" + RootNamespace = "Counter" RunPostBuildEvent = "OnBuildSuccess" StartupObject = "" > @@ -36,7 +36,7 @@ NoStdLib = "false" NoWarn = "" Optimize = "false" - OutputPath = "..\" + OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" @@ -76,14 +76,13 @@ /> <Reference Name = "System.XML" - AssemblyName = "System.Xml" + AssemblyName = "System.XML" HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> <Reference Name = "PureData" - AssemblyName = "PureData" - HintPath = "..\PureData.dll" - Private = "False" + Project = "{0015D5E7-B0FB-4F06-B334-225447D1F992}" + Package = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}" /> </References> </Build> diff --git a/external/README.txt b/Counter/README.txt index dd2d745..dd2d745 100755 --- a/external/README.txt +++ b/Counter/README.txt diff --git a/pd/AssemblyInfo.cs b/PureData/AssemblyInfo.cs index 93484d8..93484d8 100755 --- a/pd/AssemblyInfo.cs +++ b/PureData/AssemblyInfo.cs diff --git a/pd/Atom.cs b/PureData/Atom.cs index d872961..6a29483 100755 --- a/pd/Atom.cs +++ b/PureData/Atom.cs @@ -15,12 +15,12 @@ namespace PureData public Symbol(string s) { - sym = Core.SymGen(s); + sym = Internal.SymGen(s); } public override string ToString() { - return Core.SymEval(sym); + return Internal.SymEval(sym); } } diff --git a/PureData/PureData.cs b/PureData/PureData.cs new file mode 100644 index 0000000..c9ac143 --- /dev/null +++ b/PureData/PureData.cs @@ -0,0 +1,64 @@ +using System; +using System.Runtime.CompilerServices; // for extern import +using System.Runtime.InteropServices; // for structures + +namespace PureData +{ + // PD core functions + public unsafe class Internal + { + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static void *SymGen(string sym); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + internal extern static string SymEval(void *sym); + } + + // This is the base class for a PD/CLR external + public unsafe class External + { + // PD object pointer + private readonly void *ptr; + + // -------------------------------------------------------------------------- + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Post(string message); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void PostError(string message); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void PostBug(string message); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void PostVerbose(string message); + + // -------------------------------------------------------------------------- + + protected delegate void MethodBang(); + protected delegate void MethodFloat(float f); + protected delegate void MethodSymbol(Symbol s); + protected delegate void MethodPointer(Pointer p); + protected delegate void MethodList(AtomList lst); + protected delegate void MethodAnything(Symbol tag,AtomList lst); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Add(MethodBang m); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Add(MethodFloat m); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Add(MethodSymbol m); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Add(MethodPointer m); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Add(MethodList m); + + [MethodImplAttribute (MethodImplOptions.InternalCall)] + protected extern static void Add(MethodAnything m); + } +} diff --git a/pd/pd.csproj b/PureData/PureData.csproj index 8dd510d..f1b3d08 100755..100644 --- a/pd/pd.csproj +++ b/PureData/PureData.csproj @@ -3,7 +3,7 @@ ProjectType = "Local" ProductVersion = "7.10.3077" SchemaVersion = "2.0" - ProjectGuid = "{FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}" + ProjectGuid = "{0015D5E7-B0FB-4F06-B334-225447D1F992}" > <Build> <Settings @@ -36,7 +36,7 @@ NoStdLib = "false" NoWarn = "" Optimize = "false" - OutputPath = "..\" + OutputPath = "bin\Debug\" RegisterForComInterop = "false" RemoveIntegerChecks = "false" TreatWarningsAsErrors = "false" @@ -76,7 +76,7 @@ /> <Reference Name = "System.XML" - AssemblyName = "System.Xml" + AssemblyName = "System.XML" HintPath = "..\..\..\..\..\WINDOWS\Microsoft.NET\Framework\v1.1.4322\System.XML.dll" /> </References> diff --git a/pd/README.txt b/PureData/README.txt index 323f00c..323f00c 100755 --- a/pd/README.txt +++ b/PureData/README.txt @@ -27,10 +27,12 @@ extern "C" { #include <map> +#define CORELIB "PureData" +#define DLLEXT "dll" static MonoDomain *monodomain; static MonoClass *clr_symbol,*clr_pointer,*clr_atom,*clr_atomlist,*clr_external; -static MonoMethodDesc *clr_desc_main,*clr_desc_ctor; +static MonoMethodDesc *clr_desc_tostring,*clr_desc_ctor; static MonoMethodDesc *clr_desc_bang,*clr_desc_float,*clr_desc_symbol,*clr_desc_pointer,*clr_desc_list,*clr_desc_anything; static MonoMethod *ext_method_bang,*ext_method_float,*ext_method_symbol,*ext_method_list,*ext_method_pointer,*ext_method_anything; @@ -45,6 +47,7 @@ typedef struct MonoClass *mono_class; MonoClassField *mono_obj_field; MonoMethod *mono_ctor; + t_symbol *name; // ClrMethodMap *methods; } t_clr_class; @@ -65,6 +68,21 @@ typedef struct +// Print error message given by exception +static void error_exc(char *txt,char *cname,MonoObject *exc) +{ + MonoMethod *m = mono_method_desc_search_in_class(clr_desc_tostring,mono_get_exception_class()); + assert(m); + m = mono_object_get_virtual_method(exc,m); + assert(m); + MonoString *str = (MonoString *)mono_runtime_invoke(m,exc,NULL,NULL); + assert(str); + error("CLR class %s: %s",txt,cname); + error(mono_string_to_utf8(str)); +} + + + static void clr_method_bang(t_clr *x) { assert(x && x->clr_clss); @@ -72,9 +90,7 @@ static void clr_method_bang(t_clr *x) assert(m); MonoObject *exc; mono_runtime_invoke(m,x->mono_obj,NULL,&exc); - if(exc) { - error("Exception raised"); - } + if(exc) error_exc("Exception raised",x->clr_clss->name->s_name,exc); } static void clr_method_float(t_clr *x,t_float f) @@ -85,9 +101,7 @@ static void clr_method_float(t_clr *x,t_float f) gpointer args = &f; MonoObject *exc; mono_runtime_invoke(m,x->mono_obj,&args,&exc); - if(exc) { - error("Exception raised"); - } + if(exc) error_exc("Exception raised",x->clr_clss->name->s_name,exc); } static void clr_method_symbol(t_clr *x,t_symbol *s) @@ -104,9 +118,24 @@ static void clr_method_symbol(t_clr *x,t_symbol *s) #endif MonoObject *exc; mono_runtime_invoke(m,x->mono_obj,&args,&exc); - if(exc) { - error("Exception raised"); - } + if(exc) error_exc("Exception raised",x->clr_clss->name->s_name,exc); +} + +static void clr_method_pointer(t_clr *x,t_gpointer *p) +{ + assert(x && x->clr_clss); + MonoMethod *m = mono_object_get_virtual_method(x->mono_obj,ext_method_pointer); + assert(m); +#if 0 + MonoObject *ptrobj = mono_value_box(monodomain,clr_pointer,&p); + MonoObject *o = (MonoObject *)mono_object_unbox(ptrobj); + gpointer args = o; +#else + gpointer args = &p; +#endif + MonoObject *exc; + mono_runtime_invoke(m,x->mono_obj,&args,&exc); + if(exc) error_exc("Exception raised",x->clr_clss->name->s_name,exc); } struct AtomList @@ -151,28 +180,7 @@ static void clr_method_list(t_clr *x,t_symbol *l, int argc, t_atom *argv) #endif MonoObject *exc; mono_runtime_invoke(m,x->mono_obj,&args,&exc); - if(exc) { - error("Exception raised"); - } -} - -static void clr_method_pointer(t_clr *x,t_gpointer *p) -{ - assert(x && x->clr_clss); - MonoMethod *m = mono_object_get_virtual_method(x->mono_obj,ext_method_pointer); - assert(m); -#if 0 - MonoObject *ptrobj = mono_value_box(monodomain,clr_pointer,&p); - MonoObject *o = (MonoObject *)mono_object_unbox(ptrobj); - gpointer args = o; -#else - gpointer args = &p; -#endif - MonoObject *exc; - mono_runtime_invoke(m,x->mono_obj,&args,&exc); - if(exc) { - error("Exception raised"); - } + if(exc) error_exc("Exception raised",x->clr_clss->name->s_name,exc); } static void clr_method_anything(t_clr *x,t_symbol *sl, int argc, t_atom *argv) @@ -197,7 +205,6 @@ static void clr_method_anything(t_clr *x,t_symbol *sl, int argc, t_atom *argv) #endif } - // this function is called by mono when it wants post messages to pd static void PD_Post(MonoString *str) { @@ -235,6 +242,35 @@ static MonoString *PD_SymEval(t_symbol *sym) return mono_string_new(monodomain,sym->s_name); } +static void PD_AddBang(MonoObject *method) +{ + post("Add bang method"); +} + +static void PD_AddFloat(MonoObject *method) +{ + post("Add float method"); +} + +static void PD_AddSymbol(MonoObject *method) +{ + post("Add symbol method"); +} + +static void PD_AddPointer(MonoObject *method) +{ + post("Add pointer method"); +} + +static void PD_AddList(MonoObject *method) +{ + post("Add list method"); +} + +static void PD_AddAnything(MonoObject *method) +{ + post("Add anything method"); +} #if 0 // this function is called by mono when it wants post messages to pd @@ -316,6 +352,7 @@ void *clr_new(t_symbol *classname, int argc, t_atom *argv) // store class pointer x->clr_clss = clss; + x->clr_clss->name = classname; // store our object pointer in External::ptr member mono_field_set_value(x->mono_obj,clss->mono_obj_field,&x); @@ -329,18 +366,13 @@ void *clr_new(t_symbol *classname, int argc, t_atom *argv) MonoObject *lstobj = new_AtomList(argc,argv); gpointer args = lstobj; #endif + // call constructor MonoObject *exc; - - // call static constructor - MonoObject *ret = mono_runtime_invoke(clss->mono_ctor,x->mono_obj,&args,&exc); - if(ret) { - post("Warning: returned value from %s::.ctor ignored",classname->s_name); - // ??? do we have to mark ret as free? - } + mono_runtime_invoke(clss->mono_ctor,x->mono_obj,&args,&exc); if(exc) { pd_free((t_pd *)x); - error("CLR class %s - exception raised in constructor",classname->s_name); + error_exc("exception raised in constructor",classname->s_name,exc); return NULL; } } @@ -365,7 +397,7 @@ static int classloader(char *dirname, char *classname) char dirbuf[MAXPDSTRING],*nameptr; // search for classname.dll in the PD path int fd; - if ((fd = open_via_path(dirname, classname, ".dll", dirbuf, &nameptr, MAXPDSTRING, 1)) < 0) + if ((fd = open_via_path(dirname, classname, "." DLLEXT, dirbuf, &nameptr, MAXPDSTRING, 1)) < 0) // not found goto bailout; @@ -377,16 +409,13 @@ static int classloader(char *dirname, char *classname) // clr_class->methods = NULL; // try to load assembly - char path[MAXPDSTRING]; - strcpy(path,dirname); - strcat(path,"/"); -// strcat(path,dirbuf); -// strcat(path,"/"); - strcat(path,nameptr); - - assembly = mono_domain_assembly_open(monodomain,path); + strcat(dirbuf,"/"); + strcat(dirbuf,classname); + strcat(dirbuf,"." DLLEXT); + + assembly = mono_domain_assembly_open(monodomain,dirbuf); if(!assembly) { - error("clr: file %s couldn't be loaded!",path); + error("clr: file %s couldn't be loaded!",dirbuf); goto bailout; } @@ -414,24 +443,46 @@ static int classloader(char *dirname, char *classname) // find static Main method + MonoMethodDesc *clr_desc_main = mono_method_desc_new(":Setup",FALSE); + assert(clr_desc_main); + method = mono_method_desc_search_in_class(clr_desc_main,clr_class->mono_class); if(method) { + MonoObject *obj = mono_object_new(monodomain,clr_class->mono_class); + if(!obj) { + error("CLR class %s could not be instantiated",classname); + goto bailout; + } + + // store NULL in External::ptr member + void *x = NULL; + mono_field_set_value(obj,clr_class->mono_obj_field,&x); + // set current class clr_setup_class = clr_class; // call static Main method - MonoObject *ret = mono_runtime_invoke(method,NULL,NULL,NULL); + gpointer args = obj; + MonoObject *exc; + MonoObject *ret = mono_runtime_invoke(method,NULL,&args,&exc); // unset current class clr_setup_class = NULL; if(ret) { - post("CLR - Warning: returned value from %s.Main ignored",classname); + post("CLR - Warning: returned value from %s.Setup ignored",classname); // ??? do we have to mark ret as free? } + + if(exc) { + MonoObject *ret = mono_runtime_invoke(method,NULL,&args,&exc); + + error_exc("CLR - Exception raised by Setup",classname,exc); + goto bailout; + } } else - post("CLR - Warning: no %s.Main method found",classname); + post("CLR - Warning: no %s.Setup method found",classname); // find and save constructor clr_class->mono_ctor = mono_method_desc_search_in_class(clr_desc_ctor,clr_class->mono_class); @@ -502,32 +553,51 @@ void clr_setup(void) #endif try { - monodomain = mono_jit_init("PureData"); + monodomain = mono_jit_init(CORELIB); } catch(...) { monodomain = NULL; } if(monodomain) { - // add mono to C hooks - mono_add_internal_call("PureData.Core::Post",(const void *)PD_Post); - mono_add_internal_call("PureData.Core::PostError",(const void *)PD_PostError); - mono_add_internal_call("PureData.Core::PostBug",(const void *)PD_PostBug); - mono_add_internal_call("PureData.Core::PostVerbose",(const void *)PD_PostVerbose); - - mono_add_internal_call("PureData.Core::SymGen", (const void *)PD_SymGen); - mono_add_internal_call("PureData.Core::SymEval", (const void *)PD_SymEval); - + // try to find PureData.dll in the PD path + char dirbuf[MAXPDSTRING],*nameptr; + // search for classname.dll in the PD path + int fd; + if ((fd = open_via_path("",CORELIB,"." DLLEXT,dirbuf,&nameptr,MAXPDSTRING,1)) >= 0) { + strcat(dirbuf,"/" CORELIB "." DLLEXT); + close(fd); + } + else + strcpy(dirbuf,CORELIB "." DLLEXT); - MonoAssembly *assembly = mono_domain_assembly_open (monodomain, "PureData.dll"); + // look for PureData.dll + MonoAssembly *assembly = mono_domain_assembly_open (monodomain,dirbuf); if(!assembly) { - error("clr: assembly PureData.dll not found!"); + error("clr: assembly " CORELIB "." DLLEXT " not found!"); return; } MonoImage *image = mono_assembly_get_image(assembly); assert(image); + // add mono to C hooks + + mono_add_internal_call("PureData.Internal::SymGen(string)", (const void *)PD_SymGen); + mono_add_internal_call("PureData.Internal::SymEval(void*)", (const void *)PD_SymEval); + + mono_add_internal_call("PureData.External::Post(string)",(const void *)PD_Post); + mono_add_internal_call("PureData.External::PostError(string)",(const void *)PD_PostError); + mono_add_internal_call("PureData.External::PostBug(string)",(const void *)PD_PostBug); + mono_add_internal_call("PureData.External::PostVerbose(string)",(const void *)PD_PostVerbose); + + mono_add_internal_call("PureData.External::Add(PureData.External/MethodBang)", (const void *)PD_AddBang); + mono_add_internal_call("PureData.External::Add(PureData.External/MethodFloat)", (const void *)PD_AddFloat); + mono_add_internal_call("PureData.External::Add(PureData.External/MethodSymbol)", (const void *)PD_AddSymbol); + mono_add_internal_call("PureData.External::Add(PureData.External/MethodPointer)", (const void *)PD_AddPointer); + mono_add_internal_call("PureData.External::Add(PureData.External/MethodList)", (const void *)PD_AddList); + mono_add_internal_call("PureData.External::Add(PureData.External/MethodAnything)", (const void *)PD_AddAnything); + // load important classes clr_symbol = mono_class_from_name(image,"PureData","Symbol"); assert(clr_symbol); @@ -540,8 +610,8 @@ void clr_setup(void) clr_external = mono_class_from_name(image,"PureData","External"); assert(clr_external); - clr_desc_main = mono_method_desc_new("::Main()",FALSE); - assert(clr_desc_main); + clr_desc_tostring = mono_method_desc_new("::ToString()",FALSE); + assert(clr_desc_tostring); clr_desc_ctor = mono_method_desc_new("::.ctor(AtomList)",FALSE); assert(clr_desc_ctor); @@ -570,8 +640,8 @@ void clr_setup(void) sys_loader(classloader); // ready! - post("CLR - (c)2006 Davide Morelli, Thomas Grill"); + post("CLR extension - (c)2006 Davide Morelli, Thomas Grill"); } else - error("clr: mono domain couldn't be initialized!"); + error("clr: mono domain couldn't be initialized!"); } diff --git a/external/external.sln b/external/external.sln deleted file mode 100755 index 092ddee..0000000 --- a/external/external.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "external", "external.csproj", "{FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}.Debug.ActiveCfg = Debug|.NET
- {FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}.Debug.Build.0 = Debug|.NET
- {FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}.Release.ActiveCfg = Release|.NET
- {FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}.Release.Build.0 = Release|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/pd/PureData.cs b/pd/PureData.cs deleted file mode 100644 index d6ad3d9..0000000 --- a/pd/PureData.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Runtime.CompilerServices; // for extern import -using System.Runtime.InteropServices; // for structures - -namespace PureData -{ - // PD core functions - public unsafe class Core - { - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static void Post(string message); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static void PostError(string message); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static void PostBug(string message); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - public extern static void PostVerbose(string message); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - internal extern static void *SymGen(string sym); - - [MethodImplAttribute (MethodImplOptions.InternalCall)] - internal extern static string SymEval(void *sym); - } - - // This is the base class for a PD/CLR external - public unsafe class External - : Core - { - // PD object pointer - private readonly void *ptr; - - protected virtual void MethodBang() { throw new System.NotImplementedException("Bang handler not defined"); } - - protected virtual void MethodFloat(float f) { throw new System.NotImplementedException("Float handler not defined"); } - - protected virtual void MethodSymbol(Symbol s) { throw new System.NotImplementedException("Symbol handler not defined"); } - - protected virtual void MethodPointer(Pointer p) { throw new System.NotImplementedException("Pointer handler not defined"); } - - protected virtual void MethodList(AtomList lst) { throw new System.NotImplementedException("List handler not defined"); } - - protected virtual void MethodAnything(Symbol tag,AtomList lst) { throw new System.NotImplementedException("Anything handler not defined"); } - } -} diff --git a/pd/pd.sln b/pd/pd.sln deleted file mode 100755 index 2d4a44b..0000000 --- a/pd/pd.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "pd", "pd.csproj", "{FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}.Debug.ActiveCfg = Debug|.NET
- {FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}.Debug.Build.0 = Debug|.NET
- {FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}.Release.ActiveCfg = Release|.NET
- {FFBC9D2E-1FB7-4E82-B5DC-46B31F8A58A2}.Release.Build.0 = Release|.NET
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
|