main
| Rev | Line | |
|---|
| [aad342c] | 1 | #include <civlc.cvh>
|
|---|
| 2 | #include <memory.cvh>
|
|---|
| 3 |
|
|---|
| 4 | enum CMD{
|
|---|
| 5 | SEND, RECV
|
|---|
| 6 | };
|
|---|
| 7 |
|
|---|
| 8 | $atomic_f void sendRecv(enum CMD cmd, void*buf, int**array)
|
|---|
| 9 | $depends [cmd==SEND] {$write(buf), $calls(sendRecv(cmd, buf, ...))}
|
|---|
| 10 | $depends [cmd==RECV] {$access(*buf)}
|
|---|
| 11 | $assigns [cmd==SEND] {$nothing}
|
|---|
| 12 | $assigns [cmd==RECV] {*buf}
|
|---|
| 13 | $reads {array[2 .. 5][...], *buf}
|
|---|
| 14 | {
|
|---|
| 15 | if(cmd == SEND){
|
|---|
| 16 | //send(*buf, ...);
|
|---|
| 17 | int a = 0;
|
|---|
| 18 |
|
|---|
| 19 | a++;
|
|---|
| 20 | }else if(cmd==RECV){
|
|---|
| 21 | //*buf=recv(...);
|
|---|
| 22 | int a = 0;
|
|---|
| 23 |
|
|---|
| 24 | a++;
|
|---|
| 25 | }
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.