summaryrefslogtreecommitdiff
path: root/src/tests/eolian/data/struct.eo
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-06-30 14:04:03 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-06-30 16:59:21 +0100
commitab2e608239d0518241454bd7cb6abe3f680764c1 (patch)
tree950be0f34dffe5e3962c6f850e54bd770459fd21 /src/tests/eolian/data/struct.eo
parentff7a5e4f1b1286b1226fb0a9a1729759d1f72e18 (diff)
eolian: add support for static and terminated arrays
Adds two new type types, STATIC_ARRAY and TERMINATED_ARRAY. Static arrays are only allowed as struct members right now - they translate to regular C static arrays (allowing them elsewhere wouldn't be good, as C isn't very good at working with the size information). Terminated arrays are basically sequences of data terminated at the end. The base type of static arrays can be any type that is not marked ref (explicit ref may get allowed later). The base type of terminated arrays has the same restriction plus that it has to be either implicitly reference type (i.e. translating to pointer in C), integer type or a character. In case of ref types, the terminator is NULL. In case of integer types, the terminator is a zero. In case of character types, the terminator is also a zero (null terminator like C strings). @feature
Diffstat (limited to 'src/tests/eolian/data/struct.eo')
-rw-r--r--src/tests/eolian/data/struct.eo2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tests/eolian/data/struct.eo b/src/tests/eolian/data/struct.eo
index 077e499..81429b9 100644
--- a/src/tests/eolian/data/struct.eo
+++ b/src/tests/eolian/data/struct.eo
@@ -1,6 +1,8 @@
1struct Named { 1struct Named {
2 field: ref(int); 2 field: ref(int);
3 something: string; 3 something: string;
4 arr: static_array<int, 16>;
5 tarr: terminated_array<string>;
4} 6}
5 7
6struct Another { 8struct Another {