diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-06-26 17:28:49 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2010-06-26 17:28:49 +0200 |
commit | a6a3c416c77d383f00a723ceb4545e89a2334923 (patch) | |
tree | 4f99cde816967947bf4cd5dc3d631aa04df50202 /src | |
download | eva-a6a3c416c77d383f00a723ceb4545e89a2334923.tar eva-a6a3c416c77d383f00a723ceb4545e89a2334923.zip |
Put together cmake build
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 10 | ||||
-rw-r--r-- | src/Term.vala | 71 |
2 files changed, 81 insertions, 0 deletions
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()); + } + } +} |