main
| Rev | Line | |
|---|
| [4208097] | 1 | #include <civlc.cvh>
|
|---|
| 2 | #include <comm.cvh>
|
|---|
| [d66b03b] | 3 | $scope root = $here;
|
|---|
| [1de5580] | 4 | void main(){
|
|---|
| 5 | int x[2] = {1,2}, *y;
|
|---|
| 6 | $message m = $message_pack(0, 1, 2, x, sizeof(int)*2);
|
|---|
| 7 |
|
|---|
| [d66b03b] | 8 | y = (int *)$malloc(root, sizeof(int)*2);
|
|---|
| [1de5580] | 9 | $message_unpack(m, y, sizeof(int)*2);
|
|---|
| [aad342c] | 10 | $assert((x[0] == y[0] && x[1] == y[1]));
|
|---|
| [1de5580] | 11 | m = $message_pack(0, 1, 2, x, sizeof(int)*2);
|
|---|
| 12 | $message_unpack(m, y, sizeof(int)); //should throw an error, since message size exceeds the specified size.
|
|---|
| 13 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.