source:
CIVL/examples/languageFeatures/bundleStruct.cvl@
90dd7d7
| Last change on this file since 90dd7d7 was 823c3cb, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 379 bytes | |
| Line | |
|---|---|
| 1 | #include<civlc.h> |
| 2 | |
| 3 | typedef struct Interval { |
| 4 | int left; |
| 5 | int right; |
| 6 | } Interval; |
| 7 | |
| 8 | void main() { |
| 9 | Interval interval0; |
| 10 | Interval interval1; |
| 11 | $bundle bun; |
| 12 | |
| 13 | interval0.left = 0; |
| 14 | interval0.right = 1; |
| 15 | bun = $bundle_pack(&interval0, sizeof(Interval)); |
| 16 | $bundle_unpack(bun, &interval1); |
| 17 | $assert(interval0.left==interval1.left); |
| 18 | $assert(interval0.right==interval1.right); |
| 19 | } |
Note:
See TracBrowser
for help on using the repository browser.
