From 2147d5f788d36ebccb7981c427b7e430b1e4e8cd Mon Sep 17 00:00:00 2001 From: Thomas Grill Date: Sat, 28 Jan 2006 10:36:25 +0000 Subject: fixed line endings, now for real svn path=/trunk/externals/clr/; revision=4513 --- pd/Atom.cs | 178 ++++++++++++++++++++++++++++++------------------------------- 1 file changed, 89 insertions(+), 89 deletions(-) (limited to 'pd/Atom.cs') diff --git a/pd/Atom.cs b/pd/Atom.cs index 532956e..e3b6f3c 100755 --- a/pd/Atom.cs +++ b/pd/Atom.cs @@ -1,104 +1,104 @@ -using System; -using System.Runtime.InteropServices; // for structures - -namespace PureData -{ - public enum AtomType {Null = 0, Float = 1, Symbol = 2, Pointer = 3}; +using System; +using System.Runtime.InteropServices; // for structures - [StructLayout (LayoutKind.Sequential)] +namespace PureData +{ + public enum AtomType {Null = 0, Float = 1, Symbol = 2, Pointer = 3}; + + [StructLayout (LayoutKind.Sequential)] sealed public class Symbol - { - // this should NOT be public - readonly private IntPtr ptr; - - public Symbol(IntPtr p) - { - ptr = p; - } - - public Symbol(Symbol s) - { - ptr = s.ptr; - } - - public Symbol(string s) - { - ptr = Core.GenSym(s); - } - - override public string ToString() - { - return Core.EvalSym(this); - } - } + { + // this should NOT be public + readonly private IntPtr ptr; + + public Symbol(IntPtr p) + { + ptr = p; + } + + public Symbol(Symbol s) + { + ptr = s.ptr; + } + + public Symbol(string s) + { + ptr = Core.GenSym(s); + } + + override public string ToString() + { + return Core.EvalSym(this); + } + } - [StructLayout (LayoutKind.Sequential)] + [StructLayout (LayoutKind.Sequential)] sealed public class Pointer - { - public IntPtr ptr; + { + public IntPtr ptr; } - [StructLayout (LayoutKind.Explicit)] - public struct Word - { - [FieldOffset(0)] public float w_float; - [FieldOffset(0)] public Symbol w_symbol; - [FieldOffset(0)] public Pointer w_pointer; - } + [StructLayout (LayoutKind.Explicit)] + public struct Word + { + [FieldOffset(0)] public float w_float; + [FieldOffset(0)] public Symbol w_symbol; + [FieldOffset(0)] public Pointer w_pointer; + } - //[StructLayout (LayoutKind.Explicit)] - [StructLayout (LayoutKind.Sequential)] + //[StructLayout (LayoutKind.Explicit)] + [StructLayout (LayoutKind.Sequential)] sealed public class Atom - { - - public AtomType type; - public Word word; - - public Atom(float f) - { - type = AtomType.Float; - word.w_float = f; - } - - public Atom(int i) - { - type = AtomType.Float; - word.w_float = (float)i; - } - - public Atom(Symbol s) - { - type = AtomType.Symbol; - word.w_symbol = s; - } - - public Atom(string s) - { - type = AtomType.Symbol; - word.w_symbol = new Symbol(s); - } - } - - - // this struct is relative to this c struct, see clr.c - - /* - // simplyfied atom - typedef struct atom_simple atom_simple; + { + + public AtomType type; + public Word word; + + public Atom(float f) + { + type = AtomType.Float; + word.w_float = f; + } + + public Atom(int i) + { + type = AtomType.Float; + word.w_float = (float)i; + } + + public Atom(Symbol s) + { + type = AtomType.Symbol; + word.w_symbol = s; + } + + public Atom(string s) + { + type = AtomType.Symbol; + word.w_symbol = new Symbol(s); + } + } + + + // this struct is relative to this c struct, see clr.c + + /* + // simplyfied atom + typedef struct atom_simple atom_simple; typedef enum { A_S_NULL=0, A_S_FLOAT=1, A_S_SYMBOL=2, - } t_atomtype_simple; - typedef struct atom_simple - { - t_atomtype_simple a_type; - union{ + } t_atomtype_simple; + typedef struct atom_simple + { + t_atomtype_simple a_type; + union{ float float_value; - MonoString *string_value; - } stuff; - }; - */ - + MonoString *string_value; + } stuff; + }; + */ + } \ No newline at end of file -- cgit v1.2.1