From 7aa2fe31bf8baa6506e4c792229834b67ebd2207 Mon Sep 17 00:00:00 2001 From: Davide Morelli Date: Thu, 12 Jan 2006 17:09:45 +0000 Subject: working on lists of atoms svn path=/trunk/externals/clr/; revision=4392 --- external/pd.cs | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'external/pd.cs') diff --git a/external/pd.cs b/external/pd.cs index 67befdf..33f7f1f 100755 --- a/external/pd.cs +++ b/external/pd.cs @@ -71,13 +71,35 @@ typedef struct atom_simple public enum AtomType {Null = 0, Float=1, Symbol=2}; [StructLayout (LayoutKind.Explicit)] - public struct Atom +// [StructLayout (LayoutKind.Sequential)] + public class Atom { //[FieldOffset (0)] AtomType type; - [FieldOffset (0)] public int type; + //[FieldOffset (0)] public int type; + [FieldOffset (0)] + public int type; /* union members */ - [FieldOffset (4)] public long string_value; - [FieldOffset (4)] public float float_value; + [FieldOffset (4)] + public float float_value; + +// [FieldOffset (4)] + [FieldOffset (8)] + public string string_value; + + + + public Atom(string string_value) + { + this.type = 2; + this.float_value = 0; + this.string_value = string_value; + } + public Atom(float float_value) + { + this.type = 1; + this.string_value = ""; + this.float_value = float_value; + } } -- cgit v1.2.1