source:
CIVL/include/impls/time.cvl@
1aaefd4
| Last change on this file since 1aaefd4 was ea777aa, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 467 bytes | |
| Rev | Line | |
|---|---|---|
| [41340c1] | 1 | /* CIVL implementation of time.h */ |
| 2 | ||
| [bf584ca] | 3 | #ifndef __TIME_CIVL__ |
| [41340c1] | 4 | #define __TIME_CIVL__ |
| 5 | ||
| 6 | #include<time.h> | |
| [939152a] | 7 | #include<civlc.cvh> |
| [41340c1] | 8 | |
| 9 | struct tm{ | |
| 10 | double v; | |
| 11 | }; | |
| 12 | ||
| [939152a] | 13 | time_t time(time_t *timer) { |
| 14 | $abstract double _time(int count); | |
| 15 | int time_count = $next_time_count(); | |
| 16 | double result = _time(time_count); | |
| 17 | ||
| 18 | if (time_count > 0) { | |
| [3ff27cf] | 19 | $assume(result > _time(time_count-1)); |
| [939152a] | 20 | } else { |
| [3ff27cf] | 21 | $assume(result > 0); |
| [939152a] | 22 | } |
| 23 | if(timer != NULL) | |
| 24 | *timer = result; | |
| 25 | return result; | |
| 26 | } | |
| 27 | ||
| [41340c1] | 28 | #endif |
Note:
See TracBrowser
for help on using the repository browser.
