aboutsummaryrefslogtreecommitdiff
path: root/PureData/PureData.cs
diff options
context:
space:
mode:
authorThomas Grill <xovo@users.sourceforge.net>2006-03-07 13:18:32 +0000
committerThomas Grill <xovo@users.sourceforge.net>2006-03-07 13:18:32 +0000
commit88ae96ff82ddc836a822a55aef17ea66ca06ac65 (patch)
tree28b5260ba5e0f2ced6f99ea5a28f49546a3322e6 /PureData/PureData.cs
parent6ef70933fef8baaf373e43b3f2a02f3a6b083171 (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
Diffstat (limited to 'PureData/PureData.cs')
-rw-r--r--PureData/PureData.cs64
1 files changed, 64 insertions, 0 deletions
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);
+ }
+}