From a6a3c416c77d383f00a723ceb4545e89a2334923 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 26 Jun 2010 17:28:49 +0200 Subject: Put together cmake build --- src/CMakeLists.txt | 10 ++++++++ src/Term.vala | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 src/CMakeLists.txt create mode 100644 src/Term.vala (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..a725dd3 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,10 @@ +vala_precompile(EVA_C + Term.vala +PACKAGES + gee-1.0 + erl_interface +GENERATE_VAPI + eva +) + +add_library(eva SHARED ${EVA_C}) diff --git a/src/Term.vala b/src/Term.vala new file mode 100644 index 0000000..2a9cca8 --- /dev/null +++ b/src/Term.vala @@ -0,0 +1,71 @@ +namespace Eva { + public interface Term : Object { + public abstract string to_string(); + + public abstract void encode(Erl.Buffer buffer); + } + + public class Long : Object, Term { + public long value {get; construct;} + + public Long(long v) { + Object(value: v); + } + + public string to_string() { + return value.to_string(); + } + + public void encode(Erl.Buffer buffer) { + buffer.encode_long(value); + } + } + + public class ULong : Object, Term { + public ulong value {get; construct;} + + public ULong(ulong v) { + Object(value: v); + } + + public string to_string() { + return value.to_string(); + } + + public void encode(Erl.Buffer buffer) { + buffer.encode_ulong(value); + } + } + + public class Double : Object, Term { + public double value {get; construct;} + + public Double(double v) { + Object(value: v); + } + + public string to_string() { + return value.to_string(); + } + + public void encode(Erl.Buffer buffer) { + buffer.encode_double(value); + } + } + + public class Atom : Object, Term { + public string value {get; construct;} + + public Atom(string v) { + Object(value: v); + } + + public string to_string() { + return value.to_string(); + } + + public void encode(Erl.Buffer buffer) { + buffer.encode_atom(value.to_utf8()); + } + } +} -- cgit v1.2.3