Skip to content
Snippets Groups Projects
Commit cd7ccf44 authored by Sven Robertz's avatar Sven Robertz
Browse files

small changes

parent c11dc39c
Branches
Tags
No related merge requests found
NB! Before trying to build and run this example, make sure you have built the LabComm compiler
by running "ant jar" in the main directory (../../ seen from here).
This is a very simple example with one labcomm file (simple.lc) defining two samples. This is a very simple example with one labcomm file (simple.lc) defining two samples.
Example source code: Encoders and decoders written in Java and C. Example source code: Encoders and decoders written in Java and C.
Encoder.java Encoder.java
......
...@@ -18,10 +18,12 @@ int main(int argc, char *argv[]) { ...@@ -18,10 +18,12 @@ int main(int argc, char *argv[]) {
simple_IntString is; simple_IntString is;
is.x = 24; is.x = 24;
is.s = "Hello, LabComm!"; is.s = "Hello, LabComm!";
printf("Encoding IntString, x=%d, s=%s\n", is.x, is.s);
labcomm_encode_simple_IntString(encoder, &is); labcomm_encode_simple_IntString(encoder, &is);
simple_TwoInts ti; simple_TwoInts ti;
ti.a = 13; ti.a = 13;
ti.b = 37; ti.b = 37;
printf("Encoding TwoInts, a=%d, b=%d\n", ti.a, ti.b);
labcomm_encode_simple_TwoInts(encoder, &ti); labcomm_encode_simple_TwoInts(encoder, &ti);
} }
java -cp .:../../lib/java:gen Encoder encoded_data java -cp .:../../lib/java:gen Encoder encoded_data
java -cp .:../../lib/java:gen Decoder encoded_data
./example_decoder encoded_data ./example_decoder encoded_data
./example_encoder encoded_data
java -cp .:../../lib/java:gen Decoder encoded_data
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment